Get the latest tech news

The Role of Anchor Tokens in Self-Attention Networks


Large language models (LLMs) predominantly employ decoder-only transformer architectures, necessitating the retention of keys/values information for historical tokens to provide contextual information and avoid redundant computation. However, the substantial size and parameter volume of these LLMs require massive GPU memory. This memory demand increases with the length of the input text, leading to an urgent need for more efficient methods of information storage and processing. This study introduces Anchor-based LLMs (AnLLMs), which utilize an innovative anchor-based self-attention network (AnSAN) and also an anchor-based inference strategy. This approach enables LLMs to compress sequence information into an anchor token, reducing the keys/values cache and enhancing inference efficiency. Experiments on question-answering benchmarks reveal that AnLLMs maintain similar accuracy levels while achieving up to 99% keys/values cache reduction and up to 3.5 times faster inference. Despite a minor compromise in accuracy, the substantial enhancements of AnLLMs employing the AnSAN technique in resource utilization and computational efficiency underscore their potential for practical LLM applications.

This memory demand increases with the length of the input text, leading to an urgent need for more efficient methods of information storage and processing. Experiments on question-answering benchmarks reveal that AnLLMs maintain similar accuracy levels while achieving up to 99% keys/values cache reduction and up to 3.5 times faster inference. Despite a minor compromise in accuracy, the substantial enhancements of AnLLMs employing the AnSAN technique in resource utilization and computational efficiency underscore their potential for practical LLM applications.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of role

role

Photo of Anchor

Anchor

Photo of tokens

tokens

Related news:

News photo

Police seldom disclose use of facial recognition despite false arrests | A Post investigation found that many defendants were unaware of the technology’s role in linking them to crimes, leading to questions of fairness

News photo

Metal Gear fans dare to hope as David Hayter teases return to "role I've not played, since..."

News photo

Earth's ambipolar electrostatic field and its role in ion escape to space