Skip to content

Beyond Linear Probe: dynamic safety monitoring for language modelsBeyond Linear Probes: Dynamic Safety Monitoring for Language Models

arXiv· arXiv:2509.26238· ICLR 2026· James Oldfield, Philip Torr, Ioannis Patras, Adel Bibi, Fazl BarezQueen Mary University of London; University of Oxford; WhiteBox; MartianIndexed by this site · 2026-10-14· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

TPC uses truncatable polynomials to monitor LLM activations; on the Table 1 test set, the fifth-order TPC F1 of the four models is higher than same-parameter MLP.

Threat modelThe monitoring goal is to classify prompts as harmful or harmless using LLM internal activations before unsafe outputs. The monitor takes a residual stream at a certain layer and performs mean pooling over tokens, without calling an external large model. At test time, one can fix the truncation order, or add higher-order terms only when the sigmoid score falls in (τ, 1−τ). The paper does not use terms like white-box or black-box.

Questions
If activation safety monitoring uses the same compute for every request, strong monitoring wastes effort on easy samples, while weak monitoring may miss hard examples. The authors want cost to rise only when inputs are hard to judge or when the budget is higher.
Methods
Train a truncatable polynomial TPC on mean-pooled residual streams, freezing lower-order weights progressively and learning new terms with binary cross-entropy on the truncated logit. At test time, one can fix the order, or add higher-order terms only when the sigmoid score falls in an uncertain interval.
Experiments and results
The main experiment compares activation probes of 4 LLMs on WildGuardMix. In Table 1, the fifth-order TPC test F1 at the best validation layer is higher than same-parameter MLP and EE-MLP; on llama-3.2-3B the bilinear probe is higher. The authors say the cascade can approach the full polynomial, with net parameters only slightly more than a linear probe.
Limitations and future work
The authors state that no small-data experiments were done, the main task is harmful prompts rather than harm in responses, attribution combinations are not sufficiently human-readable, and extra compute does not necessarily improve monotonically and layers must be searched. The experiments cover the 4 main models above, appendix layer scans, and multiple probes, cascade thresholds, and several external monitors.
Experimental setupgemma-3-27b-it、Qwen3-30B-A3B-Base et al. · WildGuardMix、BeaverTails et al. · F1、accuracy et al.
Evaluated models
gemma-3-27b-itQwen3-30B-A3B-BaseLlama-3.2-3Bgpt-oss-20bLlama-3.2-1BLlama-3.1-8B
Benchmarks
WildGuardMixBeaverTailsHarmBenchToxicChatOpenAI-moderation
Metrics
F1accuracyprecisionrecallFRR
AI summaryThe paper proposes Truncated Polynomial Classifiers (TPC), an extension of linear probes, for dynamic safety monitoring of language model activations. The idea is that polynomials can be trained and evaluated term by term: at inference, one can early-stop for lightweight monitoring, or use more terms when needed for stronger guardrails. The authors give two usages: one as a safety knob, obtaining stronger guardrails from the same model by evaluating more terms; the other as an adaptive cascade, where clear samples exit early after low-order checks and only ambiguous inputs are evaluated with higher-order guardrails. On WildGuardMix, across 4 models with up to 30B parameters, TPC is not worse than or outperforms an MLP probe baseline of comparable size on harmful prompt classification, while being more interpretable than black-box methods. Code is available at http://github.com/james-oldfield/tpc。

