« All posts

SIMURG: Real-Time Guard Stops LLM Decoding Corruption Mid-Stream

SIMURG is a numpy-only real-time monitor that detects and aborts LLM decoding corruption mid-stream, with zero training and conformal calibration.

SIMURG is a lightweight, numpy-only monitor that watches an LLM's token stream character by character to detect decoding corruption — repetition loops, cross-lingual drift, regurgitated boilerplate, and structural garbage — before it reaches the user. It distinguishes this failure class from factual hallucination: corruption leaves a measurable statistical signature (repetition rate, script mix, compressibility, predictive surprise) that a fluent-but-wrong answer does not.

The system holds the first 350 characters of any stream, releases them only once verified clean, then re-checks every 400 characters using an ensemble of five detectors — n-gram surprise, a Count-Min repetition sketch, rolling SimHash drift, robust-z self-calibration, and interpretable rules — fused through conformal calibration that guarantees a fixed false-alarm rate on clean output. A small online logistic model adds further robustness without requiring a GPU or training data.

On a laptop CPU, SIMURG processes roughly 197,000 characters per second, far outpacing typical LLM token throughput, and aborts corrupted streams about 590 characters after onset so the host can regenerate the answer before users ever see it. On a 243-stream synthetic benchmark spanning four failure classes, it reached 97.5% stream-level detection accuracy, with perfect recall on cross-lingual drift and content regurgitation.

For engineers running quantized, small, or self-hosted models in production, SIMURG offers a drop-in, three-line integration for catching a well-known decoding failure mode without the overhead of an LLM-as-judge call or the need for token logprob access.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work