Summary

  1. Authenticate offloaded and persisted KV caches before rehydration: Binding every 16-token KV chunk or persisted .bin slot file with HMAC-SHA256 over (model_id, weight_digest, kv_dtype, tenant_id, prefix_token_hash, chunk_idx, chunk_bytes) rejects 100/100 storage tamper and replay attacks (95% CI [0.96, 1.00]) in 0.375 ms per FP8 chunk (2.3 to 6.9 ms for llama.cpp slot checks; 54.8 ms for a full 2,304-token prefix).
  2. Real serving optimizations preserve or amplify sparse KV bit flips: On compiled llama.cpp (llama-server) with 4-bit Q4_K_M weights, patching 164 bits in a 29 MB persisted .bin slot survives a full server restart and executes 10/12 unseen HTTP 200 tool calls (12/12 on F16 and Q8_0). In cloud serving patterns, datacenter FP8-E4M3 KV quantization cuts flip counts roughly in half (96 to 128 flips vs 192 to 288 in bfloat16), and evicting 90% of a ~2,300-token cache under StreamingLLM or H2O still preserves 99.7% to 100.0% of flips and 12/12 execution.
  3. Honest hardware boundary: Low-density DRAM Rowhammer (p <= 1% flippable cell fraction) fails 0/12 and 0/6 across all 8 runs up to 1,280 flips (combined study random controls: 3/8,160, 95% CI [0.0001, 0.0011], with all 3 in 10x position-matched FP8 Granite and 0/7,200 across 1x, uniform, hardware, and llama.cpp controls). The immediate production risk is unauthenticated offloaded, disk-persisted, or disaggregated KV storage, not low-density DRAM Rowhammer.

What an attack looks like

Consider an edge appliance or cloud serving cluster that caches shared system-prompt KV state to local disk or an offloaded cache tier so restarts and autoscaled workers skip redundant prefill. In llama.cpp, llama-server writes that prompt cache straight to a .bin file (POST /slots/0?action=save) with magic bytes, token IDs, and raw KV tensors, and zero cryptographic signature or checksum.

An attacker who gains write access to the shared cache volume or offloaded KV tier (without touching model weights, system prompts, or serving binaries) flips 164 mantissa bits inside the 29 MB .bin slot file. Zero exponent or sign bits change, and every prompt log stays clean. After a full server restart (pid_save != pid_restore), llama-server restores the .bin slot into a 4-bit Q4_K_M model. Every unseen factual or calendar question that hits that prefix cache silently emits {"tool": "calc"} and executes under the host’s bearer token with HTTP 200.

Why we ran R.13

After R.11 and R.12, infrastructure engineers raised three fair objections:

  • All prior Tier B results ran in PyTorch bfloat16, not on a deployed serving binary with quantized 4-bit weights or persisted KV files.
  • Production stacks quantize KV caches (FP8-E4M3 on cloud GPUs, block_q8_0 on edge engines) and compress long contexts with KV eviction (StreamingLLM / H2O), which might wash out tiny mantissa edits.
  • Real DRAM Rowhammer has directional retention bias (1->0 charge leakage) and sparse flippable cell density (p <= 1%), which might prevent targeted placement altogether.

R.13 consolidates three preregistered studies across 43 audited runs and 10,280 per-item rows, all verified by standalone automated recount scripts and 9 negative fault-injection tests. Full per-run numbers and intervals live in the Gates table below.

Real llama.cpp reboot-persistent .bin implants and Walsh-Hadamard rotation