The paper proposes Truncated Polynomial Classifiers (TPC), an extension of linear probes, for dynamic safety monitoring of language model activations. The idea is that polynomials can be trained and evaluated term by term: at inference, one can early-stop for lightweight monitoring, or use more terms when needed for stronger guardrails. The authors give two usages: one as a safety knob, obtaining stronger guardrails from the same model by evaluating more terms; the other as an adaptive cascade, where clear samples exit early after low-order checks and only ambiguous inputs are evaluated with higher-order guardrails. On WildGuardMix, across 4 models with up to 30B parameters, TPC is not worse than or outperforms an MLP probe baseline of comparable size on harmful prompt classification, while being more interpretable than black-box methods. Code is available at http://github.com/james-oldfield/tpc。

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Fixed compute monitoring struggles to balance easy example cost and hard example guardrails; TPC uses truncatable polynomials to add terms based on budget or uncertainty.

    Fixed-compute activation monitoring cannot simultaneously save cost on easy examples and strengthen guardrails on hard examples or higher safety budgets.

    • Scenario: The authors argue that test-time compute is already used for reasoning, math, and code, but safety monitoring remains inflexible. Most requests are harmless, so always-on external LLM monitoring has excessive minimum cost; linear probes provide only static guardrails.
    • Existing shortcomings: Chaining activation probes with external LLMs in two stages still requires additional fine-tuning or prompting and calls an extra LLM at inference. The authors believe this limits flexibility.
    • Observation: The authors cite work claiming that not all high-level features are one-dimensional linear subspaces in activation space. Polynomials can be trained and evaluated term by term, yielding nested sub-classifiers.
    • Proposed method: Truncated Polynomial Classifiers (TPC). The same model can act as a safety knob (more orders for stronger guardrails) or as an adaptive cascade (early exit for clear samples). The authors claim that at moderate orders it is more interpretable than black-box MLPs and can attribute decisions to neuron combinations.
    • Threat model:
      • Goal: Classify prompts as harmful or harmless before unsafe outputs.
      • Input: Residual stream at a specified layer, mean-pooled over tokens, yielding vector z. The paper does not say white-box or black-box.
      • Capability: After training an N-order polynomial, at test time one can compute only the first n≤N terms; or add higher orders only when prediction is uncertain.
      • Monitored system: The LLM producing these activations. Main experiments use 4 models, with parameter sizes up to 30B.
  2. What related research exists?

    Related work covers external LLM monitoring, activation probes, cascade early exit, and polynomial networks; TPC performs truncatable monitoring in activation space.

    External LLM Monitoring and Safety Training

    • Safety training: Ouyang et al. (2022), Bai et al. (2022), etc. use post-training alignment; O'Brien et al. (2025), Chen et al. (2025) filter data during pretraining. The paper says many models remain vulnerable to attacks and jailbreaks (Hughes et al., 2024; Anil et al., 2024).
    • Independent safety classifiers: Weng et al. (2023), Inan et al. (2023), Han et al. (2024), Zeng et al. (2025) use separate LLMs to identify harmful inputs or responses. The paper says they can generalize to new categories, but each request has additional cost (Li et al., 2025).

    Activation Probes

    • Linear probes: Alain & Bengio (2017) use linear classifiers to test whether intermediate representations are linearly separable. Later used to monitor sleeper agents (MacDiarmid et al., 2024), factuality (Tamoyan et al., 2025), and truthfulness (Burns et al., 2023).
    • Complexity and nonlinearity: The paper paraphrases Pimentel et al. (2020a), probe accuracy should be seen as a function of complexity. White et al. (2021) use polynomial kernels for nonlinear probes; the paper notes the kernel trick does not explicitly compute per-order terms and therefore cannot do the progressive evaluation in this paper.
    • Other representations: Bricken et al. (2024) probe sparse autoencoder features; Tillman & Mossing (2025) also use activations with instruction prompts.

    Cascades and Early Exit

    • Early-exit tradition: Viola & Jones (2004), Teerapittayanon et al. (2016), etc. use cascades or early exit to trade speed or robustness.
    • Two-stage LLM monitoring: McKenzie et al. (2025), Cunningham et al. (2025) first use activation probes and route to an external LLM when uncertain. The paper notes both require additional fine-tuning or prompting, and an extra LLM call at inference. The authors consider this complementary to TPC and, in principle, LLM monitoring could be the N+1th layer. Hua et al. (2025) discuss runtime monitoring combinations with cost constraints.

    Polynomial Networks

    • Higher-order models: Chrysos et al. (2020; 2022), Dubey et al. (2022), Pearce et al. (2025) use higher-order interactions for generative, discriminative, or interpretable architectures. The paper builds on this with truncated evaluation. Dubey et al. (2022) and Chrysos et al. (2022) only optimize the full polynomial, and the paper says this does not guarantee the truncated submodel is also good.

    • Baseline methods: linear probes, low-rank bilinear probes (Hewitt & Liang, 2019), standalone MLPs matched by parameter count, and jointly trained early-exit MLPs (Teerapittayanon et al., 2016). Benchmarks mainly use WildGuardMix; the appendix also has BeaverTails, and HarmBench, ToxicChat, OpenAI-moderation.

    The authors position TPC as a dynamic N-layer defense learned from neuron interactions in the original LLM activation space, rather than calling an external LLM again, and retaining an intrinsically interpretable form at moderate orders.

  3. How does the paper address this problem?

    TPC trains symmetric low-rank polynomials order by order on pooled activations, and at test time truncates by budget or cascades by uncertainty.

    Truncated Polynomial Classifier (TPC) fits a high-order polynomial on LLM activations, evaluating only the first n terms at test time, or adding more terms only when uncertain.

    Problem setup

    • Input: Sequence-level harmful/harmless prompts. Mean pooling over tokens of a residual stream at a certain layer yields a vector z.
    • Linear probe: The logit is a bias plus the inner product of z with first-order weights, then passed through a sigmoid to estimate harmful probability. The authors consider it cheap but static.
    • Goal: A polynomial gives N nested sub-classifiers; truncating to n=1 matches the linear probe.

    Truncated polynomial

    Practical forward uses symmetric CP decomposition (Eq. 5):

    P:n[N](z)=w[0]+z⊤w[1]+∑k=2min(n,N)∑r=1Rλr[k](z⊤ur[k])k

    The first two terms are the linear probe. Each order k≥2 uses only one factor matrix and coefficient vector, tying permutations of the same set of neurons into the same monomial. The authors claim this allows attributing logit changes to neuron combinations in the original model. Experiments use maximum order N=5 and rank R=64.

    Progressive training

    • Per-order loss: For k=2 to N, freeze lower orders and train new parameters using binary cross-entropy on the sigmoid of the logit truncated to k (Eq. 3).
    • Inheriting the linear probe: The first two terms directly use a pre-trained linear probe, so n=1 matches it by construction. The authors claim the maximum order can be early-stopped, and later terms do not affect existing truncations.
    • Training setup: 50 epochs per order, AdamW, batch size 1024; learning rate, weight decay, and dropout are grid-searched on the validation set (Appendix C). The linear probe uses sklearn's LogisticRegression.

    Two test-time usages

    • Fixed budget: All inputs are evaluated to the same order n. Later terms only correct the logit already computed by earlier terms.
    • Cascade: Algorithm 1 accumulates terms from the bias upward. If the sigmoid score is not in (τ, 1−τ), it exits early; τ is between 0 and 0.5. Clear samples stop at low orders, ambiguous samples proceed to higher orders.
    • Compute proxy: The authors compare models using test-time parameter count and claim in Appendix G.2 that it correlates with other cost measures; the main text does not give correlation coefficients.

    Decision

    Main task is harmful-class binary classification. The main text writes F1 as percentages. The cross-dataset section states the decision threshold is 0.5. The cascade's τ only determines early exit, not this classification threshold.

  4. What experiments did the paper conduct?

    On the WildGuardMix full-depth test set, TPC F1 is higher than parameter-matched MLP and EE-MLP, but not higher than every baseline.

    Experimental setup

    • Monitored models: gemma-3-27b-it (instruction-tuned), Qwen3-30B-A3B-Base and llama-3.2-3B (non-chat base), gpt-oss-20b (reasoning model). The appendix layer sweep additionally includes Llama-3.2-1B and Llama-3.1-8B.
    • Data: WildGuardMix train/test 86.8k/1.7k, containing many adversarial prompts; training is further split 80/20 into a validation set. BeaverTails' QA labels are described by the authors as a noisy proxy for harmful prompt labels. Cross-set is HarmBench's 200 standard prompts (all positive), ToxicChat 5083 (about 7% toxic), OpenAI-moderation 1680 (about 31% containing harmful requests).
    • Probes: TPC maximum order 5, rank 64, 5 random seeds. Baselines are a linear probe, a low-rank bilinear probe, and independent MLP and 5-exit EE-MLP matched in parameter count by truncated order.
    • Metrics: the main metric is harmful-class F1 (percentage). The appendix additionally has accuracy, precision, recall, FRR. Classification threshold 0.5. The paper does not report significance tests.
    • Representation and layer selection: residual stream at the specified layer, mean pooling over the token dimension. Table 1 reports full-depth results at the layer with the highest validation F1.
    • External comparison: Appendix F.3 compares gpt-4o-mini, claude-3-haiku, o3-mini, Llama-Guard-3-8B, shieldgemma-2b on the same WildGuard test set. System prompts are in that appendix and are not repeated here.

    Main results

    According to Table 1, mean of 5 seeds; layer is the validation-optimal layer; WildGuardMix test set F1 (percentage).

    Swipe horizontally to read the table

    Model and layerLinearBilinearMLPEE-MLPTPC five-order
    gemma-3-27b-it L3288.0388.7988.4988.3988.86
    Qwen3-30B-A3B-Base L3285.5384.8785.4885.2485.57
    gpt-oss-20b L1686.7087.1387.8687.3188.05
    llama-3.2-3B L1683.2484.7883.7783.8484.48
    • The authors state that TPC is higher than both MLP variants on the test set for all four models. This is not true for every column in the table: on llama-3.2-3B the bilinear probe is higher than TPC; on Qwen the linear probe is close to TPC and higher than the bilinear probe.
    • There are exceptions on the validation set: gpt-oss-20b's MLP validation F1 is 98.21, TPC is 98.13 (Table 1). The authors place the claim of being higher than MLP on the test set.
    • Dynamic curves are in Fig. 2 and Appendix F.1. The authors state that TPC is comparable to or higher than black-box MLP and EE-MLP; the main text does not label curve F1 by order. Fig. 2 uses gemma-3-27b-it L40 and gpt-oss-20b L16, which are not necessarily the same layers as Table 1.

    Cascade evaluation

    • Setup: Algorithm 1, gemma-3-27b-it's L40. The x-axis is net parameter count on 17352 validation and 1725 test items; τ is 0.0, 0.001, 0.01, 0.1, 0.2, 0.4, 0.5 (Fig. 3).
    • Results: the main text does not give exact F1 for each τ. The authors state that cascades at medium-high τ are often comparable to the full polynomial, with net parameters only slightly more than the linear probe. Appendix Fig. 8 covers two layers of four models; the authors state that even if higher-order terms are noisy, the cascade is almost always stronger than the linear probe at similar compute.
    • Figure notes: the authors state that lower τ requires greater confidence before early exit (Fig. 3b). The bar heights for exit frequency at each order are not listed in the main text.

    Cross-dataset and external monitoring

    • Cross-set (gemma-3-27b-it L40, Table 3): on ToxicChat, TPC five-order F1 is 57.66, EE-MLP 52.97, linear probe 46.27; TPC's precision is 44.40, recall 82.24, FRR 7.99. On HarmBench, TPC's accuracy and F1 are both 100.0, linear probe accuracy is 99.00, FRR undefined. On OpenAI-moderation, TPC's F1 is 69.02, EE-MLP 67.39, linear probe 66.27.
    • Authors' interpretation: the authors state it transfers to different text styles, but on ToxicChat precision is low and recall high. The authors mainly attribute this to different harmful annotation standards, and consider it reasonable to judge some sensitive requests labeled harmless as harmful. Examples are in the appendix and are not repeated here.
    • External monitoring (Table 4, probe is gemma L40 full depth): TPC's F1 is 88.50 (1,381,889 parameters), linear probe 86.86, gpt-4o-mini 86.63, claude-3-haiku 83.24, o3-mini 82.03, Llama-Guard-3-8B 76.85, shieldgemma-2b 69.90 at the optimal threshold. The paper does not give that threshold value. The authors consider this a preliminary comparison and state that the external LLMs were not fine-tuned on WildGuardMix and prompts were not fully optimized. This 88.50 is not the same layer as the L32 result in Table 1.

    Subclass accuracy and attribution

    • Subclasses (Fig. 10, gemma-3-27b-it L40 test set): on private information, TPC goes from 69.1 at order 1 to 79.0 at order 5; social stereotypes from 67.1 to 76.3. The introduction states that fixed-order TPC has accuracy up to 10% higher than the linear probe on some harmful subclasses, and up to 6% higher than the MLP baseline; Fig. 10 says almost 10%, and one place in the difference panel says 6.6.
    • Non-monotonicity: in the causing material harm row, TPC order 4 is 97.8 and the other orders are 100.0. This is consistent with the statement in Limitations that it "often cannot monotonically improve with additional compute"; the authors do not separately explain this cell.
    • Attribution (Section 4.4, Fig. 5): for one harmful prompt on gemma-3-27b-it L40, the second-order truncated logit is 18.11. Neuron 4830's interactions with 2483 and 4916 each raise the logit by 0.005, and its interaction with 1960 lowers it by 0.002. The authors state this is a mechanistic account of how the original neuron combination changes the logit.

    Other ablations and analyses

    • Progressive training: Fig. 4 and Appendix G.1. The authors state that training order by order makes truncations at n=1 to 5 usable, whereas training only the full polynomial cannot stably yield good truncations. Point-by-point F1 is not given.
    • Rank: the authors state it is relatively stable at R of 32, 64, 128, 256, and the main experiment uses 64; R=1 often cannot stably exceed the linear probe (Fig. 14, Fig. 16).
    • Maximum order: after training to order 10, gains flatten, so the main experiment uses N=5 (Fig. 15). Per-order values are not given.
    • Symmetric and asymmetric CP: the authors state performance is similar, and the symmetric form has fewer parameters (Fig. 17). Verifiable point-by-point F1 is not given.
    • BeaverTails: Appendix Fig. 6 gives curves; the main text does not list table numbers.
    • Layer sweep, TPC five-order, 5-seed mean test F1: Llama-3.2-1B at L6 is 84.26 (Table 5); Llama-3.2-3B at L12 is 84.78 (Table 6); Llama-3.1-8B at L10 is 85.79 (Table 7). The authors state that the 3.2 series' optimum is in the middle-to-late layers, and 3.1-8B is earlier.
  5. What are some points that can be further explored?

    The authors note that small data, response-side harm, attribution interpretability, and non-monotonic scaling with compute remain for future work.

    Limitations and future directions noted by the authors

    • Small data: The small-data regime was not explored. The authors expect that both TPC and nonlinear EE-MLP would need stronger regularization to avoid overfitting in this regime (Limitations).
    • Task scope: The experiments mainly involve harmful prompt classification. Future work could evaluate on more datasets, as well as cases where harm appears in model responses (Limitations).
    • Interpretability: The second-order terms can show how much logit is changed by neuron combinations, but the combinations in Section 4.4 are dense and lack obvious human interpretability. Future work could apply polynomials on SAE features, or learn interactions among only the most prominent few neurons (Limitations).
    • Non-monotonicity and layer selection: TPC and MLP baselines often do not improve monotonically with additional test-time compute, and activation monitoring requires searching for suitable layers. Future work could study finer progressive training, as well as multi-layer probes or ensembles (Limitations).

    Experimental coverage

    • The main experiments monitor gemma-3-27b-it, Qwen3-30B-A3B-Base, llama-3.2-3B, and gpt-oss-20b; Appendix F.4 additionally performs layer scans on Llama-3.2-1B and Llama-3.1-8B.
    • The main metric is harmful-class F1 on WildGuardMix, averaged over 5 random seeds; the scale is 86.8k/1.7k train/test, with the training set further split 80/20 into a validation set (Section 4.1).
    • Comparisons include linear probes, low-rank bilinear probes, parameter-matched MLPs, and 5-exit EE-MLP; the cascade in Fig. 3 uses τ = 0.0, 0.001, 0.01, 0.1, 0.2, 0.4, 0.5.
    • The appendix evaluates classifiers trained on the WildGuard training set on ToxicChat, HarmBench, and OpenAI-moderation, and compares with gpt-4o-mini, claude-3-haiku, o3-mini, Llama-Guard-3-8B, and shieldgemma-2b (Appendix F.2–F.3). BeaverTails is also used for training.
    • The paper does not report statistical significance tests, nor agreement between probe judgments and human review.
  6. Summarize the main content of the paper

    TPC extends the linear probe into a polynomial monitor that can be truncated by budget, and compares with MLP probes on WildGuardMix.

    TPC is dynamic safety monitoring for LLM activations: it performs binary classification before harmful prompts become unsafe outputs, and places extra computation on hard examples or higher budgets.

    • Method: token-wise mean pooling over the residual stream at a given layer, then fitting a truncatable polynomial. The first two terms are the linear probe; higher orders model neuron products using a symmetric low-rank decomposition; low-order weights are frozen order by order. At test time the order can be fixed, or terms can be added only when the sigmoid score falls in (τ, 1−τ).
    • Static main results: on WildGuardMix, best layer on the validation set, mean over 5 seeds (Table 1). gemma-3-27b-it L32 five-order TPC test F1 is 88.86%, linear probe 88.03%; gpt-oss-20b L16 is 88.05% vs. 86.70%; Qwen3-30B-A3B-Base L32 is 85.57% vs. 85.53%. llama-3.2-3B L16 TPC is 84.48%, while the bilinear probe in the same table is 84.78%, higher. The authors state that on the test sets of all four models, TPC is higher than MLP and EE-MLP with the same parameters.
    • Other uses: the authors state that the cascade on gemma-3-27b-it L40 can approach the full polynomial, with net parameters only slightly more than the linear probe; the exact F1 for each τ is not given in the main text. In Fig. 10, TPC accuracy for private information goes from 69.1 to 79.0, and for social stereotypes from 67.1 to 76.3. The introduction states up to 10% accuracy improvement over the linear probe on some subclasses, and up to 6% over the MLP baseline.
    • Authors' conclusions: the same polynomial can trade compute for guardrail strength, can early-exit based on input uncertainty, and provides attribution relative to the original neurons. They also consider small data, response-side harm, human readability of dense interactions, and test-time compute not necessarily improving monotonically all still unresolved.

Related papers

Show 3 more papers
Read originalICLR 2026