Developers have a lot to think about while programming, starting with logic and ending with syntax. While code editors help us with syntax suggestions, snippets, debugging suggestions, they are not quite the real deal. The GitHub Copilot changes the game; it is a new service offered by GitHub and OpenAI, described as “Your AI pair programmer.” GitHub Copilot is a Visual Studio Code that auto-generates code based on the content of the file and the location of your cursor.
For example, the image below shows the suggestion (grey text) GitHub Copilot offers when it is provided with some context of the function. It really is magical.
How does GitHub Copilot work?
It is no surprise that the GitHub Copilot is a marvel of Artificial Intelligence and natural language processing, in specific. GitHub Copilot harnesses OpenAI Codex to synthesize and suggest code. The OpenAI Codex is a descendant of GPT-3; Codex is trained on both natural language and billions of lines of source code from publicly available sources, including code in public GitHub repositories.
Image Credit: GitHub
OpenAI Codex employs natural language understanding due to GPT-3; however, it produces working code: English commands are converted to code. In short, OpenAI Codex empowers computers to better understand intent.
How can you use it
Once a programmer knows what to build, the act of writing code can be thought of as (1) breaking a problem down into simpler problems and (2) mapping those simple problems to existing code (libraries, APIs, or functions). The latter activity entails the highest barrier to entry, and that is where OpenAI Codex excels most.
As a side note, developers must thoroughly review code written by GitHub Copilot since research at New York University discovered that nearly 40% of the code that GitHub Copilot generated has vulnerabilities.
Will GPT-3 “replace” humans?
There has been quite a lot of debate about if GitHub Copilot will ‘replace’ programmers. The answer is a resounding “no.” Today’s technology is limited to suggesting small code snippets, so ‘replacing’ developers is out of question. In fact, it makes a developer’s job much easier since they can program more efficiently; therefore, at least in short and midterm periods there Copilot will not replace humans. However, what will happen in the future is anyone’s guess. However, most likely, AI may replace a significant amount of work done by humans
GitHub Copilot was trained on GitHub’s repository. Now, the obvious question is if Copilot committed copyright infringement while training the model. After analyzing GitHub Terms of Service, It is clear that GitHub is not committing copyright infringement by training Copilot on code hosted on GitHub. However, for code not hosted on GitHub (and thus not governed by GitHub’s terms of service), there may be a strong case that Copilot uses code in a transformative manner, which would support a fair use argument that there is no copyright infringement. However, ultimately, there cannot be a definitive answer until the matter is settled in a court.
Conclusion on GitHub Copilot
There is no doubt that GitHub Copilot is a significant addition to the existing arsenal of tools that developers have at their disposal. Copilot will only increase the productivity of developers and foster quicker development. However, the ethical questions must not be ignored.
About the author: Shloak Rathod is an open-source developer and researcher interested in AI, web technologies, data science, and economics. He relishes writing about fast-paced upcoming technologies with disruptive capabilities. He also loves a chat, don’t hesitate to reach him at firstname.lastname@example.org.