Retention — exponential decay 와 함께 recurrence
RetNet (Sun et al., 2023.7, arXiv:2307.08621, Microsoft Research Asia) 가 retention 메커니즘 도입, recurrence 또는 constrained 한 종류의 attention 으로 볼 수 있는 통합 primitive. 핵심 update 는 즐겁게 단순: s_n = γ · s_{n-1} + K_n^T · V_n, output o_n = Q_n · s_n. State s 는 SSM hidden state 와 정확히 같아 — fixed size, 모든 과거 토큰 요약.
Decay γ 가 디자인 선택. RetNet 은 γ 를 attention head 마다 fixed, 다른 head 가 다른 γ 값. γ ≈ 1 인 head 는 long memory 유지 (slow decay). γ ≈ 0 인 head 는 short memory 유지 (fast decay). 이게 자연스럽게 multi-scale memory hierarchy 만들어: 어떤 head 는 최근 과거에 attention, 다른 건 깊은 과거에, 다 parallel.
Positional encoding: xPos
RetNet 은 positional encoding 에 xPos 사용 — RoPE 와 밀접하게 관련된 complex-exponential rotation, retention 메커니즘의 recurrent 형태에 디자인됨. xPos 는 translation invariance 사주고 (모델이 absolute position 신경 안 쓰고, relative offset 만), recurrent computation 과 호환 유지. 개념적 level 에서는 별로 안 중요한데 구현 level 에서는 많이 중요한 종류의 detail.
왜 흥미로운가
수학적 깔끔함이 헤드라인. Retention 이 recurrence (per-token state update 로 쓸 수 있어) 이고 attention 이기도 (recurrent 형태가 exponential decay 가진 특정 종류의 attention matrix 로 unroll). 이 통합 — recurrence 와 attention 이 fundamentally 다르지 않고 continuum 위 점들이라는 — 이 RetNet 의 lasting intellectual 기여. linear-attention/SSM 쪽 이후 모든 architecture 가 이 통찰의 어떤 버전 흡수.