Transformer architecture is usually fixed before training begins. Each layer follows a prescribed layout of attention and MLP sublayers, and optimization adjusts the weights inside that template. Model Carving explores a different arrangement: let training learn not only the weights, but also which parts of the network should remain.
How the method works
The approach attaches a learnable scalar gate to each Transformer sublayer. As training proceeds, those gates are adjusted alongside the model’s weights. When a gate reaches zero, its corresponding sublayer can be removed. The resulting network can be smaller and less uniform than the original template. The authors also apply the method to looped Transformers.
This timing distinguishes carving from post-training compression. Rather than first training a complete large model and then pruning it, Model Carving allows components to be removed during the learning process. The broader idea is that architecture need not be treated solely as a fixed design choice made by researchers in advance; it can also be shaped by optimization.
What the paper reports
The experiments cover standard Transformers ranging from 140 million to 2.7 billion parameters, and looped Transformers from 140 million to 1.3 billion. At equal training compute, the authors report lower validation loss for carved models than for dense models trained with up to 1.7 times as much compute. They also report that carved models outperform size-matched alternatives produced through pruning or distillation. For looped models, the reported advantage grows with scale, from 1.33× at 140 million parameters to 1.71× at 1.3 billion.
The paper also highlights deployment-oriented results. Standard carved models use up to 34% fewer inference FLOPs per token, decode up to 1.6× faster, and require up to 31% less KV cache. Under the same inference budget, a 2.7-billion-parameter model carved down to 1.75 billion improves its reported GSM8K score from 28.4% to 37.5%, and its MATH-500 score from 14.2% to 19.4%. The authors further say the advantage persists after instruction tuning and quantization to 4 bits.
Why it matters—and what remains open
The proposition is more specific than simply making models smaller. If a model can discard sublayers while it learns, it may avoid spending resources on components that contribute little to the task, while arriving at a topology suited to the final model. That makes the approach relevant to efficient training and deployment, including settings where inference budgets are constrained. It also questions the default pipeline of training a large uniform model first and compressing it later.
These are promising results, not proof that carving will help every model or workload. The reported comparisons come from particular architectures and experiments. Further work should establish how reliably the method transfers across tasks, how its training overhead compares with its eventual savings, and how varied carved structures behave in real deployment stacks. For now, Model Carving is best viewed as a research direction that brings architecture selection into the training loop.
Source: Hugging Face Daily Papers
Comments
Checking sign-in status...
Loading comments...