attend op• Data kinds: tokens × tokens × tokens → tokens
• Call: import fullseye as fs; fs.ledger.attention_linear(query, key, value, causal: 'bool' = False) -> 'np.ndarray' (implementation को सीधे call करना हो तो import llmcore; llmcore.attention_linear(query, key, value, causal: 'bool' = False) -> 'np.ndarray', registry से लेना हो तो opsllmcore.get("attention_linear"))
softmax हटाया गया attention → tokens। (QKᵀ)V == Q(KᵀV) — associative नियम स्वयं।
Katharopoulos et al. 2020। softmax हटाने पर matrix product की associativity लागू होती है, इसलिए (T, T) बनाए बिना केवल (d, dv) की state काफ़ी है। यह एक ही संख्या को अलग तरह से brackets में रखना है, इसलिए उत्तर मेल खाते हैं (relative अंतर 7.1e-16), और computation O(T²d) से O(Td²) पर चला जाता है — crossover T == d पर है (measured: T=d=64 पर अनुपात 0.9, T=1024 पर 14.6 गुना)। ★T को 2048 करने पर भी अनुपात 14.4 पर रुक जाता है। formula के बताए 32 गुना तक नहीं पहुँचता — क्योंकि quadratic पक्ष bandwidth bottleneck में चला जाता है।
Args:
query: (T, d) float।
key: (S, d) float।
value: (S, dv) float। causal=True में S == T।
causal: True होने पर "केवल अपने से पहले वाले" को cumulative state से जोड़ता है (sequential 1 pass, linear time)।
Returns:
tokens (T, dv) float: softmax से नहीं गुज़रता, इसलिए row sum 1 वाला convex combination नहीं है।
attention_softmax का विकल्प नहीं, बल्कि एक अलग attention है।
• Sample data catalog (DL URL / license) — 2-D के लिए skimage.data (BSD/public) + synthetic, 3-D के लिए real data sources (Stanford/PDS आदि) के DL URL।
• Operators का स्रोत और संदर्भ — इस op family के मूल research/methods के स्रोत।
• Algorithm का मानक स्रोत (लेखक, वर्ष) और उपयोग ऊपर की family usage guide में दिए गए हैं।
• poc_attention_identities — py -3.11 examples/poc_attention_identities.py
tokens को input के रूप में लेते हैं)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 operator registry. यह per-op note tools/opdocs.py md से अपने-आप generate होता है (हाथ से edit न करें)।*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.