HackerPapers

arXiv:2305.01625cs.CL

Unlimiformer: Long-Range Transformers with Unlimited Length Input

Amanda Bertsch, Uri Alon, Graham Neubig, Matthew R. Gormley

Abstract

Since the proposal of transformers, these models have been limited to bounded input lengths, because of their need to attend to every token in the input. In this work, we propose Unlimiformer: a general approach that wraps any existing pretrained encoder-decoder transformer, and offloads the cross-attention computation to a single k-nearest-neighbor (kNN) index, while the returned kNN distances are the attention dot-product scores. This kNN index can be kept on either the GPU or CPU memory and queried in sub-linear time; this way, we can index practically unlimited input sequences, while every attention head in every decoder layer retrieves its top-k keys, instead of attending to every key. We evaluate Unlimiformer on several long-document and book-summarization benchmarks, showing that it can process even 500k token-long inputs from the BookSum dataset, without any input truncation at test time. We demonstrate that Unlimiformer improves pretrained models such as BART and Longformer by extending them to unlimited inputs without additional learned weights and without modifying their code. We make our code and models publicly available at https://github.com/abertsch72/unlimiformer .

arXiv comments
NeurIPS 2023
Journal reference
DOI
Subjects
cs.CLComputation and Language

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from May 2023 to May 2023. Found in 6 HN submissions from May 2023 to Aug 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. 100K Context Windows 1 comment
    • Is there any paper or architecture about this model that explains how they achieved it? is it unlimiformer [https://arxiv.org/abs/2305.01625?utm_source=tldrai] or something different?

      maskedpirateView on HNParent context

    • Appendix C of the PDF has an example book summary of The Brothers Karamazov, with noted minor factual errors https://arxiv.org/pdf/2305.01625.pdf > Unlimiformer summary: > The first part of the novel focuses on the question of whether or not the Russian nobleman, Dmitri…

      j2kunView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.