Turnout: Adaptive Attention Switching for Efficient Reasoning
Organizations: Qualcomm AI Research‡ · Qualcomm AI Research · NVIDIA
Abstract
Post-hoc transformer linearization replaces the key-value cache of full attention, which grows linearly with generation length, with a fixed size state. This change reduces memory consumption but often hurts accuracy. In reasoning tasks, which require long generations, this effect is especially pronounced. In this work we introduce Turnout, a method that mitigates accuracy loss as a result of linearization, while maintaining its memory-reduction benefits. We apply post-hoc linearization to a pretrained full-attention model, training a linear path through distillation while leaving the original full-attention path unchanged. During response generation, the resulting hybrid model retains both paths and uses a learned policy to control when each layer switches from full to linear attention. We train the policy with reinforcement learning using a reward that balances answer correctness and memory use. Empirical evaluation of our method shows that the learned adaptive policy achieves a better accuracy-efficiency Pareto frontier on reasoning tasks compared to fixed switching and static hybrid baselines.
Figures & tables
| Router config. | Accuracy | Cache saving | ||||||||
| Score | Context | GSM8K | GPQA-D | MATH-500 | MBPP+ | HE+ | Avg. | (%) | ||
| Qwen3-8B | ||||||||||
| Full attention | 95.6 | 56.6 | 95.0 | 93.4 | 84.8 | 85.1 | 0.0 | |||
| All linear | 79.5 | 27.3 | 64.0 | 24.1 | 34.8 | 45.9 | 69.4 | |||
| BE-Cos. | ✗ | 8K | 0.1 | 94.5 | 45.5 | 91.4 | 77.0 | 82.9 | 78.3 | 17.4 |
| BE-Cos. | 8K | 0.1 | 95.3 | 50.0 | 93.0 | 91.3 | 82.3 | 82.4 | 25.4 | |
| Added parameters | Memory (GiB) | ||||
| Method | Count | Overhead | Params | Cache | Cache |
| (1K) | (16K) | ||||
| MHA | – | – | |||
| Linear | M | ||||
| Turnout | M | ||||
| (merged) | |||||
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Loss components | LoRA rank | Non-thinking | Thinking | |||||||
| NTP | Logit | AD | TF | LAMBADA | MMLU | Avg. | GSM8K | MATH-500 | Avg. | |
| Full model | 64.2 | 74.9 | 69.6 | 95.6 | 95.0 | 95.3 | ||||
| Objective ablation | ||||||||||
| ✓ | 128 | 67.0 | 70.4 | 68.7 | 8.0 | 8.0 | 8.0 | |||
| ✓ | 128 | 62.9 | 72.3 | 67.6 | 14.7 | 15.2 | 15.0 | |||
| ✓ | 128 | 61.6 | 72.4 | 67.0 | 5.0 | 5.8 | 5.4 | |||
| Non-thinking | Thinking | |||||||||||
| Model (training data) | SWA | Sink | Tok. | LAMBADA | MMLU | Avg. | GSM8K | MATH-500 | GPQA | HE+ | MBPP+ | Avg. |
| Qwen3-8B | ||||||||||||
| Full model | – | – | – | 64.2 | 74.9 | 69.6 | 95.6 | 95.0 | 56.6 | 84.8 | 93.4 | 85.1 |
| SWA-only | 64 | 8 | – | 62.0 | 70.9 | 66.5 | 1.8 | 3.0 | 3.5 | 0.0 | 0.0 | 1.7 |
| Turnout (DCLM) | 64 | 8 | 0.4B | 62.7 | 72.8 | 67.8 | 30.4 | 20.8 | 16.2 | 17.1 | 22.5 | 21.4 |
| Turnout (DCLM) | 64 | 8 | 1.0B | 63.0 | 73.0 | 68.0 | 33.7 | 25.2 | 16.7 | 22.0 | 23.5 | 24.2 |
| Non-thinking | Thinking | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model (training data) | SWA | Sink | Tok. | LAMBADA | MMLU | Avg. | GSM8K | MATH-500 | GPQA | HE+ | MBPP+ | Avg. |
| Full model | – | – | – | 64.2 | 74.9 | 69.6 | 95.6 | 95.0 | 56.6 | 84.8 | 93.4 | 85.1 |
| SWA-only | 64 | 8 | – | 62.0 | 70.9 | 66.5 | 1.8 | 3.0 | 3.5 | 0.0 | 0.0 | 1.7 |
| SWA-only | 128 | 8 | – | 64.1 | 74.1 | 69.1 | 9.2 | 9.0 | 3.0 | 0.0 | 0.3 | 4.3 |
| SWA-only | 512 | 8 | – | 64.1 | 74.9 | 69.5 | 74.1 | 47.4 | 12.6 | 6.7 | 8.7 | 29.9 |
| Turnout (OT) | 64 | 8 | 4.5B | 57.8 | 67.9 | 62.9 | 79.5 | 64.0 | 27.3 | 34.8 | 24.1 | 45.9 |
| Non-thinking | Thinking | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model (training data) | SWA | Sink | Tok. | LAMBADA | MMLU | Avg. | GSM8K | MATH-500 | GPQA | HE+ | MBPP+ | Avg. |
| Full model | – | – | – | 72.2 | 68.3 | 70.3 | 78.2 | 48.6 | 23.7 | 58.5 | 73.0 | 56.4 |
| SWA-only | 64 | 8 | – | 69.4 | 64.3 | 66.9 | 3.0 | 6.8 | 4.0 | 11.0 | 38.1 | 12.6 |
| SWA-only | 128 | 8 | – | 72.2 | 66.5 | 69.4 | 27.7 | 18.4 | 3.0 | 31.1 | 65.6 | 29.2 |
| SWA-only | 512 | 8 | – | 72.2 | 68.1 | 70.2 | 78.5 | 49.0 | 16.7 | 57.9 | 74.9 | 55.4 |
| Turnout (OT) | 64 | 8 | 4.5B | 67.0 | 58.8 | 62.9 | 51.2 | 28.0 | 8.1 | 25.6 | 31.2 | 28.8 |
| Hyperparameter | Value |
| Training data | |
| Teacher / backbone | Qwen/Qwen3-8B ; Meta-Llama-3.1-8B-Instruct |
| Dataset | OpenThoughts3-1.2M (train) |
| Input formatting | Each model’s chat template |
| Tokens used in the loss | Assistant-response tokens only |
| Gradient propagation length | tokens |
| Router configuration | Accuracy | Cache saving | |||||||||
| Reward shape | Efficiency score | Context | GSM8K | GPQA-D | MATH-500 | MBPP+ | HE+ | Avg. | (%) | ||
| Full attention | 95.6 | 56.6 | 95.0 | 93.4 | 84.8 | 85.1 | 0.0 | ||||
| All linear | 79.5 | 27.3 | 64.0 | 24.1 | 34.8 | 45.9 | 69.4 | ||||
| Per-layer hybridization (10% full layers) | 82.4 | 25.8 | 67.6 | 20.9 | 40.9 | 47.5 | 61.7 | ||||
| Per-layer hybridization (25% full layers) | 87.0 | 24.7 | 75.4 | 22.0 | 37.8 | 49.4 | 52.1 | ||||
| Per-layer hybridization (50% full layers) | 93.2 | 39.4 | 89.4 | 73.5 | 77.4 | 74.6 | 34.7 | ||||
| Full layers | Per-layer hybridization | FlashMorph (ours) | FlashMorph (paper) |
|---|---|---|---|
| (4) | 32–35 | 2, 3, 5, 7 | – |
| (9) | 24, 28–35 | 0–3, 5–7, 11, 12 | 0, 1, 3, 7, 13, 15, 22, 24, 29 |
| (18) | 18–35 | 0–16, 35 | 0–3, 7–9, 12, 13, 15, 17, 19, 20, 22, 24, 29, 33, 34 |
| Hyperparameter | Value |
| Router | |
| Schedule hidden size | |
| Schedule activation | SiLU |
| Sinusoidal frequencies | |
| Sinusoidal maximum period | |
| Context hidden size | |