← All Engineering Notes / SCARLET Quadrilogy, Paper II

[systems] Paper II · SCARLET Quadrilogy · 29 November 2026

SCARLET Is All You Need

Stateful Cognitive Architecture for Recurrent, Local-First, Expert Ternary: hardware isomorphism, cryptographic provenance and commodity-CPU distributed inference. Quadratics, 64–130 GB KV caches and 300 W accelerators are an infrastructure choice, not a law of arithmetic.

12.19 tok/s on a NZ$3 laptop max_err = 0 MAC-sealed frames Limits stated

1. Abstract

Modern sequence modelling has achieved the impressive economic feat of turning every prompt into a metered datacenter utility bill: quadratic O(T²) attention, 64–130 GB KV caches at 512K context, 300 W accelerators and sprawling Python/C++ runtimes. This paper, first released publicly here, proposed replacing cloud-bound floating-point attention with linear-time state-space models, ternary arithmetic and cryptographic state provenance.

Under SCARLET we unify dense ternary transformers (BitNet 2B-4T), O(1)-memory state-space backbones (BitMamba-2 1B), looped recurrent depth (R ∈ {1..5}) and 7-expert block-discrete diffusion (FM-MOSTEST, 273.39M parameters) onto one zero-multiply POPCNT substrate (TRT2). On unmodified commodity hardware it drives a NZ$3 batteryless 2013 15 W Haswell laptop (i5-4300U) at 12.19 tok/s bit-exact argmax (9.4× scalar), accelerates BitMamba-2 1B to 30.20 tok/s with 144.7 ms cold boot (max_err = 0), and coordinates two consumer laptops over standard LAN (AVX2 plus hardware AVX-512 VPOPCNTDQ) at 22.64 tok/s combined. Every 2.1 MB BMS3 snapshot, 8-slot salience checkpoint and LAN frame is sealed with a 256-bit keyed BLAKE3 MAC, with live HTTP 403 on a forged MAC at the parser boundary.

2. Hardware isomorphism and surgical unification

2.1 The zero-multiply TRT2 substrate

Every ternary weight matrix w ∈ {−1, 0, +1} is stored as 64-byte aligned, word-interleaved DualTrit { pos: u64, neg: u64 } memory-mapped via MADV_HUGEPAGE. Decomposing INT8 activations into two's-complement bit-planes, with D = pos ⊕ neg and mk = neg ⊕ (D ∧ Bk), gives exact integer dot products with zero multiplications per weight:

sum_j w_j x_j = sum_{k=0..7} c_k popcnt(m_k) + popcnt(neg)

Runtime dispatch selects AVX-512 VPOPCNTDQ, AVX2 Muła vpshufb, ARM64 NEON vcntq_u8, or scalar SWAR without a code change.

2.2 Bit-exact SSM unification and 2048 → 1024 stitching

Converting BitMamba-2 1B (32 layers, d = 2048, vocabulary 50,257 GPT-2 BPE) from 644.3 MB of legacy 2-bit packing into 65 native TRT2 matrices (228.6 MB plus FP32 norms and embeddings) completes in 16.0 s with popcnt_max_err = 0. On an Intel Core i7-13620H that cuts standalone cold boot 5.2× (754.8 → 144.7 ms) and raises sustained throughput +20.9% (24.97 → 30.20 tok/s).

To condition the 7-expert 64-token block-diffusion head on BitMamba-2 1B without quadrupling matrix area to roughly 1.0B parameters, SCARLET introduces a 2.1M-parameter surgical StitchBridge (8.1 MB FP32, under 0.2 ms overhead):

h_stitched_kv = h_kv + tanh(alpha) RMSNorm(h_1B W_bridge), alpha_0 = 0

Trained for 2,500 steps on clean conversational and educational splits with Slot-0 pinned at +3.5 and a frozen trunk anchor, Stitched v8 drops clean validation perplexity from 30.66 to 23.62 (−23.0%, +0.26096 nats, tanh(alpha) = −0.22833) while sustaining 10.36 tok/s live on an AVX2 CPU.

