CLJan 11, 2024

Transformers are Multi-State RNNs

arXiv:2401.06104v2102 citationsh-index: 33Has CodeEMNLP
AI Analysis

This work addresses a critical computational bottleneck for LLM deployment by providing an efficient compression method, though it is incremental as it builds on existing transformer and RNN concepts.

The paper tackles the computational bottleneck of large language models' key-value cache size by showing that transformers can be conceptualized as multi-state RNNs and introducing TOVA, a training-free compression policy that reduces cache size to 1/8 in some cases, achieving 4.8X higher throughput while maintaining near-full model performance.

Transformers are considered conceptually different from the previous generation of state-of-the-art NLP models - recurrent neural networks (RNNs). In this work, we demonstrate that decoder-only transformers can in fact be conceptualized as unbounded multi-state RNNs - an RNN variant with unlimited hidden state size. We further show that transformers can be converted into $\textit{bounded}$ multi-state RNNs by fixing the size of their hidden state, effectively compressing their key-value cache. We introduce a novel, training-free compression policy - $\textbf{T}$oken $\textbf{O}$mission $\textbf{V}$ia $\textbf{A}$ttention (TOVA). Our experiments with four long range tasks and several LLMs show that TOVA outperforms several baseline compression policies. Particularly, our results are nearly on par with the full model, using in some cases only $\frac{1}{8}$ of the original cache size, which translates to 4.8X higher throughput. Our results shed light on the connection between transformers and RNNs, and help mitigate one of LLMs' most painful computational bottlenecks - the size of their key-value cache. We publicly release our code at https://github.com/schwartz-lab-NLP/TOVA

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes