IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo module

mla_index_kpool

K-pool compression for the DSA indexer.

A k-pooled indexer stores one candidate key per kpool consecutive tokens instead of one per token. A pooled key is a weighted average of its members, where the weights come from a softmax over a gate score plus a learned within-pool position embedding:

logits[m, c]    = gate[member m, c] + ape[m, c]
weights[:, c]   = softmax over m         # independently per channel c
pooled[p, c]    = sum_m weights[m, c] * k[member m, c]

The softmax runs per channel, not per member. One weight per member would be a different function.

Pool p covers absolute positions [p * kpool, (p + 1) * kpool) of one request. kpool_compress_kernel writes only pools whose members all arrive in the same call; a pool split across calls (some members cached in the tail ring by an earlier call, the rest arriving now) is kpool_ring_close_kernel's job instead.

Functions​

Was this page helpful?