paper-with-me

홈 › Papers

Layer-Specific Scaling of Positional Encodings for Superior Long-Context Modeling

2025-03-06 · Zhenghua Wang, Yiran Ding, Changze Lv, Zhibo Xu, Tianlong Li, Tianyuan Shi, Xiaoqing Zheng, Xuanjing Huang

Although large language models (LLMs) have achieved significant progress in handling long-context inputs, they still suffer from the `lost-in-the-middle'' problem, where crucial information in the middle of the context is often underrepresented or lost. Our extensive experiments reveal that this issue may arise from the rapid long-term decay in Rotary Position Embedding (RoPE). To address this problem, we propose a layer-specific positional encoding scaling method that assigns distinct scaling factors to each layer, slowing down the decay rate caused by RoPE to make the model pay more attention to the middle context. A specially designed genetic algorithm is employed to efficiently select the optimal scaling factors for each layer by incorporating Bezier curves to reduce the search space. Through comprehensive experimentation, we demonstrate that our method significantly alleviates the `lost-in-the-middle'' problem. Our approach results in an average accuracy improvement of up to 20% on the Key-Value Retrieval dataset. Furthermore, we show that layer-specific interpolation, as opposed to uniform interpolation across all layers, enhances the model's extrapolation capabilities when combined with PI and Dynamic-NTK positional encoding schemes.

📄 PDF Abstract BibTeX arXiv:2503.04355

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

SWAN-GPT: An Efficient and Scalable Approach for Long-Context Language Modeling

2025-04-11 · Krishna C. Puvvada, Faisal Ladhak, Santiago Akle Serrano, Cheng-Ping Hsieh 외

We present a decoder-only Transformer architecture that robustly generalizes to sequence lengths substantially longer than those seen during training. Our model, SWAN-GPT, interleaves layers without positional encodings …

DecoderLanguage ModelingLanguage Modelling

CoPE: A Lightweight Complex Positional Encoding

2025-08-23 · Avinash Amballa arxiv

Recent studies have demonstrated the effectiveness of position encoding in transformer architectures. By incorporating positional information, this approach provides essential guidance for modeling dependencies between e…

Rewiring with Positional Encodings for Graph Neural Networks

2022-01-29 · Rickard Brüel-Gabrielsson, Mikhail Yurochkin, Justin Solomon

Several recent works use positional encodings to extend the receptive fields of graph neural network (GNN) layers equipped with attention mechanisms. These techniques, however, extend receptive fields to the complete gra…

Graph Neural Network

Rethinking Addressing in Language Models via Contexualized Equivariant Positional Encoding

2025-01-01 · Jiajun Zhu, Peihao Wang, Ruisi Cai, Jason D. Lee 외

Transformers rely on both content-based and position-based addressing mechanisms to make predictions, but existing positional encoding techniques often diminish the effectiveness of position-based addressing. Many curren…

Arithmetic ReasoningLanguage ModelingLanguage Modellingparameter-efficient fine-tuning+1

Position-aware Self-attention with Relative Positional Encodings for Slot Filling

2018-07-09 · Ivan Bilan, Benjamin Roth

This paper describes how to apply self-attention with relative positional encodings to the task of relation extraction. We propose to use the self-attention encoder layer together with an additional position-aware attent…

PositionRelation ExtractionSentenceslot-filling+1