HackerPapers

arXiv:2010.04245cs.CL

Query-Key Normalization for Transformers

Alex Henry, Prudhvi Raj Dachapally, Shubham Pawar, Yuxuan Chen

Abstract

Low-resource language translation is a challenging but socially valuable NLP task. Building on recent work adapting the Transformer's normalization to this setting, we propose QKNorm, a normalization technique that modifies the attention mechanism to make the softmax function less prone to arbitrary saturation without sacrificing expressivity. Specifically, we apply $\ell_2$ normalization along the head dimension of each query and key matrix prior to multiplying them and then scale up by a learnable parameter instead of dividing by the square root of the embedding dimension. We show improvements averaging 0.928 BLEU over state-of-the-art bilingual benchmarks for 5 low-resource translation pairs from the TED Talks corpus and IWSLT'15.

arXiv comments
8 pages, 2 figures, accepted at Findings of EMNLP 2020
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.AIArtificial Intelligence cs.LGMachine Learning

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Oct 2024 to May 2025.

Comments linking this paper, per year.

Discussed in comments2 threads

  1. Attention Wasn't All We Needed 1 comment
    • > Let's look at some of the most important ones that have been developed over the years and try to implement the basic ideas as succinctly as possible. One big architectural tweak that comes to mind and isn't in the article is QK norm: https://arxiv.org/pdf/2010.04245 > Cosine…

      kouteiheikaView on HNParent context

  2. Differential Transformer 1 comment
    • I had the same thought: Just eye-balling the graphs, the result of the subtraction looks very close to just reducing the temperature. They're effectively doing softmax with a fixed temperature, but it's unclear that this work is going to do better than just learning a per-head…

      mota7View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.