QDA: AI Agent Automates LLM Quantization Design, Slashes Evaluation Cost 350-990x
MIT and NVIDIA researchers introduce QDA, an AI agent system that autonomously designs post-training quantization schemes for large language models by combining a composable algorithm library, a KL-divergence-based fast evaluator reducing assessment cost 350-990x, and long-text checks to catch generation anomalies, achieving state-of-the-art accuracy on models up to 320B parameters.
Reading font
Overview
Post-training quantization (PTQ) is a standard technique to reduce memory and compute requirements of large language models (LLMs). However, developers must manually adapt quantization methods such as GPTQ and AWQ to each model architecture, incurring high engineering cost. Moreover, evaluating a quantized checkpoint on reasoning benchmarks requires generating long outputs, consuming 23–86 GPU hours per model, which makes large-scale trial-and-error impractical.
To address these challenges, researchers from MIT and NVIDIA (Song Han's team) propose QDA (Quantization Design Agent), a closed-loop system that lets an AI agent autonomously design, build, evaluate, and iterate PTQ schemes for diverse models and precision targets.
System Architecture
QDA comprises three main components:
Composable Quantization Algorithm Library : 21 PTQ methods implemented on top of llm-compressor, covering weight transformation, rounding, scale optimization, and calibration. Methods share a unified interface, can be chained sequentially, and can further optimize existing quantized checkpoints.
Fast Evaluator : Uses KL divergence between the quantized model and the original model's next-token probability distributions on cached reference trajectories as a low-cost proxy metric.
Agent Harness : Isolates evaluation benchmarks and reference trajectories from the agent to prevent overfitting, and manages the closed-loop search process.
Closed-Loop Iteration Process
The agent runs a four-step loop until the compute budget is exhausted:
Propose Scheme : Agent selects quantization algorithms, execution order, hyperparameters, and calibration data.
Build Model : Algorithm library converts the scheme into a quantized model checkpoint.
Fast Evaluation : Computes KL divergence on cached reference trajectories; evaluation takes minutes instead of hours, reducing cost 350–990× compared to full benchmarking.
Long-Text Check : For promising candidates, runs full generation tests to detect reasoning loops, output truncation, and other anomalies that KL divergence cannot capture.
The agent adjusts the next scheme based on evaluation feedback, and finally submits the best model for official testing. The loop also allows the agent to write custom code, generate calibration data, and combine multiple quantization techniques.
Fast Evaluation with KL Divergence
Full evaluation of a quantized checkpoint on reasoning benchmarks requires 23–86 GPU hours. QDA replaces this with a proxy metric: KL divergence between the quantized and original model's next-token probability distributions on the same reasoning trajectories.
To further reduce compute and storage, the team pre-caches the original model's top-128 tokens per position and merges remaining tokens into a single probability bucket. Since the original model's distribution is cached, each evaluation only runs the quantized model on existing trajectories, avoiding full answer generation.
Experiments show this approximation underestimates the full KL divergence by no more than 0.4%. Moreover, QDA computes probabilities using vLLM's actual deployment kernels, capturing quantization errors introduced by the inference engine.
In 44 pairwise comparisons, KL-divergence ranking agreed with actual accuracy 82% of the time, outperforming layer-wise error metrics (73%). To avoid overreacting to noise, the evaluator treats two checkpoints as tied when their KL difference is below σ (relative standard deviation across calibration subsets, ~0.5%–1.6%).
Long-Text Check Catches Generation Anomalies
KL divergence alone can miss defects in long-form generation. In a Qwen3.6-35B-A3B experiment, using self-generated data for GPTQ calibration reduced KL divergence by 30%, but long-text checks revealed 12 out of 191 generations were truncated due to length limits (vs. 3 for the original model), mainly in coding tasks where the model entered endless debugging loops.
The agent responded by generating 600 difficult prompts and performing scale distillation using 1,200 long answers from the quantized model itself. The resulting model outperformed the best public quantization scheme by 1.3 percentage points, demonstrating that QDA combines fast proxy metrics with real generation feedback.
Unified Algorithm Library and Harness
The library includes 21 PTQ methods (weight transformation, rounding, scale optimization, calibration) with a unified interface for sequential composition and checkpoint refinement. For MoE models, multiple experts' GPTQ computations are batched, reducing Qwen3.6-35B-A3B GPTQ build time from ~16 GPU hours to 0.42 GPU hours.
The Harness isolates benchmarks and reference trajectories from the agent, ensuring search reliability.
Experimental Results
Four Reasoning Models, Three Precisions
Models: Qwen3.5-9B (dense), Qwen3.6-35B-A3B (MoE), Qwen3.8-27B (mixed attention), DeepSeek-R1-Distill-Llama-8B (dense). Precisions: W4A16, W4A8, W3A16. Baselines: GPTQ, AWQ, ParoQuant, GSQ, QuaRot+GPTQ. Each search used 8 GH200 GPUs for 8 hours (64 GPU-hours budget).
W4A16 : Average +0.9 pp over best public baseline. Qwen3.8-27B reached 79.8%, exceeding the BF16 original (79.5%).
W4A8 : Average +1.4 pp. Qwen3.5-9B achieved 72.3%, +5.2 pp over QuaRot+GPTQ.
W3A16 : Average +2.2 pp. DeepSeek-R1-Distill-Llama-8B hit 40.0%, +6.1 pp over GPTQ.
GLM-5.3-Flash (320B MoE) at NVFP4
QDA was applied to the 320B-parameter MoE model GLM-5.3-Flash using NVFP4 quantization. Search ran on 16 GB300 GPUs for ~6.5 hours. Compared against NVIDIA and Red Hat AI released NVFP4 checkpoints:
QDA average accuracy: 76.4%, recovering 98.3% of FP8 baseline accuracy.
NVIDIA checkpoint: 96.9% recovery.
Red Hat AI checkpoint: 96.3% recovery.
QDA checkpoint size: 183.6 GiB, smaller than NVIDIA (190.4 GiB) and Red Hat AI (184.3 GiB).
For questions about attribution, corrections or content rights, please contactand we will review it promptly.