4 ms·
If Copilot isn't showing exact copies of code it's seen, how is it able to produce code that mostly work? E.g. Copilot code from the article: function getP
by seanwilson 5y ago
If Copilot isn't showing exact copies of code it's seen, how is it able to produce code that mostly work? E.g. Copilot code from the article:
function getPhase() {
var phase = Math.floor((new Date().getTime() - new Date().setHours(0,0,0,0)) / 86400000) % 28;
if (phase == 0) {
return "New Moon";
} else if (phase == 1) {
return "Waxing Crescent";
}
// etc.
It feels like small incorrect modifications to any of the code here would completely break the function.
I've seen stories and articles written by GPT-3 where it will lose the plot and context on the way - in comparison Copilot doesn't suffer from this as much? How?
- quenix 5y agoThis is also something that kind of breaks my brain. It's always impressive to see Copilot-"authored" code which seems complex, coherent, (and most of the time, functional), and Google it to zero previous results. How is it that a glorified statistical machine is able to put blocks of code so well together?
- piyh 5y agoCode is much mores structured than English. Code is built around well defined ideas, processes, datastructures. Human language is context dependent, loose, and things like tonality of speech can change the meaning. It's easier to guess a multiple choice questions when all choices can be generated by intellisense instead of having to look at a dictionary.
- gotostatement 5y agoits worth noting that, in the article, the author explains that the moon phase function produced by copilot was actually incorrect
- YeGoblynQueenne 5y agoThere are parts of the internet that google doesn't search, it seems. I've just tried searching for a couple of strings from my github repository and I can't find them with google or duckduckgo (I get tons of results but none that's actually my repository or contains my code). To be sure the Copilot generated code is not copied verbatim from somewhere you'd have to search its training corpus. I don't know if that is available publicly.