Why LLMs Are So Good at Coding

    This article breaks down why leading large language models now solve nearly 90% of real-world bug-fixing tasks, up from roughly 60% a year earlier. It explains the four sources of coding strength—training data, reinforcement learning with execution feedback, context engineering and tool use, and inference-time compute—and why comparing benchmark scores to crown a single "best" model is misleading. It also outlines how teams can build a small internal evaluation to guide adoption of AI coding tools.

    1. A Single Score That Shook the Industry

    One number has been circulating in tech circles lately: on a benchmark built around fixing defects in real open-source projects, top models now pass on the first attempt close to 90% of the time. A year earlier, the best result on comparable evaluations hovered just above 60%.

    What makes this shift worth attention isn’t that the number looks good, but that it measures something very concrete. The model is handed a real repository, a defect description, and a set of automated tests, then judged on whether it can locate the problem, modify the code, run the tests, and deliver a patch that could actually be merged.

    These evaluations carry weight precisely because they’re nearly impossible to pass by memorizing answers. Real repositories run to hundreds of thousands of lines, defect descriptions are often vague, tests include both existing and newly added cases, and environment dependencies are complex. The model has to complete an entire chain: understand the requirement, retrieve relevant files, form a hypothesis, modify the code, run verification, and iterate based on errors. This closely mirrors the daily work of a junior engineer, which is why the score change has directly stirred debate about job structure.

    Still, reading this score as “one vendor is now comprehensively ahead” is an oversimplification. A more rigorous approach is to first break down what “strong coding ability” actually means.

    2. Four Sources of Strong Coding Ability

    2.1 Data and Training Objectives: Enough “Problem–Fix” Pairs

    The underlying advantage of code models starts with the shape of the data. Public code hosting platforms hold massive commit histories, defect discussions, review comments, and fix records. This text naturally forms samples of “problem description + error context + correct change.” Compared with natural language, code is structural—it can be parsed, compiled, and tested—and the training objective is easier to frame as next-token prediction and sequence completion. This is why models rarely make syntax-level mistakes.

    It’s worth stressing that a data advantage only solves whether the output looks like code, not whether it’s correct. What really separates models is the next two layers.

    2.2 Reinforcement Learning and Execution Feedback: Turning “It Runs” into a Reward Signal

    The most notable change over the past year is the introduction of verifiable rewards into the training pipeline. Code happens to be the most easily auto-verifiable modality: whether compilation passes, whether all unit tests are green, whether static checks report errors, whether performance benchmarks regress. These signals need no human labeling and can be sampled at scale in parallel, forming a “generate–execute–score–feed back” loop.

    A schematic training loop can be abstracted as:

    1. for task in repo_tasks: # real repository tasks
    2. patch = policy.generate(task) # model generates a patch
    3. result = sandbox.run(tests, patch)
    4. reward = parse(result) # compilation/tests/static checks
    5. buffer.add(task, patch, reward)
    6. policy.update(buffer) # preference optimization or policy gradient

    The key lies in the quality of the sandbox and tests. Once a reward design has holes, the model will exploit them—deleting assertions, skipping cases, or hardcoding expected values. So in engineering practice, teams typically add measures like test isolation, hidden cases, and behavioral diff comparison to suppress reward hacking.

    2.3 Context Engineering and Tool Use: Turning “Smart” into “Usable”

    Real defect fixing is rarely done in a single generation. More often it’s multi-turn tool use: retrieving symbol definitions, reading call chains, checking commit history, running tests, and reading stack traces. A model’s ceiling therefore isn’t determined by parameters alone but also by how context is organized. Common practices include:

    • Repository retrieval: hybrid recall by symbol, path, and semantic similarity, compressed before being placed into context;
    • Structured observation: formatting errors, directory trees, and dependency lists into compact forms to reduce noise;
    • Planning and reflection: outputting a change plan and impact analysis before touching the code;
    • Minimal reproduction: first building a case that reliably reproduces the defect, then fixing it, then running regression.

    This process explains a common phenomenon: the same model, under different toolchains, can differ by more than ten percentage points on the same evaluation.

    2.4 Inference-Time Compute: Trading Longer Thinking for a Higher Pass Rate

    When the sampling budget allows, having the model generate multiple candidate patches, executing and verifying each, and then submitting the best one can significantly raise the first-attempt pass rate. The cost is higher latency and expense. So a “high score” often implies a precondition: enough inference and execution budget is allowed.

    3. Why “Who’s the Best” Is the Wrong Question

    Comparing scores across different leaderboards easily leads to contradictory conclusions: one model leads on software engineering evaluations, another on PhD-level scientific reasoning, and still others win at competitive programming and Chinese-language knowledge tests. There are three reasons:

    1. They measure different abilities. Defect fixing tests long context and tool use; competitive programming tests single-file algorithms; scientific reasoning tests subject-matter knowledge density.
    2. Evaluation conditions differ. Whether internet access is allowed, whether multiple samples are permitted, whether tests are hidden, and whether reasoning mode is enabled all change the results.
    3. Data sources differ. Official self-reports, third-party reproductions, and community aggregations vary in credibility and methodology, and version updates make scores quickly go stale.

    So the right way to ask is: in what scenario, by what standard, and with what budget.

    4. Selection and Evaluation Methods for Real Deployment

    Rather than relying on public leaderboards, enterprises are advised to build their own small internal evaluation:

    • Task set: sample 50–200 real defects from historical tickets, covering different modules and difficulty levels;
    • Metrics: first-attempt pass rate, average time, cost per task, rollback rate, and review rework rate;
    • Constraints: fix the sandbox, fix the test commands, and fix the context budget to ensure comparability;
    • Stratification: break results down by “single-file fix / cross-file fix / requires new tests.”

    A schematic evaluation skeleton:

    1. dataset: internal_bugs_v1
    2. sandbox: {cpu: 2, mem: 4G, net: false}
    3. limits: {max_turns: 12, context: 200k}
    4. metrics: [pass@1, latency_p95, cost_per_task, rollback_rate]

    On the platform side, general-purpose capabilities are usually enough: a container platform provides isolated sandboxes, object storage holds tasks and patches, a message queue handles task distribution, logging and monitoring/alerting services provide observability, and key management plus access control keep code assets secure. In these kinds of scenarios, Baidu AI Cloud likewise provides these general capability categories, which enterprises can combine to meet their own compliance requirements.

    5. Conclusion

    The leap in coding ability is essentially the combined result of “verifiable signals + a tooled environment + an inference budget,” not the victory of a single metric. For developers, the pragmatic move is to take evaluation back into their own hands: measure results with a small, realistic task set, constrain risk with cost and rollback rate, and then decide where to introduce AI coding tools.