LeMo通过剔除冗余文本片段,显著降低长文本微调的内存占用和计算开销。
LeMo: Enabling LEss Token Involvement for MOre Context Fine-tuning
- 基于上下文的分词稀疏性,动态移除无关词元
- 内存减少最高1.93倍,速度提升达1.36倍
- 适合需高效处理长文本的模型优化场景
长文本应用需求激增,推动大模型上下文窗口扩展。尽管现有微调方法能延长上下文长度,但其高激活内存开销成为关键瓶颈。当前参数高效微调侧重减少参数更新,而稀疏化机制忽略激活内存优化,因存在‘影子激活’现象。本文提出LeMo,首个探索并利用长上下文场景中固有的词元级稀疏性——上下文词元稀疏性(Contextual Token Sparsity)的微调系统。LeMo通过评估词元嵌入的信息量,最小化冗余词元参与,保持模型精度。提出三项核心技术:(1) 词元消减,动态识别并排除不同输入与层中的冗余词元;(2) 模式预测,使用预训练预测器以极小开销近似词元稀疏模式;(3) 核心优化,采用无置换、分段策略提升系统性能。实现兼容多种大模型架构与优化技术的端到端微调系统。全面评估表明,LeMo内存消耗最高降低1.93倍,速度提升最高达1.36倍,优于现有最先进微调系统。
原文摘要 · Abstract (English)
The escalating demand for long-context applications has intensified the necessity of extending the LLM context windows. Despite recent fine-tuning approaches successfully expanding context lengths, their high memory footprints, especially for activations, present a critical practical limitation. Current parameter-efficient fine-tuning methods prioritize reducing parameter update overhead over addressing activation memory constraints. Similarly, existing sparsity mechanisms improve computational efficiency but overlook activation memory optimization due to the phenomenon of Shadowy Activation. In this paper, we propose LeMo, the first LLM fine-tuning system that explores and exploits a new token-level sparsity mechanism inherent in long-context scenarios, termed Contextual Token Sparsity. LeMo minimizes redundant token involvement by assessing the informativeness of token embeddings while preserving model accuracy. Specifically, LeMo introduces three key techniques: (1) Token Elimination, dynamically identifying and excluding redundant tokens across varying inputs and layers. (2) Pattern Prediction, utilizing well-trained predictors to approximate token sparsity patterns with minimal overhead. (3) Kernel Optimization, employing permutation-free and segment-based strategies to boost system performance. We implement LeMo as an end-to-end fine-tuning system compatible with various LLM architectures and other optimization techniques. Comprehensive evaluations demonstrate that LeMo reduces memory consumption by up to 1.93x and achieves up to 1.36x speedups, outperforming state-of-the-art fine-tuning systems.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。