Faster Query-Key Learning Sharpens Attention in Self-Attention Models

Rahul Vashisht, Harish G. Ramaswamy
8/7/2026
cs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

A standard self-attention layer consists of two interacting circuits: the query-key circuit that governs attention allocation, and the output-value circuit that maps attended representations to predictions. Collapsed and factorized parameterizations of the query-key and output-value circuits lead to qualitatively different attention patterns.

Show full abstract

In particular, some parameterizations give sharper attention to task-relevant tokens, at a similar training loss. We analyze how the parameterizations of these circuits shape the parameter trajectories in single-layer self-attention models trained for next-token prediction. Through gradient-flow analysis, we show that factorization induces implicit rescaling of the two circuits' learning rates. We derive closed-form dynamics showing that output-value and query-key parameters move along a line, with relative speeds determined by their learning rates. Faster query-key learning relative to output-value learning thus produces sharper attention, as the model compensates for slower output-value learning by increasing attention mass on relevant tokens. Experiments show that differences in the relative learning rates of the two circuits govern attention concentration. This improves attention interpretability proxies while maintaining comparable predictive performance.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{vashisht2026faster,
  title  = {Faster Query-Key Learning Sharpens Attention in Self-Attention Models},
  author = {Rahul Vashisht and Harish G. Ramaswamy},
  year   = {2026},
  eprint = {2608.06776},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.06776v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.06776.svg)](https://codeofpaper.com/paper/2608.06776)

Discussion