Over the past year, AI has seriously improved its ability to generate the written word. By scanning huge datasets of text, machine learning software can produce convincing samples of everything from short stories to song lyrics. Now, those same techniques are being applied to the world of coding with a new program called Deep TabNine.
Deep TabNine is what’s known as a coding autocompleter. Programmers can install it as an add-on in their editor of choice, and when they start writing, it’ll suggest how to continue each line, offering small chunks at a time. Think of it as Gmail’s Smart Compose feature but for code.
Machine learning can seriously improve the power of coding assistants
Jacob Jackson, the computer science undergrad at the University of Waterloo who created Deep TabNine, says this sort of software isn’t new, but machine learning has hugely improved what it can offer. “It’s solved a problem for me,” he tells The Verge.
Jackson started work on the original version of the software, TabNine, in February last year before launching it that November. But earlier this month, he released an updated version that uses a deep learning text-generation algorithm called GPT-2, which was designed by the research lab OpenAI, to improve its abilities. The update has seriously impressed coders, who have called it “amazing,” “insane,” and “absolutely mind-blowing” on Twitter.
One user, Franck Nijhof, an IT manager who works on open-source home automation software in his spare time, says he wasn’t just surprised by Deep TabNine — he was scared, in a pleasant fashion. “The first hour I used Deep TabNine was not helpful [because] I was continuously stopped by amazement trying to wrap my head around it,” Nijhof told The Verge over email. He kept asking himself, “How does it know that? But how?”
Autocompletion tools like this aren’t new, but Nijhof says Deep TabNine’s suggestions are just much more accurate. “I’ve tried some smart ‘universal’ ones in the past, but they were annoying and not helpful,” he says. “TabNine is undoubtedly a game-changer.”
The software offers better suggestions because it works on a predictive basis, says Jackson. Most autocompleters have to parse what the user has already written to make suggestions, working through their code like you would work through the steps in a mathematical formula. Deep TabNine, by comparison, relies on the ability of machine learning to find statistical patterns in data to make its predictions.
In the same way that text generation algorithms are trained on huge datasets of books, articles, and movie scripts, Deep TabNine is trained on 2 million files from coding repository GitHub. It finds patterns in this data and uses them to suggest what’s likely to appear next in any given line of code, whether that’s a variable name or a function.
Using deep learning to create autocompletion software offers several advantages, says Jackson. It makes it easy to add support for new languages, for a start. You only need to drop more training data into Deep TabNine’s hopper, and it’ll dig out patterns, he says. This means that Deep TabNine supports some 22 different coding languages while most alternatives just work with one.
Most importantly, thanks to the analytical abilities of deep learning, the suggestions Deep TabNine makes are of a high overall quality. And because the software doesn’t look at users’ own code to make suggestions, it can start helping with projects right from the word go, rather than waiting to get some cues from the code the user writes.
Deep TabNine has its problems, too
The software isn’t perfect, of course. It makes mistakes in its suggestions and isn’t useful for all types of coding. Users on various programming hang-outs like Hacker News and the r/programming subreddit have debated its merits and offered some mixed reviews (though they mostly skew positive). As you’d expect from a coding tool built for coders, people have a lot to say about how exactly it works with their existing editors and workflow.
One complaint that Jackson agrees is legitimate is that Deep TabNine is more suited to certain types of coding. It works best when autocompleting relatively rote code, the sort of programming that’s been done thousands of times with small variations. It’s less able to write exploratory code, where the user is solving a novel problem. That makes sense considering that the software’s smarts come from patterns found in archival data.
So how useful is it really for your average coder? That’ll depend on a whole lot of factors, like what programming language they use and what they’re trying to achieve. But Jackson says it’s more like a faster input method than a human coding partner (a common practice known as pair programming).
“Imagine all programmers right now are using the equivalent of mobile phone keyboards to type, and going to Deep TabNine is sort of like moving to a regular keyboard,” he says. The software improves how quickly you can input information, and that makes you more productive “because you can spend more time thinking about the high level stuff rather than the detail.” But it won’t write your code for you, and you do need to keep an eye on it.
“I haven’t really decided what I want to do with it yet.”
Currently, Jackson is considering what to do next with the software and whether it’s worth commercializing as a career. He says he has a full-time job lined up with a big tech company that he doesn’t want to give up on, but there’s been “a lot of interest” from various sectors. “I haven’t really decided what I want to do with it yet,” he says.
Right now, a license for TabNine costs $49 for personal use and $99 for business use, with individuals having to sign up for the Deep TabNine beta to get access to the new deep learning features. On the website, Jackson justifies the price like this, which acts as a decent summary of the software’s attraction: “TabNine will save you at least 1 second per minute. If you value your time above $1.40/hour, it will pay for itself in less than a year.”
He says that if he was able to create a program like this using open-source software, then the future is bright for AI-assisted coding.
“It’s the goal of everyone working in this space to tell the computer what code you want to write and it does it for you,” he says. “We’re nowhere close to that at the moment, but I see this as a tool that makes it a little more convenient for you to express your thoughts.”