Benchmarking the Coding Ability of Local Quantized Models: Metrics, Results, and Selection Guide

    This article re-evaluates the coding capabilities of local quantized LLMs for real engineering workflows rather than chat. It introduces a fully automated scoring design that breaks coding ability into verifiable metrics across tool calling, bug fixing, and full application builds, then compares three quantization routes by their working modes: minimal output for fast prototypes, low interaction rounds with high cache hit rates, and high reasoning depth for better code quality. It also explains how to choose a route based on your scarcest resource and how to turn the benchmark into a repeatable pipeline.

    ## 1. Why the Coding Ability of Local Quantized Models Needs Re-evaluation

    Over the past two years, the main reasons for running large models locally have been keeping data inside the internal network and controlling inference costs. As open-weight models iterate faster and quantization methods mature, local inference is no longer just about “being able to run.” It is starting to enter real engineering workflows: fixing bugs, generating tests, and scaffolding runnable applications.

    However, engineering scenarios differ greatly from chat scenarios. Coding tasks are typically long-chain, multi-turn agent behaviors: the model needs to read files, search code, execute commands, inspect errors, and then modify code. This type of task is extremely sensitive to three things:

    1. Single-turn output length (which determines decoding time);
    2. Number of interaction rounds (which determines end-to-end wall-clock time);
    3. Context repetition (which determines whether caching is effective).

    Therefore, evaluating local coding ability cannot rely only on “tokens per second.” It must look at end-to-end completion, time breakdown, and output quality.

    2. Benchmark Design: Breaking “Coding Ability” into Automatically Scored Metrics

    A convincing evaluation must first remove subjective judging. This benchmark uses fully automated machine scoring throughout, without introducing a large model as a judge, avoiding the bias of “models preferring models.”

    The tasks consist of three parts:

    • Tool-calling ability: the model must act as an agent and call a set of native tools (21 in total), covering basic actions such as reading, writing, searching, and executing;
    • Bug-fixing ability: complete 17 bug-fixing cases in a specific language ecosystem;
    • Full build ability: build a web application from scratch with 19 checkpoints, covering functional usability and structural completeness.

    The scoring logic should follow “verifiable first,” as illustrated below:

    1. score = 0.4 * checkpoint pass rate
    2. + 0.3 * bugs fixed / total bugs
    3. + 0.2 * tool-call validity rate
    4. + 0.1 * artifact reproducibility (builds/starts on the first try)

    The benefit of this design is that a model gains no points for “sounding good”; it only scores when it actually makes the engineering artifact run.

    3. Performance Differences Across Three Quantization Routes: Not Just Speed, but Different Working Modes

    All three models passed every test, but their working modes differed significantly, which is more informative than a simple ranking.

    1) The Minimal-Output Route: Trading “Writing Less” for a Faster Prototype

    Under 4-bit-level quantization, a model completed the application build in only about 18.4 minutes, the fastest of the three. The key reason was not a faster inference engine, but a total output of only about 20,000 tokens, extremely restrained.

    This strategy suits cases with clear requirement boundaries that aim to get a runnable prototype in the shortest time. The risk is that when a task requires extensive explanation, complex refactoring, or thorough testing, “writing less” may mean insufficient coverage.

    2) The Low-Interaction-Round Route: Plan First, Then Execute, with Cache Hits Cutting Costs

    Under 8-bit floating-point quantization, a model completed all tasks in only 77 interaction rounds, tending to give a plan first and then implement it step by step, with strong process readability. Its prompt cache hit rate was as high as about 98%, greatly amortizing the compute cost of repeated context.

    This strategy suits background long-running tasks and unattended pipelines. Engineering-wise, note that a high cache hit rate depends on a stable way of organizing context; frequently changing the system prompt or directory structure will lower the hit rate.

    3) The High-Reasoning-Depth Route: Trading Time for Engineering Quality

    Under 4-bit floating-point quantization, a model performed extensive internal reasoning every round. Its end-to-end time was about 27.6 minutes, the longest, but it produced the most standardized code and generated 18 test cases, offering the best test coverage and maintainability.

    This strategy suits teams that put code review upfront and enforce strict quality gates. The cost is higher time and compute usage.

    4. Turning the Findings into a Selection Method: Choose by “Constraint,” Not by “Model”

    Do not ask “which model is the strongest.” Ask “what is my scarcest resource right now”:

    • If the scarcest resource is time: choose a solution with restrained output that can quickly produce a runnable prototype;
    • If the scarcest resource is cost and stability: choose a solution with fewer interaction rounds, cache-friendliness, and suitability for background execution;
    • If the scarcest resource is delivery quality: choose a solution with more thorough reasoning and more complete tests.

    It is also recommended to turn the evaluation into a regression pipeline: fix the task set, fix the scoring script, and fix the hardware and quantization configuration, then run it every time the model or quantization scheme changes, keeping logs and artifacts to help determine whether the issue is a prompt problem, a tool problem, or a model problem.

    5. Necessary Boundary Notes

    Such conclusions are usually based on a single run and a specific tech stack, so there is an element of chance. A more robust approach is to repeat multiple times, extend across task families (different languages, different frameworks, different bug types), and record the time distribution rather than only the average. If an enterprise wants to engineer this type of evaluation, it can rely on common cloud capabilities such as container platforms, object storage, log services, and monitoring and alerting to build a reproducible and auditable evaluation environment; on Baidu AI Cloud, such an offline evaluation and artifact archiving process can likewise be built using general product categories.