NLL-Guided Full-Attention Layer Selection for Training-Free Sliding-Window Adaptation

Qiong Tang, Xiangkun Hu, Xiangyang Liu, Yiran Chen, Yunfan Shao
6/26/2026
cs.CLcs.AI
transformer-attention

No confident code implementation found for this paper.

Abstract

Hybrid attention models that mix full and sliding-window attention across layers offer a promising approach to efficient long-context inference, but the critical question of \emph{which layers} should retain full attention remains unsolved. Existing methods use either fixed periodic patterns or attention-based heuristics that may not capture what matters for downstream accuracy.

Show full abstract

We propose NLL-guided layer selection, a training-free method that directly measures each layer's importance by computing the negative log-likelihood degradation on answer tokens when that layer uses sliding-window instead of full attention. On LongMemEval with Qwen3-4B, our method achieves 64.6\% accuracy using only 1/4 full-attention layers, matching the 1/2-FA periodic baseline (65.0\%) while halving the computational budget. NLL-guided selection outperforms the SWAA-reported periodic 1/4-FA baseline by 10.4 percentage points and a matched LightTransfer-style baseline by 26.4 percentage points. De-confounding analysis shows the signal is consistent with long-range attention needs rather than generic layer sensitivity. The method requires only $\sim$15 minutes of one-time calibration, advancing the efficiency-accuracy Pareto frontier for long-context LLM deployment.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tang2026nllguided,
  title  = {NLL-Guided Full-Attention Layer Selection for Training-Free Sliding-Window Adaptation},
  author = {Qiong Tang and Xiangkun Hu and Xiangyang Liu and Yiran Chen and Yunfan Shao},
  year   = {2026},
  eprint = {2606.27791},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.27791v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2606.27791.svg)](https://codeofpaper.com/paper/2606.27791)

Discussion