Model Carving: Training Transformers That Optimize Their Own Topology

Kaden Zheng, Pratyusha SharmaarXiv 2026

It’s late, you’ve had a long day of debugging or reading documentation, and your brain is likely doing what brains do best: pruning. While you sleep, your synapses will undergo a structural "carving," strengthening the useful connections and letting the redundant ones wither away.

In a new paper from researchers at Harvard and NYU, we see a similar philosophy applied to the world’s most popular AI architecture. Instead of treating a Transformer like a rigid, pre-built machine, they treat it like a block of marble.

TL;DR

"Model Carving" allows a Transformer to optimize its own internal structure during training by "chipping away" unnecessary sublayers that don't earn their keep. The result is a leaner, faster, and more intelligent model that outperforms standard Transformers while using up to 34% fewer operations and decoding 1.6x faster.

What Problem Does This Paper Address?

In the world of Deep Learning, we usually treat architecture and training as two separate phases. We pick a "blueprint"—say, a Transformer with 24 layers, each containing an Attention block and an MLP (Multi-Layer Perceptron) block—and then we spend millions of dollars training the weights inside that fixed box.

The authors argue this is fundamentally suboptimal. Why should every layer look exactly the same? Some parts of the network might be redundant for a specific task, yet we force the computer to run them anyway, wasting "FLOPs" (floating-point operations) and memory. While techniques like pruning (cutting parts out after training) or distillation (teaching a small model to mimic a big one) exist, they are "after-the-fact" fixes. This paper asks: What if the model could decide its own shape while it learns?

Methods

The researchers introduce Model Carving, a technique that integrates architecture search directly into the training loop.

  1. Overparameterization: They start with a "thick" model that has extra residual connections (arcs) between layers, allowing information to skip around.
  2. Learnable Gates: Every sublayer (Attention or MLP) is equipped with a scalar "gate"—essentially a volume knob. If the knob is at 1.0, the layer is fully active; at 0.0, it’s effectively deleted.
  3. The "Pressure" Mechanism: This is the secret sauce. The authors define a "pressure" value for each sublayer. Think of this as a rent payment. If a sublayer’s contribution to reducing the training loss is less than the "cost" of the compute it consumes, the gate is pushed toward zero.
  4. Dynamic Removal: Every few hundred updates, the trainer checks for gates that have hit zero. It then physically removes those sublayers from the computation graph. The "saved" compute is then used to feed the model more training data, making the most of the fixed FLOP budget.
Figure 1: Model Carving trains the weights and the topology of a Transformer in one run. (Left) Training starts from an overparameterized Transformer: every sublayer writes through a gate (dot), and learned connections (arcs) join each pair of layers. A looped Transformer repeats the stack for R loops, with its own gates in each loop. (Middle) During training, a gate falls when its sublayer’s contribution to the loss (green) is below its pressure (orange), and a gate at zero closes its sublayer. (Right) The trainer removes the closed sublayers from the computation graph, and the freed FLOPs buy more training tokens, resulting in a smaller Transformer with a heterogeneous set of layers.

Datasets

The models were pre-trained on a shuffled sample of FineWeb-Edu, a high-quality dataset of educational web content. For evaluation, they used:

  • CORE-22: A suite of 22 downstream tasks (like HellaSwag and ARC).
  • Generative Benchmarks: GSM8K (math), TriviaQA (knowledge), SQuAD (reading comprehension), and LAMBADA (language modeling).
  • Symbolic Tasks: ListOps and modular addition to see if the model could find "minimal circuits" for logic.

Key Insights and Ideas

  • Heterogeneity is Natural: Standard Transformers are uniform by convention, but carved models are "weird." They might keep an MLP in layer 5 but delete the Attention block, or vice versa. The paper shows that these non-uniform structures are actually more efficient.
  • The Compute Multiplier: A carved model achieves the same validation loss as a standard "dense" model that used 1.7x more training compute. It’s essentially a shortcut to higher intelligence.
  • Carving > Pruning: The authors found that carving a model during training is significantly better than pruning a pre-trained one. When you carve during training, the remaining weights "grow" into the final shape, whereas pruning leaves you with "inherited" weights that weren't optimized for the new, smaller topology.
  • Minimalist Logic: In symbolic tasks like modular addition, the model carved itself down to an attention-only Transformer, proving it can find the exact mathematical "circuit" needed for a task and discard everything else.

Key Results

The quantitative wins are substantial across both standard and "looped" (weight-tied) Transformers:

  • Efficiency: Carved models use 8% to 34% fewer FLOPs per token.
  • Speed: They decode up to 1.61x faster at the largest batch sizes.
  • Performance: In almost every test, a carved model outperformed a size-matched model created via traditional distillation or pruning.
  • Scaling: Crucially, the "carving advantage" actually grows with scale. The bigger the starting model, the more "fat" there is to carve out, leading to even greater relative gains.
Table 1: Model Carving outperforms standard models in loss and downstream evaluations with up to 34% fewer FLOPs per token. Each row compares the full-depth model, a shallower-depth model, the carved model, and a student distilled from the full-depth model into the shallower-depth shape (Section 4.3). Sublayers per token counts the attention and MLP sublayers a token passes through. All train on the same data and optimizer. The change row compares the carved model with the full-depth model, namely the ratios for parameters, sublayers, tokens and FLOPs, differences for bpb, and CORE-22. k measures the compute multiplier, defined as training compute at which full-depth training reaches the carved loss (see Section 3). Finally, Table 14 gives the compute-optimal multiplier k∗.

Limitations and Future Work

  • Scale Limits: The study went up to 2.7 billion parameters. While the trend looks great, we don't yet know if this holds for 70B or 400B parameter giants.
  • The "Cooldown" Phase: The current pressure mechanism is turned off during the final "cooldown" (learning rate decay) of training. The authors suspect that refining how carving interacts with this phase could yield even better results.
  • Granularity: Currently, the model carves out entire sublayers. Future work could explore carving at the level of individual attention heads or neurons.
  • Static vs. Dynamic: The final carved model is a static graph. It doesn't yet do "per-token" carving (where the model might skip a layer for an easy word like "the" but use it for a hard word like "topology").

In short, this paper suggests that our current way of building AI is a bit like building a skyscraper where every floor must have exactly the same number of windows and desks, regardless of who is working there. Model Carving lets the building design itself around the tenants—resulting in a structure that is lighter, faster to navigate, and much more sensible.

Summary updated

BibTeX
@misc{zheng2026model,
  author = {Kaden Zheng and Pratyusha Sharma},
  title = {{Model Carving: Training Transformers That Optimize Their Own Topology}},
  year = {2026},
  eprint = {2611.27962},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27962},
}
Figure