Manuscript Offprint

arXiv:2608.28099

Speculative Probing: LLM Monitoring at Speculative-Decoding Cost

Collin Zhang, Tingwei Zhang, Vitaly Shmatikov

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Real-time classification during language model inference is valuable for safety filtering, behavioral analysis, and model monitoring, but current approaches force a trade-off between accuracy and efficiency. Hidden-state probes are fast but limited: they are either not context-aware: operating on a single vector and cannot model interactions across positions; or they are very costly: having dedicated classifier models (Llama Guard, Qwen Guard, LLM-as-judge) or performing computation on hidden states for all tokens and then pooling the results (MultiMax). This shows an intrinsic trade-off between efficiency and accuracy.

However, we find that the speculative-decoding module in recent LLMs can be repurposed for efficient high-quality classification. By appending a trained soft prompt at the end of the target sequence, we can repurpose the speculative-decoding module into a sequence classifier. At inference time in a speculative-decoding pipeline, the KV cache is already in GPU memory, so classification adds negligible overhead. We evaluate on four classification tasks across four models (Qwen3.5-4B, 9B, 27B, MiniCPM4.1-8B). Our small probes consistently outperform zero-shot GPT-5.4-mini and, on multilingual prompt safety, match or beat specialized 8B safety classifiers (Qwen3Guard-Gen-8B, Llama-Guard-3-8B) without running a full LLM.

1 Introduction

Modern LLM systems need more than just text generation. Safety filtering, behavioral monitoring, live quality control, and user studies all require real-time classification of model inputs and outputs (Inan et al., 2023). Classification must happen during or immediately after generation, placing strict constraints on latency.

These monitoring needs are concrete and active in deployment: safety filtering of harmful prompts and outputs (Inan et al., 2023; Cunningham et al., 2026), monitoring reasoning-model chain-of-thought traces for misbehavior (Baker et al., 2025), detecting prompt injection and in-context scheming in agentic systems (Meinke et al., 2024), PII leakage prevention in enterprise pipelines (Asthana et al., 2025), and real-time hallucination and uncertainty estimation (Su et al., 2024; Kossen et al., 2024).

Current approaches present an unsatisfying trade-off. Hidden-state probing adds a linear or MLP classifier on the model’s internal representations. It is cheap, but it only takes one or a few hidden states at the last token, limiting accuracy on tasks that require understanding long-range dependencies or structural patterns. At the other extreme, running a separate classifier model (e.g., Llama Guard (Inan et al., 2023), Qwen Guard, or LLM-as-judge) achieves high accuracy but significantly increases inference cost.

We observe that modern language models often ship with auxiliary layers for speculative decoding (Qwen3.5, DeepSeek, MiniCPM4.1). The Multi-Token Prediction (MTP) layer in Qwen3.5 (Team, 2026) is a small transformer (one decoder layer each) trained to predict future tokens from the base model's hidden states and input embeddings. Crucially, during speculative decoding, their KV caches are already computed and resident in GPU memory. We can repurpose these layers for classification at very low additional cost: a single or a few speculative-decoding layer forward passes, no architectural changes to the inference pipeline. This makes our method conditional on the presence of such a head, but that is a mild and shrinking condition: a native MTP layer now ships with Qwen3.5 and Qwen3.6, GLM 5.2, and DeepSeek V4 Preview, while MiniCPM4.1 and Llama-3.1 are served with Eagle3 heads, and a model without a drafter can have one distilled post-hoc for decoding speed alone. We therefore treat Speculative Probing as free reuse of a module deployments already pay for, rather than a new requirement we impose.

Co-pretrained MTP (Qwen3.5, DeepSeek-V3) trains the auxiliary head jointly with the base model over the full pretraining corpus. The head's hidden-state representations are therefore aligned with the base model for the multi-token prediction objective from the outset, and both components are exposed to the same large-scale data budget. Post-hoc Eagle3 (MiniCPM4.1, LLaMA-3.1) instead distills the head separately on a frozen, already-trained base, fitting it to mimic the base's next-token distribution. The training set is typically drawn from the supervised fine-tuning dataset used during the model's post-training stage. Consequently, Eagle3 is distilled on a supervision budget several orders of magnitude smaller than the pretraining corpus consumed by MTP.

This distinction may matter for our use case: co-pretrained MTP heads generally achieve higher speculative-decoding acceptance rates than post-hoc distilled heads, and stronger draft-head quality plausibly translates into better features to probe. Empirically, probes built on the Qwen MTP head outperform those built on the MiniCPM Eagle3 head by 4–12 pp across most tasks, while both still surpass zero-shot LLMs and match purpose-built classifiers ( §6.5§6.5).

Our method is simple: freeze the base model and the MTP layer, append k learned soft-prompt vectors to the input, then perform classification with a linear transformation. For Qwen3.5-27B with k=5, this only trains about 18K parameters.

We make the following contributions. First, we propose Speculative Probing, which repurposes the MTP/Eagle3 speculative-decoding head as a frozen feature extractor for sequence classification, training only a recursive soft prompt and linear head ( ∼\sim16K–20K parameters per task) on top of the head's already-computed KV cache. Second, we evaluate two speculative-decoding head families, namely co-pretrained MTP (Qwen3.5-4B/9B/27B) and post-hoc-distilled Eagle3 (MiniCPM4.1-8B), on four binary classification tasks: instruction contradiction, repetitive- and branched-thinking detection in chain-of-thought, and multilingual prompt safety. Probes on either family beat zero-shot GPT-5.4-mini and, on multilingual prompt safety, match or beat dedicated 8B safety classifiers (Qwen3Guard-Gen-8B, Llama-Guard-3-8B), with a modest gap in favor of the co-pretrained heads. Third, we ablate prompt length and the choice of classification head (trainable linear vs. reusing the frozen LM head). Our code is available at https://github.com/collinzrj/SpeculativeProbing.

References (34)