arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.27705cs.CL
收藏

通过层特定位置嵌入缩放缓解Transformer中的位置偏差

Mitigating Position Bias in Transformers via Layer-Specific Positional Embedding Scaling

Fudan University(复旦大学);Westlake University(西湖大学);Shanghai Key Laboratory of Intelligent Information Processing(上海市智能信息处理重点实验室)

Changze Lv, Zhenghua Wang, Yiran Ding, Yixin Wu, Tianlong Li, Zhibo Xu, Muling Wu, Tianyuan Shi, Shizheng Li, Qi Qian, Xuanjing Huang, Xiaoqing Zheng

AI总结:

提出层特定位置嵌入缩放方法,通过遗传算法优化各层缩放因子,无需微调或增加延迟,有效缓解长上下文中的位置偏差,在关键值检索任务上准确率提升11.2%。

摘要:

大型语言模型(LLMs)仍然面临“中间丢失”问题,即位于长上下文输入中间的关键信息常常被低估或丢失。现有方法尝试通过结合多尺度旋转位置嵌入(RoPE)来解决这一问题,但通常存在高延迟或依赖次优的手工缩放策略。为了克服这些限制,我们引入了一种层特定位置嵌入缩放(LPES)方法,为每一层分配不同的缩放因子。LPES无需微调模型参数或增加推理延迟即可实现更均衡的注意力分布。采用专门设计的遗传算法,通过引入贝塞尔曲线显著减少搜索空间,从而高效选择每层的最优缩放因子。大量实验表明,LPES有效缓解了位置注意力偏差,并在多个长上下文基准上带来一致改进,在关键值检索数据集上准确率提升高达11.2%。

英文摘要:

Large Language Models (LLMs) still struggle with the ``lost-in-the-middle'' problem, where critical information located in the middle of long-context inputs is often underrepresented or lost. While existing methods attempt to address this by combining multi-scale rotary position embeddings (RoPE), they typically suffer from high latency or rely on suboptimal hand-crafted scaling strategies. To overcome these limitations, we introduce a layer-specific positional embedding scaling~(LPES) method that assigns distinct scaling factors to each layer. LPES achieves a more balanced attention distribution without fine-tuning model parameters or increasing inference delay. A specially designed genetic algorithm is employed to efficiently select the optimal scaling factors for each layer by incorporating Bézier curves to significantly reduce the search space. Extensive experiments demonstrate that LPES effectively mitigates positional attention bias and delivers consistent improvements across multiple long-context benchmarks, yielding up to an $11.2$\% accuracy gain on the key-value retrieval dataset.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