Benchmarking the Coding Ability of Locally Quantized Models: Behavior Patterns and Selection Framework

    This article re-evaluates how to measure the coding ability of locally deployed, quantized LLMs. Based on an independent benchmark across three quantization schemes on a dual-accelerator setup, it explains why quantization shapes model behavior rather than raw capability, breaks down three typical behavior profiles, and outlines a reusable evaluation methodology with a selection framework for matching models to engineering tasks.

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

    Over the past two years, the focus of running large models locally has mostly been on whether they can run at all: VRAM usage, context length, and basic throughput. Once models start taking on real software engineering tasks, however, the evaluation criteria must shift to whether they can finish the job, how well they do it, and at what cost. Coding tasks are the harshest test precisely because they demand long-context understanding, multi-turn tool calling, strict syntactic correctness, and consistent cross-file modifications.

    In an independent benchmark designed for a local dual-accelerator environment, three lightweight inference models using different quantization schemes were compared under the same set of engineering tasks. Several aspects of the test design are worth noting:

    • Realistic tasks: not answering algorithm puzzles, but fixing bugs in multiple real projects and building an application from scratch with a complete set of checks.
    • Native tool calling: the model had to act as an agent and proactively invoke more than twenty native tools (reading and writing files, executing commands, searching code, running tests, and so on), rather than only offering suggestions in conversation.
    • Fully automated scoring: a machine decided pass or fail against predefined checks, with no LLM acting as judge, avoiding the systematic bias of “models preferring models.”
    • Controlled variables: hardware, task set, and scoring scripts were kept identical, with the only variable being the model and quantization scheme.

    The core value of this design is that it decomposes “model capability” into observable engineering metrics: completion time, number of interaction turns, total output tokens, cache hit ratio, number of test cases, and check pass rate.

    2. How Quantization Indirectly Determines Working Mode

    A common misconception needs clearing up: quantization does not directly improve coding ability. What it changes is the inference cost and throughput characteristics, and the cost structure in turn shapes the model’s “behavioral style.”

    • Extremely low-bit quantization (such as 4-bit level): the most aggressive weight compression, usually accompanied by a tendency toward shorter output. Inference engine implementations vary widely, so it is not necessarily the fastest, but if the model naturally produces sparse output, the end-to-end time may actually be the shortest.
    • Low-precision floating-point quantization (such as FP8 level): a more balanced trade-off between precision and efficiency, typically with the lowest compute cost under high cache reuse, making it suitable for long autonomous runs.
    • Block-level scaling quantization (such as NVFP4-style schemes): tends to perform more thorough internal reasoning each turn, slower per turn, but produces more standardized output.

    This yields a practical rule: end-to-end time ≈ per-turn inference time × number of turns, while total output tokens and cache hit ratio together determine the actual compute cost. Extreme behavior at any single stage can rewrite the final ranking.

    3. Three Typical Behavior Profiles and Their Use Cases

    The first type is the “minimalist rapid prototyping” profile. It has the shortest total time and very low output throughout, completing tasks with a small number of precise edit actions. Its strength is quickly obtaining a runnable skeleton; its risk is relatively weak test coverage and edge-case handling. It suits prototype validation and exploratory development.

    The second type is the “plan-driven” profile. It uses the fewest interaction turns, tends to form a plan first and then implement it step by step, and is highly readable in process. Combined with a high ratio of prompt cache reuse, it has the lowest compute cost per task. This mode is well suited to background long-running tasks, batch refactoring, and unattended pipelines.

    The third type is the “deep thinking” profile. It performs extensive internal reasoning every turn and takes the longest, but produces the most standardized code with the most built-in test cases. It fits scenarios with hard requirements on maintainability and test coverage, such as core module refactoring and pre-review of code.

    An easy-to-follow illustrative flow for the plan-driven profile is closer to:

    1. Read project structure -> Generate fix plan -> Apply patches in batches -> Run tests -> Summarize results

    The deep thinking profile is closer to:

    1. Read context -> Long-chain internal reasoning -> Single high-information edit -> Add test cases -> Verify

    4. Recommendations for Building a Reusable Evaluation Setup

    To reproduce a similar comparison in your own environment, follow these steps:

    1. Fix the task set: select three categories—bug fixing, feature building, and refactoring—each with machine-verifiable checks.
    2. Unify the tool layer: wrap file operations, command execution, and test running into a restricted tool set, and record the parameters and duration of each call.
    3. Collect fine-grained metrics: beyond total time, record turns, input and output tokens, cache hits, and the number of failed retries.
    4. Isolate external dependencies: pin dependency versions and network policies to avoid environment drift contaminating conclusions.
    5. Repeat multiple times and take the distribution: a single run is not enough to support a selection decision, so focus on both the mean and tail latency.

    Metric collection can be abstracted into the following structure:

    1. {
    2. "task_id": "build_web_app",
    3. "wall_clock_sec": 1104,
    4. "turns": 77,
    5. "output_tokens": 20000,
    6. "cache_hit_ratio": 0.98,
    7. "checks_passed": "19/19"
    8. }

    5. Selection Framework and Conclusions

    Selection should not chase a single “strongest model” but should match the task profile:

    • When you need a runnable prototype as soon as possible: choose a configuration with minimal output and fast responses.
    • When you need low-cost, long-running autonomous execution: choose a configuration with high cache reuse and strong planning.
    • When you need high standardization and high test coverage: choose a configuration with more thorough reasoning and more rigorous output.

    A more robust engineering approach is layered composition: use a fast model for exploration and skeleton building, a deep-reasoning model for core modules and test completion, and a plan-driven model for batch and background tasks. When deploying in the cloud, you can combine a container platform to host the inference service, use object storage to save task artifacts, and track turns and failure rates through logging services and a monitoring and alerting system, turning a one-off benchmark conclusion into a continuously optimizable engineering loop.