by AlexDenisov on 2/23/21, 8:10 PM with 103 comments
by moyix on 2/23/21, 8:57 PM
* Trained 17GB of code from the top 10,000 most popular Debian packages. The source files were deduplicated using a process similar to the OpenWebText preprocessing (basically a locality-sensitive hash to detect near-duplicates).
* I used the [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) code for training. Training took about 1 month on 4x RTX8000 GPUs.
* You can download the trained model here: https://moyix.net/~moyix/csrc_final.zip and the dataset/BPE vocab here: https://moyix.net/~moyix/csrc_dataset_large.json.gz https://moyix.net/~moyix/csrc_vocab_large.zip
Happy to answer any questions!
by Felk on 2/23/21, 9:40 PM
by et1337 on 2/23/21, 9:00 PM
by Aardwolf on 2/23/21, 9:36 PM
TIFF is a real thing, so some human was involved in some part of that code, it has just been garbled up by GPT2... In other words, the training set is showing quite visibly in the result
by ironmagma on 2/24/21, 1:53 AM
by klik99 on 2/23/21, 8:44 PM
by damenut on 2/23/21, 8:41 PM
by efferifick on 2/24/21, 12:21 AM
I understand that GPT-2/3 is just a very smart parrot that has no semantic knowledge of what it is outputting. Like I guess let's take a very dumb markov chain that was "trained" on the following input:
a.c ``` int array[6]; array[5] = 1; ```
b.c
``` int array[4]; array[3] = 2; ```
I guess a markov chain could theoretically produce the following code:
out.c
``` int array[4]; array[5] = 1; ```
which is undefined behaviour. But it is produced from two programs where no undefined behaviour is present. A better question would be, how can we guarantee that certain program invariants (like lack of undefined behaviour) can be preserved in the produced code? Or if there are no guarantees, can we calculate a probability? (Sorry, not an expert on machine learning, just excited about a potentially new way to fuzz programs. Technically, one could just instrument C programs with sanitizers and produce backwards static slices from the C sanitizer instrumentation to the beginning of the program and you get a sample of a program without undefined behaviour... so there is already the potential for some training set to be expanded beyond what Csmith can provide.)
EDIT: I don't know how to format here...
by technologia on 2/23/21, 8:31 PM
by iconara on 2/24/21, 7:41 AM
by reillyse on 2/24/21, 7:14 AM
by thewarrior on 2/23/21, 9:32 PM
The real examples have worse comments at times.
The only flaw is that it shows fake code most of the time so you can game it that way.
by Gravityloss on 2/24/21, 10:02 AM
Functions with lots of arguments while the body consists of "return true;"
I guess it tells what AI often tells us about ourselves: That what we do makes much less sense than we think it does. It is thus easy to fake.
How is it possible to churn out so much music or so many books, or so much software? Well, because most creative works are either not very original or are quite procedural or random.
And this kind of work could be automated indeed (or examined if it needs to be done in the first place).
by ivraatiems on 2/23/21, 8:28 PM
I'm also pretty sure there are formatting, commenting, and in-string-text "tells" that indicate whether something is GPT2 reliably. Maybe I should try training an AI to figure that out...
by cryptica on 2/23/21, 10:15 PM
GPT2's code looks like correct code at a glance but when you try to understand what it's doing, that's when you understand that it could not have been written by a human.
It's similar to the articles produced by GPT3; they have the right form but no substance.
by blueblimp on 2/24/21, 12:49 PM
It reminds me of how GPT-3 is good at producing a certain sort of bad writing.
My guess as to why this happens: we humans have abilities of logical reasoning, clarity, and purposefulness that GPT doesn't have. When we use those abilities, we produce writing and code that GPT can't match. If we don't, though, our output isn't much better than GPT's.
by _coveredInBees on 2/23/21, 9:51 PM
It's harder to do with some of the smaller excerpts though, and I'm sure there are probably examples of terrible human programmers who write worse code than GPT-2.
by TehCorwiz on 2/23/21, 9:00 PM
by nickysielicki on 2/23/21, 8:57 PM
by Aeronwen on 2/23/21, 8:54 PM
by thebean11 on 2/23/21, 9:15 PM
by jeff-davis on 2/24/21, 6:15 AM
by xingped on 2/24/21, 1:11 AM
by mhh__ on 2/24/21, 10:18 AM
by hertzrat on 2/23/21, 9:34 PM
by azhenley on 2/24/21, 3:04 AM
by IceWreck on 2/24/21, 9:02 AM
by The_rationalist on 2/23/21, 9:18 PM
by tpoacher on 2/23/21, 10:36 PM
What's next? Advices? Feedbacks? Rests?
I give ups.
by neolog on 2/23/21, 8:40 PM
by theurbandragon on 2/23/21, 9:52 PM
by jmpeax on 2/24/21, 2:22 AM
by AnssiH on 2/23/21, 9:54 PM
by avipars on 2/24/21, 8:07 AM