Abstract
Compression techniques such as pruning and quantization offer a solution for more efficient deployment of language models (LMs), albeit with small performance drops in benchmark performance. However, general-purpose LM compression methods can negatively affect performance in specialized domains (e.g. biomedical or legal). Recent work has sought to address this, yet requires computationally expensive full-parameter fine-tuning. To this end, we propose cross-calibration, a novel training-free approach for improving the domain performance of compressed LMs. Our approach effectively leverages Hessian-based sensitivity to identify weights that are influential for both in-domain and general performance. Through extensive experimentation, we demonstrate that cross-calibration substantially outperforms existing approaches on domain-specific tasks, without compromising general performance. Notably, these gains come without additional computational overhead, displaying remarkable potential towards extracting domain-specialized compressed models from general-purpose LMs.
Introduction
As Large Language Models (LLMs) scale, compression techniques like pruning and quantization become vital for efficient deployment. While these methods generally preserve broad reasoning capabilities, they often lead to significant performance degradation in specialized domains such as medicine or law. Existing solutions like D-Pruner attempt to mitigate this through full-parameter fine-tuning, but the high computational cost often negates the efficiency benefits of compression.
Researchers have introduced MixCal (Mixed Calibration), a training-free method that allows LLMs to be compressed for specialized domains without losing expert knowledge. MixCal operates in a post-training setting, achieving superior in-domain accuracy while being up to 18 times faster than fine-tuning alternatives.
Methodology: Mixed Calibration (MixCal)
Advanced compression algorithms like SparseGPT rely on a calibration phase to identify sensitive weights using a Hessian matrix. Standard approaches typically use either generic web-scraped data or domain-specific data, but rarely both effectively.
MixCal’s innovation lies in Mixing Activations. It samples small amounts of both generic and domain-specific data. Instead of simple averaging, it creates a "mixed activation matrix" by linearly combining internal layer responses from both sources. This process introduces a "cross-term" in the Hessian matrix, representing the alignment between generic and domain-specific features. By capturing these interactions, the model preserves weights critical for both general reasoning and specialized expertise without requiring backpropagation or heavy fine-tuning.
Experimental Setup and Datasets
The effectiveness of MixCal was evaluated across several high-stakes domains and model families (Llama 3.1/3.2, Gemma 2, Mistral NeMo):
- Biomedical: MultiMedQA (including PubMedQA, MedQA, and MedMCQA) and BioLaySumm.
- Legal: Legal-MMLU, CaseHOLD, and ECtHR.
- General Purpose: ARC, HellaSwag, and MMLU to ensure no "catastrophic forgetting" of general logic.
- Multilingual: Tests on Chinese medical (CMB) and legal (CAIL2018) benchmarks using the Yi 1.5 6B model to prove language-agnosticism.
Key Results
MixCal was tested at 50% sparsity and 4-bit quantization, showing significant improvements over standard post-training pruning methods.
- Superior Accuracy: For Llama 3.1 8B on legal benchmarks, MixCal achieved 88.6% relative accuracy, significantly higher than SparseGPT (72.9%) and the fine-tuning-based D-Pruner (77.2%).
- Efficiency: MixCal is 18x faster and uses 3x less peak memory than D-Pruner, making specialized compression feasible on single-GPU workstations.
- Generalization: The method maintains or slightly improves general-purpose reasoning scores, proving that domain specialization does not necessitate the loss of general utility.
- Joint Compression: The method works exceptionally well when combining 2:4 semi-structured sparsity with 4-bit quantization, a key target for high-speed GPU inference.
Limitations and Future Work
While MixCal offers a robust training-free alternative, some limitations remain. The primary baseline, D-Pruner, is currently limited to the Llama architecture, making broader comparisons difficult. Additionally, while a 50/50 data mix works well generally, optimal ratios may vary for extremely niche domains. Future work could explore using synthetic data for calibration in scenarios where real-world domain data is restricted due to privacy concerns.
Summary updated