Kestrom Inspect Mirror

by CAPH TECH · Tool · Text & code

Detects quantization-triggered backdoors in a model checkpoint by comparing its rounding errors against mirrored and random versions, with no original model or trigger needed.

Latest · Nov 25Adds inspect mirror and inspect disarm to Kestrom (PR #26) to detect and neutralize quantization-conditioned LLM backdoors without the original model or trigger.

AccessOpen codeRuns onmacOS

Evidence

  1. Nov 25
    Self-comparison method: builds a mirrored-rounding model and a random-sign-rounding model from the checkpoint alone; aligned rounding-error signs expose quantization-conditioned backdoors.
    Maker's claimrizumitaJapanese
  2. Nov 25
    On Qwen3.5-0.8B with MLX 4-bit affine (group size 64), benign models scored max spectral sign coherence 1.0165 versus 16.74 for a 16-layer Egashira-type attack.
    Maker's claimrizumitaJapanese
  3. Nov 25
    Across 806 benign tensors (official 0.8B and 4B, uncensored derivative, ordinary 16-layer fine-tune), rho1 had median 1.000 and max 1.0243, with zero false positives.
    Maker's claimrizumitaJapanese
  4. Nov 25
    On a 2-layer stealth attack, the behavior mirror ranked the true backdoor target token 'M' first from 64 plain Wikipedia sentences (19.01x coherence vs benign 1.003x).
    Maker's claimrizumitaJapanese
  5. Nov 25
    Weight-space scan takes about 30 seconds for a 0.8B model with no forward passes, using three metrics: spectral sign coherence, cell-boundary fraction, block collapse.
    Maker's claimrizumitaJapanese
Show all 8
  1. Nov 25
    An adaptive attacker who hid the cell-boundary histogram (b85 0.1495–0.1499) still succeeded, so b85 alone is evaded; spectral coherence (4.91–7.19) and the behavior mirror still caught it.
    Maker's claimrizumitaJapanese
  2. Nov 25
    Outlier Injection (block-collapse, arXiv 2605.15152) evaded rho1, b85 and the behavior mirror; only the single-bin-collapse metric ge90 flagged the two implanted layers (65 and 64 blocks vs max 12).
    Maker's claimrizumitaJapanese
  3. Nov 25
    Limits: validated only on Apple Silicon MLX affine quantization, mainly Qwen3.5-0.8B; GGUF, NF4, AWQ and GPTQ untested; a clean result does not prove no backdoor.
    Maker's claimrizumitaJapanese

Cost to run

Alternatives

Works with