paper-with-me

홈 › Papers

MEP: Multiple Kernel Learning Enhancing Relative Positional Encoding Length Extrapolation

2024-03-26 · Weiguo Gao

When the predicted sequence length exceeds the length seen during training, the transformer's inference accuracy diminishes. Existing relative position encoding methods, such as those based on the ALiBi technique, address the length extrapolation challenge exclusively through the implementation of a single kernel function, which introduces a constant bias to every post-softmax attention scores according to their distance. These approaches do not investigate or employ multiple kernel functions to address the extrapolation challenge. Drawing on the ALiBi approach, this study proposes a novel relative positional encoding method, called MEP, which employs a weighted average to combine distinct kernel functions(such as the exponential kernel and the Gaussian kernel) to generate a bias that is applied to post-softmax attention scores. Initially, the framework utilizes various kernel functions to construct multiple kernel functions. Each kernel function adheres to a consistent mean weight coefficient, harnessing the synergistic advantages of different kernels to formulate an innovative bias function. Subsequently, specific slopes are tailored for each kernel function, applying penalties at varying rates, to enhance the model's extrapolation capabilities. Finally, this bias is seamlessly incorporated as a penalty to the post-softmax scores. We present two distinct versions of our method: a parameter-free variant that requires no new learnable parameters, which enhances length extrapolation capabilities without compromising training efficiency, and a parameterized variant capable of integrating state-of-the-art techniques. Empirical evaluations across diverse datasets have demonstrated that both variants of our method achieve state-of-the-art performance, outperforming traditional parameter-free and parameterized approaches.

📄 PDF Abstract BibTeX arXiv:2403.17698

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

ALiBi ALiBi, or Attention with Linear Biases, is a positioning method that allows…

Similar Papers 제목 키워드 기반

Stable, Fast and Accurate: Kernelized Attention with Relative Positional Encoding

2021-06-23 · NeurIPS 2021 12 · Shengjie Luo, Shanda Li, Tianle Cai, Di He 외

The attention module, which is a crucial component in Transformer, cannot scale efficiently to long sequences due to its quadratic complexity. Many works focus on approximating the dot-then-exponentiate softmax function …

Linearized Relative Positional Encoding

2023-07-18 · Zhen Qin, Weixuan Sun, Kaiyue Lu, Hui Deng 외

Relative positional encoding is widely used in vanilla and linear transformers to represent positional information. However, existing encoding methods of a vanilla transformer are not always directly applicable to a line…

image-classificationImage ClassificationLanguage ModelingLanguage Modelling+2

LazyAttention: Efficient Retrieval-Augmented Generation with Deferred Positional Encoding

2026-06-03 · Haocheng Xia, Mihir Pamnani, Hanxi Fang, Supawit Chockchowwat 외 arxiv

Key-value (KV) caching accelerates inference of large language models (LLMs) by reusing past computations for generated tokens. Its importance becomes even greater in long-context applications such as retrieval-augmented…

Analysis of Positional Encodings for Neural Machine Translation

2019-11-01 · EMNLP (IWSLT) 2019 11 · Jan Rosendahl, Viet Anh Khoa Tran, Weiyue Wang, Hermann Ney

In this work we analyze and compare the behavior of the Transformer architecture when using different positional encoding methods. While absolute and relative positional encoding perform equally strong overall, we show t…

Machine TranslationSentenceTranslation

Toward Relative Positional Encoding in Spiking Transformers

2025-01-28 · Changze Lv, Yansen Wang, Dongqi Han, Yifei Shen 외

Spiking neural networks (SNNs) are bio-inspired networks that mimic how neurons in the brain communicate through discrete spikes, which have great potential in various tasks due to their energy efficiency and temporal pr…

image-classificationImage Classificationtext-classificationText Classification+1