Microsoft Simplifies Programming: New GitHub Tool Suggests Code

Microsoft’s GitHub and OpenAI preview Copilot for program synthesis in Python, JavaScript, TypeScript, Ruby, Go, and others.

July 1, 2021

Microsoft’s GitHub and OpenAI preview Copilot, a tool that relies on machine learning for program synthesis. GitHub Copilot is Microsoft’s latest attempt at leveraging artificial intelligence to streamline programming in Python, JavaScript, TypeScript, Ruby, Go, and others.

GitHub has released a new tool that can give the existence of Stack Overflow a run for its money. Currently available as a technical preview, the tool, called GitHub CopilotOpens a new window , could streamline the development process by alluding developers with relevant code suggestions as and when they type the code.

Microsoft-owned GitHub developed Copilot in collaboration with OpenAI, which lent its expertise in artificial intelligence for the new tool. Headed by former Y Combinator president Sam AltmanOpens a new window , OpenAI is financially backed by Redmond-based Microsoft since 2019Opens a new window , so it would seem the investment has paid off, provided Copilot takes off.

“I think Copilot is a great and very tangible example of how our ongoing partnership with OpenAI is starting to yield incredibly useful tools created by leveraging huge ML models trained on large-scale infrastructure,” Microsoft CTO Kevin ScottOpens a new window said in a blog postOpens a new window .

“We knew from the beginning of our partnership that things like Copilot were what we wanted to explore together — increased scale delivering a wider breadth of AI capabilities — but it’s beyond satisfying to see our hopes come to life in the real world.”

See Also: Google Uses AI to Design Next-Generation Chips in Just Six Hours

AI for Programming

The notion of machines that know how to code, also known as program synthesisOpens a new window , has so far been a pipe dream. Microsoft and researchers from several other institutions such as the Massachusetts Institute of Technology’s Computer Science and Artificial Intelligence Laboratory (MIT CSAIL), University of Cambridge, Rice University, Ubisoft, Mozilla, and others are currently involved in this research.

According to MIT CSAIL professor Armando Solar-LezamaOpens a new window , the problem with automated coding is generating the structure as well as the smaller details that go into a program. “Neural nets are pretty good at getting the structure right, but not the details,” Solar-Lezama explainedOpens a new window . “By dividing up the labor — letting the neural nets handle the high-level structure, and using a search strategy to fill in the blanks — we can write efficient programs that give the right answer.”

In 2017, Microsoft shared details of RobustFillOpens a new window , a deep learning tool for program synthesis. RobustFill couldn’t manage to gain traction in tech circles, mainly because it lacked in the performance department as compared to other such tools such as Solar-Lezama and another MIT professor Josh Tenenbaum’s SketchAdaptOpens a new window which itself is in its infancy even though it came out two years later in 2019.

Moreover, program synthesizers aren’t adaptable enough to the nuances of understanding human context with respect to the project at hand.

Microsoft also developed DeepCoderOpens a new window in collaboration with the University of Cambridge. DeepCoder is designed to build projects by searching for existing code.

Ubisoft and Mozilla’s Commit-CleverOpens a new window is also a debugger. Rice University’s BayouOpens a new window is the closest that can be considered to Copilot considering both enable developers to complete code from partial implementations. Bayou was developed with backing from the US Department of Defense’s Defense Advanced Research Projects Agency (DARPA), and Google.

Researchers from Oak Ridge National Laboratory in late 2017 predictedOpens a new window a radical change in software development spurred by the combination of machine learning, artificial intelligence, natural language processing. And as such, code generation technology will improve so much that machines, instead of humans, will write most of their own code by 2040.

But so far, none of the above research, including Copilot, has been successful in total program synthesis.

GitHub Copilot

Copilot is Microsoft’s (and GitHub’s) latest program/code synthesizer based on OpenAI’s AI Codex, a tool that can translate natural language into code. “GitHub Copilot draws context from the code you’re working on, suggesting whole lines or entire functions,” said Nat FriedmanOpens a new window , CEO at GitHub.

OpenAI co-founder and CTO Greg BrockmanOpens a new window described the OpenAI Codex as “a descendant of GPT-3Opens a new window ,” which is a deep learning model that is capable of generating human-like text. The major difference between GPT-3 and OpenAI Codex is that unlike the former that generates text in the English language, the latter generates code in programming languages.

GitHub Copilot’s machine learning model is trained on billions of lines of publicly available open source code from GitHub as well as natural language. So not only does the tool suggests coders with what can/should come next, but it also automatically generates code snippets based on developer comments.

Friedman calls Copilot an ‘AI pair programmer’, viz., someone or in this case, something that works side by side to a programmer that reviews each line of code. He addsOpens a new window , “It helps you quickly discover alternative ways to solve problems, write tests, and explore new APIs without having to tediously tailor a search for answers on the internet.”

Obviously, the power ultimately lies with the developer who can accept, edit, or reject suggestions made by their Copilot. This is necessary since not all code could be usable. More importantly, the output of Copilot is based on the quality of the code it was trained on. So a bad quality training code could result in poor suggestions.

Copilot supports multiple languages although this particular technical preview is most efficient with Python, JavaScript, TypeScript, Ruby and Go.

See Also: Artificial Intelligence: To Build or Not To Build? 

Closing Thoughts

Once again, the advancements in automation have kicked off debates around the prospect of AI-driven technologies taking over human jobs.

Concerns can also arise over the use of code from the public domain for commercial purposes. Additionally, it was found that Copilot reproduces code it already knows 0.1% of the timeOpens a new window . However, this shouldn’t pose a copyright infringement problem since it is unlikely that the tool will reproduce large chunks of code from the same source.

Developers can sign up for the GitHub Copilot technical preview hereOpens a new window . The company provided no clear timeline for its broader release.

Let us know if you enjoyed reading this news on LinkedInOpens a new window , TwitterOpens a new window , or FacebookOpens a new window . We would love to hear from you!

Sumeet Wadhwani
Sumeet Wadhwani

Asst. Editor, Spiceworks Ziff Davis

An earnest copywriter at heart, Sumeet is what you'd call a jack of all trades, rather techs. A self-proclaimed 'half-engineer', he dropped out of Computer Engineering to answer his creative calling pertaining to all things digital. He now writes what techies engineer. As a technology editor and writer for News and Feature articles on Spiceworks (formerly Toolbox), Sumeet covers a broad range of topics from cybersecurity, cloud, AI, emerging tech innovation, hardware, semiconductors, et al. Sumeet compounds his geopolitical interests with cartophilia and antiquarianism, not to mention the economics of current world affairs. He bleeds Blue for Chelsea and Team India! To share quotes or your inputs for stories, please get in touch on sumeet_wadhwani@swzd.com
Take me to Community
Do you still have questions? Head over to the Spiceworks Community to find answers.