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.
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 Copilot, 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 Altman, OpenAI is financially backed by Redmond-based Microsoft since 2019, 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 Scott said in a blog post.
Meet GitHub Copilot – your AI pair programmer. https://t.co/eWPueAXTFt pic.twitter.com/NPua5K2vFS
— GitHub (@github) June 29, 2021
“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 synthesis, 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-Lezama, 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 explained. “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 RobustFill, 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 SketchAdapt 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 DeepCoder in collaboration with the University of Cambridge. DeepCoder is designed to build projects by searching for existing code.
Ubisoft and Mozilla’s Commit-Clever is also a debugger. Rice University’s Bayou 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 predicted 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 Friedman, CEO at GitHub.
OpenAI co-founder and CTO Greg Brockman described the OpenAI Codex as “a descendant of GPT-3,” 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.
This is mind blowing.
With GPT-3, I built a layout generator where you just describe any layout you want, and it generates the JSX code for you.
W H A T pic.twitter.com/w8JkrZO4lk
— Sharif Shameem (@sharifshameem) July 13, 2020
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 adds, “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.
Yes, Github Copilot does work with Swift, although I’m seeing the best results when using it with Javascript. pic.twitter.com/7fRaoU79AN
— Guilherme Rambo (@_inside) June 30, 2021
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 time. 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 here. The company provided no clear timeline for its broader release.
Let us know if you enjoyed reading this news on LinkedIn, Twitter, or Facebook. We would love to hear from you!