Post-training hybridization of large language models (LLMs) often replaces quadratic self-attention with sliding-window attention (SWA) to reduce KV cache usage and improve latency. Existing hybridization schemes are typically defined either at the layer level (e.g., interleaving) or at the head level via static rankings from local to global. Layer-level schemes ignore that local and global dependencies are routed through heads within the same layer, while static head-level rankings suffer from entanglement: a head's local/global behavior can change after hybridization. We propose BOSCH, Black-box Binary Optimization for Short-context Head Selection, a training-free method that formulates the problem as a Large Neighborhood Search and decomposes it into three subproblems: (i) layer-importance detection via small-budget black-box probes, (ii) adaptive per-layer SWA-ratio assignment based on these sensitivities, and (iii) grouped head-level optimization within ratio buckets. Extensive experiments on 4 LLMs ranging from 1.7B to 30B parameters, across 4 SWA ratios, show that BOSCH consistently outperforms layer-level heuristics and 6 strong static head-level methods, with larger gains at higher SWA ratios. Under continual pretraining, BOSCH recover original long-context performance faster and to a higher level. Analysis of the selected heads reveals substantial turnover for BOSCH across different SWA ratios, underscoring the importance of performing head-level selection for each target ratio rather than relying on fixed locality rankings.
Attention Heads of Large Language Models: A Survey
Institute for Advanced Algorithms Research (IAAR)(高级算法研究院(IAAR));Institute for AI Industry Research (AIR), Tsinghua University(清华大学人工智能产业研究院);Research Institute of China Telecom(中国电信研究院)
Efficient Hallucination Detection for LLMs Using Uncertainty-Aware Attention Heads
Mohamed bin Zayed University of Artificial Intelligence (MBZUAI)(莫扎德人工智能大学);ETH Zurich(苏黎世联邦理工学院);Independent Researcher(独立研究者);Applied AI Institute(应用人工智能研究所)
Interpreting and Exploiting Functional Specialization in Multi-Head Attention under Multi-task Learning
State Key Laboratory of Multimodal Artificial Intelligence Systems(多模态人工智能系统国家重点实验室);Institute of Automation, CAS(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)
Beyond Black-Box Interventions: Latent Probing for Faithful Retrieval-Augmented Generation
School of Informatics, Xiamen University(厦门大学信息学院);The Hong Kong Polytechnic University(香港理工大学);University of Chinese Academy of Sciences(中国科学院大学);Alibaba Group(阿里巴巴集团);Key Laboratory of Digital Protection and Intelligent Processing of Intangible Cultural Heritage of Fujian and Taiwan (Xiamen University), Ministry of Culture and Tourism, China(福建省和台湾非物质文化遗产数字化保护与智能处理重点实验室(厦门大学),中华人民共和国文化和旅游部,中国)