← Latest papers
💬 NLP

Evaluating and Achieving Controllable Code Completion in Code LLM

This paper introduces the Controllable Code Completion Benchmark (C3-Bench) to address the lack of instruction-following evaluation in code LLMs, reveals significant performance gaps between open-source and proprietary models, and proposes a data synthesis pipeline that enables a fine-tuned model to achieve state-of-the-art results on the new benchmark.

Original authors: Jiajun Zhang, Zeyu Cui, Lei Zhang, Jian Yang, Jiaxi Yang, Qiang Liu, Zilei Wang, Binyuan Hui, Liang Wang, Junyang Lin

Published 2026-01-23
📖 4 min read☕ Coffee break read

Original authors: Jiajun Zhang, Zeyu Cui, Lei Zhang, Jian Yang, Jiaxi Yang, Qiang Liu, Zilei Wang, Binyuan Hui, Liang Wang, Junyang Lin

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 master chef (the AI) working in a busy kitchen. For a long time, the way we tested these chefs was simple: we gave them a half-cooked dish (the code before the missing part) and a half-cooked dish after it (the code after the missing part), and asked them to fill in the middle. If the final dish tasted good (passed the unit tests), the chef got a gold star.

The Problem: The "Recipe" Was Missing
The authors of this paper argue that this old way of testing is flawed. In the real world, a head chef doesn't just say, "Fill in the middle." They say, "Fill in the middle, but use only vegetarian ingredients," or "Fill in the middle, but make it exactly three lines long," or "Fill in the middle, but use a specific type of knife."

Current AI models are great at making the dish taste good, but they often ignore the specific instructions on how to make it. They might use meat when you asked for veggies, or write a paragraph when you asked for a single line. The old tests didn't catch this because they only checked if the food was edible, not if the chef listened to the order.

The Solution: C3-Bench (The "Instruction-Following" Test)
To fix this, the team created a new test called C3-Bench (Controllable Code Completion Benchmark). Think of this as a new, much stricter cooking competition.

Instead of just asking for a missing piece of code, every test in C3-Bench comes with a specific, fine-grained instruction. They split these instructions into two main categories:

  1. The "How-To" Instructions (Implementation-Control):
    • Analogy: "Build a bridge, but you must use a suspension design, not a beam design."
    • The AI has to write code that works and follows a specific style, algorithm, or structure. For example, "Sort this list using a specific sorting method" or "Handle errors in this specific way."
  2. The "Size" Instructions (Scale-Control):
    • Analogy: "Write a sentence that is exactly 10 words long," or "Write a paragraph that is exactly 3 sentences."
    • The AI has to generate code that fits a strict size limit, like exactly 5 lines of code or a specific block of logic, no more and no less.

What They Found
The team tested over 40 different AI models (both free, open-source ones and expensive, closed-source ones) on this new test. Here is what they discovered:

  • The "Overconfident" Open-Source Models: On the old tests, many free, open-source AI models performed just as well as the expensive, top-tier ones. However, on this new C3-Bench, they struggled significantly. It turns out they had "memorized" the old tests but didn't actually know how to follow complex instructions. They were like students who memorized the answer key but couldn't solve a new problem with a twist.
  • The Gap: There is a huge gap between models that can just "make code work" and models that can "make code work exactly how you asked." Even some of the smartest, most expensive models had trouble with the "Size" instructions (like writing exactly the right number of lines).
  • The Fix: The authors didn't just point out the problem; they built a solution. They created a pipeline to automatically generate thousands of new training examples where an AI writes code and follows a specific instruction. They used this data to train a new version of their model, called Qwen2.5-Coder-C3.
  • The Result: This new model became the best at following instructions in code completion, beating almost everyone else on the new test while still being good at the old tests.

The Takeaway
This paper introduces a new way to measure AI coding skills that actually matters for real-world use: Can the AI listen?

They found that many current AI models are like talented musicians who play the right notes but ignore the conductor's tempo changes. By creating this new benchmark and a method to train models to listen better, the authors are helping developers build AI tools that don't just write code, but write the right code according to the user's specific, detailed needs. They have made all their data and models available for others to use and improve upon.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →