ChatPaper.aiChatPaper

하이브리드 어텐션 모델로의 변형

Morphing into Hybrid Attention Models

June 29, 2026
저자: Disen Lan, Jianbin Zheng, Yuxi Ren, Xin Xia, Xuanda Wang, Xuefeng Xiao, Xipeng Qiu, Yu Cheng
cs.AI

초록

하이브리드 어텐션 모델은 전체 어텐션 레이어의 일부만 유지하고 나머지 레이어를 선형 어텐션으로 대체하여 장문맥 효율성을 개선한다. 그러나 트랜스포머-하이브리드 변환의 효과성은 어떤 레이어가 전체 어텐션을 유지하는지에 결정적으로 의존한다. 기존의 하이브리드 레이어 선택 방법은 일반적으로 고정 배치 패턴이나 레이어별 점수화와 같은 휴리스틱 전략에 의존하며, 레이어 중요도를 개별적으로 취급하고 전역 하이브리드 구성 하에서의 상호 의존적 레이어 효과를 간과한다. 본 연구에서는 하이브리드 레이어 선택을 예산 제약 하의 부분 집합 최적화 문제로 정식화한다. 또한 트랜스포머-하이브리드 변환을 위한 효과적이고 효율적이며 확장 가능한 레이어 선택 방법인 FlashMorph(Fast LAyer Selection for Hybrid MORPHing)를 제안한다. FlashMorph는 먼저 각 전체 어텐션 레이어에 변환된 선형 어텐션 분기를 장착하여 형태 변환 가능한 모델을 구축한다. 이후 모든 모델 가중치를 고정시키고 합성 장문맥 검색 데이터에 대해 레이어별 게이트를 공동 최적화하며, 효율성을 위해 모델이 선형 어텐션에 의존하도록 유도하는 선형화 정규화를 적용한다. 학습된 게이트는 사전 설정된 전체 어텐션 예산 하에서 이산화되어 하이브리드 아키텍처를 인스턴스화하며, 이후 표준 로짓 증류 및 장문맥 미세조정이 수행된다. 광범위한 실험 결과, FlashMorph는 기존 레이어 선택 방법 대비 더 효과적인 하이브리드 구성을 발견하고, 레이어 선택 비용을 크게 줄이면서도 강력한 장문맥 재현율과 일반 벤치마크 성능을 유지하여, 그 효과성, 효율성 및 확장성을 입증한다.
English
Hybrid attention models improve long-context efficiency by retaining only a subset of full-attention layers and replacing the remaining layers with linear attention. However, the effectiveness of Transformer-to-hybrid conversion critically depends on which layers preserve full attention. Existing hybrid layer selection methods typically rely on heuristic strategies such as fixed placement patterns or layerwise scoring, implicitly treating layer importance as isolated and overlooking the interdependent layer effect under a global hybrid configuration. In this work, we formulate hybrid layer selection as a budget-constrained subset optimization problem. We further propose FlashMorph (Fast LAyer Selection for Hybrid MORPHing), an effective, efficient and scalable layer selection method for Transformer-to-hybrid conversion. FlashMorph first constructs a morphable model by equipping each full-attention layer with a converted linear-attention branch. It then freezes all model weights and jointly optimizes layerwise gates on synthetic long-context retrieval data, with a linearization regularization that encourages the model to rely on linear attention for efficiency. The learned gates are discretized under a preset full-attention budget to instantiate the hybrid architecture, followed by standard logits distillation and long-context finetuning. Extensive experiments show that FlashMorph discovers more effective hybrid configurations, preserves strong long-context recall and general benchmark performance while substantially reducing layer selection cost compared with existing layer selection methods, demonstrating its effectiveness, efficiency, and scalability.