NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Compressing Large Language Models with Automated Sub-Network Search

Rhea Sanjay Sukthanker, Benedikt Staffler, Frank Hutter, Aaron Klein · DOI

Abstract

Large Language Models (LLMs) demonstrate exceptional reasoning abilities, enabling strong generalization across diverse tasks such as commonsense reasoning and instruction following. However, as LLMs scale, inference costs become increasingly prohibitive, accumulating significantly over their life cycle. In this paper, we consider model compression for LLMs to reduce model size while improving downstream task performance. We phrase this as a neural architecture search (NAS) problem that automatically prunes structural components, such as attention heads, neurons, and layers, by searching for the Pareto-optimal set of sub-networks balancing performance and on-device latency. Compared to state-of-the-art structural pruning approaches and fine-tuned smaller sub-networks extracted from the pre-trained model, our method achieves up to 9.85% improvement on average on 11 diverse downstream tasks, while achieving up to 22% improvement in on-device latency.

Introduction

As Large Language Models (LLMs) continue to grow in parameter count, the computational burden of inference has become a primary bottleneck for deployment. While training smaller models from scratch is an alternative, the resource requirements are often prohibitive—for example, training a Llama 2 13B model requires over 360,000 GPU hours.

Existing compression techniques, such as structural pruning, attempt to remove entire neurons, heads, or layers to create more efficient models. However, these methods often rely on manual heuristics or rigid rules that fail to account for the complex trade-offs between a model's architectural dimensions and its actual speed on specific hardware. This research introduces an automated framework that treats compression as a Neural Architecture Search (NAS) problem, identifying optimal "sub-networks" hidden within a large pre-trained model without requiring massive retraining.

Methodology: Two-Stage NAS

The proposed framework frames compression as a two-stage process designed to discover the most efficient sub-models within a pre-trained "super-network."

1. Super-network Training and Importance Ranking

The pre-trained LLM is treated as a super-network containing billions of potential sub-architectures. To ensure high-quality sub-networks from the outset, the authors employ Importance-Based Sorting. Components like attention heads and MLP neurons are ranked based on their activation values. The model is then "reordered" so that the most critical weights are consistently included in smaller sub-networks, ensuring that even the most compressed versions retain maximum information.

Super-network training and importance-based component ranking.

2. Sandwich Rule and In-Place Distillation

During fine-tuning, the authors utilize a "sandwich rule": in each update step, they train the full model alongside several randomly sampled sub-networks. To preserve the original model's reasoning capabilities, In-Place Knowledge Distillation is used, forcing smaller sub-networks to mimic the outputs of the full-sized teacher model via a cosine-similarity loss. To make this process feasible on consumer hardware, LoRA (Low-Rank Adaptation) is integrated into the search process.

Addressing Search Bias and Structural Integrity

A common pitfall in NAS is the "Tiny Model Bias," where uniform sampling over-represents very small models, starving larger sub-networks of training time. The authors introduced a Calibrated Grid Sampling strategy to ensure sub-networks of all sizes receive adequate training.

Furthermore, the search space is designed to be GQA-Aware. In models using Grouped-Query Attention (GQA), pruning must occur at the group level rather than the individual head level to maintain structural integrity and realize actual hardware speedups. The research demonstrates that a Joint Search Space—searching across layers, heads, head sizes, and MLP expansion ratios simultaneously—yields significantly better results than pruning any single dimension in isolation.

Key Results

The proposed method was evaluated against state-of-the-art pruning baselines, including LLM-Pruner, LaCO, and SliceGPT, across 11 diverse benchmarks such as MMLU, HellaSwag, and GSM8K.

Comparison of the proposed method against state-of-the-art pruning baselines across accuracy, latency, and parameter count.
  • Accuracy and Latency: The method achieved a 9.85% average improvement in accuracy over existing structural pruning methods. Simultaneously, it identified models that were up to 22% faster on-device.
  • Pareto Efficiency: By utilizing weight-sharing, the framework generates an entire "Pareto front" of models in a single fine-tuning run. This allows developers to choose the optimal model for their specific latency budget without training multiple separate architectures.

Conclusion and Future Work

This automated sub-network search provides a scalable and efficient path for LLM compression. While the two-stage NAS approach incurs a higher initial computational cost than one-shot pruning (approximately 4x standard SGD), the resulting performance gains and latency reductions are substantial. Future work may explore the use of synthetic data distillation to further enhance fine-tuning and the adaptation of search spaces for diverse edge-device hardware, such as mobile processors and specialized AI accelerators.

Summary updated

BibTeX
@misc{sukthanker2024compressing,
  author = {Rhea Sanjay Sukthanker and Benedikt Staffler and Frank Hutter and Aaron Klein},
  title = {{Compressing Large Language Models with Automated Sub-Network Search}},
  year = {2024},
  eprint = {2410.06479},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.06479},
}
Figure