학술

Your Query Is My Key: Halving Attention Parameters via Cross-Head Cyclic Rings

arXiv CS.AI
CC BY
이 매체는 공공·자유 라이선스로 본문을 직접 표시합니다.

Abstract

In multi-head self-attention, the logits depend solely on the bilinear product $U_h = W_{Q,h}W_{K,h}^{\top}$.

This creates a $d_h^{2}$-dimensional gauge redundancy in each head.

Thus, we ask: Can we remove half the query-key parameters without losing directional attention?

If we keep $W_{Q,h} = W_{K,h}$, then it will remove half the parameters, but it will make the score matrix a symmetric positive semidefinite Gram matrix, which cannot express directional retrieval or negative self-scores.

In this paper, we first derive the exact identity that comes with this redundancy, and thereafter, we describe the symmetry and sign constraints when we do direct tying.

Then, we introduce a cross-head cyclic construction, which utilises only one projection per head and borrows the other from a neighbouring head to calculate the scores, forming a cyclic ring.

It will reduce the query-key parameter count, GEMM count, and optimizer states by half.

In the experimental part, we have covered associative recall, character-level language modelling, memory use, and some small-scale expressiveness tests.

In these tested cases, the cyclic model achieved competitive performance with half the query-key parameters compared to a paired setting.

These measurements do not establish any general advantage, but they have shown that the cyclic restriction can retain strong performance at the tested scale.

관련 뉴스