arXiv:2412.18811cs.CL2024-12EMNLP被引 2

通过分治搜索优化旋转位置编码,低成本扩展大模型上下文长度。

DCIS: Efficient Length Extrapolation of LLMs via Divide-and-Conquer Scaling Factor Search

  • 采用分治策略高效搜索旋转位置编码的缩放因子
  • 在不微调情况下也能实现长上下文推理,性能衰减减少50%以上
  • 适合需要低成本扩展上下文的模型部署场景

基于Transformer架构的大语言模型通常因训练成本高而受限于上下文长度。近期方法通过调整RoPE缩放因子并微调来扩展上下文窗口,但初始因子设置不佳会导致微调成本上升且性能下降。为此,我们提出一种基于RoPE的新型微调框架——分治增量搜索(DCIS),通过策略性确定更优的缩放因子。实验表明,该方法不仅有效缓解长上下文下的性能衰减,还使模型可在短上下文上微调并泛化到长上下文,显著降低微调成本。经DCIS获得的缩放因子甚至无需微调即可有效工作。对搜索空间的分析显示,DCIS的搜索效率是其他方法的两倍。我们还研究了非严格递增缩放因子的影响,并评估了模型在不同上下文长度下的泛化能力。

原文摘要 · Abstract (English)

Large language models (LLMs) based on the Transformer architecture usually have their context length limited due to the high training cost. Recent advancements extend the context window by adjusting the scaling factors of RoPE and fine-tuning. However, suboptimal initialization of these factors results in increased fine-tuning costs and reduced performance at target length. To address these challenges, we propose a novel RoPE-based fine-tuning framework that diverges from conventional scaling factors search. Specifically, we present a \textbf{D}ivide-and-\textbf{C}onquer \textbf{I}ncremental \textbf{S}earch (DCIS) algorithm that strategically determines the better scaling factors. Further fine-tuning with the identified scaling factors effectively extends the context window of LLMs. Empirical results demonstrate that our methodology not only mitigates performance decay at extended target lengths but also allows the model to fine-tune on short contexts and generalize to long contexts, thereby reducing the cost of fine-tuning. The scaling factors obtained through DCIS can even perform effectively without fine-tuning. Further analysis of the search space reveals that DCIS achieves twice the search efficiency compared to other methods. We also examine the impact of the non-strictly increasing scaling factors utilized in DCIS and evaluate the general capabilities of LLMs across various context lengths.

大模型上下文扩展位置编码微调优化

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