LLM Quantization and Coding Performance: A Dual-GPU Benchmark Comparing Three Model Types

    This article reports a local dual-GPU benchmark that treats quantization as a first-class variable in coding agent performance. It explains the evaluation design—unified hardware and runtime, a real tool chain, defect-fixing and application-building tasks, and fully automated scoring—and compares three observed working modes: minimal-output, plan-driven, and deep-reasoning. It also provides a reusable metrics set, a scenario-first selection method, and the boundaries of the findings.

    1. Why Quantization Should Be Treated as a First-Class Variable in Coding Performance

    When teams deploy coding agents locally, they usually focus on two things: whether there is enough VRAM and whether generation is fast enough. But a cross-model benchmark reminds us that the quantization scheme affects more than whether a model can run. It changes three things at once: the compute cost per token, cache reuse efficiency under long contexts, and the model’s own output habits. Together, these determine how long an agent takes to finish the same engineering task and the quality of the code it produces.

    Quantization is fundamentally a trade-off between precision and resource usage. Common approaches include 4-bit integer quantization, 4-bit floating-point quantization designed for low-precision compute units, and 8-bit floating-point quantization. Lower bit widths reduce weight footprint and bandwidth pressure but increase sensitivity to numerical distribution; higher bit widths offer better numerical stability but raise VRAM and bandwidth costs. This trade-off is often invisible in chat scenarios. In agent scenarios—multi-turn tool calls, long repository context, and repeated file reads and writes—it is significantly amplified.

    2. Benchmark Design: Let the Machine Be the Judge, Not the Model

    The key to a credible coding benchmark is not the score but the evaluation design. The framework used here can be abstracted into four elements that any team can reproduce on its own stack.

    1. Unified hardware and runtime: A dual-GPU environment built from two workstation-class accelerators, with model weights loaded as shards. All candidate models run on the same driver, the same inference backend, and the same context window configuration, avoiding contamination from environment differences.
    2. A real tool chain: Models act as agents calling more than twenty native tools (reading and writing files, executing commands, searching code, running tests, and so on) rather than only emitting a code snippet. This is the dividing line—models that can only “write” but not “do” have limited value in engineering scenarios.
    3. Two task categories: First, more than ten real defect-fixing tasks requiring a closed loop of localization, modification, and regression verification. Second, a full application build task with nearly twenty acceptance checks, covering scaffolding, the data layer, the API layer, and tests.
    4. Fully automated scoring: Scripts score results based on test pass rates, check completion, and static-analysis results. No “LLM judge” is involved, eliminating subjective and self-preference bias by design.

    The value of this design is that it replaces “the model feels good” with reproducible numbers.

    3. Results: All Three Models Passed, but Their Working Modes Differ Completely

    Models under all three quantization schemes completed every task; the differences show up in the process, not the outcome. Three typical working modes emerged.

    • Minimal-output: Shortest total time and very few tokens generated throughout. Its strategy is “think less, say less, just make the change.” Although the underlying inference engine does not have the best throughput, the small total token count puts it ahead in end-to-end time. It suits prototype validation, script-level changes, and well-defined single-point defects.
    • Plan-driven: Fewest interaction turns. It tends to present a plan first and then execute step by step, making the process highly readable. Because the prefix is highly repetitive, prompt cache hit rates are very high and the cost of recomputation is pushed very low. This mode has a clear advantage in unattended background tasks.
    • Deep-reasoning: Extensive internal thinking every turn and the longest total time, but the most standardized code structure, the most built-in test cases, and the best engineering-quality metrics. The cost is time and compute.

    An easily overlooked conclusion is that time and quality are not simply positively or negatively correlated. Time is mostly determined by “total output tokens × per-token cost ÷ effective throughput,” while quality is mostly determined by “whether the model builds a complete mental model before acting.” The two are driven by different variables, so they can be optimized together—or degrade together.

    4. Turning Perceived Experience into Metrics: A Reusable Measurement Set

    If a team remembers only one conclusion, it is easy to fall into the same trap during the next selection. It is worth fixing the following metrics to build your own baseline library.

    1. End-to-end duration = from task start to all acceptance checks passing
    2. Interaction turns = round trips between the agent and tools
    3. Total output tokens = sum of tokens generated across all turns
    4. Prompt cache hit rate = input tokens served from cache / total input tokens
    5. Cost per task = input tokens × input price + output tokens × output price
    6. First-pass rate = share of tasks passing all checks on first submission
    7. Lint and test density = static-check warnings per 1K lines, test cases per 1K lines

    Among these, “prompt cache hit rate” is the most underestimated metric in local agent scenarios. Every turn, the agent resends the system prompt, tool definitions, and prior trajectory into the context. The prefix is highly similar, so whether the cache hits can make the cost of a single task differ by several times. “Total output tokens” is the main lever for time: a model that turns a three-line change into thirty lines of explanation may be slower overall even if it generates faster.

    5. Selection Method: Define the Scenario First, Then the Quantization

    Abstracting away specific model names, selection comes down to a two-dimensional decision: task uncertainty and delivery time requirements.

    • High time sensitivity, low uncertainty (changing configs, fixing single-point defects, generating scaffolding): Prefer low-bit quantization plus a minimal-output style, aiming to get a runnable result as quickly as possible.
    • Low time sensitivity, high uncertainty (refactoring, cross-module changes, code that needs long-term maintenance): Prefer high-bit quantization plus a deep-reasoning style, trading time for engineering quality and test coverage.
    • Unattended batch tasks (batch migration, batch test generation, scheduled inspections): Prefer cache-friendly, low-turn, predictable configurations where cost matters more than speed.

    There are also three practical recommendations. First, treat the quantization scheme and the prompting strategy as a set of joint hyperparameters: pair low-bit models with “strong constraints, short output” prompts and high-bit models with “plan first, then execute” prompts. The gains far exceed tuning either one alone. Second, use lint checks and test execution as objective gates; do not let models grade themselves. Third, keep a human spot-check step, especially for changes involving security and data handling.

    If cloud resources are used for this kind of benchmark, there is usually no need to build the entire infrastructure yourself: a container platform brings up a reproducible runtime, object storage holds weights and artifacts, a message queue decouples task distribution, and logging and monitoring/alerting services collect turn counts, durations, and failure reasons. This keeps the focus on the evaluation design itself.

    6. Boundaries of the Conclusions and Next Steps

    The scope of the conclusions must be stated: results from a single run, a single stack, and a fixed context length are only directional references. Build toolchains and test-framework maturity across different language ecosystems, as well as repository size, can change the ranking. The recommended next step is to script the metrics above, run repeated experiments on your own codebase, report means and variances, and gradually expand to more task types. Once a team has its own baseline data, choosing a quantization scheme and a model style is no longer hearsay but a verifiable engineering decision.