Abstract: Quantization and pruning are fundamental approaches for model compression, enabling efficient inference for language models. In a post-training setting, state-of-the-art quantization and pruning methods require calibration data, a small set of unlabeled examples. Conventionally, this is randomly sampled web text, aiming to reflect the model training data. However, this poses two key problems: (1) unrepresentative calibration examples can harm model performance, and (2) organizations increasingly avoid releasing model training data. In this paper, we propose self-calibration as a solution. Our approach requires no external data, instead leveraging the model itself to generate synthetic calibration data, with a view to better approximating the pre-training data distribution. We extensively compare the performance of self-calibration with several baselines, across a variety of models, compression methods, and tasks. Our approach proves consistently competitive in maximizing downstream task performance, frequently outperforming even using real data.
Introduction
To make Large Language Models (LLMs) run efficiently on consumer-grade hardware, researchers employ techniques like quantization (reducing weight precision) and pruning (removing redundant weights). In a "post-training" setting, these methods require a small set of unlabeled examples—calibration data—to observe internal model activations and guide the compression process.
Traditionally, random snippets of web text (e.g., C4 or WikiText) are used for this purpose. However, this faces two growing hurdles. First, data availability is decreasing as organizations become more secretive about training data due to legal and privacy concerns. Second, distribution shift occurs if the calibration data does not match the model's internal "understanding" of language, which can inadvertently damage performance during compression.
Methodology: The Self-Calibration Approach
We propose Self-calibration, a data-free approach where the model generates its own calibration data. Instead of fetching external text, we prompt the model to "talk to itself," starting from a simple "Beginning of Sentence" (BOS) token. Because no external prompt is used, the generated text naturally reflects the model's own learned posterior distribution.
A core technical novelty of our method is the use of a temperature schedule during generation. By varying the "creativity" (temperature) as the model generates a sequence—scaling from an initial temperature ($t_{initial}$) to a final one ($t_{final}$)—we can control the diversity and coherence of the calibration data. We tested this approach against four popular compression methods: AWQ and GPTQ for quantization, and SparseGPT and Wanda for pruning (specifically 2:4 semi-structured sparsity).
Experimental Setup
We evaluated self-calibration against several baselines across five model families: Gemma 2B, Phi-2 2.7B, OPT 6.7B, Mistral 7B, and Llama 3.1 8B. The baselines included:
- Real Data: C4 (Common Crawl) and WikiText.
- External Synthetic Data: Cosmopedia (generated by Mixtral 8x7B) and a "Random Vocabulary" baseline.
Performance was measured using a suite of 10 zero-shot downstream tasks, including ARC (Easy/Challenge), BoolQ, HellaSwag, LAMBADA, OpenBookQA, PIQA, RTE, StoryCloze, and WinoGrande.
Key Results and Insights
Our results indicate that the model is often its own best proxy. Self-generated data is "cleaner" in the sense that it contains exactly the patterns the model has already internalized.
Pruning Sensitivity and Sample Efficiency
One of the most critical findings is that while quantization is relatively robust to the choice of calibration data, pruning is highly sensitive. Using unrepresentative data during pruning leads to significant accuracy drops. Self-calibration proved particularly valuable here, matching or exceeding other synthetic datasets in 17 out of 20 tested scenarios. For example, when pruning Llama 3.1 8B with SparseGPT, self-calibration achieved a mean accuracy of 53.8%, compared to 50.9% for the synthetic Cosmopedia baseline.
Furthermore, self-calibration appears more sample-efficient. In several tests, using just 16 self-generated examples outperformed 128 examples from the C4 dataset. Analysis suggests that for calibration, "internal consistency" matters more than "broad coverage"; self-calibrated data is less diverse than real-world text but results in superior compression outcomes.
Conclusion and Future Work
Self-calibration provides a robust, data-free alternative for LLM compression that circumvents data privacy and distribution shift issues. While our current study focused on English, future work will explore multilingual steering to ensure all language-specific weights are properly calibrated. Additionally, "targeted" self-calibration—forcing a model to generate domain-specific text (e.g., medical) before compression—remains a promising avenue for specialized applications.
Summary updated