Model Carving: Automatically Sculpting Transformer Topology During Training

Model Carving carves sublayers with gates during training, letting architecture be learned like weights.
The article introduces Model Carving, a training method that breaks the "fixed architecture, train weights only" convention by attaching a learnable scalar gate to each sublayer—when the gate approaches zero, the sublayer is removed, letting a large model precipitate a smaller heterogeneous network during training. In equal-compute pre-training comparisons on Transformers from 140M to 2.7B and Recurrent Transformers, carved models show lower validation loss than dense models trained with up to 1.7x compute and outperform same-size pruned or distilled models; inference FLOPs per token drop by up to 34%, decoding speed rises by up to 1.6x with no quality loss. The article argues the best path to small models is direct carving during training, not post-hoc compression.
The convention of separating architecture from training should be broken
In a traditional Transformer, every layer stacks attention sublayers and feed-forward networks (MLP) in a fixed order, and training only updates weights without changing structure. This "uniform stacking" is more of an engineering convention than a verified optimal design. The paper's authors point out that for specific tasks, truly efficient architectures are often smaller and more heterogeneous, far from what uniform structures can match. So they propose Model Carving: learning weights and topology simultaneously during a single training process, letting the training loss itself "carve" the model.

The method itself is lightweight: attach a learnable scalar gate to each sublayer, and during training, if the gate approaches zero, the corresponding sublayer is removed. As training progresses, a smaller heterogeneous network "precipitates" from within the large model, and the remaining sublayers continue to be jointly optimized.
Experimental design: coverage from 140M to 2.7B
The authors conducted pre-training comparisons on both standard Transformers (140M to 2.7B parameters) and Recurrent Transformers (140M to 1.3B). Evaluation dimensions include validation loss, downstream few-shot tasks, generation quality, as well as inference FLOPs and decoding speed. All comparisons are based on equal training compute, ensuring the conclusions are not propped up by feeding more data or compute.
Recurrent Transformer refers to a Transformer variant that repeatedly iterates execution on the same set of weights rather than stacking different layers. It increases effective depth by looping the same block multiple times, thereby improving expressive capacity without changing the parameter count. This structure is naturally suited to discussing the question of "whether depth must be uniform," because the number of loops is itself an adjustable structural parameter. Model Carving is equally effective on Recurrent Transformers, showing that the gating carving mechanism does not depend on the independence between layers, and can make reasonable sublayer trade-offs even for weight-sharing recurrent structures.
Core finding: small models aren't compressed out, they're trained out
Under the same training compute, the carved model has lower validation loss than dense models trained with up to 1.7x the compute. More critically, it outperforms same-size models obtained through pruning or distillation. The authors thus offer a counterintuitive judgment: the best path to obtaining small models for edge devices is to carve directly during training, not to compress a large model afterward. This advantage grows with model scale and transfers to few-shot evaluation and generation tasks.
The inference benefits are equally tangible: removed sublayers no longer participate in computation, FLOPs per token are reduced by up to 34%, decoding speed is improved by up to 1.6x, and there is no quality loss.
Pruning and Distillation are two common post-hoc compression methods. Pruning removes weights, channels, or layers after training is complete, usually requiring additional fine-tuning to recover accuracy; distillation has a small model fit the output distribution of a large model. Both assume a two-stage process of "first have a large model, then extract a small model from it," and the compression process is not fully aligned with the original training objective. The comparative significance of Model Carving lies in this: it completes structural trade-offs directly within the training loss, so the small model's structure and weights are co-optimized rather than approximately trimmed from an already-converged large model—this is precisely why it outperforms pruning and distillation results at the same size.
Why it's worth attention
Model Carving pulls "architecture search" from an independent stage before training into the training loop itself. It does not rely on expensive search proxies, nor does it require a complex compression pipeline after training ends. The gating mechanism lets architecture decisions and weight optimization share the same loss signal, providing a scalable paradigm for "training as architecture design." The paper's conclusion is straightforward enough: architecture should be learned like weights, not fixed in advance; inside every large Transformer hides a smaller, faster, stronger network waiting to be carved out.
For engineering practice, this means that when deploying small models in the future, the two-stage process of "train large first, then compress" may no longer be necessary—the training stage can directly produce a streamlined structure oriented toward the target compute budget.
One-line Summary
Model Carving carves sublayers with gates during training, letting architecture be learned like weights.
Paragraph Summary
The article introduces a training method called Model Carving, which breaks the convention of "fixed architecture, only training weights" by attaching a learnable scalar gate to each sublayer; when the gate approaches zero, that sublayer is removed, allowing a large model to precipitate a smaller heterogeneous network during training. The authors conduct equal-compute pre-training comparisons on Transformers from 140M to 2.7B and Recurrent Transformers, finding that the carved model's validation loss is lower than dense models trained with up to 1.7x the compute, and it outperforms same-size models obtained through pruning or distillation; at inference, FLOPs per token are reduced by up to 34%, decoding speed is improved by up to 1.6x with no quality loss. The article thus argues: the best path to obtaining small models is to carve directly during training, not to compress afterward.
Related articles

ChatGPT Plus Subscription Pitfall Guide: Go/Plus/Pro Tier Comparison and Quick Activation
A complete ChatGPT Plus subscription guide based on a Bilibili tutorial: from registering an account, comparing Go/Plus/Pro tiers, to the practical steps for quickly completing your subscription.

GPT-6.2 Sol/Astra Released! A Step-by-Step ChatGPT Plus Subscription Guide and Tier Comparison
GPT-6.2 Sol/Astra is out—here's a ChatGPT Plus subscription guide: register an account, compare Go/Plus/Pro tiers, and subscribe in a minute.

Comparing Three Channels for Subscribing to GPT Plus in China: Is Website Top-Up the Easiest?
How to subscribe to GPT Plus in China? This article compares website top-up, credit card, and mobile top-up channels—process, cost, and risk—with steps and tips to help you choose wisely.