Create and explore imaginative 3D worlds with our new product Dreamfield (opens in a new tab)

Model Carving: Training Transformers That Optimize Their Own Topology

This lightning talk introduces Model Carving, a method that learns which attention and MLP sublayers to keep while training a Transformer from scratch. Unlike conventional pruning or architecture search, it jointly optimizes weights and topology in a single run by comparing each sublayer's predictive contribution against the value of the compute it consumes. The result: carved models achieve lower validation loss, faster decoding, and better downstream performance than dense, shallow, pruned, and distilled baselines at equal training budgets.
Script
Most Transformers are trained with a fixed architecture and compressed afterward. Model Carving flips this: it starts with an overparameterized network and learns which sublayers to delete while training, converting the saved compute into additional tokens.
Every attention and MLP application gets a gate that estimates its value against the compute it consumes. If a sublayer contributes less to prediction than the future learning that could be bought with its FLOPs, the gate is driven toward zero and the sublayer is permanently removed.
The learned topologies are heterogeneous and nontrivial. In standard Transformers, removals concentrate in the first third of depth, contrary to prior studies suggesting deeper layers are easier to prune. Knockout analysis shows that each retained sublayer is over five times more important than the median layer in the dense baseline.
Across five training budgets from 10 to the 19 to 10 to the 20 FLOPs, the compute-optimal carved frontier lies below the dense frontier, and the gap increases with scale. The looped 1.3 billion parameter carved model reaches the same loss as its dense counterpart using only 59% of the training compute.
The computational savings are real. Carved models decode up to 1.61 times faster on an H100, use up to 34% fewer inference FLOPs per token, and store smaller KV caches. When sampling is part of inference, the carved 2.7 billion model can draw 24 samples where the dense model draws 16, lifting solved problem rates by 9 percentage points on GSM8K.
Model Carving shows that learning topology during training beats fixing it beforehand or compressing afterward. The method scales favorably and transfers to instruction tuning and quantization, but open questions remain at larger scale, pretrained initialization, and hardware-aware cost functions. To explore the full paper and generate your own video summaries, visit EmergentMind.com.