COGNIT-Guard: a calibrated standalone direct-decision guardrail based on heterogeneous CPU-NPU confidence cascades under explicit latency and false-positive constraintsCOGNIT-Guard: Calibrated Standalone Direct-Decision Guardrails with Heterogeneous CPU-NPU Confidence Cascading under Explicit Latency and False-Positive Constraints
The authors propose COGNIT-Guard: a cascade guardrail with fast CPU screening plus a 322M direct-decision model on Ascend 910C, reaching 98.85% accuracy and 0.42% FPR on the DUCS-Bench strict test set (N=607).
The defender screens user prompts as a standalone pre-ingestion guardrail before the target LLM's prefill, with a binary decision to allow or block; the focus is on controlling false positives on dual-use compliance consultations (containing sensitive words but legitimate) and meeting explicit latency SLOs (typically <50 ms). The paper does not set an adversarial attacker model.
- Production-grade LLM safety gateways need to screen prompts in real time before the target model's prefill, while controlling false positives on dual-use compliance consultations, providing calibrated posterior probabilities, and meeting latency SLOs; the authors state that existing shallow classifiers, generative guardrails, and internal probes all struggle to satisfy these constraints simultaneously.
- COGNIT-Guard cascades a CPU fast gate (TF-IDF+XGBoost) with Laya-322M, a 322M bidirectional direct-judgment model resident in HBM on an Ascend 910C, using a confidence threshold calibrated on the validation set, together with an asymmetric false-positive penalty and experience replay to mitigate the alignment tax brought by domain specialization.
- On the DUCS-Bench strictly clean test set (N=607), accuracy 98.85%, benign FPR 0.42%, ECE 1.12%; the real-time cascade (N=130) has a mean latency of 41.63 ms and accuracy 99.23%; experience replay restores SafetyBench-ZH OOD accuracy from 56.81% to 65.05%.
- The paper does not include a dedicated limitations section; the experiments conduct OOD evaluation only on Chinese dual-use compliance data (DUCS-Bench), SafetyBench-ZH, and XSTest, and the hardware is limited to a Xeon CPU and an Ascend 910C; the remaining errors are concentrated in three categories: antitrust-dense vocabulary, academically disguised disinformation, and borderline commercial health claims.
- Evaluated models
- Laya-322M
- Benchmarks
- DUCS-BenchSafetyBench-ZHXSTest (EN)
- Metrics
- AccuracyFPRFNRECEBrier ScoreROC-AUCPR-AUCMean/P50/P95 LatencyQPS
COGNIT-Guard is a calibration-independent direct-decision model for real-time safety guardrails before ingestion, escalated by confidence from a fast CPU gatekeeper to Laya-322M on the NPU. On the DUCS-Bench unseen test set (N=607), accuracy is 98.85% and the benign false positive rate is 0.42%; on Huawei Ascend 910C, the serial CPU-NPU cascade has an average latency of 41.63 ms and a false positive rate of 0.00%.
Paper analysis
What problem does this paper attempt to solve?
The authors study how to use a calibrated independent direct-judgment model for real-time pre-ingestion safety guardrails under explicit latency and false-positive constraints.
Core question: when should a foundation-model safety gateway generate tokens and when should it directly output a calibrated decision result—the authors study using a calibrated standalone direct-judgment foundation model as a serving primitive for a real-time pre-ingestion guardrail under explicit latency SLOs and false-positive constraints.
- Scenario and importance: production-grade guardrails need to synchronously screen user prompts before the target LLM's prefill; the authors propose four production constraints: semantic understanding of disguised prompts, dual-use false-positive control on benign queries containing sensitive words, posterior probability calibration for risk routing, and explicit latency SLOs (typically <50 ms).
- Shortcomings of existing methods (according to the authors): shallow classifiers such as TF-IDF+XGBoost are fragile to syntactic variation and poorly calibrated (ECE=13.11%); autoregressive guardrails such as Llama-Guard decode through 7B–70B backbones, with high latency and uncalibrated token logits; internal hidden-state probes such as ShieldHead are tightly coupled to a specific target LLM and require running the target model's prefill first, so they cannot serve as a model-agnostic front-end gateway.
- Core observation: zero-shot models produce false positives on legitimate compliance consultations containing high-risk keywords, consistent with decisions dominated by lexical priors—the zero-shot cross-encoder has an FPR of 35.71% (85/238) on DUCS-Bench, and the zero-shot bi-encoder baseline has an FPR of 90.34% (215/238); the authors state that mere domain specialization also brings an alignment tax that harms OOD safety categories.
- What the paper proposes: COGNIT-Guard—couples a validation-calibrated CPU fast gate with confidence-gated escalation to an NPU-resident 322M bidirectional direct-judgment model (Laya-322M), using an asymmetric false-positive penalty and explicit latency constraints; it also releases the DUCS-Bench benchmark. The authors explicitly state that they do not intend to invent a non-autoregressive decision model or to be the first to study over-refusal.
- Threat model:
- Guardrail position: a standalone pre-ingestion guardrail, decoupled from the weights and KV cache of the downstream serving LLM, filtering inputs before the target LLM's prefill.
- Decision task: binary classification (y=0 benign / y=1 violating), outputting allow or block.
- Key risk: dual-use compliance queries (sensitive words + legitimate question phrasing) being falsely blocked; the paper does not set an adversarial attacker model, and adversarial red-team prompts are included only during data construction.
- Constraints: explicit latency SLOs (typically <50 ms) and a low false-positive rate.
What related research exists?
The paper divides related work into four categories: autoregressive guardrails, internal probes, encoder/direct-judgment models, and cascade serving, and provides a paradigm comparison table.
Autoregressive guardrails and over-refusal
- Llama-Guard [1], ShieldGemma [3], WildGuard [2]—model content moderation as autoregressive token generation on 7B–70B causal backbones; the paper notes that such models have higher latency than lightweight encoders or probes, and that their output token logits are uncalibrated.
- XSTest [13], OR-Bench [14]—the paper states that these benchmarks show that safety-aligned generative models exhibit lexical oversensitivity to benign prompts containing sensitive words.
Hidden states and internal safety probes
- ShieldHead [4]—attaches a classification head to the final hidden state during decoding of 7B–8B LLMs; SingProbe [5], Khatri et al. [6], AEGIS [18]—reuse decoding states for streaming risk monitoring, train MLP probes on LLaMA-3.1-8B hidden states, and project multi-layer latent instruction manifolds to mitigate over-refusal under indirect prompt injection.
- The distinction the paper names: internal probes are tightly coupled to the hidden states of a specific target LLM, cannot screen traffic before the target model's prefill, and cannot protect closed-source/heterogeneous downstream APIs.
Encoder and direct-judgment guardrail models
- GLiNER Guard [7]—a bidirectional encoder performs PII and safety labeling; SingGuard [8]—policy-adaptive moderation at about 50 ms; FlexGuard [9]—learns a continuous risk score for strictness-adaptive moderation.
- Two families of System-One decision foundation models (DFM): cross-encoder DFM (Jev [16], Laya [15], [17], full token-level cross-attention followed by projection to a typed softmax head) and bi-encoder contrastive DFM (the Stanford × NVIDIA CLM technical report [10], which independently encodes states and candidate actions and caches action vectors in an on-chip VectorArena). This paper uses Laya-322M as the primary engine and CLM-8B as a comparison baseline.
Calibration and heterogeneous cascade serving
- FrugalGPT [19], Reflex-Guard [20]—route simple inputs to cheap classifiers and escalate uncertain samples to large models; the paper notes that prior safety cascades rarely address posterior miscalibration, asymmetric dual-use false-positive penalties, and the domain-specialization alignment tax across CPU–NPU hardware.
Baselines and benchmarks: the comparison baselines are Traditional ML (TF-IDF+XGBoost), Zero-Shot DFM (Laya-322M), and the CLM-8B bi-encoder baseline; the benchmarks are the self-built DUCS-Bench, plus SafetyBench-ZH [21] and XSTest [13] for cross-domain evaluation.
The authors position this paper as: under explicit CPU–NPU latency and false-positive constraints, grounding CPU–NPU escalation routing in validated calibrated posteriors and SLO-constrained risk minimization, bridging the gaps in the above four categories of work.
How does the paper address this problem?
COGNIT-Guard couples CPU fast screening with a 322M direct-judgment model on the NPU via a validation-calibrated confidence cascade, and controls dual-use false positives with an asymmetric false-positive penalty.
Overall approach: organize standalone pre-ingestion moderation as a four-stage pipeline (Figure 1) — dual-use input and instruction preparation, lightweight CPU gating screening with calibrated confidence gating, escalation of ambiguous queries to a resident Ascend 910C NPU, and calibrated posterior projection output decisions. The core model is the 322M bidirectional direct-decision encoder Laya-322M.
Problem formalization and the direct-decision model
- Input prompt x carries a binary safety label y∈{0,1}; in dual-use scenarios x contains both a set of sensitive-word entities K (criminal law provisions, controlled goods, extremist terms) and a set of legitimate-inquiry markers E.
- The authors give a stylized log-odds surrogate (explicitly described as only a conceptual heuristic, not a mechanistic claim): Pconcept(y=1|x) ≈ σ(∑w∈ K∩ xαw − ∑w∈ E∩ xβw), where before domain adaptation αw≫βw, consistent with high zero-shot false positives.
- A bidirectional transformer encoder Φθ (322M parameters) maps (x, q) to a contextual representation h, where q is the safety moderation instruction; a typed linear decision head projects directly to a posterior probability (the softmax in Eq. 3).
- Calibration measures: Brier score and 15-bin ECE (Eq. 4).
Calibrated confidence cascade
- The fast CPU gate Mfast outputs a posterior Pfast, with confidence c(x)=maxc Pfast(y=c|x); when c(x)≥θ the CPU decides, otherwise the query is escalated to Mdeep on the NPU, with per-query latency equal to TCPU plus the escalation overhead (Eqs. 6, 7).
- The threshold θ∗ is solved on the validation set by risk minimization with an asymmetric false-positive penalty γ>1 (Eq. 8), subject to expected latency not exceeding TSLO; sweeping θ gives the latency–accuracy Pareto frontier, and the deployment threshold θdeploy=0.70 is selected on the validation set only.
Ascend 910C hardware deployment
- Three serving optimizations: all 322M weights and the decision head are kept resident in on-chip HBM (per-query PCIe tensor copy reduced to 0.82 ms); 20 warm-up iterations plus explicit stream synchronization eliminate cold-start jitter; bidirectional self-attention executes on the Ascend Cube matrix units, at 45.90 QPS with B=1.
Data construction and evaluation protocol
- DUCS-Bench: drawn from Chinese regulatory consultations, enterprise compliance inquiries and adversarial red-team prompts, with 3,663 original annotations in total, covering criminal law consultation, regulatory compliance and disguised attacks; two domain annotators labeled independently (Cohen's κ=0.91), with disagreements adjudicated by a third senior annotator.
- SHA-256 normalized deduplication to 3,551 entries; after removing 28 train/test overlaps, two evaluation tracks are defined: a strictly clean unseen test track (N=607: 238 benign, 369 violating) and a full benchmark track (N=635).
- 3-way split (seed=42): Train 70% (N=2,485), Validation 15% (N=533), Held-Out Test 15% (N=533); the real-time cascade profile uses a stratified 150-sample test set, and after removing 20 non-binary open inquiries yields an N=130 binary real-time slice (82 violating, 48 benign).
- OOD evaluation: SafetyBench-ZH, 300 questions sampled from each of the 7 official harm categories (2,100 in total: 694 unsafe, 1,406 safe), with zero overlap with the N=458 experience replay pool; XSTest (N=450) is for cross-literature reference only.
- Experience replay: a disjoint 15.56% replay slice (N=458) is mixed in during adaptation to mitigate the alignment tax.
What experiments did the paper conduct?
On the strict test set of DUCS-Bench, COGNIT-Guard achieves 98.85% accuracy and 0.42% FPR, the real-time cascade takes 41.63 ms, and replay restores OOD accuracy to 65.05%.
Experimental setup
- Systems under test: COGNIT-Guard (Laya-322M cross-encoder), CLM-8B bi-encoder baseline (Qwen3-8B pooling encoder + 73MB two-tower projection head), Traditional ML (TF-IDF+XGBoost), Zero-Shot DFM (Laya-322M); Table V additionally lists published reference values for GPT-4, Llama-2-70B-Chat, WildGuard and SingGuard.
- Benchmarks: DUCS-Bench strictly clean unseen track (N=607: 238 benign, 369 violating) and full track (N=635); SafetyBench-ZH stratified 2,100 questions; XSTest (N=450, reference only).
- Metrics: Accuracy, FPR, FNR, Precision/Recall/F1, Brier, ECE (15 bins), ROC/PR-AUC, Mean/P50/P95 latency, QPS.
- Statistical tests: paired McNemar (accuracy), two-sided Fisher exact test (FPR), 95% Wilson confidence intervals; with a benign subset of N=238, one false positive corresponds to a 0.42% discrete step.
- Hardware and protocol: Intel Xeon CPU @2.60 GHz (32GB RAM) and Huawei Ascend 910C (64GB HBM, CANN 8.0, torch_npu 2.1, FP16, B=1, 20 warm-ups, explicit stream synchronization).
- Cascade protocol: θdeploy=0.70 is tuned on Validation only; the real-time profile is the N=130 binary slice.
Main results
According to Table II (strictly clean unseen track N=607):
Swipe horizontally to read the table
Metric Traditional ML Zero-Shot DFM COGNIT-Guard Accuracy 95.39% (579/607) 76.61% (465/607) 98.85% (600/607) FPR 5.88% (14/238) 35.71% (85/238) 0.42% (1/238) FNR 3.79% (14/369) 15.45% (57/369) 1.63% (6/369) Brier / ECE 0.0525 / 13.11% 0.1654 / 5.38% 0.0104 / 1.12% Mean Latency 85.36 ms (diagnostic) / 38.91 ms (fast) 22.88 ms (NPU) 21.77 ms (NPU) - The authors report that the accuracy improvement is statistically significant (paired McNemar χ2=14.81, p=1.19×10−4 vs. ML); FPR is reduced by 98.8% relative to zero-shot (Fisher p=2.78×10−28) and by 92.9% relative to ML (p=8.23×10−4), with non-overlapping 95% Wilson CIs.
- On the full track (N=635), COGNIT-Guard achieves 98.90% accuracy, 0.42% FPR and 1.07% ECE (Table II).
- Figure 2(a)–(b): COGNIT-Guard ROC-AUC 0.9973, PR-AUC 0.9983, higher than Traditional ML (0.9802/0.9891) and zero-shot Laya-322M (0.8274/0.8632).
Ablation 1: Cross-Encoder vs. Bi-Encoder (CLM-8B)
- Zero-shot fragility: lacking token-level cross-attention across E×K, CLM-8B has a zero-shot FPR of 90.34% (215/238), accuracy 64.25%, ROC-AUC 0.6944 and ECE 24.29% (Clean-607).
- Projection-head adaptation: with the Qwen3-8B backbone frozen and only the 73MB two-tower head adapted, the Zero-FPR setting (lr=2×10−4, 8 epochs) takes 2.81 s to reach 98.35% accuracy and 0.00% FPR; the Best-Acc setting (lr=3×10−4, 12 epochs) takes 3.73 s to reach 98.85% accuracy and 0.83% ECE.
- Authors' interpretation: both types of direct-decision architecture need boundary-aware calibration to control dual-use false positives, with the trade-off lying in single-stream backbone size (322M vs. 8B) and head adaptation speed (34.55 s vs. 2.81–3.73 s).
Ablation 2: Cascade routing and latency breakdown (Table III)
- Offline sweep (N=635): the pure NPU path gives 98.90% accuracy at 21.76 ms; θ=0.80 gives 98.58% at 14.27 ms (the offline Pareto knee); θ=0.70 raises FPR to 2.52%.
- Real-time cascade (N=130, θdeploy=0.70): 94.62% (123/130) of queries are resolved on the fast CPU path (38.91 ms), and 5.38% (7/130) are escalated to the NPU (89.48 ms); overall accuracy 99.23% (129/130), 0.00% FPR (0/48), mean 41.63 ms (P50 39.47, P95 76.25).
- CPU mode distinction: diagnostic mode (including evidence retrieval) 85.36 ms, real-time fast gate 38.91 ms, cached feature-tree lookup 10.50 ms.
Ablation 3: Hardware residency and cross-benchmark generalization (Tables IV, V)
- HBM residency: Laya-322M single-query latency drops from 48.20 ms cold-start to 21.77 ms (2.21×, 45.9 QPS); CLM-8B uncached single-stream is 45.78 ms, batched (B=64) 6.64 ms/item (150.6 QPS), and VectorArena hits 0.60 ms P50.
- Alignment tax in three stages (Table V): pure domain fine-tuning lowers DUCS FPR from 35.71% to 0.42% (Laya), but SafetyBench-ZH accuracy drops from 60.33% to 56.81% (CLM-8B: 55.10%); after mixing in 15.56% experience replay, OOD recovers to 65.05% (Laya, +8.24%) and 64.10% (CLM-8B, +9.00%), while Clean-607 accuracy reaches 99.67% (Laya, 0.42% FPR) and 99.84% (CLM-8B, 0.00% FPR, 0.86% ECE, ROC-AUC 1.0000).
- Remaining failures (qualitative): three types of boundary errors — regulatory consultations containing dense antitrust vocabulary (which the authors state is resolved by CLM-8B's 4096-dimensional representation), academically disguised disinformation, and borderline commercial health claims.
Other ablations and analyses
- Keyword perturbation sensitivity: when K is fixed and E is varied, zero-shot risk stays >0.88, while COGNIT-Guard pushes the benign-inquiry posterior down to 0.003 and keeps attacks at 0.992; inserting criminal-law terms into neutral inquiries raises zero-shot false positives by +84.2%, while COGNIT-Guard stays <0.02.
- Traditional ML achieves 53.29% (1119/2100) OOD accuracy on SafetyBench-ZH (Table V).
- Zero-shot Laya-322M achieves 60.33% (1267/2100) on SafetyBench-ZH with 24.68% FPR (347/1406) (Table V).
What are some points that can be further explored?
The paper does not include a dedicated limitations section; the experiments cover Chinese compliance data, two types of direct-judgment architectures, and a single CPU–NPU hardware combination.
Limitations noted by the authors and future directions
- The paper does not specifically discuss limitations (there is no Limitations/Discussion subsection). The only explicit statements related to shortcomings in the conclusion and main text are two: the remaining borderline errors cluster in three types of boundary cases—regulatory consultations containing dense antitrust vocabulary, disinformation carriers disguised as academic content, and borderline commercial health claims (Section IV-G); the authors explicitly state that they do not intend to invent a non-autoregressive decision model or to be the first to study over-refusal (Section I).
Scope of experimental coverage
- The systems under test are four categories: COGNIT-Guard (Laya-322M), the CLM-8B baseline, Traditional ML, and Zero-Shot DFM; GPT-4, Llama-2-70B-Chat, WildGuard, and SingGuard are listed only as published reference values (Table V), and the paper did not run them itself.
- The evaluation data are Chinese dual-use compliance data (DUCS-Bench, strict track N=607, full track N=635), a stratified 2,100-question SafetyBench-ZH, and XSTest (N=450, cross-literature reference only); the sample size for the real-time cascade profile is N=130.
- The hardware environment is an Intel Xeon CPU @2.60 GHz and one type of NPU, Huawei Ascend 910C, with B=1 (CLM-8B additionally has B=64 batching).
- The benign compliance subset is Nsafe=238, where 1 false positive corresponds to a 0.42% discrete step; the paper reports McNemar, Fisher exact tests, and Wilson intervals, but does not report variance across multiple repeated runs.
- The paper does not report evaluation of adversarial adaptive attacks (evasion attacks targeting the cascade threshold or calibration mechanism); adversarial red-team prompts appear only among the data construction sources.
Summarize the main content of the paper
The authors propose a calibrated CPU–NPU cascaded direct-judgment guardrail, COGNIT-Guard, which achieves low false positives, low latency and calibrated posteriors on a self-built Chinese compliance benchmark.
A system-type defense paper: it studies using a calibrated standalone direct-judgment foundation model as a real-time pre-ingestion safety gateway under explicit latency SLOs and false-positive constraints.
- Problem: production guardrails need to screen prompts before the target LLM's prefill; the authors state that shallow classifiers are poorly calibrated, autoregressive guardrails have high latency, internal probes are tightly coupled to the target model, and zero-shot models have high false-positive rates on legitimate compliance consultations containing sensitive words (zero-shot cross-encoder FPR 35.71%, bi-encoder 90.34%).
- Method: COGNIT-Guard cascades a CPU fast gate (TF-IDF+XGBoost, 38.91 ms) with Laya-322M, a 322M bidirectional direct-judgment model resident in HBM on an Ascend 910C, using a validation-calibrated confidence threshold (θdeploy=0.70), and adopts an asymmetric false-positive penalty; it also releases DUCS-Bench, which is double-annotated (κ=0.91) and deduplicated to prevent leakage.
- Main results: on the strict clean unseen test set (N=607), accuracy is 98.85% (McNemar p=1.19×10−4 vs. ML), benign FPR is 0.42% (1/238), ECE is 1.12%, and Brier is 0.0104 (Table II).
- Serving efficiency: the pure NPU path takes 21.77 ms (45.90 QPS); in the real-time cascade (N=130), 94.62% of queries are resolved on the CPU, with end-to-end 41.63 ms, 99.23% accuracy, and 0.00% FPR (Table III).
- Alignment tax and recovery: pure domain fine-tuning lowers SafetyBench-ZH OOD accuracy from 60.33% to 56.81%; mixing in 15.56% experience replay restores it to 65.05%, while in-domain accuracy reaches 99.67%–99.84% (Table V).
- Authors' conclusion: calibrated posterior routing plus experience replay can simultaneously achieve low in-domain false positives and OOD recovery under explicit latency and false-positive constraints; the remaining errors are concentrated in three types of boundary cases: antitrust-dense vocabulary consultations, academically disguised disinformation, and borderline health claims.