- 1 What Is GitHub Copilot?
- 2 GitHub Copilot uses OpenAI Codex
- 3 How Does GitHub Copilot Work?
- 4 GitHub Copilot Examples
- 4.1 Copilot writes Python code for Zip and Unzip File
- 4.2 GitHub CoPilot writes Tic Tac Toe Code
- 4.3 GitHub Copilot Codes to get Cryptocurrency Price
- 4.4 CoPilot gets Pokemon Data
- 4.5 Speechless with Copilot Autocomplete
- 4.6 Copilot Neatly Writes HTML Tags
- 4.7 Copilot Gives Different Suggestions
- 4.8 AI writes Machine Learning Code
- 4.9 You Don’t Need to write Regex Again
- 4.10 One More CoPilot Autocomplete Example
- 4.11 CoPilot Writes R Code
- 5 How can I get Github Copilot?
- 6 What Does It Mean For The Future of Coding?
What Is GitHub Copilot?
Although there is a waitlist to get hold of the technical preview, the internet is filled with jaw-dropping GitHub Copilot examples by those who managed to get the preview version.
GitHub Copilot uses OpenAI Codex
GitHub Copilot is powered by Codex which is a model created by OpenAI for code. For the uninitiated OpenAI is a startup that has recently become popular for delivering breakthroughs in the field of AI year after year.
Last year they had released the language model GPT-3 whose astonishing capabilities gained viral popularity on the internet even outside the ML community.
Even at that time, some people had able to use GPT-3 to convert natural language into code. However, all this was quite rudimentary, because GPT-3 was not trained explicitly trained for generating codes, yet it showed a glimpse of the future.
Below you can see a user generating a Keras model using GPT-3.
This time OpenAI has developed Codex, a GPT version that only specializes in converting natural language into codes. Codex has been trained on publicly available GitHub code. Its performance benchmarking in generating standalone Python code from docstrings can be found in this paper.
How Does GitHub Copilot Work?
Github Copilot is currently available as an extension for Microsoft Visual Code only. It is claimed that the user just needs to define the function in plain English and the Copilot has the ability to converts it to actual code.
To do so Copilot tries to gain a contextual understanding of the code that you have written by using the Codex Model in the background and generate suggested code based on it.
But one has to note that at the end of the day it is “artificial” intelligence. Thus, the suggested code may not be accurate or may not work sometimes since the copilot is unable to check/test the suggested code. (So we are not even going in the direction that how it can steal Coder’s job!)
GitHub Copilot Examples
1Copilot writes Python code for Zip and Unzip File
This example shows how Copilot produces the code for unzipping and zipping of the file just by reading the comments given by the coder.
2GitHub CoPilot writes Tic Tac Toe Code
In this intriguing example, GitHub Copilot is able to produce the Tic Tac Toes code just by reading the comments written by the developer.
3GitHub Copilot Codes to get Cryptocurrency Price
Just look here how effortlessly you can get a code for getting the price of a cryptocurrency from Copilot just by writing your requirements in a comment.
4CoPilot gets Pokemon Data
Want to write a code to get pokemon data, just sit back and let Copilot do it for you.
5Speechless with Copilot Autocomplete
— Wassim Chegham 🌱 (@manekinekko) July 7, 2021
Even we are speechless of how effortlessly Copilot autocompletes the lines of codes here.
6Copilot Neatly Writes HTML Tags
— Colby Fayock (@colbyfayock) June 30, 2021
This GitHub Copilot example truly shows how it can pair up with you for programming.
7Copilot Gives Different Suggestions
Jokes apart #GitHubCopilot has enormous potential!
You can toggle across the different suggestions that the bot has to offer, it also is context aware. pic.twitter.com/WTRG0s7ZTI
— Hemanth.HM (@GNUmanth) June 30, 2021
This example of GitHub Copilot shows that it is flexible enough to offer different suggestions to the coders.
8AI writes Machine Learning Code
🚀 I just got access to @github Copilot and it’s super amazing!!! This is going to save me so much time!! Check out the short video below! #GitHubCopilot I think I’ll spend more time writing function descriptions now than the code itself 😀 pic.twitter.com/HKXJVtGffm
— abhishek (@abhi1thakur) June 30, 2021
This is getting more intriguing now, in this example, Copilot is writing machine learning code itself. We are not going to say the end of the world is near now. It is good for data scientists who can focus on experiments in model building and less on writing codes.
9You Don’t Need to write Regex Again
— Ben Hong (@bencodezen) July 2, 2021
We all know how difficult it becomes to write regular expressions even for simple things. But now you need not worry more about it as CoPilot can take care of it.
10One More CoPilot Autocomplete Example
GitHub Copilot is definitely more than just an autocompletion tool, it tries to understand the code you’re writing. Have been using it for weeks and it’s truly amazing. pic.twitter.com/nx84tWT8pw
— Shu Ding (@shuding_) July 1, 2021
This is yet another example of GitHub Copilot where it can autocomplete codes by understanding the context of what you are coding.
11CoPilot Writes R Code
— David Smith (@revodavid) July 1, 2021
CoPilot knows R syntax as well and this is yet another good news for data scientists and statisticians who prefer to work in R.
How can I get Github Copilot?
Currently, there is a small set of people being able to use Copilot since it being an invite-only testing phase. But you can sign up for the Copilot waiting list to be able to use it in the future. Copilot waiting list.
What Does It Mean For The Future of Coding?
The official body of GitHub clearly mentioned that Copilot is not designed to write code for developers. Instead, it is meant to suggest alternative codes based on what the user is working on this should be carefully tested and reviewed.
“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. As the developer, you are always in charge.”
As we discussed earlier that Github Copilot is just a language model powered by OpenAI Codex that specializes in code. But these language models do not have the ability to ‘comprehend’ what is being fed to them. They cannot come up with new ideas or designs. They simply convert the input into artificial outputs to degree that it is indistinguishable.
However, the Copilot suggested code can be rarely found in the training set (almost 0.1 percent). It is no surprise that AI in coding is a breakthrough but it was met with rather frightening comments online:
- “All this time we were using Github thinking “hey, this is neat and free”, but didn’t know that actually, we were feeding the AI that will replace us all.”
- “It is certainly impressive to see how much the GPT models have improved let’s how this changes things.”
But some were hopeful and welcoming
- “Your mother-in-law is not going to install Copilot and start knocking out web apps. Tools like this allow programmers to become more productive, which increases demand for the skills.“
- While this is cool and I look forward to trying it, it’s not going to replace software engineers. Even if it worked 100% correctly, it would be a tool for software engineers. There are still a ton of problems for engineers to solve – Architecture, maintenance, and increasingly, we’re getting pulled into dev ops and data science roles.