InAttention: Linear Context Scaling for Transformers

Joseph Eisner
10/9/2024
cs.LG

No confident code implementation found for this paper.

Abstract

VRAM requirements for transformer models scale quadratically with context length due to the self-attention mechanism. In this paper we modify the decoder-only transformer, replacing self-attention with InAttention, which scales linearly with context length during inference by having tokens attend only to initial states. Benchmarking shows that InAttention significantly reduces VRAM usage during inference, enabling handling of long sequences on consumer GPUs. We corroborate that fine-tuning extends context length efficiently, improving performance on long sequences without high training costs. InAttention offers a scalable solution for long-range dependencies in transformer models, paving the way for further optimization.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{eisner2024inattention,
  title  = {InAttention: Linear Context Scaling for Transformers},
  author = {Joseph Eisner},
  year   = {2024},
  eprint = {2410.07063},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.07063v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.07063.svg)](https://codeofpaper.com/paper/2410.07063)

Discussion