paper-with-me

Papers

Landmark Attention: Random-Access Infinite Context Length for Transformers

2023-05-25 · Amirkeivan Mohtashami, Martin Jaggi

While Transformers have shown remarkable success in natural language processing, their attention mechanism's large memory requirements have limited their ability to handle longer contexts. Prior approaches, such as recurrent memory or retrieval-based augmentation, have either compromised the random-access flexibility of attention (i.e., the capability to select any token in the entire context) or relied on separate mechanisms for relevant context retrieval, which may not be compatible with the model's attention. In this paper, we present a novel approach that allows access to the complete context while retaining random-access flexibility, closely resembling running attention on the entire context. Our method uses a landmark token to represent each block of the input and trains the attention to use it for selecting relevant blocks, enabling retrieval of blocks directly through the attention mechanism instead of by relying on a separate mechanism. Our approach seamlessly integrates with specialized data structures and the system's memory hierarchy, enabling processing of arbitrarily long context lengths. We demonstrate that our method can obtain comparable performance with Transformer-XL while significantly reducing the number of retrieved tokens in each step. Finally, we show that fine-tuning LLaMA 7B with our method successfully extends its context length capacity to over 32k tokens, allowing for inference at the context lengths of GPT-4. We release the implementation of landmark attention and the code to reproduce our experiments at https://github.com/epfml/landmark-attention/.

📄 PDF Abstract BibTeX arXiv:2305.16300

Code (2)

epfml/landmark-attention 공식 구현 pytorch
cstankonrad/long_llama pytorch

Tasks

Retrieval

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Cosine Annealing Cosine Annealing is a type of learning rate schedule that has the effect of starting with a large learning rate that is relatively rapidly decreased to a minimum value before…
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Variational Dropout Variational Dropout is a regularization technique based on dropout, but uses a variational inference grounded approach. In…
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

Random-Access Infinite Context Length for Transformers

2023-09-21 · NeurIPS 2023 11

While Transformers have shown remarkable success in natural language processing, their attention mechanism's large memory requirements have limited their ability to handle longer contexts. Prior approaches, such as recur…

Hierarchical Sparse Attention Done Right: Toward Infinite Context Modeling

2026-07-03 · Xiang Hu, Xinyu Wei, Hao Gu, Minshen Zhang 외 hf

Scaling modern large language models (LLMs) to long contexts is limited by the quadratic computation cost, and poor length extrapolation of dense attention. Chunk-wise sparse attention offers a promising alternative, but…

Synthetic Augmentation for Anatomical Landmark Localization using DDPMs

2024-10-16 · Arnela Hadzic, Lea Bogensperger, Simon Johannes Joham, Martin Urschler

Deep learning techniques for anatomical landmark localization (ALL) have shown great success, but their reliance on large annotated datasets remains a problem due to the tedious and costly nature of medical data acquisit…

Data AugmentationDenoising

Nyström landmark sampling and regularized Christoffel functions

2019-05-29 · Michaël Fanuel, Joachim Schreurs, Johan A. K. Suykens

Selecting diverse and important items, called landmarks, from a large set is a problem of interest in machine learning. As a specific example, in order to deal with large training sets, kernel methods often rely on low r…

DiversityPoint Processes

ReAttention: Training-Free Infinite Context with Finite Attention Scope

2024-07-21 · Xiaoran Liu, Ruixiao Li, Qipeng Guo, Zhigeng Liu 외

The long-context capability of the Large Language Models (LLM) has made significant breakthroughs, but the maximum supported context length remains a critical bottleneck limiting their practical applications. The constra…

Language ModellingLarge Language ModelPosition