이진 주성분 기반 해싱 어텐션을 활용한 학습 불필요한 방식
Training-Free Hashing-Based Attention via Binary Principal Components
장문 데이터를 처리하는 대규모 언어 모델(LLM)은 실제 응용 분야에서 점점 더 많이 사용되고 있지만, 자기-주의 메커니즘은 특히 디코딩 과정에서 지속적으로 증가하는 키-값(KV) 캐시를 반복적으로 처리해야 하므로 효율성 저하의 주요 원인이 됩니다. 기존의 희소 어텐션 방식은 KV 쌍의 수를 줄여 계산량을 감소시키지만, 종종 상당한 정확도 손실을 초래하거나 추가적인 학습이 필요하며, 값비싼 해싱 기술에 의존하는 경우가 많습니다. 본 연구에서는 장문 데이터를 처리하는 LLM을 위한 학습이 불필요하고 데이터 기반 해싱 어텐션 방법을 제안합니다. BinaryPC는 데이터의 이진 주성분을 계산하여 압축된 이진 해시 코드와 해당 해시 함수를 생성합니다. 기존의 데이터에 독립적인 랜덤 투영을 사용하는 Locality-Sensitive Hashing (LSH) 또는 학습된 비선형 해싱 방법과 달리, BinaryPC는 기울기 기반 학습 없이 데이터의 구조적 정보를 명시적으로 보존하는 이진 코드를 구성합니다. 다양한 모델 패밀리와 장문 벤치마크에 대한 광범위한 실험 결과, BinaryPC는 전체 어텐션 방식과 비교하여 정확도를 유지하면서 희소 및 해싱 기반 기법보다 우수한 성능을 달성함을 보여줍니다. 최신 GPU에서 BinaryPC는 FlashAttention 커널 대비 엔드투엔드 디코딩 처리량을 3.56배 향상시킵니다. 저희 코드는 https://github.com/yudaohai666/BPC 에서 확인할 수 있습니다.
Long-context large language models (LLMs) are increasingly deployed in real-world applications, yet self-attention remains a major efficiency bottleneck -- especially during decoding -- due to the necessity of repeatedly processing ever-growing key-value (KV) caches. Existing sparse attention reduce computation by attending to fewer KV pairs, but often suffer from substantial accuracy degradation, require additional training, or rely on expensive hashing. In this work, we present BinaryPC, a training-free, data-aware hashing-based sparse attention for long-context LLMs. BinaryPC constructs compact binary hash codes and corresponding hash function by computing binary principal components of data. Unlike Locality-Sensitive Hashing (LSH) with data-independent random projections or learned non-linear hashing methods, BinaryPC constructs binary codes that explicitly preserve the structural information of data without requiring gradient-based training. Comprehensive experiments across multiple model families and long-context benchmarks show that BinaryPC preserves accuracy relative to full attention while achieving superior performance among sparse and hashing-based baselines. On modern GPUs, BinaryPC improves end-to-end decoding throughput by 3.56$\times$ over the FlashAttention kernel. Our code is available at https://github.com/yudaohai666/BPC.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.