Model Carving: Training Transformers That Optimize Their Own Topology

Kaden Zheng, Pratyusha Sharma

Harvard University · New York University

Published November 20, 2026 · on the feed November 25, 2026 · ▲ 2 · arXiv 2611.27962

LLM training & RLEfficiency & inferenceModel architecture Code arXiv ↗Hugging Face ↗

The abstract

Machine learning has largely kept separate the choice of architecture and the process of training. A classic Transformer, for instance, trains a fixed set of attention and MLP sublayers at every layer, in the same order, and optimizes the weights within. This uniformity is a convention rather than a principled design choice, and it is likely suboptimal: the best architecture for a given task may be smaller, more efficient, and far from uniform. We believe that, ideally, training itself should shape the model's topology. To this end, we introduce Model Carving, which learns both a Transformer's weights and its architecture in a single run. By applying learnable, scalar gates to each sublayer, we allow the training loss to remove the model's own components during training -- freeing a smaller heterogeneous network inside. We evaluate Model Carving by pre-training standard Transformers from 140M to 2.7B parameters and looped Transformers from 140M to 1.3B. At equal training compute, carved models reach a lower validation loss than dense models trained with up to 1.7 times more compute. Furthermore, carved models also outperform size-matched models produced by pruning or distillation, suggesting that the best way to obtain small models for edge devices is to carve them during training, not to compress a large one afterwards. This advantage both grows with scale and carries over to downstream tasks such as few-shot evaluation and generation. Because the removed sublayers no longer run, carved models also cost up to 34% fewer FLOPs per token and decode up to 1.6 times faster without cost in quality. Our results show that architecture, like weights, should be learned and not fixed in advance, and that inside every large transformer is a smaller, faster, stronger one waiting to be carved out.

The Brief

2:58

A short podcast summary of the paper. Written and voiced by AI.

Transcript

Model Carving. Training Transformers That Optimize Their Own Topology. By Kaden Zheng and one other, from Harvard University and New York University. Published on the twentieth of November.

Machine learning has mostly treated two decisions as separate. First someone chooses an architecture. Then training optimizes the weights inside it. A classic Transformer is a clear case: every layer trains the same fixed set of attention and MLP sublayers, in the same order, and only the weights within them are learned. The authors argue that this uniformity is a convention, not a principled design choice, and that it is likely suboptimal. The best architecture for a given task may be smaller, more efficient, and far from uniform. Ideally, in their view, training itself should shape the topology of the model.

Model Carving puts that into practice. It learns a Transformer's weights and its architecture together, in a single run. Every sublayer gets a learnable scalar gate. Those gates let the training loss remove parts of the model while training is under way, and what remains is a smaller, heterogeneous network that was inside the original all along. Hence the name. Nothing is added during training, and nothing is compressed after it. The model starts as an ordinary uniform Transformer, and the loss decides, sublayer by sublayer, which pieces earn their place. Different layers can end up keeping different components, which is where the heterogeneity comes from.

The method is evaluated by pre-training at a range of sizes. Standard Transformers run from one hundred and forty million parameters up to two point seven billion. Looped Transformers run from one hundred and forty million up to one point three billion. Carved models are then compared against dense models, and against models of matched size obtained by pruning or by distillation. Those two comparisons ask different questions. Against dense models, the question is whether carving makes better use of a fixed compute budget. Against pruned and distilled models, it is whether carving during training beats the usual way of getting a small model, which is to train a large one first and shrink it afterwards.

At equal training compute, carved models reach a lower validation loss than dense models trained with up to one point seven times more compute. They also outperform the size-matched models that pruning or distillation produce. The authors read this as a suggestion that the best route to small models for edge devices is to carve them during training, rather than to compress a large model afterwards.

The advantage grows with scale, and it carries over to downstream tasks, including few-shot evaluation and generation. There is a direct efficiency dividend too. Sublayers that have been removed no longer run, so carved models cost up to thirty-four percent fewer FLOPs per token, and they decode up to one point six times faster, with no cost in quality. The savings follow directly from the carving itself: a component the loss has switched off is simply not computed.

The broader claim is about where architecture belongs. Like the weights, the authors argue, it should be learned rather than fixed in advance. The gates are simple scalars, yet they hand the loss a decision that is normally made before training even starts. Their image for the outcome is that inside every large transformer sits a smaller, faster, stronger one, waiting to be carved out.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.