Is GitHub Copilot a blessing, or a curse?
fast.ai
fast.ai
I also think the discussion around searching versus autocomplete is interesting. What we need is something that autogenerates a Google search based on your code context and shows you some promising results. I'm imagining a pane in VS Code getting populated with Stack Overflow answers whenever I slow down.
I agree that it is basically just code suggestion software, or like a big autocomplete. But it's definitely being marketed as more.
Yeah, CoPilot already replaced my job. I used to be the office copypasta, going around to my coworkers desk all day long to fix their problems by googling them, then pasting in the first snippet to pop up. It didn't matter if the language matched or not, it was more the thought that counted. Now I've had to get a job as a loan rejection stamper at my local bank. It's not nearly as fun or exciting, but at least my effort makes a difference now. A big difference.
>Tests without the toil. Tests are the backbone of any robust software engineering project. Import a unit test package, and let GitHub Copilot suggest tests that match your implementation code.
Accompanied by a picture of copilot filling out the implementation of a unit test, based on the test's name.
The implication seems very clearly that it is more than a google search. According to the ads, it understands your code well enough to write the unit tests for it!
Yes, Github Copilot marketing has overstatements -- but it also has caveats about its limitations and creating errors.
In other words, the landing page has a mix of statements ... some hyping up the potential -- and some disclaimers to mention the reality and pitfalls.
Excerpt from that same Copilot landing page about it being wrong more often than right: https://copilot.github.com/
>How good is GitHub Copilot?
>We recently benchmarked against a set of Python functions that have good test coverage in open source repos. We blanked out the function bodies and asked GitHub Copilot to fill them in. The model got this right 43% of the time on the first try, and 57% of the time when allowed 10 attempts.
>Does GitHub Copilot write perfect code?
>No. GitHub Copilot tries to understand your intent and to generate the best code it can, but the code it suggests may not always work, or even make sense. While we are working hard to make GitHub Copilot better, code suggested by GitHub Copilot should be carefully tested, reviewed, and vetted, like any other code.
I'm using it primarily for Swift and some Kotlin.
Another thing: I was using the free version in beta so it was effectively the full blown version. It worked super well. I changed jobs, changed hardware, and haven't set up my key yet (hopefully still grandfathered in) but it's felt not as good - the output is a lot shorter, for one. I would likely get the paid version if I lose my beta key. But it's weird that you have the paid version and it's not useful.
It's also possible they nerfed the models over time in the name of some other tradeoff, like cpu or memory. May still be able to configure it. But I distinctly remember it spitting out entire lines or chunks of code, exactly as I would have written them.
It works best when you are writing stuff similar to your own codebase. Perhaps try vendoring some Swift or Kotlin in your project dir to get the engine to fine-tune on it?
Right but realize how much of a marginal gain we're fighting for here. You can already do this with a separate window and some extra clicking and typing. Saving a little clicking and typing isn't a huge win, unless you're also willing to argue the most valuable work a SWE does is the clicking and typing.
This whole thing feels ultimately like a PR spot that we're all tripping over ourselves to participate with. Its the SWE equivalent of getting all excited about how self-driving is just around the corner TM. It's a premature waste of energy until real advancements are made.
The automatic SO search pane I was describing might give the same benefits. Most of the time maybe it would be useless. Sometimes it would show what I knew I wanted and save me the trivial effort of a search. The real gain would come from when it hit something that I should have asked but didn't think to. Then, I'd have a valuable insight I never would've had otherwise sitting in some pane ready for me.
Maybe it's just my imagination - but that's how I think it could be good.
Copilot has announced their plans to become a paid service.
So this product that would not be possible without public, open-source code will itself be non-public, closed-source, closed-data. It is extracting value from the commons and funneling it to a private company.
We have a duty as practitioners in the industry to call it out when we see something wrong. If even devs aren't calling bullshit on Copilot, the media won't care, courts won't care, and it will be declared legal, and future theft will be normalized.
Its ridiculous how we all see the big tech companies doing various kinds of terrible shit and then the next new shiny thing comes along and everyone forgets all about it? Are you goldfish? What will it take to get someone to actually give a shit and stop supporting this kind of product/behavior?
Just like you're endorsing being sponsored and effectively stealing GitHub's bandwith? :)
> We have a duty as practitioners in the industry to call it out when we see something wrong.
It's wrong both ways. You accepted the service from GitHub, the free one where you get to open your account, host your code, share it etc.
What exactly did you expect? To be served for free for your entire lifetime?
Please, get off the moral highground. You ate the devil fruit, now you're whining about it. You should be smart enough to know that this kind of whining will get you nowhere. Just quit.
Yes its free, no they did not tell me or ask for my permission before using the code in this way. Free does not give them the right to break existing laws and licenses. Its pretty simple.
[1] https://docs.github.com/en/github/site-policy/github-terms-o...
In my understanding your reading is that users uploading code that they don't own the copyright to, but otherwise have the right to copy through a license, are in violation with the ToS in general.
My reading is that the license grant only applies to "Your Content" as defined in the ToS, and otherwise users are free to upload code with permissive license and it _does not grant_ additional licenses to Github.
> Certainly the GitHub TOS grants them some common-sense ability to copy the code you upload so that they can usefully host it. Can you point to the portion that allows them to use it for Copilot?
> Because I'm pretty sure it doesn't. Section D4:
> > This license does not grant GitHub the right to sell Your Content. It also does not grant GitHub the right to otherwise distribute or use Your Content outside of our provision of the Service...
> The “Service” refers to the applications, software, products, and services provided by GitHub, including any Beta Previews.
If I were to hazard a guess, I'd say that the vitriol around Copilot stems from five factors that distinguishes it from Google:
(1) The length of the suggestions alongside some of Copilot's marketing demonstrated that perhaps non-trivial replacement of engineers with AI might not be as far-fetched or far away as most people thought. Google's autocomplete has yet to make me feel replaceable.
(2) The content of the training data had a clearer intrinsic commercial value, making perceived license violations feel more 'real'.
(3) GitHub (historically) didn't have the same reputation as Google for training AI models on data uploaded to its free services. People likely (mis)placed some trust in GitHub when they uploaded code, and this backlash is part of the adjustment process.
(4) The indication that Copilot will eventually be a paid commercial service, effectively building a commercial service off the backs of millions of open source developers. While this is perfectly legal and common across all industries, it doesn't feel good.
(5) Copilot spitting out raw training data really doesn't help its image.
(And the design of copilot is an attempt to extract only knowledge.)
This is just business as usual for tech companies though. How many Silicon Valley businesses built their products on top of open source projects without contributing much back? Heck.. how many YC companies do that? When you see vital open source projects like OpenSSL struggling to raise more than a few tens of thousands in donations (it only continues through OSF contracting work), and libraries like Svelte barely clearing $30k, when you know they're used by Apple, Google, Facebook, Microsoft, etc you can't be that surprised when companies do the same thing on a larger scale.
The entire tech industry and all the multi-trillion and multi-billion dollar unicorn businesses that have billionaire founders and millionaire developers working at them fall under the description of "would not be possible without public, open-source code" and "will itself be non-public, closed-source, closed-data."
We can't reasonably claim there's anything wrong with a company building a product on the back of open source work when literally all of us do that as well. The only difference with Copilot is scale.
The fact that the license allows you to do this is great; the fact that people actually do is not.
Only if the code is distributed. SaaS can be (and is) used to get around this.
It is still quite rude to do that though.
If I copy the code line by line with my eyes and keyboard, then the code briefly doesn't exist, but the instructions to recreate it do. Copying it is then a two-phase process: first I read the code, then I type it in. It is clear that I'm allowed to look at the code, so it's the action of typing it in that violates copyright. In the same way, distributing Copilot doesn't necessarily break copyright, but using it may.
https://twitter.com/stefankarpinski/status/14109710611816816...
Copyright was established (much) after the printing press made copying so easy.
We now need protection against machine learning (learnright?) because the only way to not work for Microsoft for free now is to not release your source code... so not open source. Remember when people said that Microsoft changed its mind on open source?
We cannot (are not allowed to, by law, contracts etc.) open source everything we write. I think the most important contribution is not funding but to contribute in some way or another for most.
Having said that, it is disheartening that important projects lack even basic funding. Is this getting better? There are also success stories that pop up with funding and donations becoming easier.
For companies open source funding can be a major thing to improve their relationship with the wider software community. It is a signal that they are interested in sustainability of software and collaboration. And it is a form of recognition for the authors.
Edit:
I just realized we are talking about GitHub here. They are a major contributor to open and free software as they provide free hosting and tooling. I'm not saying this absolves them of everything they do with Copilot, but I'm very, very happy to have such an amazing service freely available and many others are too.
Edit: I don't really know what things would be like without GitHub. Same with YouTube and Facebook. I don't assume any of these have a net positive impact, though.
They took my work, removed my name and trained an advanced pattern matching technique to try to make code like mine and then sell it. It’s so obviously ethically questionable it’s insane.
Developers are absolutely pissed about this, and rightfully so.
Fairly straight forward solution to your very unique problem.
It’s such a BS argument to say “your license didn’t anticipate the future, it’s your fault.” No, that’s not how law works.
Furthermore, law is not ethics. I said it’s ethically questionable because that’s what matters. Not if a court will find Microsoft guilty of some kind of overreach.
Anybody with even passing knowledge of law knows this, so please, stuff it somewhere.
It literally is though.
You don't get to change your mind on an agreement because something happened that you didn't expect.
The best question to ask yourself is if you would be annoyed as much if a company like Black Duck did a similar training or analysis with their OpenHub (openhub.net)?
I think one could even make a case for training an AI in this manner from the leaked Windows code: copyright law treats these generally as "fair use", though how you gained the copy of the code might still be illegal.
IANAL though :)
Copilot doesn't comply with opensource licenses, so authors of Copilot lost the right to use opensource licensed code permanently, until they settle the case with authors of the code.
It’s also common to see GPL license for non-commercial usage and paid licenses for commercial usage.
If CC-BY-NC prohibits commercial use, it is not an open source or free software license (which have compatible definitions, but differ in motivations).
AFAIK, Creative Commons was set to create a set of licenses in the spirit of open source for creative works, and I wouldn't expect them to be open source at all.
You are likely using the wrong license then.
Rare exceptions are not acceptable in other situations.
If you, on rare exceptions, include copyrighted songs in your YouTube videos you still get strikes.
Citibank couldn't recover 900 million dollars it transferred too soon just because it was a rare mistake.
Microsoft shouldn't get a pass.
Not that this excuses GitHub/Microsoft in any way, this was an obvious outcome and they're morally and legally responsible.
It doesn't matter whether the code is GPL or MIT or BSD. If Copilot reproduces it in your codebase, you're violating the license anyway - almost all FLOSS licenses carry an attribution requirement, which Copilot does not and can not reproduce[0].
The difference between GPL and MIT is whether you have to release your source code, or just add a blurb in README. It's a big one, but it's downstream from the core problem: with Copilot, you won't even know when you're violating some license - much less what to do about it.
--
[0] - The whole point of a DNN model is to pre-mix the inputs in training, so that responses to queries are cheap and fast. This comes at the cost of making it impossible to reverse-query the model, so the only way for Copilot to give correct attribution would be to take its output and run a search on the training data, which would kill all the costs savings they won by using a neural network.
And as this famous example[0] shows, the GAN is able to reproduce what is unquestionably copyrighted material from those repos.
[0]: https://twitter.com/mitsuhiko/status/1410886329924194309
Generally, when you (for example) use GANs to learn from (copyrighted) images and generate new images, I see no reason why those new images should inherit any copyrights from the original image if the resulting images look sufficiently different. (Obviously, if you just train on 1000 images of Mickey Mouse, you'll get mostly Mickey Mouse, and you wouldn't get the copyright.)
Humans work the same way -- artists train on existing images or subjects/etc., and unless they produce something that looks similar to an existing image, they get the copyright.
In other words, I don't think training on copyrighted code violates copyright (UNLESS the license explicitly disallows that; maybe there will be licenses for that soon). However, if generated code is too similar to existing code, then that could be a copyright violation. In other words, the user is responsible to make sure they aren't violating any copyrights from their usage of Copilot. It may be useful to build plagiarism checkers for this purpose. (Or maybe they already exist.)
If you use Copilot, I recommend keeping track of things that were generated automatically, just so you can go back to change those components if necessary.
> In other words, I don't think using of an algorithm on copyrighted code violates copyright
It does.
If I were a master artist, my existence wouldn’t violate copyright, but I would certainly be violating it every time I chose to reproduce a copyrighted work for a client.
If you own the copyright to a work, you need to be aware that you also have rights to derivative works. If you're considering incorporating someone else's work into your new work, you need to be aware that you may be violating the copyright to the original work.»
https://www.legalzoom.com/articles/what-are-derivative-works...
This is the fundamental issue. They don't.
You can't sneak a camera into a cinema saying "don't worry, it works just like human eyes".
Neural nets aren't neurons.
This is the what copilot does as far as I understand
In my view, artists work the same way. If you ask them to draw Mickey Mouse, they (maybe) will. It wouldn't be fair to say that they are infringing on Disney's copyright by storing images of Mickey Mouse in their brain. But their version of Mickey Mouse won't be copyrightable (unless they add parody/significant creativity etc.).
If we perform an _exact_ simulation of a human brain such that it believes it is a human, how will copyright law work? (Maybe it will own the copyright and turning the simulation off would be robocide. Okay, enough sci-fi.) If we remove consciousness and all that from the simulation, will the copyright go to its creator?
I saw in a couple other comments saying that machine learning is "just an algorithm"... But is machine learning sufficiently different from the way some parts of the human brain work to warrant being held to different standards?
My opinion is that it's reasonably similar and should have the same privileges that humans enjoy -- learning from whatever's in sight that is not explicitly marked as "for authorized personnel only".
But I think eventually we are at level of what is the minimum required duplicate to define something as duplicate. (I think this is more of a problem of music, similar songs etc)
I think main problem is we are not yet there (exact simulation of human brain), we are more like 'convince people to you are exact simulation of brain' stage.
Also another problem here is 'self trained/directed' vs 'trained/directed by someone'. Imagine I have a human artist (never seen Mickey Mouse), and in front of me some Mickey Mouse art, if I am giving directions to draw a mouse, then saying make in cartoon style, then saying make ears bigger, etc. Till I get the Mickey Mouse reasonably similar, even maybe exactly to the pixel in front of me, is it copyright violation, I wouldn't maybe 100% yes, but I am very closer to that.
It might not be illegal, but for a lot of us it feels unethical. IMO licenses should list what they allow versus what they forbid. In other words, if something isn’t explicitly allowed it should be assumed to be forbidden.
We need similar protections for personal data too. Tech companies have gotten too used to ingesting data and profiting from it without asking for consent. I’m willing to bet that had GitHub asked repo owners whether GH could use their work to train a new product, most would have said no, much like what happened when Apple asked iOS users if they were ok with Facebook tracking them.
If the copilot would have been trained on open source software e.g. to discover bugs, bad code style, or other things "learned" by analyzing existing code and using the results of this analysis as a metric for judging code, it wouldn't be a copyright problem. But creating new code based on what it "learned" is a much more difficult field, especially, if it is "quoting" so literally.
This was discussed on another thread: https://news.ycombinator.com/item?id=27740001
A new license saying "this license does not permit use in training an AI" won't have any effect, because the claim by the trainers is that they don't need to license the work in the first place. Unfortunately this is likely to be something that's only settled ad hoc in court.
If I learn programming from a book that is copyrighted and use a small snippet (for example, how to do a particular kind of sort) from it in my own program, am I violating a copyright?
However, if you copy an example from a book into a code, then very often it's fair use, but if you copy the same example from a book into your own book, then very often it's a copyright infringement, unless explicitly allowed by the book license.
This has been my experience as well. Some of the early promo material for Copilot showed someone writing a function signature with docs, and having Copilot write the entire body. This rarely works for me, except for fairly trivial functions. This is also not how I normally write code.
However, where Copilot has been rather good is offering intelligent "tab completion", where it makes a suggestion for the next line of code. In particular, it seems very good at figuring out the structure of my code and making sensible suggestions.
I suspect that if anyone ends up using Copilot for the long term, they will (as a human operator) need to learn and gain intuition about how to use Copilot's strengths and avoid its weaknesses.
For example, NVIDIA's DLSS was viewed as a failure at launch, but now it's almost magic in terms of offering better results at a lower performance cost.
Copilot is the antithesis of designing good software.
People aren't even agreed on what is "good" code.
AI can probably also beat humans in terms of things like performance optimization. An AI can write code a human never would. We have to write short functions and well-factored code which fits in the human brain. An AI could theoretically write millions of lines of highly-specialized spaghetti which is perfectly correct and perfectly optimized.
or actually they shouldn't, since it can cause undefined behaviors.
Not suggesting anything, here, just musing on a possibility.
This is similar to what I thought—replace "experienced" and "beginner" with "curious" and "lazy"—when I first read the tagline of GitHub Copilot on its landing page:
> Skip the docs and stop searching for examples. GitHub Copilot helps you stay focused right in your editor.
We need docs and examples for things that we aren't familiar with. Skipping them means that we blindly trust Copilot to generate correct code. And even if the generated code is correct, we still need to understand why and how it's correct.
One use case I see the best fit for Copilot is for generating boilerplates that we are already familiar with and understand.
Sometimes, the model correctly guesses exactly what I'm trying to write, and gives me non-trivial contextually correct suggestions. More than once I've been impressed enough to pause and take a screen recording of what it generated.
Other times, it's a complete mess that competes with the local language server for autocomplete corrections.
Among the misses, the most glaring issues have been when it's suggested code that violates static typing constraints. The model outputs the right contextual code, but uses variables with slightly different spelling/wording/capitalization.
This is to be expected of course, as Copilot doesn't integrate with the language server in VSCode. However it does show the limits of building the model without a native understanding of the AST it's working with.
I do wonder if Copilot has any idea of the structure of what it's generating though. Does it know when something is a comment, a variable, or a piece of syntax?
However, in the case of Copilot, there has to be a much higher signal-to-noise ratio in terms of generated text than creative language models like GPT-2/GPT-3 to use it as a pair programmer where the overhead in working with the model is worth the time saved via the model.
is that true though? Progress in natural(!) language processing is very iterative, but coding and code correctness is a very precise thing. Both semantically as well as literally. Code that's a 'little bit' wrong technically does not compile, and code that's a 'little bit' wrong semantically might produce catastrophic results.
Engineering doesn't become a natural language problem just because you throw a natural language model at it.
Them: type type type ... accept accept ... save (unaware or choosing not to understand the meaningless uncompilable garbage that's been generated)
Them: "There, that's the xxxx function. You'll have the rest done in 2 days, won't you!"
You: “Great, that might be good. Please stay here while we write and run the tests for that. (Our engineering handbook emphasizes how important tests are, as you know.)”
I know very, very little about AI, but, like the OP said, it'll reproduce the traits of its training distribution. If the traits don't map on to the domain-specifics of the type ssytem, the traits don't map on, and the code fails.
Generating garbage the compiles is harder, but generating garbage in general is just as easy.
Maintaining it is.
The challenging part of coding is converting domain knowledge into correct code.
An AI has no high-level understanding of the domain and desired solution. It just guesses at what you might want and glosses over all the edge cases and exceptions that actually need to be considered and resolved. The issues that only come to light after a real intelligence studies the problem, and works through correct steps to implement a solution.
It's an iterative process, because the solution is arrived at only after attempting a solution, learning what you don't know or haven't considered about the problem, then resolving those ambiguities, and producing a revised and more correct solution.
When responsible programmers realize that they don't know what they don't know, they ask questions and apply the answers.
AI never realizes when it makes mistakes because it has no domain knowledge. It just pulls a best guess out it's ass and says, "Here you go. Check my work."
What you say here is true. Writing code is not remotely the hardest part of software engineering. But that does not mean that there is zero value in making it easier.
Shifting gears is not remotely the hardest part of safely driving a car. Yet automatic transmissions are a nice feature for tons of people.
I do not understand this dismissal based on the fact that copilot does not completely revolutionize software engineering in a way that no other product has ever come close to doing.
Unlike Copilot you don’t have to give it instructions - it guesses what you’re trying to do from context. And since it works on a single line of code at a time, providing multiple completions which you can glance at and decide whether to use or ignore, you the programmer are still in charge of planning the function and making choices.
That said, I haven't turned it off yet. It's very fun on those occasions when it suggests correctly.
Some other ideas:
- Look for libraries with similar code and suggest them
- Deobfuscating minified variable names? Or just suggesting better ones for your source code
- Speculatively running things. If the model predicts importing a certain library, start indexing it before I even type it
- Estimate how long it thinks a block of code will take to write, based on the predicted code + past usage patterns (like the kindle reading progress estimate)
Just spitballing but all of these things feel more helpful and pair programming-y than trying to fabricate code out of the blue.
There are so much low hanging fruit it is silly.
1 thing though, tab for auto complete still does not work for me.. ever
I can't speak to whether or not using copilot in long lasting projects would be a good idea, but even if you just tagged the copilot generated code with a comment that said '#TODO: Verify this is correct' I still think it would help you get a lot of work done that you would normally have to switch to stackoverflow to do.
One thing that I found very interesting from the article was the idea of anchoring bias, I definitely felt this a lot. When I used copilot to generate some nontrivial functions that were directly related to my problem, if the code did not work and I ended up erasing the generated code completely, I am just realising now that when I reimplemented it myself I was still essentially using the algorithm copilot had come up with.
It's just a footnote.
I think it's getting talked about more than it deserves to be.
All the talk about the low quality of code got me thinking: if humans aren’t reading the code, then the only thing that matters is correctness. Correctness may be an easier problem to solve than readability and refactorability.
Consumer level robotics, drones, and battery tech is close to a level that manual labor, delivery, and such tasks can be automated.
Maybe we should be preparing for post-scarcity. At the very least, the idea of "jobs" is going to have to transform. The 40 hour work week isn't going to make much sense in the near future.
The part of dev that you get paid to do is not writing the code. It's the part where you define what the code should do. That's where all the value in development resides. Getting AI to write the syntax is 100% upside for the tech industry.
I guess they felt the same ways when the first compilers were introduced. Or interpreters.
> the lack of available developers at a cost-effective price.
There's already developers on the market at an incredibly low price. Good luck getting code that compiles out of them, much less that is correct. I'm afraid we'll see more and more of these, since now they'll be able to cycle through completions and try until it seems to pass all tests.
I've been a dev for almost 25 years, and in my experience how much someone is paid has very little correlation to how good their code is. I've worked with outsourced developers in India, Poland, and Vietnam who are brilliant at writing clean, robust, well-designed code and earn the equivalent of low-two-digits thousands of dollars per year, as well as former FAANG engineers who earn three-digit thousands of dollars and write untested, untestable spaghetti code.
I'm afraid we'll see more and more of these, since now they'll be able to cycle through completions and try until it seems to pass all tests.
In which case the value will lie in defining the tests, and the people who do that will earn the most. That's fine.
That has not been my experience at all.
There's this myth of the genius dropout in our industry, or that FAANG is basically luck, and yet it always fails to materialize.
These tools are effectively less then a year old in production, but we're already seeing the potential for huge disruption in lots of markets based on relatively straightforward uses of the tech.
I can't wait to see what a skillful and artfully sophisticated use will be. I don't think we've even scratched the surface.
Eh. That deep learning networks is like the brain is like saying that cars are like cheetahs. Sure, they go really fast by converting some kind of fuel into kinetic energy, and they move by exerting force on the ground, but that's about it.
Brains don't have ReLU units. Brains have lots of different types of topology, not just an uniform network, and can handle some of that topology arbitrarily being shut off due to damage. Brains use global chemical changes for (otherwise) out-of-band signaling purposes. Brains don't use gradient descent. Etc...
Reproducing high level code seems like a human step that could be removed.
I suspect it's the opposite: It's rather easy to write code that looks good but isn't exactly correct.
Electricians are good but you're going to get zapped quite a few times in your career. From what I've heard plumbing is where it's at for finding a trade that will let you retire without destroying your body. All of my friends/family who got into construction eventually tried to find their way to plumbing because they saw it was something they could do well into their 40s and 50s without destroying themselves with overly physical work.
That is if you can get in. The test is a high school equivelency exam, at least for local 6, but hundreds of guys are taking the exam. You can't miss one question.
1/2 of the hiring process is the interview. (They used to accept only electrician's sons, like the police/fire departments; but that has changed.)
You will make a good middle class living, have retirement, medical, and will never be homeless if you show up. Being around guys all day long can get tedious.
Get in early if you can. To become vested for retirement you need to work for 25 years. Union electricians seem to die at 65. Too many guys retire--collect three paychecks, and gone. Whatever you do in life don't expect to be happy in retirement. Sorry guys--tonight is my Journal night. I am sad.
You can bypass the test, and the interview, if you know your trade. You will be referred to as White Paper. You will be treated like chit, but you are making exactly the same as the other guys.
(I worked as an electrician, but didn't like it. The pay was good, but it just wasen't for me. I have had too many jobs that, "weren't for me"? I was becoming my father? If you had my father, you would understand. Oh yea, you can always set up shop yourself if you get your C-10 license. Non-union construction work should be avoided. Why--terrible job conditions, and pay.)
All the time I wrote the code in the last years, I ended up discovering someone ALREADY have done it, often in a better way (not always).
There is a nice quote who says "Who did not know Unix is doomed to rewrite it..." I think the same is with Java/Python/... code.
Given it's far from getting syntax and semantics right, it should probably be best to position this product as a tool that promotes creativity not productivity.
> The reason is because of how language models work. They show how, on average, most people write. They don’t have any sense of what’s correct or what’s good. Most code on GitHub is (by software standards) pretty old, and (by definition) written by average programmers.
Does Copilot apply any project quality filters before training? A small minority of public repos on GitHub are awesome projects that are popular and maintained, while the rest are forgotten experiments, side projects and interview answers.
That said, I find OpenAI’s beta APIs based on GPT-3 to be very useful (so useful that I immediately released new versions of my Common Lisp and Clojure books with examples). These APIs are so inexpensive to use and useful, that they really should be part of many developers’ standard stack: different than Copilot that seems like a gimmick (but to be fair, I haven’t tried it yet).
Hah, just make it autocommit, and will be much like with self-driving cars - human takes the blame for computer's mistakes (= algorithm/ programmer/ knowledgebase), as well as hir own, and can't/won't do anything about it..
And you may not use it as the license of the generated code is unclear at best, GPL at worst.
might just keep the experienced/quality ones & have less need for a high quantity of inexperienced programmers.
I haven't used Copilot yet (I'm not coding in any of the languages it covers) but I've tried to understand it from the few articles (most critical) posted about it on the internet and from my understanding of program synthesis and languae modelling. I don't fully trust lay users to be able to exercise a machine learning model comprehensively enough to precisely understand its pros and cons, but I think I've formed some intuition about how Copilot works from the demonstrations I've seen. Here's my thoughts:
a) As TFA points out, Copilot was trained on _all_ code on github (for select languages). "All" includes good code and bad code, code with bugs and code with, er, fewer bugs, code that does what it should and code that doesn't. The result is that Copilot models _all_ that code, regardless of whether it's got bugs or not.
b) Copilot is (based on) a language model that predicts the next sequence of tokens, not a discriminator of good/bad code. That means it can generate code but it can't generate "correct" code. It doesn't have a concept of correct/incorrect code.
b.1) More generally, it's impossible to discriminate between "correct" and "incorrect" code from features (tokens, in the case of language models) alone. The correctness of code depends on the programer's intent. In program synthesis, the programmer's intent is encoded as a specification and the correctness of a synthesised program must be considered in the context of that specification. A language model could be trained to include a specification as a feature, or as an additional modality (similar to training on images and text together to generate captions for images, or images from captions). However, this is not how Copilot was trained. The upshot of all this is that Copilot can't generate "correct programs" because it doesn't know what "correct programs" are.
b.2) But wait! Copilot can generate code from a specification! From a natural language specification, in the form of inline comments given as part of a prompt. This seems to be a favourite mode of testing Copilot and its results are impressive, but there are two problems: i) natural language specifications are imprecise and get more so the longer they grow; and, ii) Copilot still has no way to determine whether the code it generates satisfies a natural language specification, or not.
b.3) For program synthesis with guarantees of correctness, a specification is not enough: a verification procedure is also necessary -and those tend to be very tricky because Halting Problem.
c) Copilot has memorised at least part of its training set. This is evident in the demonstrations of verbatim generation of known code, e.g. the Inverse Square Root function (from Quake... III Arena I think?) etc.
c.1) This observation is helpful in understanding language models in general. The assumption is often stated that a model can't possibly be memorising its training set because models are smaller on disk than their training sets. And yet it seems that large language models are memorising parts of their training sets- most likely, the ones that are more common, and therefore most likely.
c.2) This in turn means that the programs that Copilot is most likely to generate are variations of programs included in its training set and that have been memorised. Why is this most likely? Because those programs are themselves "most likely" - they are programs with the highest prior probability in the space of programs represented by Copilot's model.
c.3.1) That said, Copilot doesn't always generate memorised programs verbatim. It clearly has the ability to "mix and match" and generate programs that are not included in its training set. How does Copilot (or language models in general) achieve that? A language model is essentially a representation of a dense region of Cartesian space bounded by the elements (tokens, expressions, whole programs) of the training set. Anything within that dense geometric region, a language model can recognise and generate. Anything outside it, is down to luck.
c.3.2) To generate programs not included in its training set, Copilot interpolates between the programs in its training set and other programs in its model ("interpolates" as in "finds a point on a gradient between two programs' representations"). However, this interpolation is stochastic. Fudging very, very much, we can imagine Copilot traversing the AST of a memorised program and applying slight peturbations to that AST, at random, though according to its learned prior probabilities. This is why Copilot will generate different code each time it's run even with the same prompt, and the generated code is closer or farther away from memorised code according to its "temperature" parameter (that controls the randomness of "perturbations").
c.4) Suppose you take some program P and walk down its AST, perturbing the nodes at random, without having any way to know whether a perturbation results in correct code, incorrect code, or pure garbage. What is the expected result? The expected result is correct code, incorrect code, or garbage. Remember: Copilot can't tell which is which. So we don't know which we'll get.
d) All that said, I think that i) Copilot can make a great boilerplate generator but ii) only if people learn to use it right. So far I think most demonstrations I've seen are "holding it wrong".
d.1) As to ii) above, I think the best use-case of Copilot is to generate short code snippets, spanning at most a couple of lines, rather than entire functions. I think it's also going to work a lot better if it's allowed to complete code rather than comments (with code). See point b.2 above. The demonstrations I've seen so far seem to try to get Copilot to act as an Autopilot (sorry, couldn't resist). In that, it fails in the ways it should be expected to fail . I suspect that as users get more familiar with Copilot's abilities the best way to use it will become evident and Copilot will take its rightful place as a useful tool in the programmer's toolbox that can simplify, but not replace, day-to-day programming work.
e) Rumours of the imminent demise of the programming profession have, of course, been greately exaggerated. Wait another couple of generations, maybe. Human generations.
f) If you're interested in program synthesis and the progress that has been achieved so far in this old, but still active field of research, the following is a good recent survey of the field:
https://www.microsoft.com/en-us/research/wp-content/uploads/...
With that said, I have found all "creative" types of AI to be similarly gimmicky and shallow. Co-pilot is like IntelliJ code-complete in more generic circumstances. It can't architect systems, interview and recruit good engineers, or do any of the things that separate true success from failure. It's yet another cool demo but ultimately useless for me.