Local Dual-GPU Benchmark: Comparing the Coding Ability of Three Quantized Models
This article presents a local dual-GPU benchmark comparing three quantized open-source Flash-class models across native tool calling, bug fixing, and full application builds, all scored automatically without an LLM judge. It breaks down how 4-bit integer, low-precision floating-point block, and 8-bit floating-point quantization produce three distinct working modes, and summarizes three general cost patterns—output verbosity, interaction turns, and cache hit rate—along with scenario-based selection advice and a practical engineering checklist.
1. Why the Coding Ability of Local Quantized Models Needs Re-evaluation
Over the past two years, evaluations of AI coding tools have mostly relied on cloud-based closed-source services, with metrics centered on single-turn answer accuracy. But once model weights are compressed enough to stay resident on a single machine with two GPUs, the focus of evaluation shifts. What developers care about is no longer just whether an answer is correct, but whether a model can act as an agent—continuously calling tools, reading repository context, executing commands, self-correcting based on failure output, and delivering runnable code within an acceptable time and VRAM budget.
Quantization is the prerequisite for all of this. The common approach is to compress weights from high-precision floating point down to 8-bit, 4-bit, or even lower effective bit widths, combined with different numeric formats and grouping strategies. The widely accepted trade-off is this: the lower the bit width, the smaller the VRAM footprint and bandwidth pressure, but the larger the representation error in the numeric distribution, and the more the model’s performance on long-chain reasoning and code strictness tends to fluctuate. As a result, “different quantized versions of the same model family” are often not a simple speed difference but a difference in working mode.
The setup for this benchmark: on a local inference host equipped with two desktop-class accelerator cards, three open-source Flash-class models using different quantization schemes were compared side by side (corresponding to three technical routes: 4-bit integer quantization, low-precision floating-point block quantization, and 8-bit floating-point quantization). All tasks were real engineering scenarios, and scoring was fully automated by machine, with no LLM judge introduced, to avoid noise from subjective preference.
2. Evaluation Design: Breaking “Can Write Code” into Measurable Actions
The credibility of an evaluation depends on task design. This benchmark defined three workload types:
- Native tool-calling ability: The model was required to call 21 native tools as an agent, covering basic actions such as file read/write, directory traversal, command execution, dependency queries, and log retrieval. The focus was on the accuracy of tool selection and the completeness of parameter filling.
- Bug-fixing ability: 17 real bug samples, each with reproduction steps and failure output, which the model had to locate, modify, and verify on its own.
- Full application build: A web application with 19 check items, where the model handled everything from scaffolding to feature implementation, and the check items were judged automatically by scripts.
Scoring was fully automated—essentially a set of “executable acceptance criteria.” The key advantage of this design is that it turns vague quality judgments into binary or count-based metrics, such as number of check items passed, number of test cases, number of interaction turns, total generated tokens, and wall-clock time.
A simplified evaluation skeleton looks like this:
# Pseudocode: automated acceptance loopdef run_agent(model, task, tools, max_turns=200):ctx = load_context(task.repo)turns, tokens = 0, 0while turns < max_turns:resp = model.step(ctx, tools) # the model decides to call a tool or answer directlytokens += resp.output_tokensturns += 1if resp.is_final:breakctx = apply_tool(resp.tool_call) # execute the tool and feed the result backreturn {"checks_passed": run_checks(task), # machine scoring, no LLM judge"turns": turns,"output_tokens": tokens,"wall_clock": elapsed(),"tests_added": count_new_tests(ctx),}
3. Results: Three Quantization Routes, Three Working Modes
All three models passed every test, but their process characteristics differed significantly—which is more informative than “who is stronger.”
Low-bit integer scheme: trading minimal output for the shortest delivery time. This model completed the application build in only about 18.4 minutes, the fastest of the three, and produced about 20K tokens in total, the fewest of the three. Notably, its underlying inference engine’s per-token speed was not the fastest; the advantage came entirely from “saying less”—fewer explanations, fewer redundant comments, more direct patches. This reveals a commonly overlooked engineering fact: end-to-end time ≈ output tokens ÷ effective throughput + tool execution and waiting overhead. Compressing output is just as effective as improving throughput.
8-bit floating-point scheme: trading the fewest interaction turns for the lowest compute cost. This model completed the task in only 77 turns, with a behavioral pattern of giving a plan first and then executing step by step, offering the best process readability. Its prompt cache hit rate was as high as about 98%, meaning the vast majority of the context prefix was reused and repeated computation was greatly reduced, giving the lowest compute cost per task. This kind of model is well suited for long-running autonomous background work, such as nightly batch fixes and inspections.
Low-precision floating-point block scheme: trading deep thinking for engineering quality. This model performed extensive internal reasoning in every turn, taking the longest total time, about 27.6 minutes; but it produced the most standardized code and added the most new test cases (18). The extra “thinking budget” was converted into boundary-condition handling and verifiability.
For easier side-by-side understanding, the differences can be summarized as follows (values are from this benchmark’s measurement and are only used to illustrate the trend):
| Dimension | Low-bit integer | 8-bit floating point | Low-precision floating-point block |
|---|---|---|---|
| App build time | ~18.4 min | Medium | ~27.6 min |
| Output tokens | ~20K, fewest | Medium | More |
| Interaction turns | Medium | 77, fewest | More |
| Cache hit characteristic | Average | ~98%, highest | Average |
| Code quality & tests | Meets bar | Meets bar | Best, 18 cases |
4. Three General Patterns Behind the Results
Pattern 1: Output verbosity is a hidden cost center. In a local environment, the generation phase is usually constrained by VRAM bandwidth and per-token speed is limited, so “writing a thousand more words of explanation” directly scales time linearly. Explicitly requiring “output only the patch and necessary notes” in the prompt often yields more benefit than switching to a faster inference engine.
Pattern 2: The number of interaction turns determines the share of fixed overhead. Every turn includes fixed costs such as context rebuilding, tool process startup, and result feedback. Models that plan first and then execute can compress multi-turn exploration into a few high-quality actions, and the benefit of fewer turns is compounded.
Pattern 3: Cache hit rate is a first-order factor in cost. When task context is stable and prefix repetition is high, a high hit rate can reduce repeated computation to nearly zero. In engineering, this can be improved by keeping context ordering stable and placing volatile content later.
5. Scenario-based Selection Advice
- Daily iteration and bug fixing: Prefer an 8-bit floating-point type of scheme, balancing execution efficiency and compute cost; especially suitable for long-running background tasks.
- Deliverables requiring high standardization and high coverage: Choose a low-precision floating-point block type of scheme, trading time for engineering quality, suitable as a “hardening” step before submission.
- Rapid prototyping: Choose a low-bit integer type of scheme to get a runnable skeleton in the shortest time, then hand it to a stronger model for refactoring.
6. A Practical Engineering Checklist
- Unified acceptance scripts: Turn “does it look right” into executable checks to eliminate subjective scoring.
- Layered context: Put the stable system prompt first and dynamic repository fragments later to improve cache reuse.
- Output budget constraints: Limit the output structure in the prompt to suppress explanatory redundancy.
- Turn and timeout guardrails: Set a maximum number of interaction turns and a per-task timeout to avoid endless self-correction.
- Full-process logging: Record each turn’s tool calls and failure information for regression localization.
- Pin the quantization version: Include the quantization scheme in the dependency list to avoid environment drift that makes results non-reproducible.
To reproduce a similar evaluation on Baidu AI Cloud, you can use the container platform to host the inference and evaluation scripts, use object storage to save weights and artifacts, use a message queue to decouple task distribution, and use logging and monitoring/alerting services to track metrics such as time, turns, and cache hit rate—turning a one-off comparison experiment into a sustainable, automated evaluation pipeline.
