Visual Studio IntelliCode AI Assistant Gets Deep Learning Upgrade

Microsoft has improved the code-completion capabilities of Visual Studio's AI-powered development feature, IntelliCode.

IntelliCode is an AI-boosted upgrade of the rudimentary IntelliSense code-completion functionality long baked in to the IDE. It uses AI to provide more accurate and relevant suggestions for code completion, with the ability to analyze a developer's code context -- variable names, functions, the type of code used and so on -- in order to suggest relevant API calls the developer is most likely to use.

Capable of whole-line completions, IntelliCode puts those API calls atop the suggestion list marked with star icons. It can also assist with refactoring and other tasks, being based on large-scale machine learning transformer models somewhat similar to the tech that powers the revolutionary ChatGPT chatbot and GitHub Copilot.

However, unlike the latter "AI pair programmer" from GitHub, which costs $10 per month, IntelliCode is free, installed in Visual Studio via the IDE's installer app, and in Visual Studio Code via an extension. Thus, while it's not as powerful as the large language models (LLM) developed by Microsoft partner OpenAI (creator of ChatGPT) such as GPT-4, it's still instrumental to Visual Studio users, especially those who like to code on the cheap.

With that in mind, Microsoft has been busy improving IntelliCode while Copilot-branded AI constructs infiltrate numerous other Microsoft products and services.

[Click on image for larger view.] An IntelliCode Suggestion Example (source: Microsoft).

The most recent improvement was the addition of deep learning functionality, which is now helping to provide those starred completion suggestions for custom methods in the IntelliSense list.

Basically, deep learning is replacing IntelliCode's Markov-chain model, which couldn't rank custom methods specific to a developer's code. So, to provide that custom method functionality, Microsoft created a way for developers to train personal or team models associated with their code repos. Microsoft's custom model documentation explains that this way:

IntelliCode models are an encapsulation of a set of rules that let you predict some useful information (for example, recommendations in the IntelliSense list) based on an analysis of code. IntelliCode creates team models using the same learning process as for the IntelliCode base models, except they're trained on your own code. The more code you provide to illustrate your patterns of usage, the more capable your team model will be at offering useful recommendations.

Now that scheme is being replaced by deep learning's neural network approach in which data can be processed and transformed by network nodes in a non-linear way, suitable for complex tasks including computer vision, natural language processing, speech recognition and so on.

In a post last month, Microsoft explained how deep learning enables IntelliCode to rank custom methods in the IntelliSense list out of the box.

"Since the Visual Studio 2022 release (version 17.0+), custom methods are ranked with the help of a neural encoder model," Microsoft said. "This deep learning model ranks candidates provided by static analyzer."

That reportedly provides the following benefits to developers:

  • Provide completions even on unseen libraries -- for instance, private user code which is not present in the training set.
  • Completions tailored to your code -- all without the need to train a personal / repository associated team completions model.
  • All your code stays local -- the model runs right on your computer, so there's no need to transmit code to a remote server for custom model training. This is enabled by our machine learning system design, which led to dramatically reduced memory footprint and improved inference speed.

What's more, the deep learning model can improve itself, being able to suggest better code completion options by analyzing:

  • The specific programming language being used, libraries and frameworks and other contextual information.
  • The user's editing history to dynamically update the ranking model based on the user's recent code changes.

Using telemetry garnered from the custom personal/team model training scheme explained above, Microsoft shut down that capability after noticing how much better the deep learning approach is.

"All Visual Studio 2022 users will automatically switchover to using the improved deep learning model -- including those who had previously trained custom repository-associated team & personal models," Microsoft said.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


Subscribe on YouTube