LongCat-2.0: Sparse Attention, N-gram Embedding & Infra Terms

A reference note — companion to the interactive trace lesson on the same mechanism.

Primary sources
The arXiv link commonly assumed to cover this (2509.01322) is LongCat-Flash, the previous model — it does not describe LongCat Sparse Attention. LSA is new in LongCat-2.0 and, as of this writing, only documented in the GitHub README plus secondary reporting, not a dedicated paper.

1. Is "score" the same thing as "attention"?

Yes — a score is the raw material of attention, before it becomes a weight.

Three stages, one idea
StageWhat it isFormula shape
Score / logitRaw compatibility between a query and a keyq · k
WeightScore turned into a probabilitysoftmax(scores)
Attention outputWeighted sum of valuesΣ weight · v

Full attention: Attn(q,K,V) = softmax(qKᵗ/√d)V. Sparse attention reuses that shape twice, at two price points: a cheap indexer score that decides what's worth looking at, then the real, expensive score computed only for the winners.

Lightning Indexer — DeepSeek-V3.2 paper, eq. 1
I(t,s) = Σ (h=1..H_I) w[t,h] · ReLU( q[t,h] · k[s] ) H_I = a small number of indexer heads · ReLU chosen for throughput · runs in FP8

Then a hard top-k cutoff decides who survives — DeepSeek-V3.2's real, published number is k = 2048 out of the whole context.

fine-grained selection — eq. 2
u = Attn( h_t , { c_s : s ∈ Top-k(I_t,:) } )

The catch: the indexer still has to look at every token to score it — so indexing itself stays O(L²) even though the real attention afterward is only O(L·k). LongCat's README names this directly as "the output discontinuity and quadratic scoring bottleneck of the Lightning Indexer in DSA" — the exact problem LSA exists to fix.

2. LongCat Sparse Attention (LSA)

Three orthogonal fixes to the indexer's cost — not a change to the score → select → attend idea itself.

Verbatim from the LongCat-2.0 README
MechanismWhat it doesWhy
Streaming-aware Indexing (SI)Combines hardware-aligned contiguous access with dynamic random selectionRandom-access reads into a huge KV cache are slow (uncoalesced HBM access); SI turns fragmented reads into contiguous runs
Cross-Layer Indexing (CLI)One indexing pass serves several consecutive layers — shared every 2 layers; all 3 MTP draft steps share a single passAttention saliency is empirically stable across adjacent layers, trained in via cross-layer distillation
Hierarchical Indexing (HI)Coarse block-level score first, fine token-level selection only within surviving blocksShrinks the candidate pool before the expensive per-token scoring step

How streaming vs. full-history tokens actually get separated — a general pattern across this whole family (DSA, LSA, StreamingLLM, NSA), not unique to one indexing trick:

local window + sink tokens → always included, free everything older → indexer → top-k → attend

Final attention = local_window ∪ top_k_selected_history. LSA's Streaming-aware Indexing is specifically about making the memory access pattern hardware-friendly for whichever tokens get selected — not a separate semantic rule for what counts as local.

3. N-gram Embedding — not attention sparsity

Easy to lump in with LSA since both say "sparse" — they're unrelated mechanisms.

N-gram Embedding scales embedding parameters cheaply by giving every token an extra vector, looked up by hashing its last few token IDs. LongCat-2.0 inherits it from LongCat-Flash-Lite.

exact formula — arXiv:2601.21204, eq. 1–2
e_i = NE0(t_i) + E_n( H_n(t_(i-n+1), ..., t_i) ) H_n(...) = ( Σ_j t_(i-j) · V0^j ) mod V_n — a polynomial rolling hash into a bucket

NE0(t_i) is the ordinary token embedding. H_n hashes the last n token IDs into a bucket (base V0 = vocab size, modulus V_n = table size); E_n looks that bucket up in a separate table and adds it on top. LongCat-2.0: n up to 5, 135B parameters in this table.

rule 1 — introduce once MoE sparsity passes its sweet spot rule 2 — cap at ~50% of total parameter budget

Why it matters for the "does it sparsify attention" question: it's sparsity in parameters (via hashing), fully orthogonal to LSA's sparsity in attention computation. Two different axes, bolted onto the same model.

4. Prefill vs. decode

Opposite bottlenecks, from the LongCat-Flash paper (§6.2.2).

PhaseWhat happensBottleneckOptimized via
PrefillProcess the whole input prompt at once, build the initial KV cacheCompute-boundChunked prefill
DecodeGenerate one token at a time, autoregressivelyMemory-bound (small/irregular batches)KV-cache layout, custom kernels — where LSA/DSA pay off most

Two latency metrics fall out of the split: TTFT (time-to-first-token, prefill) and TPOT (time-per-output-token, decode). Because the two phases have opposite resource profiles, LongCat runs them on separate hardware pools — a PD-disaggregated architecture — trading network cost (shipping the KV cache over) for independent tuning of each pool.

5. The infra jargon

Training/serving infrastructure, not attention — grounded in what's published, with secondary reporting flagged.

AI ASIC superpods

Domestic (non-Nvidia) Chinese ASICs, reportedly wired in units of up to 48 machines — all-to-all high bandwidth inside the pod, RoCE fabric between pods. Same idea as Nvidia's "SuperPOD" branding, on Meituan's own chips.

6D parallelism

TP (tensor) · CP (context) · EP (expert) · DP (data) · PP (pipeline) — five standard axes — plus a new sixth, EMBP, invented specifically to shard the 135B-parameter N-gram Embedding table.

Muon optimizer

An Adam alternative: orthogonalizes the momentum-accumulated gradient of a whole weight matrix (via Newton-Schulz iteration) instead of scaling each parameter independently. Reported "customized" large-scale deployment with TP-parallel and DP-state-redundancy optimizations.

Why EMBP is the tell

It's not part of any standard parallelism taxonomy elsewhere — it exists specifically because N-gram Embedding (§3) is big enough to need its own splitting strategy, separate from how MoE experts are split.

Quick self-check