News for hackers. Stuff that matters.
Re:GitHub Copilot is not infringing copyright by nl on Tuesday July 06, 2021 @12:16AM (#27744179)
This understanding of how a generative process from a NN works is completely wrong.

There is no database lookup.

I've attempted to break that part down here: https://news.ycombinator.com/item?id=27744156

But you seem to have a basic fundamental misunderstanding of what is going on inside the NN. There is no "search for code" - it is generating new code each time, but sometimes that code will be the same as something it has seen because there is little or no variation in the training data for that snippet.

The NN generates code token by token, conditioned on the code leading up to it (and perhaps the code ahead, similar to BERT).

If you see tokens like this you probably generate the same next token too:

  for i in range(1,10)
You have conditioned your input on the code you have seen and the most likely token you produce is ":".

That's what the NN does, but for much longer range conditioning.

Re:GitHub Copilot is not infringing copyright by nextaccountic on Tuesday July 06, 2021 @06:29PM (#27755200)
The code is literally stored in the weights of the NN, in a weird codification. That's exactly why it can retrieved verbatim.
Re:GitHub Copilot is not infringing copyright by nl on Tuesday July 06, 2021 @07:40PM (#27755734)
> The code is literally stored in the weights of the NN, in a weird codification.

This is a massive simplification. It's adequate for most purposes, but when discussing at this level this simplification breaks down.

Tokens are stored, and the NN contains weights of likelihood of a token occurring after another, given a sequence of prior (and possibly post) tokens.

Verbatim retrieval usually means there is very little variation in the training data for that sequence, so the same set of weights gets stored.

So "retrieval" is actually the same generative process as unique code uses, but the NN hasn't seen any other versions.

Re:GitHub Copilot is not infringing copyright by throwaway413 on Tuesday July 06, 2021 @11:24AM (#27749777)
I am not educated on this matter, but I have to ask for your clarification. Would that not be just a pre-emptive lookup? Akin to keeping a cache of "results" per input token that are essentially memorized and regurgitated?

Sounds like there is still a db lookup, just not at runtime and instead at build time of the NN. Can you clarify this please?

Re:GitHub Copilot is not infringing copyright by freeone3000 on Tuesday July 06, 2021 @01:44PM (#27751867)
GPT-3's raw output is "logits", or indexes into an encoding space. The encoding space contains individual tokens; for generation, it would be words, or even word pieces. The pieces are as small as "for", or "if". Constructing code from an embedding space, even if it is more specialized, is like constructing sentences by using a dictionary -- it is a lookup table, but it's not a database. Generation works by looking at the existing document (or portion), and based on what is already present, generating a token. Then repeating until some condition is met (such as length, end of sentence, something else).

The issue here is that certain sentences (code segments) are memorized, and reproduced -- much like a language learner who completes every sentence which begins with "Mi nombre" with the phrase "Mi nombre es Mark". The regurgitation is based on high probability built into the priors, not an explicit lookup. A different logit sampling method (instead of taking the likeliest) reduces regurgitation, without changing anything else about the network. (It also makes nonsense happen more often, since nonsense items are inherently less likely!)

Re:GitHub Copilot is not infringing copyright by nl on Tuesday July 06, 2021 @07:55PM (#27755842)
This response is correct.