Blog

Home / Blog

Github uneveils copilot : an AI coding assistant for Visual Studio Code

Jason Li
Sr. Software Development Engineer
Skilled Angular and .NET developer, team leader for a healthcare insurance company.
July 07, 2021


The software giant MICROSOFT has brought an AI to GitHub which helps in creating a smart programming Copilot tool. It has been previewed that this new Visual Studio Code is designed in such a way that it can support the programmers for a smarter and faster way to write codes using AI technology with OpenAI. This Copilot works as such it takes the context from the specific code which is being worked on and auto-suggest it with functions and also whole lines. In other words, the Copilot is said to attract the actual context in which the coding is taking place and suggests proper traces as well as complete features by also providing various alternative routes to solve issues and find out new APIs without the assistance from solutions that are provided from browsing the web.

Github

It was more than a couple of years back, Microsoft has gained GitHub which is a mainstream code repository service that has been of use to innumerous developers and multinational companies. An investment of around 1 billion dollars was made in Open AI for building artificial general intelligence and mutually fostering new Azure supercomputing advancements. As of now, it is seen that Microsoft has held on mainstream licenses for Open AI’s GPT 3 language model. At the beginning of this year, Microsoft has also annou8nced that it has plans to produce coding in plain English much easier by combining Microsoft PowerFx low code language with OpenAir's GPT-3 AI model.

Controlled using Open AI Codex, which is another Artificial Intelligence framework that consists of a considerable chunk of public source code, Copilot has been a product of hard work and cooperation of Microsft and Open AI for the last couple of years which has now resulted in this fruitful effort providing better outputs. It has also been reported that if the technical preview has been garnering acceptance all over, they would be collaborating to build a commercial version of Github Copilot in the future. They are expecting to utilize the preview to get an idea about how people use this GitHub Copilot and what it will take to operate it at scale.

GitHub copilot has been arranged with assortments of multiple systems and also dialects. This has been previewed and has seen that Copilot works admirably well with languages like Javascript, Python, Ruby, Typescript, and many more. This AI pair programmer has successfully worked with many new frameworks and libraries. For the programmer to provide the codes in plain English, the Copilot helps them to covert the same into the actual code without any delay. Multiple features enabled in this tool have been helpful in many ways which can help in exploring new API’s and has been claimed to be the most advanced one among the list of available code assistants to date. Copilot has been skillful and adaptive to how the customer writes the code and has been able to trace billions of public code and deliver meaningful results in no time.

Nonetheless, as reported officially from the team's brief, Copilot can be anything but not a complete substitute for human software engineers. GitHub has made attempts to comprehend your plans and produce the best output or the apt code you need. But on the other side, they always point out that the code it recommends may not generally work or can lack sense sometimes. As keeping this in mind, the whole team behind the development of these tools is constantly working on the improvements to be made in its framework and structure. It has also to be noted that even if GitHub provided you with an ample amount of code recommendations, you must be testing and reviewing it thoroughly just as you do with any other codes. You have to be in charge of the code in terms of its working and competency and make it error-free. This point has been strongly emphasized by the team because Copilot is not capable of testing the code it recommends. Also on another note, they pointed that Copilot-generated code wouldn’t be able to compile or even run properly. Since the context that Copilot explores is very limited, inside a file where a huge number of lines are being run Copilot just goes on with the immediately preceding context which can cause an issue of misinterpretation of the context. By pointing out these reasons, the team has cautioned the programmers that even if they are permitted to use the code anywhere, they have to be alert while using it and have to perform the tasks only at their own risk. In other words, even if the Copilot is designed in such a way to generate the best form of code it can according to the suggestions and context, the chances of it using data from deprecated languages and libraries are to be dealt with caution.

Developed as a hand in help to the programmers to help with their code generations, Copilot has been showing the best results in multiple ways. It has also been observed that the efficiency of Copilot is observed to be the maximum when the code is split into small functions along with the usage of meaningful and understandable names given to functions parameters and composed with good docstrings and great remarks while in the process. Copilot has been tested against a bunch of Python functions with greater test inclusion in open source repos. The test was carried out by the team which has blanked several function bodies and asked the tool to fill it accordingly. The result was quite interesting because on the first try, Copilot gave an accuracy of around 43 percent of the time in generating the functions and the percentage increased to 53 percent of the time after ten tries. The official also remarked that after observation of the tools function, it has been shown that Copilot has been able to perform its best when it helps you in navigating around unfamiliar libraries and similar frameworks.

There has been a term called Stochastic parrots coined by Timnit Gebru, a renowned computer scientist who predominantly works on data mining and algorithmic bias. As the Copilot is been instructed to work on billions and trillions of codes that are available publicly, there can be a relationship between the suggested code and the informed code. The above-mentioned term has been introduced to such AI systems which straightly reproduce what they acquire during their training time. But as a response to this, team Copilot has responded saying that it would be unfair and also a clear misrepresentation to categorize the tool with a similar class of AI frameworks. They have been identifying this tool to a crow that builds novel tools from smaller available blocks rather than being considered as a tool parroting the current corpus of codes available publicly. Another specialist from Github has also remarked that this tool is working like a framework that can be felt like a baby with a photographic memory.

Conclusion

One thing to be kept in mind is that GitHub Copilot does not fall under the category of a search engine. It is a tool that is identified as a code synthesizer. The name itself implies that the tool is meant to recommend codes that have to be unique and also which have not been in use earlier. Even though the tool has been designed to work under these conditions, the chances of code duplication cannot be ruled out entirely. After running a bunch of tests on the tool, the team has discovered that 0.1 percent of the time, the recommendations provided by it contained small pieces of code from the training set. These types of recommendations are generated when the developer has not been able to provide the required context for the same or the issue would be having a generalized universal solution. There have been claims from a few users that since Copilot is being prepared and trained in public code, it has to be viewed as a form of open code laundering. Keeping these factors in mind, the developers have now informed that they have been engaged in building an origin tracker which would help the tool to detect the instances where code duplication occurs.

The framework and efficiency of Copilot are meant to be improved with usage and time. The introduction of this AI pair programmer is regarded as a great breakthrough in the third revolution of software development which has been witnessing the usage of AI in the world of coding. Open AI has been clear in their brief that they will be releasing Codex through its API after a while so that the developers associated could be able to explore the much more vast capabilities of the brand new AI system which can be easily incorporated with their apps and produce greater results.