attend op• 데이터 종류: tokens × tokens × tokens → tokens
• 호출: import fullseye as fs; fs.ledger.attention_linear(query, key, value, causal: 'bool' = False) -> 'np.ndarray'(구현을 직접 호출하려면 import llmcore; llmcore.attention_linear(query, key, value, causal: 'bool' = False) -> 'np.ndarray', 원장에서 가져오려면 opsllmcore.get("attention_linear"))
softmax를 뺀 어텐션 → tokens. (QKᵀ)V == Q(KᵀV) — 결합법칙 그 자체.
Katharopoulos 등 2020. softmax를 빼면 행렬곱의 결합법칙을 쓸 수 있어, (T, T)를 만들지 않고(d, dv)의 상태만으로 충분하다. 같은 수를 다르게 괄호로 묶은 것이므로 답은 일치하고(상대 차이 7.1e-16), 계산량은 O(T²d)에서 O(Td²)로 옮겨 간다 — 교차점은 T == d(실측: T=d=64에서 비 0.9, T=1024에서 14.6배). ★T를 2048로 해도 비는 14.4에서 포화한다. 식이 말하는 32배에는닿지 않는다 — 2차 쪽이 대역폭 병목에 들어가기 때문이다.
Args:
query: (T, d) float.
key: (S, d) float.
value: (S, dv) float. causal=True에서는 S == T.
causal: True이면 "자기보다 앞만"을 누적 상태로 더한다(순차 1회, 선형 시간).
Returns:
tokens (T, dv) float: softmax를 거치지 않으므로 행 합 1의 볼록 결합이 아니다.
attention_softmax의 대체가 아니라 다른 어텐션이다.
• 샘플 데이터 카탈로그(DL URL / 라이선스) —— 2-D 는 skimage.data(BSD/public)+ 합성, 3-D 는 실데이터 소스(Stanford/PDS 등)의 DL URL.
• 연산자의 내력·참고문헌 —— 이 연산자 족의 바탕이 된 연구/기법의 출처.
• 알고리즘의 정전(저자·연도)과 용도는 위의 패밀리 사용 가이드에 적혀 있습니다.
• poc_attention_identities — py -3.11 examples/poc_attention_identities.py
tokens 를 입력으로 받는 것)rms_norm · rope_rotate · attention_scores · attention_apply · attention_softmax · attention_tiled · attention_grouped · kv_cache_decode
attend)attention_softmax · attention_tiled · attention_grouped
*Provenance: llmcore.py — LLMCORE 연산자 레지스트리. 이 op 노트는 tools/opdocs.py md 가 자동 생성합니다(직접 편집하지 마세요).*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.