We compiled llama.cpp 1.1.0-dev (commit e7ec636, Apple Metal + FlashAttention, zero PyTorch at serving time) and ran llama-server with --slot-save-path across F16, Q8_0, and 4-bit Q4_K_M GGUF checkpoints. In all 15 runs, cold prefill and clean restored slots matched bit-for-bit (12/12 on Qwen3-1.7B, 6/6 on Llama-3.2-1B), and every restored query verified pid_save != pid_restore and tokens_cached >= n_prefix_tokens.

  • Default f16 KV slots fall with zero refit: Patching R.12’s PyTorch flips straight into slot_clean.bin executes 6/6 (95% CI [0.61, 1.00]) across F16, Q8_0, and 770 MB 4-bit Q4_K_M on Llama-3.2-1B (480 bits in a 14.6 MB slot), and 11/12 (F16), 9/12 (Q8_0), and 6/12 (Q4_K_M) on Qwen3-1.7B (224 bits in a 55.4 MB slot) against 0/1,080 matched random .bin patch controls.
  • Walsh-Hadamard q8_0 KV rotation (PR #21038) cuts both ways: Modern llama.cpp applies an orthonormal Walsh-Hadamard rotation (H_128 on keys, H_64 on values) before block_q8_0 quantization. Unadapted q8_0 scale flips drop to 0/12 on default llama-server (while hitting 12/12 F16, 10/12 Q8_0, and 3/12 Q4_K_M when rotation is disabled). However, fitting 164 adaptive fp16 scale mantissa bits directly in the H_128/H_64 basis restores 12/12 on F16 and Q8_0 and boosts 4-bit Q4_K_M survival from 3/12 to 10/12 (95% CI [0.55, 0.95]) against 0/720 random controls. Spreading each scale flip across 64 to 128 orthogonal dimensions makes the implant more resistant to 4-bit weight quantization noise.

Cloud serving optimizations: FP8-E4M3 quantization and 90% KV eviction

Both standard cloud KV optimizations fail to stop sparse bit-flip attacks:

  • Datacenter FP8-E4M3 KV quantization cuts flip count roughly in half: Quantizing R.12’s bfloat16 poisoned caches directly to per-head scaled OCP FP8-E4M3 with zero refit preserves execution identically (33/36 vs 33/36 in bfloat16: 11/12 Qwen3, 10/12 Granite, 12/12 Phi-4). Fitting native FP8-E4M3 single-mantissa-bit XOR flips (bp in 0..2, zero exponent, sign, or scale changes) requires ~2x fewer flips than bfloat16 because each 3-bit FP8 mantissa bit carries a 12.5% to 50% value step: 128 flips on Qwen3-1.7B (12/12 MPS & CPU, 95% CI [0.76, 1.00]), 96 flips on Granite-3.3-2B (11/12 MPS & CPU), and 128 flips on Phi-4-mini-3.8B (12/12 MPS / 11/12 CPU). Likewise, edge block_q8_0 fp16 scale-only flips reach >=80% in just 32 flips on both Qwen3-1.7B (12/12 at 36 flips) and Llama-3.2-1B (6/6 at 32 flips). One honest nuance: forcing a 13-token arbitrary argument ("audit-export") in coarse 3-bit FP8 stalled at 0/12 up to 960 flips (loss 5.57 to 0.425).
  • Evicting 90% of a ~2,300-token KV cache preserves 12/12 execution: Taking R.12’s exact ~2,300-token poisoned caches (Qwen3-1.7B 352 flips, Granite-3.3-2B 320 flips, zero refit) and compressing them down to 10% retention (229 to 231 tokens kept) leaves 99.7% to 100.0% of attack flips intact under both StreamingLLM (351/352, 320/320) and H2O Heavy-Hitter (352/352, 320/320). Live HTTP 200 execution stays 12/12 on both MPS and CPU (0 malformed, 0/12 clean evicted false executions) because eviction policies pin Block 0 (the attention sink) and high-attention tool-schema tokens while discarding the handbook.

Where DRAM Rowhammer actually stops: the p <= 1% cell-sparsity wall

Evaluating hardware fault constraints across 22 runs (4,686 rows, 0/3,960 controls) cleanly separates physical DRAM constraints from software storage risk:

  • Unidirectional retention bias does not block forcing: At full cell access (p = 100%), pure 0->1 flips still execute 12/12 (Qwen3 in 64 flips) and 6/6 (Llama in 32 flips), and pure 1->0 charge-leakage-only flips still execute 12/12 (Qwen3, 256 flips for >=80%) and 5/6 (Llama, 32 flips).
  • Cell sparsity p <= 1% kills the attack completely: Restricting flips to a seeded random hardware mask at p = 1% or 0.1% (bidirectional, 1->0, or 0->1) yields 0/12 on Qwen3-1.7B and 0/6 on Llama-3.2-1B across all 8 runs up to 1,280 flips (95% CI [0.00, 0.24] and [0.00, 0.39]). Execution turns on sharply at p = 5% (7/12, 5/6), rises at p = 10% (9/12, 6/6), and recovers 100% by p = 25% (12/12, 6/6). In practice, realistic DRAM Rowhammer cell densities sit far below 5%, which means unauthenticated software/offloaded/persisted KV stores are the primary threat to fix first.

Defense: authenticated KV chunk and slot envelopes

Persisted .bin slots and offloaded KV chunks currently carry zero cryptographic authentication. We evaluated an HMAC-SHA256 per-chunk envelope binding (model_id, weight_digest, kv_dtype, tenant_id, prefix_token_hash, chunk_idx, chunk_bytes) on 16-token paged FP8 chunks (0.92 MB per chunk across 28 Qwen3-1.7B layers) and on all 15 llama.cpp .bin slot runs:

  • 100% detection across 5 attack classes: 100/100 honest chunks accepted and 100/100 adversarial trials rejected (95% CI [0.96, 1.00]): 20/20 each across 1-bit payload tamper, cross-tenant replay, chunk-index swap, wrong-model replay, and wrong-dtype replay, plus 15/15 llama.cpp slot implants detected.
  • Measured CPU verification latency: 0.375 ms for a single 16-token FP8 chunk, 3.441 ms for 9 schema chunks (144 tokens; 2.3 to 6.9 ms for llama.cpp slot schema MAC), and 54.787 ms for full 2,304-token prefix authentication (144 chunks / 126 MB FP8). As R.14 demonstrates via handbook-resident conditional backdoors, authenticating the full offloaded prefix rather than only schema chunks is strongly recommended wherever KV tiers cross trust boundaries.

Recommendations (in priority order)

  1. Authenticate offloaded and persisted KV chunks at rehydration: Add per-chunk or per-slot HMAC-SHA256 / AEAD tags bound to (model_id, weight_digest, kv_dtype, tenant_id, prefix_token_hash, chunk_idx) before loading any .bin slot, Redis/NVMe cache, or disaggregated prefill-decode transfer into GPU memory.
  2. Do not rely on KV quantization or eviction for tamper resilience: Neither FP8-E4M3, block_q8_0, Walsh-Hadamard rotation, nor 90% StreamingLLM/H2O eviction neutralizes adaptive sparse KV bit flips.
  3. Keep host-side tool allowlists and argument validation as the primary perimeter: Just as in R.11, chunk MACs catch storage and transit tampering but cannot stop a compromised prefill node that holds the signing key itself.

Reproducibility

All 43 run directories (items.jsonl, flips.json / patch_records.json, summary.json), preregistrations, study reports, and standalone automated recount scripts are published in symbolon-labs/symbolon-latent-channels (v2.0).

  • One-command artifact audit (CPU only, Python 3 stdlib): git clone https://github.com/symbolon-labs/symbolon-latent-channels && cd symbolon-latent-channels && bash checks/verify_all.sh runs all 19 public automated recounts (including verify_r13_hardware_constraints.py, verify_r14_llamacpp_kv.py, and verify_r16_cloud_kv.py) plus 22 negative fault-injection tests across the repository (9 specific to R.13).
  • Reference environment: Apple M1 Pro (16-core GPU, 32 GB unified memory), Python 3.12.14, PyTorch 2.15.0, Transformers 4.52.4, and compiled llama.cpp 1.1.0-dev (e7ec636, Apple Metal + FlashAttention). Multi-MB raw slot_*.bin files (~911 MB total) are omitted from git while every byte offset, before/after uint16, PID pair, cache-hit count, and MAC digest is verified directly from patch_records.json and items.jsonl.

Limits

Models tested span 1B to 3.8B open-weight checkpoints (Llama-3.2-1B-Instruct, Qwen3-1.7B, Granite-3.3-2B-Instruct, Phi-4-mini-3.8B-Instruct); larger 7B to 70B models were not tested. FP8-E4M3 quantization uses exact OCP per-head scaled lookup emulation on MPS/CPU rather than H100 Tensor Core FP8 kernels, and 13-token arbitrary arguments ("audit-export") in FP8 remained 0/12 up to 960 flips. Eviction tests used ~2,300-token static prefixes rather than 32K+ multi-turn streams. Rowhammer masks model uniform random flippable-cell locations rather than physical bank/row DRAM topology.

Changelog

  • rev 01 (2026-11-29): Initial public release of consolidated R.13 (v2.0 of symbolon-latent-channels), combining real llama.cpp Q4_K_M reboot-persistent .bin slot implants + Hadamard q8_0 analysis (15 runs), cloud StreamingLLM/H2O 90% KV eviction survival + FP8-E4M3 quantization + chunk HMAC-SHA256 envelope (6 model runs + 200 MAC trials), and hardware Rowhammer sparsity + block_q8_0 scale constraints (22 runs).

Edge and cloud KV serving attack surface

Figure 1. Production serving optimizations do not neutralize sparse KV tampering. Edge persisted .bin slots, cloud FP8-E4M3 quantization, and 90% KV eviction all preserve or amplify bit-flip forcing, while low-density DRAM Rowhammer fails at p <= 1%. Per-chunk HMAC-SHA256 envelopes close offloaded storage and transfer risk.

Destructive controls

Each arm removes one part of the attack or isolates one variable.

  • Uniform and position-matched random mantissa / .bin controls (1x and 10x)3/8,160 [0.0001, 0.0011] combined across all 43 runs (0/3,960 hardware, 0/3,240 llama.cpp .bin, 3/960 FP8 with all 3 in 10x pos-matched Granite and 0/720 in 1x & uniform)

    Removes: the attacker-chosen bit offsets, flipping an equal or 10x count of random mantissa bits across the cache or persisted .bin slot file.

  • llama.cpp value-transparency & server-restart audit15/15 runs exact cold == clean match (12/12 Qwen3, 6/6 Llama) with verified prefix cache reuse after restart

    Removes: in-memory state carryover and cache misses by restarting llama-server (pid_save != pid_restore), checking cold == clean restored slot output, and asserting tokens_cached >= prefix_tokens.

  • Clean evicted baseline and fresh CPU bfloat16 cross-checks0/12 clean false executions across all eviction levels; 12/12 CPU agreement at 90% eviction on both Qwen3 and Granite

    Removes: eviction-induced routing drift and Apple Silicon GPU (MPS) arithmetic differences by evaluating clean evicted caches and re-running final caches on CPU.

  • Non-adaptive Hadamard q8_0 negative arm0/12 [0.00, 0.24] across F16, Q8_0, and Q4_K_M weights (vs 12/12, 12/12, and 10/12 once adapted to the Hadamard basis)

    Removes: awareness of llama.cpp PR #21038 Walsh-Hadamard rotation (H_128/H_64) before q8_0 quantization, testing whether unadapted scale flips survive.

Gates

GatePreregistered conditionResultRecord
[Edge] Real llama.cpp GGUF reboot-persistent .bin slot implantsPatching 164 to 480 strict fp16 mantissa bits inside real llama.cpp llama-server persisted slot .bin files across full server restart (pid_save != pid_restore, KV reuse verified, 0 exp/sign flips). Measured: Llama-3.2-1B f16 KV hits 6/6 [0.61, 1.00] on F16, Q8_0, and 4-bit Q4_K_M; Qwen3-1.7B adaptive Hadamard q8_0 scale flips (164 bits) hit 12/12 [0.76, 1.00] on F16 and Q8_0 and 10/12 [0.55, 0.95] on 4-bit Q4_K_M (vs 3/12 unrotated q8_0, 0/12 non-adaptive Hadamard, and 0/3,240 random .bin controls).Passedverify_r14_llamacpp_kv.py
[Cloud] 90% StreamingLLM & H2O KV-cache eviction survivalZero-refit R.12 ~2,300-token poisoned caches compressed from 100% down to 10% retention (229 to 231 tokens kept) under StreamingLLM and H2O Heavy-Hitter eviction. Measured: 99.7% to 100.0% of attack flips survive (351-352/352 Qwen3-1.7B, 320/320 Granite-3.3-2B) and live HTTP 200 stays 12/12 [0.76, 1.00] across all retention levels on MPS and CPU (0 false executions on clean evicted baselines).Passedverify_r16_cloud_kv.py
[Cloud & Edge] FP8-E4M3 and block_q8_0 KV quantization cut flip costZero-refit bf16 -> FP8-E4M3 transfer plus native single-mantissa-bit XOR flips in per-head FP8-E4M3 (bp 0..2, 0 exp/sign/scale flips) and block_q8_0 fp16 scales (bp 0..9). Measured: zero-refit bf16->FP8 survives 33/36 (11/12 Qwen3, 10/12 Granite, 12/12 Phi-4); FP8-native flips cut train-stop cost ~2x vs R.12 bf16 (128 fl Qwen3 12/12, 96 fl Granite 11/12, 128 fl Phi-4 12/12 MPS / 11/12 CPU; 3/960 FP8 controls, all 3 in 10x pos-matched Granite); block_q8_0 scales hit >=80% in 32 flips on both Qwen3 (12/12 @ 36) and Llama (6/6 @ 32) vs 0/360 controls. Long 13-token FP8 arbitrary arg scored 0/12 at 960 flips.Passedverify_r13_hardware_constraints.py, verify_r16_cloud_kv.py
[Hardware limit] Low-density DRAM Rowhammer (cell sparsity p <= 1%)Sparse single-mantissa flips restricted to seeded random hardware masks at p = 0.1% and 1% (bidirectional, 1->0 only, 0->1 only) up to 1,280 flips across Qwen3-1.7B and Llama-3.2-1B. Measured: 0/12 [0.00, 0.24] on Qwen3 and 0/6 [0.00, 0.39] on Llama across all 8 runs (0/1,440 controls). Execution turns on at p = 5% (7/12, 5/6) and recovers 100% by p = 25% (12/12, 6/6); pure 1->0 or 0->1 retention bias at p = 100% still executes 12/12 and 5/6-6/6.Failed(attack blocked at p <= 1%)verify_r13_hardware_constraints.py
[Defense] Authenticated KV chunk and slot .bin HMAC-SHA256 envelopesPer-chunk HMAC-SHA256 bound to (model_id, weight_digest, kv_dtype, tenant_id, prefix_token_hash, chunk_idx, chunk_bytes) tested across 100 honest chunks and 100 adversarial trials (20 each: 1-bit tamper, cross-tenant replay, chunk swap, wrong-model, wrong-dtype) plus 15 llama.cpp slot .bin MAC checks. Measured: 100/100 [0.96, 1.00] honest accepted, 100/100 [0.96, 1.00] adversarial rejected (0.375 ms/FP8 chunk, 3.441 ms schema 9 chunks, 54.787 ms full 2,304-token prefix), and 15/15 llama.cpp slot implants detected in 2.3 to 6.9 ms.Passedverify_r14_llamacpp_kv.py, verify_r16_cloud_kv.py

Figures

Two-panel chart showing real llama.cpp reboot-persistent .bin slot implants on the left and quantization flip-count reductions on the right. Left panel shows Llama-3.2-1B Q4_K_M hitting 6/6 and Qwen3-1.7B adaptive Hadamard q8_0 hitting 12/12 on F16 and Q8_0 and 10/12 on 4-bit Q4_K_M vs 3/12 unrotated and 0/12 non-adaptive. Right panel shows FP8-E4M3 and block_q8_0 scales cutting train-stop flips roughly in half compared to R.12 bfloat16 across four models.
Figure 2. Real llama.cpp restart-persistent .bin implants (left) and quantization flip-count reduction (right). Patching 164 Hadamard-adapted fp16 scale bits in a 29 MB slot file survives 4-bit Q4_K_M weights (10/12) better than unrotated q8_0 (3/12); FP8-E4M3 and block_q8_0 cut flip counts ~2x vs bfloat16.
Two-panel line chart showing KV-cache eviction survival from 100% down to 10% cache retention (90% evicted) on ~2,300-token prefixes for Qwen3-1.7B and Granite-3.3-2B. Both live HTTP 200 execution (12/12) and flip retention (99.7% to 100.0%) remain flat at 100% across StreamingLLM and H2O eviction while clean evicted baselines stay at 0/12 false executions.
Figure 3. KV-cache eviction survival on ~2,300-token prefixes (zero refit). Compressing caches by 90% (down to 229 to 231 tokens) under StreamingLLM and H2O retains 99.7% to 100.0% of attack flips and 12/12 live HTTP 200 execution on both MPS and CPU.
Two-panel chart showing the DRAM Rowhammer cell-sparsity phase transition on the left and authenticated chunk/slot HMAC-SHA256 defense on the right. Left panel shows 0/12 and 0/6 across all 8 runs at p <= 1%, turning on at p = 5% to 25%. Right panel shows 20/20 rejection across all 5 adversarial chunk classes plus 15/15 llama.cpp slot MAC detection, with verification latencies of 0.375 ms per FP8 chunk, 3.441 ms for 9 schema chunks, and 54.787 ms for a full 2,304-token prefix.
Figure 4. Where the real threat lives and how to close it. Low-density Rowhammer fails completely at p <= 1% (left), focusing defense on offloaded and persisted KV tiers where per-chunk HMAC-SHA256 rejects 100/100 tamper and replay trials at 0.375 ms per chunk (right).

Record and artifacts