On-Policy Morphing into Hybrid Attention Models
Organizations: Fudan University · ByteDance Seed · Nanyang Technological University
Abstract
Hybrid attention models combine full and linear attention to achieve a better quality--efficiency trade-off. Converting pretrained Transformers into such models requires identifying which layers should retain full attention under a prescribed budget. We identify two off-policy mismatches in FlashMorph's layer selection: (i) continuous branch interpolation and teacher-forced hidden states differ from discrete hybrid computation; and (ii) frozen model weights fail to account for parameter adaptation during subsequent recovery. We introduce FlashMorph2, an on-policy layer-selection method that (I) evaluates sampled discrete hybrid architectures end to end using their own hidden states, and (II) jointly optimizes layer-selection scores and model weights under the recovery objective to reflect post-adaptation performance. Experiments across Qwen3 model scales and linear-attention variants show that FlashMorph2 consistently outperforms existing layer-selection methods, improving average scores over FlashMorph by points on RULER, on LongBench, and on recall-intensive tasks, while completing layer selection in only -- GPU hours across 0.6B--8B models, demonstrating high efficiency and scalability.
Figures & tables
| Attn. | Method | RULER | LongBench | |||||||||
| NIAH | VT | Agg. | QA | Avg | SQA | MQA | Sum. | FS | Code | Avg | ||
| 0.6B Backbone | ||||||||||||
| Full | Qwen3 | 94.38 | 95.32 | 55.78 | 33.56 | 79.15 | 21.22 | 20.86 | 19.39 | 60.78 | 33.26 | 30.95 |
| Lightning | Uniform | 61.12 | 1.56 | 51.64 | 29.99 | 50.29 | 19.90 | 16.46 | 17.92 | 48.58 | 33.28 | 26.80 |
| KL-LS | 54.49 | 2.20 | 34.46 | 31.66 | 43.87 | 18.52 | 20.15 | 18.60 | 43.32 | 38.71 | 27.09 | |
| HALO | 59.51 | 1.20 | 50.48 | 32.61 | 49.50 | 19.05 | 18.24 | 17.11 | 44.72 | 34.65 | 26.19 | |
| Attn. | Method | 0.6B Backbone | 1.7B Backbone | ||||||||||||
| FDA | SWDE | SQD | NQ | TQA | DROP | Avg | FDA | SWDE | SQD | NQ | TQA | DROP | Avg | ||
| Full | Qwen3 | 76.95 | 66.52 | 46.35 | 30.92 | 57.41 | 28.27 | 51.07 | 70.78 | 71.11 | 51.21 | 34.75 | 63.39 | 30.81 | 53.67 |
| Lightning | Uniform | 54.90 | 61.93 | 45.58 | 25.34 | 57.76 | 27.17 | 45.45 | 49.36 | 62.83 | 50.97 | 27.91 | 64.34 | 31.53 | 47.82 |
| PostNAS | — | — | — | — | — | — | — | 54.08 | 64.81 | 51.58 | 28.51 | 64.10 | 32.34 | 49.24 | |
| KL-LS | 49.36 | 57.61 | 46.92 | 22.68 | 58.35 | 27.93 | 43.81 | 48.64 | 60.13 | 50.94 | 29.17 | 63.15 | 32.20 | 47.37 | |
| HALO | 56.72 | 61.21 | 46.95 | 23.25 | 58.12 | 28.17 | 45.74 | 49.36 | 64.27 | 51.01 | 28.13 | 63.57 | 33.01 | 48.23 | |
| Method | RULER | LongBench |
| FlashMorph2 | 74.46 | 33.81 |
| w/o On-Policy Computation | 44.91 | 28.10 |
| w/o On-Policy Weight | 69.58 | 32.43 |
| w/o Both (FlashMorph) | 73.07 | 32.62 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Attribute | 0.6B | 1.7B | 8B | 30B-A3B |
| #layers | 28 | 28 | 36 | 48 |
| #full-attention layers | 7 | 7 | 9 | 12 |
| #linear-attention layers | 21 | 21 | 27 | 36 |
| hidden dimension | 1024 | 2048 | 4096 | 2048 |
| dense FFN dimension | 3072 | 6144 | 12288 | — |
| #experts | — | — | — | 128 |
| Hyperparameter | Stage 1 | Stage 2 | Stage 3 | Stage 4 |
| training tokens | 320M | 20M | 1B | 1B |
| layer-selection score LR | — | — | — | |
| model weight LR | ||||
| LR scheduler | cosine | WSD | cosine | constant |
| weight decay | 0 | 0 | 0 | 0 |
| sequence length | 512 | <4,096 | 512 | 16,384 |
| Attn. | Method | Layer indices (most important least important) |
| Qwen3-0.6B Backbone | ||
| Lightning | FlashMorph2 | 21, 11, 16, 6, 20, 19, 25, 24, 2, 26, 8, 18, 0, 3, 17, 13, 22, 1, 9, 12, 4, 14, 5, 23, 27, 15, 10, 7 |
| FlashMorph | 1 , 16, 21, 11, 19, 24 , 0 , 25, 18, 2, 6, 8, 20, 3, 26, 13, 9, 23, 22, 10, 14, 17, 4, 15, 12, 27, 5, 7 | |
| HALO | 10 , 21, 9 , 5 , 11, 1 , 13 , 16, 25, 12, 19, 24, 6, 18, 15, 8, 2, 26, 14, 23, 0, 27, 20, 7, 17, 22, 3, 4 | |
| KL-LS | 21, 16, 19, 20, 18 , 22 , 25, 24, 26, 17, 23, 14, 8, 12, 6, 13, 11, 15, 3, 2, 9, 4, 1, 5, 0, 10, 7, 27 | |
| GLA | FlashMorph2 | 21, 16, 11, 20, 6, 19, 25, 2, 24, 4, 3, 1, 26, 8, 18, 17, 13, 14, 0, 22, 12, 5, 9, 23, 15, 7, 10, 27 |
| Attn. | Method | SG1 | SG2 | SG3 | MK1 | MK2 | MK3 | MQ | MV | VT | CWE | FWE | QA1 | QA2 | Avg |
| 0.6B Backbone | |||||||||||||||
| Full | Qwen3 | 100.00 | 100.00 | 99.60 | 99.20 | 99.00 | 63.60 | 97.70 | 95.90 | 95.32 | 52.96 | 58.60 | 41.32 | 25.80 | 79.15 |
| Lightning | Uniform | 99.80 | 99.80 | 95.60 | 65.80 | 15.40 | 0.40 | 53.25 | 58.95 | 1.56 | 46.62 | 56.67 | 36.58 | 23.40 | 50.29 |
| KL-LS | 100.00 | 100.00 | 73.60 | 42.20 | 30.80 | 0.20 | 48.35 | 40.75 | 2.20 | 18.52 | 50.40 | 37.32 | 26.00 | 43.87 | |
| HALO | 83.80 | 100.00 | 97.40 | 62.00 | 13.20 | 1.00 | 60.05 | 58.60 | 1.20 | 48.04 | 52.93 | 38.62 | 26.60 | 49.50 | |
| FlashMorph | 100.00 | 100.00 | 94.20 | 79.00 | 43.40 | 1.40 | 64.50 | 66.00 | 10.84 | 54.80 | 55.27 | 42.25 | 28.40 | 56.93 | |
| Attn. | Method | Single-Doc QA | Multi-Doc QA | Summarization | Few-shot | Code | Avg | |||||||||
| NQA | QQA | MFQ | HQA | 2WM | Mus | GvR | QMS | MNs | TRC | TQA | SSM | LCC | RBP | |||
| 0.6B Backbone | ||||||||||||||||
| Full | Qwen3 | 10.04 | 14.12 | 39.49 | 26.25 | 25.91 | 10.41 | 25.05 | 19.10 | 14.03 | 70.50 | 73.49 | 38.34 | 31.31 | 35.21 | 30.95 |
| Lightning | Uniform | 14.34 | 17.78 | 27.59 | 20.21 | 20.80 | 8.38 | 15.87 | 20.36 | 17.52 | 56.00 | 55.80 | 33.95 | 30.14 | 36.42 | 26.80 |
| KL-LS | 11.50 | 18.76 | 25.30 | 24.76 | 26.37 | 9.32 | 17.15 | 20.16 | 18.50 | 48.50 | 49.03 | 32.44 | 36.22 | 41.20 | 27.09 | |
| HALO | 10.33 | 19.44 | 27.39 | 22.66 | 24.81 | 7.25 | 13.70 | 20.58 | 17.05 | 50.00 | 53.28 | 30.87 | 32.19 | 37.11 | 26.19 | |
| Attn. | Method | Wiki. | LMB. | LMB. | ARC-e | ARC-c | PIQA | Hella. | Wino. | SIQA | BoolQ | Avg |
| ppl | ppl | acc | acc | acc n | acc | acc n | acc | acc | acc | |||
| 0.6B Backbone | ||||||||||||
| Full | Qwen3 | 26.18 | 24.72 | 41.02 | 60.65 | 33.96 | 67.90 | 47.24 | 55.96 | 39.05 | 64.40 | 51.27 |
| Lightning | Uniform | 22.58 | 12.94 | 49.18 | 65.19 | 33.79 | 68.44 | 49.01 | 57.85 | 40.79 | 61.41 | 53.21 |
| KL-LS | 31.43 | 12.44 | 50.01 | 64.81 | 34.64 | 68.28 | 48.75 | 58.25 | 41.25 | 60.73 | 53.34 | |
| HALO | 23.02 | 12.74 | 49.62 | 65.91 | 34.47 | 68.28 | 48.99 | 56.35 | 40.99 | 63.94 | 53.57 | |
Hybrid Attention
Hybrid attention combines full attention with efficient mechanisms such as linear, recurrent, local, or sparse attention to balance recall and computation.
See all 88 papers