SubFit Shrinks LLMs by Replacing Submodules, Not Layers
Researchers in Trento compress LLMs by swapping individual attention and feedforward blocks for small fitted bypasses. At 25% sparsity it kept 84.6% of accuracy.
TL;DR
- University of Trento researchers compress LLMs by replacing individual attention and feedforward submodules, picked from anywhere in the model, with small fitted bypasses [^1].
- At 25% sparsity, SubFit kept 84.6% of the original accuracy and raised perplexity 2.42-fold, against 81.6% and 4.34-fold for the strongest baselines [^1].
Background
A transformer LLM is a stack of layers, each with an attention submodule that mixes information between tokens and a feedforward (FFN) submodule that transforms each token. Many layers turn out to be redundant: ShortGPT removed 10 of the 40 layers of LLaMA 2-13B and saw its MMLU score fall only from 55.0 to 52.2 [^2]. Plain deletion usually costs more, so newer methods replace removed parts with small modules fitted on sample data [^1].
What happened
Elia Cunegatti, Marcus Vukojevic, Erik Nielsen and Giovanni Iacca argue that these replacement methods share two needless constraints: they remove whole layers, and they remove a contiguous block of them [^1]. Their method, SubFit, picks attention and FFN submodules separately and from any depth. It scores and replaces attention first, since attention tends to be more redundant, then scores the FFNs on the partly compressed model [^1]. Each removed submodule gets a bypass that approximates only its contribution to the model's output. The bypasses are fitted in closed form from calibration data, without gradient training, and the FFN bypasses share one input basis to save parameters [^1].
The authors tested ten models from 3B to 8B parameters: five base models, including Llama-3.1-8B, Qwen3-8B and DeepSeek-7B, and five instruction-tuned versions [^1]. They compared SubFit at five sparsity levels from 12.5% to 37.5% with four baselines from the LLM-Streamline and ReplaceMe families, all of which replace contiguous full layers under the same parameter budget [^1]. Base models were judged by perplexity, a measure of how well a model predicts text where lower is better, and instruction-tuned models by accuracy on thirteen tasks [^1].
At 25% sparsity, SubFit kept 84.6% of the uncompressed models' accuracy, against 81.6% for the strongest baseline, and its perplexity rose 2.42 times, against 4.34 times [^1]. The gap was widest on Qwen models: on Qwen3-8B, the best ReplaceMe variant's perplexity rose 6.80 times, SubFit's 3.18 times [^1]. The lead grew with compression, and SubFit was the only method to keep above 80% accuracy at 25% sparsity and above 73% at 37.5% [^1]. It was not best everywhere. On Qwen2.5-7B-Instruct, ReplaceMe Cosine was marginally ahead in aggregate accuracy [^1].
Why it matters
Removing whole components is attractive because the savings are real without special sparse kernels or hardware [^1]. On a single A100 GPU at 25% sparsity, SubFit models produced their first token 1.18 to 1.40 times faster than the dense versions and generated text 1.12 to 1.17 times faster, and KV-cache memory fell in proportion to sparsity because attention submodules are removed entirely [^1]. The paper's broader claim is that granularity itself is a design choice: choosing parts at a finer level recovered more of the original model than cutting contiguous layers under the same budget [^1].
The method has costs. The bypasses add about 10% of the removed parameters and 15% of the removed compute at 25% sparsity, while ReplaceMe adds none because its transforms are folded into existing weights [^1]. Compressing one model takes about 2,000 to 2,600 seconds, once [^1]. Math reasoning is fragile: the authors report GSM8K separately because many compressed models collapse to very low accuracy there at higher sparsity [^1]. They also stress that their benchmarks are no full fairness or safety audit, and that high-stakes uses need their own evaluation [^1].
Practical example
Say Amira runs a small company that serves Llama-3.1-8B-Instruct, one of the models in the study, to answer customer questions about its product manuals. Everything runs on one A100 GPU, and at busy hours the memory for the KV cache, which grows with every conversation, runs out first.
Amira tries SubFit at 25% sparsity. It samples calibration text, scores which attention and FFN submodules matter least, and fits a bypass for each one it removes, which took 2,000 to 2,600 seconds per model in the paper [^1]. Because removed attention submodules no longer keep a KV cache, cache memory drops in proportion to sparsity, so more conversations fit on the same card [^1]. Answers also start sooner; the study measured first-token speedups of 1.18 to 1.40 times across its models [^1].
The catch is quality. Across the instruction-tuned models, SubFit kept 84.6% of the original accuracy on average at this setting, better than the layer-cutting baselines but still a loss [^1]. So before switching, Amira runs the compressed model on a few hundred real customer questions next to the original. If the manuals include calculations, Amira checks those answers separately: on the GSM8K math benchmark, results varied widely between methods, and many compressed models collapsed at higher sparsity [^1].
Related gear
We recommend this book because it explains the building blocks SubFit works with, from feedforward networks to the linear algebra behind low-rank approximations.