potentialpaper

How Query–Key Initialization Shapes Gradients and Training in Transformers

Keep the title, authors and abstract in paper.json

potentialpaper · 2026-11-23 19:37 UTC · 8221ead515f4 ·

.potentialpaper/metadata.json modified

+++ b/.potentialpaper/metadata.json
@@ -1,19 +1,5 @@
{
- "layout": 5,
- "identifiers": [
- {
- "scheme": "openreview",
- "value": "419qaAMpme"
- }
- ],
- "title": "How Query–Key Initialization Shapes Gradients and Training in Transformers",
- "authors": [],
- "abstract": "We study how query and key (QK) initialization shapes gradient propagation and training in Transformers.\nWe derive an explicit gradient-norm recurrence for softmax attention and Pre-Norm residual blocks, revealing an asymmetry between large and small initialization scales.\nLarge initialization can cause gradient explosion: the expected input-gradient gain diverges in the long-sequence limit.\nFor normalized, weakly correlated inputs, this yields $(2\\ln T)^{1/4}$ as a practical upper reference for $\\sigma_{qk}$, where QK weight entries have variance $\\sigma_{qk}^2/d$, $d$ is the input dimension, and $T$ is the sequence length.\nSmall, nonzero initialization preserves a nonvanishing gradient-to-weight ratio, while gradient normalization in Adam and Muon permits substantial updates despite nearly uniform attention.\nExperiments with $100$-layer attention stacks and 124M-parameter language models support the analysis, with AdamW and Muon exhibiting a broad low-loss plateau down to $\\sigma_{qk}=10^{-5}$.\nThese findings motivate a practical recipe: favor small, nonzero QK initialization; and for broader searches, stay below the upper reference $(2\\ln T)^{1/4}$.",
- "year": 2027,
- "venue": "ICLR 2027 (under review)",
- "source": "openreview",
- "license": {
- "metadata": "CC0-1.0",
- "abstract": "CC0-1.0"
- }
+ "layout": 6,
+ "kind": "paper",
+ "key": "37d4e797-ea47-4b9d-9615-42395b7b30d5"
}

paper.json added

+++ b/paper.json
@@ -0,0 +1,9 @@
+{
+ "title": "How Query–Key Initialization Shapes Gradients and Training in Transformers",
+ "authors": [],
+ "abstract": "We study how query and key (QK) initialization shapes gradient propagation and training in Transformers.\nWe derive an explicit gradient-norm recurrence for softmax attention and Pre-Norm residual blocks, revealing an asymmetry between large and small initialization scales.\nLarge initialization can cause gradient explosion: the expected input-gradient gain diverges in the long-sequence limit.\nFor normalized, weakly correlated inputs, this yields $(2\\ln T)^{1/4}$ as a practical upper reference for $\\sigma_{qk}$, where QK weight entries have variance $\\sigma_{qk}^2/d$, $d$ is the input dimension, and $T$ is the sequence length.\nSmall, nonzero initialization preserves a nonvanishing gradient-to-weight ratio, while gradient normalization in Adam and Muon permits substantial updates despite nearly uniform attention.\nExperiments with $100$-layer attention stacks and 124M-parameter language models support the analysis, with AdamW and Muon exhibiting a broad low-loss plateau down to $\\sigma_{qk}=10^{-5}$.\nThese findings motivate a practical recipe: favor small, nonzero QK initialization; and for broader searches, stay below the upper reference $(2\\ln T)^{1/4}$.",
+ "license": {
+ "metadata": "CC0-1.0",
+ "abstract": "CC0-1.0"
+ }
+}