3. Cryptographic provenance across three layers

  1. MAC-sealed BMS3 Radix SSM snapshots. BitMamba-2 1B recurrent state persists to disk as a flat 2.1 MB file sealed with a 256-bit keyed BLAKE3 MAC, restoring bit-exactly in under 1 ms with constant O(1) RAM.
  2. Crash-safe salience working memory. An 8-slot Prefrontal Cortex persists active context through atomic .json + .bak writes sealed by keyed BLAKE3.
  3. Authenticated episodic recall and LAN peers. A 256-bit SimHash episodic graph executes exact POPCNT recall in 112.9 μs per 10,000 entries with a native gap_signal. Across LAN peers every frame is MAC-checked, and a single-bit forgery is rejected live with HTTP 403.

4. Commodity silicon and LAN receipts

All measurements were collected in pure Rust (rustc 1.99.0 --release) with no Python, no C++ and no GPUs, across unmodified consumer hardware spanning 2013 to 2026.

WorkloadCold startThroughputParityHardware
BitNet 2B-4T (TRT2 + INT8 head)58.1 ms†12.19 tok/sargmax exact2013 15 W i5-4300U (NZ$3 laptop), 9.4× scalar
BitNet 2B-4T (exact / top-64)—15.89 / 27.16 tok/sexact / 160 of 1602013 i5-4570, 4 cores
BitMamba-2 1B (native TRT2)144.7 ms30.20 tok/smax_err = 0i7-13620H, 5.2× boot, +20.9% versus 2-bit
FM-MOSTEST Stitched v8150.3 ms10.36 tok/smax_err = 0i7-13620H, 23.62 PPL (−23.0%)
Two-node LAN distributed77.7 ms22.64 tok/sMAC-checkedi7-13620H (AVX2) + i7-1165G7 (AVX-512)
Episodic SimHash graphunder 1 ms112.9 μs per 10kexact256-bit BLAKE3 + POPCNT gap_signal
BMS3 Radix SSM cacheunder 1 ms2.1 MB flatkeyed BLAKE3O(1) RAM, bit-exact restore, tamper-evident
Android arm64-v8a bridge—deployedprovenance-stampedGalaxy S25 Ultra (Snapdragon 8 Elite, NEON)

† The 58.1 ms figure is a cold 30-layer ternary pass over 521 MB of weights at 8.97 GB/s — a weight pass, not a process start.

5. The Bitter Lesson versus the Sovereign Lesson

Rich Sutton's Bitter Lesson notes that general methods leveraging massive compute eventually dominate hand-crafted heuristics. Cloud-hosted floating-point Transformers are the commercial apex of that observation — an undifferentiated compute sponge tuned for hyperscaler balance sheets.

Bare-metal engineering yields a corollary we call the Sovereign Lesson: scale without hardware isomorphism is rent-seeking. Providers did not standardise on quadratic floating-point attention because it is the only path to capable inference; they standardised on it because it aligns with metered API dependency. Replacing multiplies with POPCNT, gigabyte KV caches with 2.1 MB MAC-sealed snapshots, and 300 W racks with authenticated consumer-laptop LAN swarms returns inference economics to hardware people already own.

6. Boundaries

SCARLET v1.4 is a compute-constrained, staged-training proof of concept. Three boundaries are disclosed rather than hidden:

Every figure here is an author build-log measurement on the named hardware with rustc 1.99.0 --release. None has been reproduced by a third party, and no external baseline is claimed.

References

  1. A. Vaswani et al., “Attention Is All You Need,” NeurIPS, 2017.
  2. S. Ma et al., “The Era of 1-bit LLMs,” arXiv:2402.17764, 2024.
  3. T. Dao and A. Gu, “Transformers are SSMs,” ICML, 2024.
  4. M. Arriola et al., “Block Diffusion,” ICLR, 2025.
  5. W. Muła, N. Kurz and D. Lemire, “Faster Population Counts Using AVX2 Instructions,” The Computer Journal, 61(1):111–120, 2018.
  6. M. S. Charikar, “Similarity Estimation Techniques from Rounding Algorithms,” STOC, 2002.
  7. J. O'Connor et al., “BLAKE3: One Function, Fast Everywhere,” blake3.io, 2020.
  8. D. Kelly, “TritCore v1.4,” Paper IV, 29 Nov 2026.