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 at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube