LLaMaFlex: Many-in-one LLMs via Generalized Pruning and Weight Sharing
Ruisi Cai, Saurav Muralidharan, Hongxu Yin, Zhangyang Wang, Jan Kautz, Pavlo Molchanov
Abstract
Large Language Model (LLM) providers typically train a family of models, each of a different size targeting a specific deployment scenario. Models in the family are all trained from scratch, making the process extremely resource intensive. Recent work has successfully reduced the cost of training model families through a combination of structured pruning and knowledge distillation; here, only the largest model in the family is trained from scratch, and smaller models are obtained via pruning. We observe that while effective, this strategy must still perform pruning and distillation with hundreds of billions of training tokens for every new model, keeping overall training costs high. In this work, we introduce a novel nested weight-shared architecture named LLAMAFLEX that can be pruned across both width and depth dimensions in a zero-shot manner to instantly yield a large number of highly accurate compressed models. LLAMAFLEX starts from a pretrained model, and only requires a single continued training phase consisting of ∼ 60B tokens, which trains the elastic network and an end-to-end Gumbel Softmax-based router; this router is able to interpolate smoothly across model sizes, enabling the "train once, deploy many" paradigm. We train LLAMAFLEX on Llama 3.1 8B and use it to zero-shot generate a family of compressed models that achieves accuracy on par with or better than state-of-the-art pruned, elastic/flexible, and trained-from-scratch models.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
6 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- UniQL: Unified Quantization and Low-rank Compression for Adaptive Edge LLMs cites PIQA: Reasoning about Physical Commonsense in Natural Language
- UniQL: Unified Quantization and Low-rank Compression for Adaptive Edge LLMs cites Measuring Massive Multitask Language Understanding
- UniQL: Unified Quantization and Low-rank Compression for Adaptive Edge LLMs cites Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search
- UniQL: Unified Quantization and Low-rank Compression for Adaptive Edge LLMs cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- PIQA: Reasoning about Physical Commonsense in Natural Language cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- Measuring Massive Multitask Language Understanding cites PIQA: Reasoning about Physical Commonsense in Natural Language
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites PIQA: Reasoning about Physical Commonsense in Natural Language
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Measuring Massive Multitask Language Understanding
- Scalable Diffusion Models with Transformers cites Denoising Diffusion Probabilistic Models
- Boomerang Distillation Enables Zero-Shot Model Size Interpolation cites PIQA: Reasoning about Physical Commonsense in Natural Language
- Boomerang Distillation Enables Zero-Shot Model Size Interpolation cites Measuring Massive Multitask Language Understanding
- Boomerang Distillation Enables Zero-Shot Model Size Interpolation cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
- Týr-the-Pruner: Structural Pruning LLMs via Global Sparsity Distribution Optimization cites Measuring Massive Multitask Language Understanding
- Týr-the-Pruner: Structural Pruning LLMs via Global Sparsity Distribution Optimization cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
Cited by top-tier papers6
- Jet-Nemotron: Efficient Language Model with Post Neural Architecture SearchYuxian Gu, Qinghao Hu, Haocheng Xi, Junyu Chen et al.NeurIPS 2025 · 39 citations
- Týr-the-Pruner: Structural Pruning LLMs via Global Sparsity Distribution OptimizationGuanchen Li, Yixing Xu, Zeping Li, Ji Liu et al.NeurIPS 2025 · 7 citations
- UniQL: Unified Quantization and Low-rank Compression for Adaptive Edge LLMsHung-Yueh Chiang, Chi-Chih Chang, Yu-Chen Lu, Chien-Yu Lin et al.ICLR 2026 · 6 citations
- Deep Hierarchical Learning with Nested Subspace Networks for Large Language ModelsPaulius Rauba, Mihaela van der SchaarICLR 2026 · 3 citations
- Boomerang Distillation Enables Zero-Shot Model Size InterpolationSara Kangaslahti, Nihal V. Nayak, Jonathan Geuter, Marco Fumero et al.ICLR 2026 · 3 citations
Builds on23
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Measuring Massive Multitask Language UnderstandingDan Hendrycks, Collin Burns, Steven Basart, Andy Zou et al.ICLR 2021 · 7,905 citations
- Scalable Diffusion Models with TransformersWilliam Peebles, Saining XieICCV 2023 · 5,568 citations
- WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
- PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao et al.AAAI 2020 · 2,916 citations
Related papers
- Pruning Large Language Models with Semi-Structural Adaptive Sparse TrainingWeiyu Huang, Yuezhou Hu, Guohao Jian, Jun Zhu et al.AAAI 2025 · 25 citations
- Flextron: Many-in-One Flexible Large Language ModelRuisi Cai, Saurav Muralidharan, Greg Heinrich, Hongxu Yin et al.ICML 2024 · 38 citations
- Star Elastic: Many-in-One Reasoning LLMs with Efficient Budget ControlAli Taghibakhshi, Ruisi Cai, Saurav Muralidharan, Sharath Turuvekere Sreenivas et al.ICML 2026 · 1 citation
- FlexRank: Nested Low-Rank Knowledge Decomposition for Adaptive Model DeploymentRiccardo Zaccone, Stefanos Laskaridis, Marco Ciccone, Samuel HorváthICML 2026 · 1 citation
- GPTailor: Large Language Model Pruning Through Layer Cutting and StitchingGuinan Su, Li Shen, Lu Yin, Shiwei Liu et al.ICLR 2026 · 3 citations
