News

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

Featured

  • Creating Reactive Applications in .NET

    In modern applications, data is being retrieved in asynchronous, real-time streams, as traditional pull requests where the clients asks for data from the server are becoming a thing of the past.

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

Subscribe on YouTube