The Query Knows What to Forget: A Second Erase Direction for Linear Attention
Linear attention models keep a state of fixed size, which can lead to interference between stored items at long context. The authors introduce the Query-derived Erase Direction (QED), a second erase direction derived from the query and orthogonal to the key, to improve re…
Intelligence analysis by Llama

The Query Knows What to Forget: A Second Erase Direction for Linear Attention improves retrieval at long context by introducing a second erase direction derived from the query and orthogonal to the key.
Imagine you have a big box of toys, and you want to find a specific toy. Linear attention models are like a search engine that helps you find the toy. However, when you have too many toys in the box, it can be hard to find the one you want. The Query-derived Erase Direction (QED) is like a new way of searching the box that helps you find the toy more efficiently, even when there are many toys in the box.
Analysis
Background
Linear attention models have been widely used in natural language processing tasks due to their ability to handle long-range dependencies. However, they suffer from interference between stored items at long context, which degrades retrieval performance. Gated DeltaNet-2 (GDN-2), a delta-rule model, derives its erase vector from the key of the current token, but this approach cannot reach the interference in its reads measured through the query.
The Query-derived Erase Direction (QED)
We introduce the Query-derived Erase Direction (QED), a second erase direction derived from the query and orthogonal to the key. In the fast-weight view, a key-directed delta edit cannot change the key-orthogonal part of a read. It uses the editable part to cancel old-state content measured along the query. This approach improves retrieval at every length past the training window and doubles the usable context length on S-NIAH-1.
Implications
The introduction of QED has significant implications for the design of linear attention models. It enables them to handle long-range dependencies more effectively, leading to improved performance in tasks such as question answering and text classification. Furthermore, QED can be used in conjunction with other techniques, such as attention mechanisms, to further improve model performance.
Future Work
Future work will focus on exploring the application of QED in other areas of natural language processing, such as machine translation and sentiment analysis. Additionally, we will investigate the use of QED in conjunction with other techniques to further improve model performance.
Key points
- Linear attention models suffer from interference between stored items at long context.
- The Query-derived Erase Direction (QED) is a new approach that improves retrieval at every length past the training window.
- QED doubles the usable context length on S-NIAH-1.
- QED has significant implications for the design of linear attention models.
- Future work will focus on exploring the application of QED in other areas of natural language processing.
If this development plays out positively, it could lead to significant improvements in the performance of linear attention models, enabling them to handle long-range dependencies more effectively and leading to better results in tasks such as question answering and text classification.
However, there are also potential risks associated with the introduction of QED. For example, it may lead to overfitting or underfitting in certain models, or it may require significant computational resources to implement. Therefore, it is essential to carefully evaluate the performance of QED in different models and scenarios before adopting it widely.



