SGLang Integrates Iris for Real-Time Token-Level Safety Monitoring
Summary:Project Iris adds two complementary monitoring layers to SGLang. Stateless linear or MLP probes and stateful minGRU probes score hidden states while tokens are generated, allowing operators to steer or stop a response; Iris Content Guard adds multi-label, per-token conversation classification through an extended `/v1/classify` endpoint. Reflection also open-sourced the Iris Safety Evaluations benchmark, while ICG is distributed as an open-weight classifier with 28.7 billion total and 3.2 billion
What Changed: Moving Safety Decisions Into the Generation Loop
Project Iris does not attach another heavyweight review model to every request. Instead, it separates risk detection into two layers. Activation probes inspect the model's internal hidden states while tokens are generated, while Iris Content Guard reviews full conversations in a separate classification service. The former provides low-cost, real-time token screening; the latter performs more comprehensive but more expensive conversation-level analysis.
| Path | Input and state | Core mechanism | Typical use | |---|---|---|---| | Stateless activation probe | Hidden state for the current token | Per-token linear or MLP scoring | Low-overhead inline screening | | Stateful activation probe | Compact per-token features plus history | Sequence model such as minGRU | Detecting jailbreak or cyber intent that develops over time | | Iris Content Guard | Fully tokenized conversation history | Multi-label classifier | Offline or near-real-time review of prompts and responses |
Stateless probes can be enabled through --activation-monitors and return token-aligned scores through /generate or Engine.generate under meta_info.activation_monitors. Stateful probe results are available through /v1/monitor_scores/{rid} or an SSE stream. Reflection's initial Iris Cyber Probe uses the stateful path, allowing an operator to steer a response or terminate generation. Iris Content Guard extends /v1/classify with per-token multi-label outputs shaped as [num_tokens, 28].
How the Activation Monitoring Path Works
Stateless probes: Inline with the forward pass
A stateless probe extracts hidden states from selected Transformer layers and applies a linear classifier or small MLP to each new token. It requires no activations from earlier tokens and therefore needs no structural change to the KV cache. SGLang supports both eager execution and probe integration in decode and verify CUDA Graphs, avoiding repeated operator-launch overhead on every decoding step.
The tradeoff is that probes execute on every forward pass. SGLang also reserves monitor buffers before sizing the KV cache, so this memory reduces the cache space available for concurrency. When no monitor is configured, however, the engine skips the entire monitoring path and incurs no default runtime overhead.
Under speculative decoding, SGLang reports scores only for accepted tokens and the bonus prediction. Rejected candidates do not produce safety records. This is consistent with the final visible output, but monitoring coverage therefore depends on the speculative decoding acceptance policy rather than every proposed branch.
Stateful probes: Keep sequence history outside the KV cache
A minGRU or comparable stateful probe needs the activations of every preceding token in strict order. Relying only on hidden states stored in the KV cache can lose or misassociate history when pages are evicted, prefixes are reused, or cache entries move between systems. SGLang instead projects and compresses activation features, stores the sequence history in the scorer process's host memory, and attaches a 16-byte computation ID to cached tokens. That ID follows computation identity across prefix reuse, HiCache, unified memory, and prefill-decode disaggregation.
In a six-hour test with an 8 GiB history budget and concurrency 64, the implementation scored all 59.95M output tokens across 67,846 requests without a missing score, compared with 18.38% missing under plain LRU. This separates probe-history management from the KV-cache lifecycle. It does not eliminate operational complexity, however: deployments still need recovery after scorer restarts, timeout cleanup, request-level ID isolation, and consistent ordering between features and generated tokens.
Iris Content Guard: The Heavier Conversation-Level Layer
Iris Content Guard uses a sparse activation profile with 28.7B total parameters and 3.2B active parameters and can run independently on a single 80 GB H100. SGLang adds multi-label token classification, elementwise sigmoid outputs, and BeamForTokenClassification support for both breakable and full prefill CUDA Graphs.
Unlike an activation probe, ICG performs a full prefill over the tokenized conversation history. Longer contexts increase prefill memory, queueing delay, and time to the first result. Returning 28 probabilities for every token also adds serialization and downstream bandwidth. The smaller active-parameter count lowers per-token computation, but all 28.7B weights still need to be stored, loaded, and routed through, so it should not be treated as a low-memory deployment merely because only 3.2B parameters are active.
Measured Overhead and Isolation
The official results use Beam 1.0 NVFP4, TP4, DFLASH 2, B300 hardware, concurrency 128, and one minGRU probe:
| Deployment | Throughput change | Reported P99 wait | Engineering interpretation | |---|---:|---:|---| | Stateful probe on a dedicated fifth GPU | -0.71% | 0.349 s | Isolates inference and scoring for high-concurrency production | | Stateful probe sharing a serving GPU | -4.81% | 0.436 s | Saves hardware but introduces compute and memory contention |
The reported P99 wait is a serving-scheduling metric, not necessarily the end-to-end safety-intervention latency. If a service must retract content already emitted over a streaming connection, operators must separately measure feature transport, probe execution, policy evaluation, and client-side cancellation propagation.
Project Iris follows a cascade model in which inexpensive probes screen most traffic and only uncertain samples escalate to a heavier classifier. Anthropic's Constitutional Classifiers++ and Google DeepMind's probe-cascade work provide architectural precedents, but they are not directly comparable benchmarks under a shared evaluation setup. Coverage of jailbreaks, prompt injection, multilingual obfuscation, and long-horizon attacks still depends on training distributions, probe layer selection, and threshold calibration.
Engineering Trade-offs
- Throughput versus isolation: A dedicated scoring GPU limits the reported throughput loss to 0.71%, but adds the capital and operating cost of another high-end accelerator. Sharing a GPU is cheaper while making safety traffic compete directly with generation.
- Memory versus cache capacity: Stateless monitor buffers are reserved before KV-cache sizing. Stateful history stays outside the KV cache, but consumes scorer host memory and requires strict lifecycle management.
- Throughput versus intervention latency: Probe execution sits on the generation critical path. Throughput alone does not capture the full delay from risk detection to a rewritten answer or stopped stream.
- Compatibility versus specialization: The interfaces accept compatible checkpoints, but probe weights remain tied to model architecture, layer indices, and hidden-state distributions. Thresholds should not be assumed portable across base models or quantization formats.
- Open tooling versus enforcement: The features are disabled by default, and a private operator can turn them off. They reduce risk for compliant operators but do not prove that the underlying model is safe or replace output auditing, access controls, and incident response.
Deployment Guidance
- Establish a stateless baseline on the intended base model before adding a minGRU or another stateful probe. Recalibrate every model, quantization variant, and decoding configuration.
- For high-concurrency deployments, isolate the stateful scorer on a dedicated GPU and track its request queue, P99 delay, host-memory use, and timeout rate. A shared-GPU deployment needs explicit quota and fallback policies.
- Calibrate thresholds with both benign production traffic and adversarial examples. Report recall, false-positive rate, rewrite-trigger rate, and final refusal rate by harm category instead of relying on one aggregate accuracy number that can hide long-tail failures.
- Test prefix reuse, KV-page boundaries, HiCache, unified memory, prefill-decode disaggregation, and speculative decoding to confirm that every visible output token has the correct, unique score.
- Treat ICG as a separate classification service. Plan H100 capacity, queueing, and long-context prefill costs, and do not combine probe and classifier scores as calibrated probabilities without a validation procedure.
- Retain input filtering, output auditing, rate limiting, and human escalation. Activation features and conversation histories may contain sensitive information, so deployments also need encryption in transit, access controls, retention limits, and secure deletion.
How to Interpret the Evaluation
Iris Safety Evaluations is a useful open benchmark foundation for replication and comparison, but the supplied material does not establish independent detection results, detailed data splits, or broad cross-model performance. The B300 measurements demonstrate low service overhead in one configuration; they do not show that probes will remain effective against new jailbreaks, model updates, or distribution shifts.
The central engineering advance is not a claim that activation monitoring solves alignment. It is the movement of safety detection from a post-generation second LLM call into a token-level inference path, with interfaces for probes, scoring, intervention, and standalone classification. Production adoption should therefore be grounded in workload-specific calibration, adversarial testing, and independent red-team evaluation.
— END —Source: LMSYS / SGLang Blog (2026-11-30)
Tags: #SGLang #AI Safety Monitoring #Activation Probes #Iris Cyber Probe #Iris Content Guard
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments