LeMo:以更少的Token参与实现更长上下文的微调
LeMo: Enabling LEss Token Involvement for MOre Context Fine-tuning
AI总结:
针对长上下文LLM微调中激活值内存占用高的问题,提出基于上下文Token稀疏性的LeMo微调系统,通过三项关键技术在保精度的同时显著降内存提速度,性能优于现有最优系统。
摘要:
长上下文应用需求的不断攀升,使得扩展大语言模型(LLM)上下文窗口的必要性愈发迫切。尽管近期的微调方法已成功拓展了上下文长度,但其极高的内存占用(尤其是激活值内存)构成了关键的实际限制。当前的参数高效微调方法优先降低参数更新开销,却未解决激活值内存约束问题。同样,现有的稀疏机制虽提升了计算效率,但因“影子激活”现象,忽略了激活值内存优化。\n 本文提出LeMo,这是首个探索并利用长上下文场景下固有的新型Token级稀疏机制(即上下文Token稀疏性)的LLM微调系统。LeMo在保持模型精度的同时,通过评估Token嵌入的信息量来减少冗余Token的参与。具体而言,LeMo引入了三项关键技术:(1)Token消除:在不同输入和层间动态识别并排除冗余Token。(2)模式预测:利用训练良好的预测器以极低开销近似Token稀疏模式。(3)内核优化:采用无排列和基于分段的策略提升系统性能。我们将LeMo实现为端到端微调系统,兼容多种LLM架构及其他优化技术。综合评估表明,LeMo最多可降低1.93倍内存消耗,实现最高1.36倍的加速,性能优于当前最先进的微调系统。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。