What happened
Model Carving adds gates that scale each sublayer and each connection’s write to the residual stream. A sparsity pressure encourages gates to close; its loss is framed as the compute cost of the extra training tokens that could otherwise be used. When a gate reaches zero, that sublayer is removed from the graph during training. The evaluation covers models up to 2.7B parameters. The public repository includes standard Transformer configurations from 140M to 2.7B and looped configurations from 140M to 1.3B, and says the code was tested with Python 3.11. For a standard 140M starting point, it gives a Carving command, python train.py configs/standard_140m.yaml --carving, alongside the dense full-depth baseline, python train.py configs/standard_140m.yaml. A Carving run writes carved.json, recording retained sublayers and their gates. The repository is public and licensed under MIT.
The researchers also report reduced KV-cache use (kadenzheng.com) and say model quality matched or improved (kadenzheng.com).
What the archive adds
Unlike approaches that use pretrained weights to change a model’s architecture, Model Carving learns which sublayers to keep during training.
Why it matters
A pretraining team can use the repository’s paired 140M commands as a starting point for a controlled dense-baseline-versus-Carving run, then inspect carved.json to see what the method retained.
Limits and uncertainty
The headline is an “up to” inference-compute reduction, not a dollar-cost result (kadenzheng.com). The reported evaluation reaches 2.7B parameters, while the package gives no detailed benchmark conditions or numerical quality results to assess the matching-or-improving claim (kadenzheng.com).
Reader takeaway
Model Carving uses gates to remove Transformer sublayers during training, rather than requiring teams to choose a smaller architecture in advance. The researchers report up to 34% lower inference compute, but the result alone does not establish dollar savings or show how quality and costs compare under a particular workload.
Open question
Do the reported compute savings persist beyond 2.7B parameters and translate into net training and serving cost savings?