STAGE 01 • THE MEMORY BOTTLENECK
Unbounded Softmax KV Grows Linearly Forever
Standard GQA Transformers like Qwen/Qwen3-4B append every new token's Key and Value across all 36 layers. At 65,536 tokens, exact bfloat16 KV caches consume 9,216 MB and memory-bandwidth saturation cuts decode throughput from 59.4 tok/s down to 29.6 tok/s.
KV_Bytes = L(36) * 2 * HKV(8) * HD(128) * T * 2B → 9.22 GB @ 64k
STAGE 02 • SINK + 4C UNIFIED LOCAL RING
Chunked Execution (C = 128, 4C = 512 Ring) & CUDA Graph
Bolt-3.1 processes sequences in C = 128 token chunks. It permanently pins the first n_sinks = 4 tokens plus a unified circular loc_chunks = 4 ring (512 exact local tokens). During single-token decode, _Bolt3GraphRunner writes in-place via index_copy_ with zero allocation.
buf_k = [ sink(4) | ak_eff(128) | loc_ring(512) | (cold) ]
STAGE 03 • TRI-PARTITIONED DIVERSITY ATTRACTORS
Un-Smeared Cosine Merge & Multi-Band Eviction (S = 128)
Evicted local tokens enter S = 128 tri-partitioned slots: S_hh = 64 heavy-hitters, S_land = 48 landmarks, and S_proto = 16 un-smeared high-novelty prototypes biased by kappa * log(mass). On 16 WikiText-103 16k docs, Attractors cut KL vs SWA_W512 from 0.1705 → 0.1279 (-25.0%, M_res on) or 0.1033 (-39.4%, NoMres R6), beating equal-byte SWA and plain-HF Donor-SWA.
S = S_hh(64) + S_land(48) + S_proto(16) | bias = kappa * log(mass)
STAGE 04 • GERSHGORIN M_RES (CARTRIDGE SUBSYSTEM)
Algebraic Delta State (M_res [HKV, HD, HD]) for .vsa Cartridges
Overflow tokens write into a fixed float32 delta matrix (beta_proj, eta_proj, trained via L_mem) enabling exact 0.0-residual forget() subtraction for external .vsa neural cartridges. On standard QA/LM without cartridges, swapping M_res's 1.0 MiB/layer budget into +2C local ring tokens (OptB_NoMres_R6, same GPU bytes) lowers KL (0.0622 vs 0.0750) and lifts GSM8K@8192 to 86.0%.
M_res ← gamma * M_res + K_ev^T @ ((V - K_ev @ M_res) * beta / gershgorin)
STAGE 05 • OPTION-B SPARSE COLD-ARMED LAYERS
Sparse Mid-Deep Exact Buckets Capped Past 32,768 Tokens
In bolt3.1-qwen3.5-4b.pth, 24 native GatedDeltaNet layers and 5 pure O(1) layers pair with 3 mid-deep Cold-Armed layers ([11, 19, 27]) holding up to max_cold_blocks = 256 with cold_hit deduplication. Past 32k, oldest blocks invert RoPE (-ok_pos) and overflow into Attractors & M_res, locking state flat near 873 MB.
cold_cap ∈ {0, 16, 32, 64, 128, 256} | overflow: ok_kr = apply_rope_pos(ok_p, -ok_pos)
STAGE 06 • NEURAL CARTRIDGES & EXACT FORGET
Disk-Backed .vsa State Cartridges (0.0 Erase Residual)
Bolt3MemoryBank pre-encodes external documents into disk .vsa cartridges and routes queries by normalized embedding cosine similarity (37.44 ms avg route, 100% recall on 4/4 benchmarks). Because updates to M_res are linear delta traces, forget() subtracts gamma^k * delta with 0.0 algebraic residual.
states[li] ← states[li] - (gamma_delta ** n_res_steps) * delta (res = 0.0)
STAGE 07 • BOLT-3.3 SUB-BLOCK TIER-2 DIGESTS & PINNED DMA
4×32-Token Sub-Boxes (42% Tighter) + Async Pinned Paging
RoPE rotates keys across a 128-token block, loosening coarse single-box [kmin, kmax] bounds. Bolt-3.3 splits every cold/Tier-2 block into 4 tight 32-token sub-boxes (vol4/vol1 = 0.58, backward-compatible with 4D digests) to cut false positives in topk=8 retrieval with zero retraining, while _Tier2BlockStore pins host RAM blocks and issues non_blocking=True H2D DMA transfers.
kmin/kmax: (B, HKV, N_blk, 4, HD) | ub = max_sub(q+ · kmax + q- · kmin)
STAGE 08 • BOLT-3.3 NATIVE AVX-512F / AVX2+FMA CPU ENGINE
18.96 tok/s CPU Decode via Split-Half Q4_0 + Fused SwiGLU
bolt3/cpu_engine.py auto-compiles native C++/OpenMP SIMD kernels with explicit AVX-512F & AVX2+FMA split-half Q4_0 (int4) and Q8_0 (int8) GEMV/GEMM plus FusedSwiGLUMLP (fusing gate_proj + up_proj into 1 GEMV). On meta-llama/Llama-3.2-3B-Instruct (12 threads), int4 hits 18.96 tok/s decode & 60.25 tok/s prefill (3.81e-6 vs PyTorch dequant), with int8 at 14.74 tok/s and bf16 at 11.62 tok/s.
python -m bolt3 serve --ckpt model.pth --cpu --cpu-dtype int4 | bolt3 cpubench