SGLang Adds Iris Safety Monitoring with 0.71% Throughput Loss on a Dedicated GPU
Summary:The SGLang team and Reflection have introduced opt-in safety monitoring for token generation. Reflection open-sourced the Iris Safety Evaluations benchmark and released Iris Cyber Probe, a stateful activation probe that inspects hidden states during generation. Iris Content Guard adds a 28.7B-parameter open-weight classifier with 3.2B active parameters for contextual, multi-label content inspection. SGLang can run stateless linear or MLP probes inline on the serving GPU, while stateful minGRU p
The SGLang team and Reflection are moving safety inspection from post-generation text review to direct inspection of hidden states while a response is still being generated. This is an inference-engine-level change rather than another application-side moderation API: SGLang supplies the sampling, caching, and monitoring orchestration, while Reflection supplies the Project Iris benchmark, activation probes, and content classifier. All monitoring paths are disabled by default.
What Was Added
| Layer | Component | Execution location | Interface and purpose |
|---|---|---|---|
| Stateless activation monitoring | Linear probe or small MLP | Serving GPU | Token-aligned scores returned through /generate or Engine.generate |
| Stateful activation monitoring | Reflection Iris Cyber Probe, initially based on minGRU | Separate scoring process | Scores retrieved through GET /v1/monitor_scores/{rid} or an SSE stream |
| Conversational content classification | Reflection Iris Content Guard | Standalone classification server | Multi-label per-token probabilities returned by POST /v1/classify |
| Offline evaluation | Iris Safety Evaluations, or ISE | Outside the online inference path | Benchmark for evaluating safety detectors |
SGLang does not restrict these interfaces to a particular checkpoint. Model developers provide the weights, while operators define thresholds, enforcement actions, and escalation policies. Reflection's initial open probe release primarily exercises the stateful path; the stateless linear and MLP interfaces are general SGLang extensions.
How Token-Level Activation Monitoring Works
For a hidden vector h_t produced at layer l during generation step t, a linear probe can be expressed as s_t = wᵀh_t + b, while a small MLP introduces a nonlinear decision boundary. The resulting score is aligned with the generated token. A client can therefore inspect the model's behavior before generation finishes and decide whether to continue, redirect the model, terminate the response, or apply another policy.
Stateless probes depend only on the current token's activation. SGLang runs them inline on the serving GPU in eager mode and through decode and verify CUDA graphs. Monitor buffers are reserved before KV-cache sizing, avoiding runtime allocation spikes during cache pressure.
Stateful probes need the activation history of preceding tokens. Iris Cyber Probe uses a sequence model such as minGRU to identify cyberattack or jailbreak behavior that emerges progressively rather than appearing in one token. SGLang does not place the full probe history in the model KV Cache. Instead, it projects and compresses each token's features, streams them to a separate scorer, and keeps the recurrent state in that process's host memory.
The interface also handles several failure-prone boundaries:
- Under speculative decoding, scores are returned only for accepted tokens and the bonus prediction; rejected draft candidates do not produce monitor results.
- Missing or non-finite values are returned as
null, with monitor states ofok,partial, orunavailable. - A score is only a signal. SGLang does not itself decide whether to block, steer, or allow the response; that remains an operator-controlled policy decision.
Preserving Statefulness Across the KV Cache
Running a minGRU is not the hardest part of stateful monitoring. The difficult part is keeping every score associated with the correct generated sequence. SGLang tags cached tokens with a 16-byte computation ID that follows the KV cache through prefix reuse, HiCache, unified memory, and prefill-decode disaggregation.
This turns safety scoring into a cache system with continuity requirements. If the scorer evicts a historical entry incorrectly, the model's KV cache may still return valid text while the corresponding safety history contains a hole. The history store therefore needs to preserve token order and computation continuity rather than rely on ordinary LRU behavior.
In a six-hour test with an 8 GiB history budget, SGLang processed 67,846 requests and 59.95M output tokens at concurrency 64 without missing a score. A plain-LRU comparison missed 18.38% of them. The result validates the ID-tracking and history-reclamation design under that test, although it does not establish correctness for every cache topology or model.
The design also has costs. Cached tokens consume at least 16 bytes of identifier space each, before alignment and other metadata. The deployment must account for host memory, GPU-to-scorer transfers, synchronization, scheduling, and scorer concurrency. The article does not disclose the exact transport protocol, cross-host network cost, or scorer concurrency ceiling.
How Iris Content Guard Extends Classification
Iris Content Guard is an open-weight safety classifier with 28.7B total parameters and 3.2B active parameters. Reflection reports that it can run as a standalone service on a single 80 GB H100. Unlike an activation probe, it evaluates user requests and assistant responses using the broader conversation context.
SGLang extends /v1/classify with per-token outputs and element-wise sigmoid activations, allowing several risk labels to be active simultaneously instead of forcing a single class per token. The documented output shape is [num_tokens, 28], described as covering 14 broad harm categories; operators should confirm the exact mapping between taxonomy and output dimensions from the model configuration.
BeamForTokenClassification serves the classifier with breakable and full prefill CUDA Graphs to reduce kernel-launch overhead during prefill. This is primarily a conversational, offline classification path. It generally requires the full context and therefore does not provide the same immediate interruption signal as a token-aligned activation monitor. Activation probes are better for in-flight stopping; ICG is better when a judgment requires complete conversational context.
The 28.7B model also imposes a meaningful memory floor. Even with only 3.2B active parameters, the cited single-H100 deployment does not establish quantized footprint, batch throughput, long-context latency, or behavior on smaller accelerators.
Reported Performance
The cited setup uses B300 hardware, Beam 1.0 NVFP4, TP4, DFlash 2, concurrency 128, and one Iris minGRU probe:
| Deployment topology | Throughput change | P99 wait | |---|---:|---:| | Dedicated fifth GPU for the scoring process | -0.71% | 0.349 s | | Scoring shares serving GPU 3 | -4.81% | 0.436 s |
These figures are specific to the tested hardware, serving configuration, concurrency, and probe count. They should not be treated as universal capacity-planning constants. Isolating the scorer reduces interference with the generation path, while sharing a GPU saves hardware but places probe execution, feature transfer, and cache contention directly on that path.
P99 wait is also not the same as end-to-end response latency. Queueing, scorer execution, polling or SSE transport, and policy execution still contribute to the user-visible latency.
The measurements show that activation monitoring can fit into a low-overhead serving regime. They do not establish how accurately the probes detect harmful behavior.
Safety Evaluation Cannot Be Replaced by Serving Benchmarks
Reflection's release of ISE as an open benchmark is a significant part of the announcement. However, the article does not disclose the benchmark's full sample size, language coverage, attack templates, judging procedure, benign prompt set, false-positive rate, false-negative rate, threshold calibration, or complete external baselines.
A production evaluation should cover at least four areas:
- Plot ROC or PR curves for the exact checkpoint, layer, and inference configuration rather than relying on one aggregate score at one threshold.
- Measure malicious-prompt recall, benign-dialogue false positives, and the availability cost of unnecessary refusals. More aggressive thresholds generally increase false positives and operational jitter.
- Test paraphrased attacks, multi-turn escalation, encoded variants, long-context jailbreaks, and out-of-domain prompts to determine whether the probe merely recognizes public attack templates.
- Recalibrate after quantization, LoRA adapters, model upgrades, or parallelization changes, because shifts in the hidden-representation distribution can invalidate an existing probe.
Open probes and weights improve reproducibility and auditability, but an operator can still disable them on a private server. Runtime monitoring is therefore not an unbypassable security boundary. Its practical value is to provide a low-friction, auditable protection layer for operators willing to enforce the resulting policy.
Deployment Guidance
- Establish a no-monitor baseline for throughput, TTFT, TPOT, tail latency, GPU memory, and host memory. Do not use the reported 0.71% as a universal capacity coefficient.
- Place stateful scorers on a dedicated GPU for high-concurrency deployments, especially as probe count or scorer host-memory demand grows. With tighter GPU budgets, use stateless probes for initial screening and escalate uncertain cases to stateful probes or ICG.
- Distinguish
ok,partial,unavailable, andnull. Decide explicitly whether monitoring failures should fail open or closed rather than treating unavailable scores as safe by default. - When enabling prefix caching, HiCache, unified memory, or prefill-decode disaggregation, verify that computation IDs survive transfer, eviction, and reconstruction, and monitor missing-history rates.
- Deploy ICG as a separate service, budget for 80 GB-class memory, and benchmark batching, long conversations, and cold starts independently.
- Make enforcement auditable by recording the triggering probe, token position, score, threshold, action, and model version.
- Test prompt-injection resistance before enabling automatic steering. A misclassified or malicious activation could cause the model to generate a new safety strategy or expose monitoring internals.
Engineering Assessment
The significance is not simply another safety-classification endpoint. SGLang now integrates activation probes, cache identity, speculative decoding, CUDA Graphs, and a separate scoring process into one serving stack. Deployers can obtain token-level internal behavior signals without launching another large language model for every conversation turn.
The 0.71% throughput loss with a dedicated GPU indicates that runtime monitoring can approach the cost profile of a serving primitive. The current evidence, however, is stronger for serving efficiency and cache integrity than for detection accuracy. False-positive control, adversarial robustness, and cross-model transfer remain the decisive requirements for production deployment.
— END —Source: LMSYS / SGLang Blog (2026-11-30)
Tags: #SGLang #Iris Safety Tools #Activation Probes #KV Cache #Inference Safety
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