Ranking and Partitioning of Attention Heads for Sparse and Continual Reinforcement Learning Fine-tuning
Organizations: University of Washington · Tsinghua University · University of Hong Kong · Amazon, Inc.
Abstract
We study sparse and continual reinforcement learning fine-tuning of language models through attention-head ranking and partitioning. For sparse learning, we rank attention heads by gradient norm to identify a small subset of heads that can be trained effectively. For continual learning, we partition heads across tasks to reduce cross-task interference and preserve previously learned capabilities. Theoretically, we relate gradient norm to training effectiveness, and further characterize why sparse, separated head updates can remain stable. Empirically, across math, instruction-following, and coding tasks, tuning higher-ranked heads consistently outperforms tuning lower-ranked ones while often matching denser baselines, and head partitioning improves retention while preserving adaptation to new tasks.
Figures & tables
| Model | Task | Eval split | Base | Top 50% | Bottom 50% | Rand 50% | Full-attn | Full |
| Qwen3-1.7B | Math | In-dist test | 26.6 | 36.7 | 30.9 ( ) | 38.6 | 33.1 | 35.3 |
| Out-dist test | 70.2 | 76.7 | 73.6 ( ) | 79.2 | 74.2 | 73.6 | ||
| Qwen3-1.7B | IF | In-dist test | 41.7 | 57.3 | 47.0 ( ) | 51.6 | 59.4 | 54.6 |
| Out-dist test | 17.7 | 22.2 | 15.9 ( ) | 19.7 | 20.0 | 19.7 | ||
| Qwen3-1.7B | Coding | In-dist test | 53.7 | 59.5 | 57.8 ( ) | 58.5 | 58.2 | 61.6 |
| Out-dist test | 33.6 | 35.2 | 33.9 ( ) | 35.6 | 34.8 | 34.4 |
| Model | Task | Eval split | Base | Top 50% | Bottom 50% | Full-attn |
| Mistral-7B-Instruct-v0.3 | IF | In-dist test | 27.4 | 69.9 | 53.5 ( ) | 56.9 |
| Out-dist test | 18.3 | 21.0 | 20.3 ( ) | 25.3 |
| Model | Performance ranking ( Zhang et al., 2026 ) | Gradient norm ranking |
| Qwen3-1.7B-Base | ||
| Qwen3-4B-Base | ||
| Qwen3-8B-Base |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Train stage | Eval split | Math metric | Coding metric |
| Top 50% bottom 50% | In-dist test | 37.5 | 56.6 | |
| Out-dist test | 75.6 | 37.0 | ||
| In-dist test | 35.8 ( ) | 56.1 | ||
| Out-dist test | 75.2 ( ) | 37.7 | ||
| Full-attn continual | In-dist test | 33.1 | 54.8 | |
| Out-dist test | 74.2 | 35.2 |
| Method | Train stage | Eval split | IF metric | Math metric |
| Top 50% bottom 50% | In-dist test | 58.0 | 24.6 | |
| Out-dist test | 20.3 | 70.6 | ||
| In-dist test | 57.7 ( ) | 30.5 | ||
| Out-dist test | 20.7 ( ) | 73.8 | ||
| Round robin 50%+50% | In-dist test | 52.5 | 27.2 | |
| Out-dist test | 19.0 | 70.0 |
| Method | Train stage | Eval split | Coding metric | IF metric |
| Top 50% bottom 50% | In-dist test | 69.0 | 49.9 | |
| Out-dist test | 51.4 | 24.3 | ||
| In-dist test | 68.3 ( ) | 53.1 | ||
| Out-dist test | 52.6 ( ) | 23.0 | ||
| Round robin 50%+50% | In-dist test | 68.0 | 49.8 | |
| Out-dist test | 42.9 | 25.7 |
| Method | Train stage | Eval split | Math metric | IF metric |
| Top 50% bottom 50% | In-dist test | 59.3 | 49.6 | |
| Out-dist test | 88.4 | 22.7 | ||
| In-dist test | 60.0 ( ) | 53.6 | ||
| Out-dist test | 87.2 ( ) | 26.0 | ||
| Round robin 50%+50% | In-dist test | 53.2 | 50.3 | |
| Out-dist test | 86.0 | 23.3 |
| Train stage | Eval split | Math metric | Coding metric | IF metric |
| In-dist test | 34.5 | 55.6 | ||
| Out-dist test | 76.2 | 34.9 | ||
| In-dist test | 32.4 ( ) | 59.3 | 41.7 | |
| Out-dist test | 75.0 ( ) | 35.2 | 14.0 | |
| In-dist test | 33.6 ( ) | 58.7 ( ) | 47.3 | |
| Out-dist test | 74.8 ( ) | 34.0 ( ) | 17.7 |
| Train stage | Eval split | Math metric | IF metric | Coding metric |
| In-dist test | 55.7 | 50.2 | ||
| Out-dist test | 86.8 | 21.3 | ||
| In-dist test | 53.6 ( ) | 57.7 | 66.4 | |
| Out-dist test | 83.0 ( ) | 24.0 | 43.5 | |
| In-dist test | 53.9 ( ) | 56.7 ( ) | 67.2 | |
| Out-dist test | 85.0 ( ) | 23.3 ( ) | 49.2 |
| Model | 50% Attn | Full Attn | Full |
| Qwen3-1.7B | 0.176B / 0.656 GiB | 0.352B / 1.312 GiB | 1.721B / 6.410 GiB |
| Qwen3-4B | 0.472B / 1.758 GiB | 0.944B / 3.516 GiB | 4.022B / 14.985 GiB |
| Mistral-7B-Instruct-v0.3 | 0.671B / 2.500 GiB | 1.342B / 5.000 GiB | 7.248B / 27.001 GiB |
| Within-task | Cross-task | |||||
| Model | Math | IF | Coding | Math & IF | Math & Coding | IF & Coding |
| Qwen3-1.7B | 0.025 | 0.026 | 0.051 | 0.044 | 0.084 | 0.081 |
| Qwen3-4B | 0.067 | 0.040 | 0.047 | 0.076 | 0.121 | 0.104 |
| Stage task | Stage task | |||||
| Model | Task sequence | Head allocation | In-dist | Out-dist | In-dist | Out-dist |
| Qwen3-1.7B | Math Coding | Partition | ||||
| Qwen3-1.7B | IF Math | Partition | ||||
| Round robin | ||||||
| Qwen3-4B | Coding IF | Partition | ||||
| Round robin | ||||||
Continual Learning for LLMs
Continual learning for large language models studies how models absorb new knowledge and skills while retaining previously learned capabilities.
See all 231 papers