Control Models for In-IDE Code Completion
This paper introduces and evaluates control models, specifically ML classifiers, to optimize LLM-powered code completion in JetBrains IDEs by triggering inference and filtering suggestions, demonstrating improved efficiency and quality through offline analysis and a production A/B study.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a chef (the developer) working in a busy kitchen (the IDE). You have a super-intelligent sous-chef (the AI) who constantly shouts out recipe ideas and ingredient suggestions while you are chopping vegetables.
Sometimes, the sous-chef is brilliant and saves you time. But often, the sous-chef is a bit too eager:
- It suggests a dessert while you are making soup (bad timing).
- It suggests an ingredient you already have (redundant).
- It suggests something that tastes terrible (bad code).
This constant shouting is distracting. It breaks your "flow," wastes the kitchen's energy (computing power), and makes you feel annoyed rather than helped.
The Problem:
The JetBrains team (the authors of this paper) noticed that their AI was generating suggestions that developers ignored or rejected about 70% of the time. They were wasting a lot of money and energy on suggestions nobody wanted.
The Solution: "Control Models" (The Smart Bouncer)
Instead of just making the AI smarter at guessing recipes, the team built a new layer of intelligence called Control Models. Think of these as a smart bouncer standing at the door between the AI and the chef.
This bouncer has two jobs:
- The Trigger (The "Wait" Signal): Before the AI even starts cooking a suggestion, the bouncer checks the chef's mood. Is the chef typing fast? Are they in the middle of a sentence? If the timing is off, the bouncer says, "No, don't bother the AI yet."
- The Filter (The "Trash" Bin): If the AI does cook up a suggestion, the bouncer tastes it first. If it looks weird or doesn't fit the current dish, the bouncer throws it in the trash before the chef ever sees it.
How They Tested It
The team ran experiments using real data from thousands of developers using JetBrains software (like IntelliJ IDEA). They tested two types of bouncers:
- The "Boosting" Bouncer: A fast, lightweight model that looks at simple stats (like typing speed and cursor position). It's like a bouncer who just glances at your ID and decides quickly.
- The "Transformer" Bouncer: A heavy, complex model that reads the actual code and understands deep context. It's like a bouncer who reads the entire recipe book before letting you in.
The Results
- Saving Money: By using the "Boosting" bouncer, they stopped about 20% of unnecessary AI requests. This saves a lot of computing power (inference costs).
- Better Quality: Because the bad suggestions were filtered out, the suggestions that did reach the developers were much better. Developers accepted them more often and rejected them less often.
- The Trade-off: Interestingly, while they filtered out a lot of bad ideas, the total number of words developers typed didn't drop much. This is because when developers aren't distracted by bad suggestions, they actually type more code themselves, creating new opportunities for the AI to help.
The Catch (Why not use the fancy bouncer?)
The "Transformer" bouncer (the one that reads the code) was actually very good at filtering, but it was too slow and required too much computing power to run on everyone's laptops. It also raised privacy concerns because it needed to read the actual code to make decisions. So, the team decided to stick with the faster, lighter "Boosting" bouncer for now.
The Big Picture
The paper concludes that to make AI helpful in coding, we can't just make the AI smarter at writing code. We also need to build smart gatekeepers that decide when and how to show that code. This ensures the AI helps the developer's flow instead of interrupting it.
In short: They built a smart filter that stops the AI from annoying developers with bad ideas, saving money and making the coding experience smoother.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.