LLM Code Generation Evaluation: From Benchmark Scores to Engineering Practice
This article reports a small-scale evaluation of LLMs on real development tasks, covering feature development, refactoring, deep bug localization, token consumption, caching, and non-public test sets. It explains why parameter counts and public benchmark rankings are not enough for model selection, and it offers practical recommendations for teams adopting LLM-assisted coding.
LLM Code Generation Evaluation: From Benchmark Scores to Engineering Practice
This article documents an evaluation of models on real development tasks. The tasks included three new feature implementations and two code refactors. The sample size was limited. The data in this article reflects only this test and should not be generalized directly to all scenarios.
1. Parameter Count Does Not Directly Represent Development Efficiency
A mixture-of-experts (MoE) model activates only a subset of its parameters during inference. The MoE model tested here had approximately 320B total parameters and approximately 18B active parameters. These figures came from vendor-published information and were not independently verified in this test. Active parameters reduce the computation per token, but they do not directly determine how quickly a task is completed, nor do they directly determine code quality.
In routine code review and feature coding, the two models tested here performed similarly. They found roughly the same range of issues, and there was no obvious gap in the quality of delivered code. This suggests that on standard coding tasks, the baseline capabilities of mainstream models are converging, and parameter count alone is a weak way to distinguish their value in daily development.
2. Deep Bug Localization Tests Long-Context Linking
Basic coding capability can be compensated for through prompt design. Bug localization in complex engineering projects is harder to solve with prompts alone, because it tests whether a model can link code that is far apart across an entire repository.
In this test, a new feature raised an exception at runtime. The hidden logic bug was not in the modified code block. Instead, it arose from an unexpected interaction between two distant pieces of code. In this scenario, the high-parameter general model traversed repository-wide context, found the relationship between the two code areas, and located the problem. The MoE model did not find the issue. We did not determine why it missed the problem, so we cannot infer from this that its architecture has some form of attention pruning.
For another bug that was harder to locate, we introduced a third-party closed-source model for cross-validation. At a higher reasoning intensity, that model found the root cause. Higher reasoning intensity usually means higher latency and cost per call, and that tradeoff must be included in model selection.
These two cases show that cross-file logical coupling places high demands on a model’s long-range context capability. The two cases do not constitute a statistical conclusion, but they suggest that comparing only generation speed during model selection would miss this capability.
3. Speed, Token Consumption, and Total Cost
When evaluating cost, saving tokens is not the same as saving money. In single-step calls, the MoE model consumed fewer tokens, which was observable in this test. However, its generation speed was clearly slower than that of the comparison model.
The time required for a long-running task is the sum of generation time at each step. Consider an automated repair task that includes dozens of tool-call steps. The generation and waiting time at each step all contribute to total elapsed time. Token savings at a single step cannot offset the accumulated waiting time across multiple steps. Developers should therefore measure experience by end-to-end completion time, not by single-step metrics alone.
Cost accounting also needs to consider billing rules and caching mechanisms. Many platforms currently offer API discounts, and their billing methods differ. In this calculation, the MoE model’s total cost only roughly matched that of a general model billed at list price but equipped with efficient context caching. Most platforms offer a lower unit price for input tokens that hit the cache; specific rules should be based on each platform’s published documentation. In multi-turn tool calls and long-context reviews, cache hit rate often has a more significant effect on final cost than unit price itself.
4. Cache Hit Rate and Context Window
Cache hit rate refers to the proportion of input tokens that hit the cache within a period, out of all input tokens. It depends on whether the request prefix is stable. Repeated content such as system instructions and codebase structure placed at the front, with dynamic content placed later, is easier to reuse through caching.
In this test, we privately deployed a general model internally. Due to VRAM constraints, inference speed dropped noticeably when context exceeded 300k. We therefore limited the context window to 300k and enabled a context compression strategy. In the code review and refactoring tasks in this test, the engineering quality of this version did not show obvious degradation. At the same time, cache reuse effectively shortened time to first token (TTFT), and the interaction experience was relatively smooth.
By comparison, the MoE model supports a context window of up to 1M, but in our observations its cache hit rate was lower than that of the privately deployed model. Because the measurement window and statistical criteria were not fully recorded, this conclusion can only serve as directional reference.
This phenomenon shows that the numerical upper limit of a context window does not equal usable capability. Reasonable cache design and compression strategies can partly compensate for limitations in hardware and context length. Whether such engineering optimization is worth the investment depends on the team’s task scale and cost sensitivity.
5. The Role and Limits of Non-Public Test Sets
Public leaderboards carry the risk of data contamination. A model may have seen similar problems during training, which can inflate its score. To reduce this effect, we adapted a non-public test set based on the question types in Terminal Bench and asked models to handle unpublished tasks.
On this test set, model rankings changed. Models that had ranked high on public leaderboards dropped, while models that performed stably in real development rose. This was broadly consistent with our practical experience in actual development.
It should be noted that this article does not fully disclose the sample size, scoring rules, or anti-contamination measures of the test set. The ranking change can therefore only be treated as a directional observation and cannot be directly reproduced. Readers who want to borrow this approach should record how the test set was constructed and how scoring was performed, so that others can verify it.
A more reliable approach is to use a private test set aligned with your own business for cross-validation, while treating public leaderboards as reference.
6. Recommendations for Development Practice
Based on the tests above, teams that want to introduce LLMs to assist programming in real development can consider the following practices.
Build a private evaluation set and use it together with public leaderboards. You can extract de-identified bug-fix records and refactoring cases from your own codebase. For each sample, record the task type, pass criteria, elapsed time, token consumption, cost, and number of manual rework rounds to support long-term comparison.
Use end-to-end efficiency as the primary metric. When selecting a model, in addition to active parameters and unit price, consider generation speed, stability of multi-step tool calls, and the platform’s cache hit rate.
Adopt multi-model collaboration and cross-validation. For example, use one model to generate initial code and another to review it. For difficult bugs, selectively introduce a model with stronger reasoning capability. Each additional model increases cost and call-chain complexity, so use multiple models only at critical stages.
Optimize engineering infrastructure. Whether using public cloud APIs or private deployment, manage context windows and design for caching. For example, place stable system instructions and code structure in the prefix and variable content at the end; set a reasonable threshold for context truncation and validate task state after truncation.
Competition in LLM code generation is shifting from parameter scale to engineering practice. Teams should run A/B tests on real business pipelines and make model-selection decisions based on cost, stability, and compliance requirements.
