arXiv:2411.10606cs.LGcs.AI2024-11NeurIPS被引 15

让大模型随需变形,一键部署到不同设备。

AmoebaLLM: Constructing Any-Shape Large Language Models for Efficient and Instant Deployment

  • 通过动态剪枝与重要性驱动,灵活调整模型深度和宽度。
  • 一次微调后可立即生成任意形状的子模型,性能达最优平衡。
  • 适合需要快速适配多平台的工程化落地场景。

为应对大语言模型在多样真实应用场景与计算平台中的高效部署需求,本文提出AmoebaLLM框架,实现任意形状模型子网的即时生成。该框架通过三项创新:(1)基于动态规划的深度剪枝与重要性驱动的宽度剪枝,保持知识完整性;(2)形状感知的LoRA混合机制,缓解子模型微调时的梯度冲突;(3)损失量级平衡的就地蒸馏策略作为微调目标。实验表明,AmoebaLLM显著提升模型适应性,生成的子模型在准确率与效率间达到当前最优权衡,且可在一次微调后立即提取使用,大幅加速跨平台部署流程。

原文摘要 · Abstract (English)

Motivated by the transformative capabilities of large language models (LLMs) across various natural language tasks, there has been a growing demand to deploy these models effectively across diverse real-world applications and platforms. However, the challenge of efficiently deploying LLMs has become increasingly pronounced due to the varying application-specific performance requirements and the rapid evolution of computational platforms, which feature diverse resource constraints and deployment flows. These varying requirements necessitate LLMs that can adapt their structures (depth and width) for optimal efficiency across different platforms and application specifications. To address this critical gap, we propose AmoebaLLM, a novel framework designed to enable the instant derivation of LLM subnets of arbitrary shapes, which achieve the accuracy-efficiency frontier and can be extracted immediately after a one-time fine-tuning. In this way, AmoebaLLM significantly facilitates rapid deployment tailored to various platforms and applications. Specifically, AmoebaLLM integrates three innovative components: (1) a knowledge-preserving subnet selection strategy that features a dynamic-programming approach for depth shrinking and an importance-driven method for width shrinking; (2) a shape-aware mixture of LoRAs to mitigate gradient conflicts among subnets during fine-tuning; and (3) an in-place distillation scheme with loss-magnitude balancing as the fine-tuning objective. Extensive experiments validate that AmoebaLLM not only sets new standards in LLM adaptability but also successfully delivers subnets that achieve state-of-the-art trade-offs between accuracy and efficiency.

大模型部署模型压缩自适应架构高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。