paper-with-me

홈 › Papers

Just read twice: closing the recall gap for recurrent language models

2024-07-07 · Simran Arora, Aman Timalsina, Aaryan Singhal, Benjamin Spector, Sabri Eyuboglu, Xinyi Zhao, Ashish Rao, Atri Rudra, Christopher Ré

Recurrent large language models that compete with Transformers in language modeling perplexity are emerging at a rapid rate (e.g., Mamba, RWKV). Excitingly, these architectures use a constant amount of memory during inference. However, due to the limited memory, recurrent LMs cannot recall and use all the information in long contexts leading to brittle in-context learning (ICL) quality. A key challenge for efficient LMs is selecting what information to store versus discard. In this work, we observe the order in which information is shown to the LM impacts the selection difficulty. To formalize this, we show that the hardness of information recall reduces to the hardness of a problem called set disjointness (SD), a quintessential problem in communication complexity that requires a streaming algorithm (e.g., recurrent model) to decide whether inputted sets are disjoint. We empirically and theoretically show that the recurrent memory required to solve SD changes with set order, i.e., whether the smaller set appears first in-context. Our analysis suggests, to mitigate the reliance on data order, we can put information in the right order in-context or process prompts non-causally. Towards that end, we propose: (1) JRT-Prompt, where context gets repeated multiple times in the prompt, effectively showing the model all data orders. This gives $11.0 \pm 1.3$ points of improvement, averaged across $16$ recurrent LMs and the $6$ ICL tasks, with $11.9\times$ higher throughput than FlashAttention-2 for generation prefill (length $32$k, batch size $16$, NVidia H100). We then propose (2) JRT-RNN, which uses non-causal prefix-linear-attention to process prompts and provides $99\%$ of Transformer quality at $360$M params., $30$B tokens and $96\%$ at $1.3$B params., $50$B tokens on average across the tasks, with $19.2\times$ higher throughput for prefill than FA2.

📄 PDF Abstract BibTeX arXiv:2407.05483

Code (1)

HazyResearch/prefix-linear-attention 공식 구현 pytorch

Tasks

In-Context LearningLanguage ModelingLanguage ModellingMamba

Methods 이 논문이 사용한 방법론

SET Dynamic Sparse Training method where weight mask is updated randomly periodically
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Multi-Head Attention 설명 없음
Attention 설명 없음
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$…
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…
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
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…

Similar Papers 제목 키워드 기반

ReadTwice: Reading Very Large Documents with Memories

2021-05-10 · NAACL 2021 4 · Yury Zemlyanskiy, Joshua Ainslie, Michiel de Jong, Philip Pham 외

Knowledge-intensive tasks such as question answering often require assimilating information from different sections of large inputs such as books or article collections. We propose ReadTwice, a simple and effective techn…

Question Answering

R2-D2: A Modular Baseline for Open-Domain Question Answering

2021-09-08 · Findings (EMNLP) 2021 11 · Martin Fajcik, Martin Docekal, Karel Ondrej, Pavel Smrz

This work presents a novel four-stage open-domain QA pipeline R2-D2 (Rank twice, reaD twice). The pipeline is composed of a retriever, passage reranker, extractive reader, generative reader and a mechanism that aggregate…

Open-Domain Question AnsweringPassage RetrievalQuestion AnsweringTriviaQA

NLP-Cube: End-to-End Raw Text Processing With Neural Networks

2018-10-01 · CONLL 2018 10 · Tiberiu Boros, Stefan Daniel Dumitrescu, Rux Burtica, ra

We introduce NLP-Cube: an end-to-end Natural Language Processing framework, evaluated in CoNLL{'}s {``}Multilingual Parsing from Raw Text to Universal Dependencies 2018{''} Shared Task. It performs sentence splitting, to…

LemmatizationSentence

Closing Brackets with Recurrent Neural Networks

2018-11-01 · WS 2018 11 · Natalia Skachkova, Thomas Trost, Dietrich Klakow

Many natural and formal languages contain words or symbols that require a matching counterpart for making an expression well-formed. The combination of opening and closing brackets is a typical example of such a construc…

Language ModelingLanguage Modelling

Meta Answering for Machine Reading

2019-11-11 · Benjamin Borschinger, Jordan Boyd-Graber, Christian Buck, Jannis Bulian 외

We investigate a framework for machine reading, inspired by real world information-seeking problems, where a meta question answering system interacts with a black box environment. The environment encapsulates a competiti…

Natural QuestionsQuestion AnsweringReading Comprehension