LLM Coding Capabilities: Evolution and a Practical Evaluation Guide
This article explains how large language models have evolved from general-purpose chat to agentic, code-specialized systems, and how to evaluate them in real development workflows. It covers a reusable six-dimension evaluation framework, prompt and context engineering practices, when to use direct versus reasoning modes, and how to calculate cost per effective output. The goal is to help teams choose models and configurations based on their own task distribution rather than version numbers or benchmark hype.
1. From “Usable” to “Reliable”: The Stages of Coding Capability
Over the past two years, the coding ability of large language models has not grown linearly. Instead, it has progressed through distinct stages. Early versions were primarily general-purpose conversational systems, where code generation was a byproduct. The industry then adopted the agent paradigm, giving models the ability to break down tasks, call tools, and execute multiple steps. Later, targeted optimization on code corpora and engineering tasks moved “generating runnable code” from demos into production. Understanding this progression is more valuable than memorizing a specific version number, because it determines how you should design evaluations and integration.
A common misjudgment is treating the previous generation’s “reasoning mode” as the capability ceiling. In practice, as training and alignment strategies improve, a newer model’s non-reasoning (direct) mode can often match the previous generation’s reasoning mode, and enabling reasoning pushes it up another level. This means model selection should not only compare whether a “chain of thought” is enabled. Instead, compare the best configuration at the same cost—the optimal setup for equal budget.
2. Building a Reusable Evaluation Framework
Judging whether a model is “strong” without a specific scenario is meaningless. It helps to break evaluation into six dimensions, and prepare 10–20 real samples from your own repository for each:
- Correctness: Does it pass unit tests, and are boundary conditions covered?
- Runnability: Are dependencies reasonable, and are there obvious syntax or type errors?
- Context adherence: Does it strictly follow existing interfaces, naming, and directory conventions?
- Modification ability: In a given diff scenario, does it change only the necessary lines and avoid large-scale rewrites?
- Long context: Can it correctly associate cross-file references, type definitions, and configuration items?
- Stability: What is the variance in pass rate across repeated samples of the same prompt, avoiding a “lottery-style” experience?
The evaluation set should be desensitized: remove internal domains, proprietary tool names, and keys, keeping only structure and semantics.
3. Prompt and Context Engineering
Beyond model capability, input quality determines most of the output quality. A four-part structure works well: goal, constraints, context, and acceptance criteria.
Goal: Add an idempotent order-placement API to the order moduleConstraints: Reuse the existing repository-layer interfaces; do not introduce new dependencies; follow the unified error-code conventionContext: <relevant file snippets / interface definitions / table schemas>Acceptance: Provide unit test cases covering duplicate requests and insufficient inventory
In engineering practice, inject repository retrieval results, type definitions, and dependency lists as context rather than making the model “guess.” For large codebases, retrieve first, then generate, then validate—an approach that keeps cost under control.
4. Choosing Between Direct and Reasoning Modes
Reasoning mode improves performance on complex tasks through additional intermediate steps, but it increases latency and compute cost. A practical strategy is tiered routing:
- Simple completion, formatting, and comment generation: direct mode, prioritizing throughput and cost.
- Cross-file refactoring, defect localization, and complex algorithms: reasoning mode, prioritizing first-pass success.
- High-risk changes: reasoning mode plus mandatory unit tests plus human review.
Illustrative routing logic:
def route(task):if task.risk == "high" or task.files > 3:return "reasoning"return "direct"
5. Accounting for Cost, Latency, and Stability
Do not look at unit price alone. Calculate the “cost per effective output”: total consumption divided by the number of samples that pass acceptance. If reasoning mode clearly improves the first-pass success rate and reduces rework, the total cost may actually be lower. It also helps to monitor time to first token, end-to-end duration, retry rate, and human-intervention rate, and to establish baselines using logging services and monitoring alerts. For batch evaluation, container platforms can scale elastically, with object storage used to save desensitized samples and results.
6. Implementation Recommendations
Start with a pilot in non-core modules, and build an evaluation set and regression process. Integrate generated results into continuous integration, automatically running tests and static checks. Keep a human gate for high-risk changes. Baidu AI Cloud can provide engineering support for the above workflow through general capabilities such as model services, container platforms, and logging and monitoring. In the end, there is only one criterion: on your real task distribution, whose “cost per effective output” is lower and requires less rework.
