Rust in Everything
← Papers

On-Policy Morphing into Hybrid Attention Models

Disen Lan, Xuanda Wang, Jianbin Zheng, Huafeng Kuang, Wei Tang, Yu Cheng

2026-11-20▲ 13arXiv 2611.24809v1Hugging Face

AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.

TL;DR

FlashMorph2 improves Transformer-to-hybrid layer selection by sampling budget-constrained discrete hybrid architectures and jointly optimizing layer-selection scores and model weights under the recovery objective.

Problem

FlashMorph selects full-attention layers using continuous gates, teacher-forced hidden states, and frozen weights, while deployment uses a discrete hybrid architecture with self-generated hidden states and weights adapted during recovery. This creates off-policy computation and off-policy weight mismatches that can misrank layers. The paper targets selecting layers that perform well after recovery under a full-attention budget.

Method

FlashMorph2 assigns each layer a learnable layer-selection score and uses Gumbel-Top-K sampling to select exactly K full-attention layers, forming a discrete hybrid architecture under the budget. It performs an end-to-end forward pass through each sampled architecture so each layer uses hidden states propagated by that sampled hybrid model. It jointly optimizes the layer-selection scores and model weights over sampled architectures using the logits distillation objective used in subsequent recovery training. Discrete Top-K selection is handled with a budget-constrained straight-through estimator, where a threshold is found by binary search and gradients pass through a continuous relaxation. After optimization, it removes sampling noise, selects the top-K layers by score, reinitializes the selected model with the Stage 1 weights, and applies the same Stage 3-4 recovery pipeline.

Results

  • Averaged across configurations, FlashMorph2 raises RULER and LongBench average scores over FlashMorph. §5.2
  • Averaged across configurations, FlashMorph2 improves the recall-intensive task average over FlashMorph. §5.2
  • FlashMorph2 completes layer selection in 0.72 to 3.57 GPU hours across 0.6B to 8B models, while HALO and KL-LS require more GPU hours relative to FlashMorph2. §5.3
  • In the Qwen3-1.7B GDN ablation, removing on-policy computation or on-policy weight adaptation lowers RULER and LongBench scores, and removing both reverts to FlashMorph. §5.3
  • Under the tightest 6:1 hybrid ratio, FlashMorph2 achieves higher RULER scores than Uniform on GLA and GDN. §5.3

Limitations

  • Stated: FlashMorph2 requires 1.7-2.6× the FLOPs and 1.9-2.4× the GPU hours of FlashMorph for layer selection; the paper says this overhead is confined to a one-time selection stage.
  • Experiments leave open: main comparisons cover Qwen3-0.6B and Qwen3-1.7B, while the larger 8B and 30B-A3B results in Appendix C are reported only with Lightning Attention.
  • Experiments leave open: layer-selection efficiency is reported across 0.6B-8B models, but not for the 30B-A3B backbone that appears in benchmark tables.

Key points

  • FlashMorph2 evaluates sampled discrete hybrid architectures end to end using their own hidden states and jointly optimizes layer-selection scores and model weights under the recovery objective. §Abstract
  • FlashMorph's layer selection uses continuous gates with teacher-forced hidden states and frozen weights, whereas the deployed model uses a discrete hybrid architecture with self-propagated hidden states and recovered weights. §3.2
  • Gumbel-Top-K sampling selects exactly K distinct full-attention layers per sample, with higher scores giving higher selection probabilities and all scores initialized to the same constant. §4.1
  • The joint objective is the expectation of the logits distillation loss over sampled hybrid architectures, with gradients for layer-selection scores and model weights obtained in a single backward pass. §4.2
  • After score optimization, the final layers are TopK of the scores; the selected model is reinitialized with the Stage 1 weights and the Stage 2 updated weights are used only to guide selection. §4.2
  • A continuous sigmoid relaxation with a binary-search threshold preserves the full-attention budget, and gradients are propagated through a straight-through estimator with implicit differentiation of the threshold. §4.3
  • Experiments use Qwen3-0.6B and Qwen3-1.7B backbones with Lightning Attention, GLA, and GDN, using a 3:1 linear-to-full attention ratio unless otherwise specified. §5.1
  • The ablation reports that removing on-policy weight adaptation replaces selected layers {6,17,19,20} with {0,1,2,26}, indicating that weight adaptation alters the preferred budget allocation. §5.3

Mind map

FlashMorph2
Off-policy mismatches
Continuous and teacher-forced computation
Frozen weights vs recovery adaptation
On-policy selection
Gumbel-Top-K discrete sampling
End-to-end self-propagated forward
Joint score and weight optimization
Budget STE
Binary-search threshold
Straight-through gradient
Conversion pipeline
Layerwise alignment
Layer selection
Logits distillation
Long-context finetuning
Experiments
Qwen3 backbones
Lightning GLA GDN
RULER LongBench recall
Findings
RULER plus 2.42
LongBench plus 1.08
Recall plus 0.76
0.72 to 3.57 GPU hours