Task-Circuit Quantization: Leveraging Knowledge Localization and Interpretability for Compression

Hanqi Xiao, Yi-Lin Sung, Elias Stengel-Eskin, Mohit Bansal
4/10/2025
cs.LGcs.AIcs.CL

No official code found. Best implementation: The-Inscrutable-X/TACQ (28 stars, Apache-2.0, last commit 2025-06-01). 1 more below.

Abstract

Post-training quantization (PTQ) reduces a model's memory footprint by mapping full precision weights into low bit weights without costly retraining, but can degrade its downstream performance especially in low 2- to 3-bit settings. We develop a new mixed-precision PTQ approach, Task-Circuit Quantization (TaCQ), that draws parallels to automated circuit discovery, directly conditioning the quantization process on specific weight circuits -- which we define as sets of weights associated with downstream task performance. These weights are kept as 16-bit weights, while others are quantized, maintaining performance while only adding a marginal memory cost. Specifically, TaCQ contrasts unquantized model weights with a uniformly-quantized model to estimate the expected change in weights due to quantization and uses gradient information to predict the resulting impact on task performance, allowing us to preserve task-specific weights. We compare TaCQ-based quantization to existing mixed-precision quantization methods when conditioning both on general-purpose and task-specific data. Across QA, math reasoning, and text-to-SQL tasks for both Llama-3 and Qwen2.5, we find that TaCQ outperforms baselines using the same calibration data and a lower weight budget, achieving major improvements in the 2 and 3-bit regime. With only 3.1 bits we are able to recover 96% of Llama-3-8B-Instruct's unquantized 16-bit MMLU performance, obtaining a 5.25% absolute improvement over SPQR. We also observe consistently large gains over existing methods in the 2-bit regime, with an average gain of 14.74% over the strongest baseline, SliM-LLM. Moreover, we observe a 7.20% gain without conditioning on specific tasks, showing TaCQ's ability to identify important weights is not limited to task-conditioned settings.

View on arXivView PDF

Code Implementations(2)

Apache-2.0

Official Repository for Task-Circuit Quantization

285C++, CudaApr 9, 20251 years agoApache-2.0
ai-in-pm/TCQ-AgentCommunity55%
MIT

Demos the Task-Circuit Quantization technique described in the paper "Task-Circuit Quantization: Leveraging Knowledge Localization and Interpretability for Compression

00Python, BatchfileApr 13, 20251 years agoMIT

Cite this paper

@article{xiao2025taskcircuit,
  title  = {Task-Circuit Quantization: Leveraging Knowledge Localization and Interpretability for Compression},
  author = {Hanqi Xiao and Yi-Lin Sung and Elias Stengel-Eskin and Mohit Bansal},
  year   = {2025},
  eprint = {2504.07389},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.07389v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.07389.svg)](https://codeofpaper.com/paper/2504.07389)

Discussion