Reading the Model's Mind About Yours: Live Layer-32 User Mental-State Probes in Qwen3.8-27B
Every conversational language model silently builds an internal representation of whether you seem frustrated, confused, rushed, curious, or skeptical. We wired five orthogonalized Layer-32 linear probes straight into Basalt's CUDA serving kernel to expose that hidden user model live in Space Chat, and discovered two things we didn't expect along the way.
Following NOTE 03 (Glass-Box Chat), we extract five read-only user mental-state linear probes (user_frustration, user_confusion, user_urgency, user_curiosity, user_skepticism) at Layer 32 (50% depth, d=5120) of Qwen3.8-27B using forward-only Whitened-Fisher LDA with cross-axis hard negatives and exact behavioral-core orthogonalization (leakage < 2e-9). Evaluated on 60 zero-keyword implicit OOD prompts, the Layer-32 probes reach 0.9992 macro AUROC (96.0% 5-way accuracy, 0/10 neutral false positives) versus 0.9508 (84.0%) for a TF-IDF + char-ngram Ridge baseline, opening a +0.174 AUROC gap on deadpan sarcasm and implicit frustration without ever training on sarcasm. On 25 adversarial minimal pairs sharing identical technical jargon and lexical traps, L32 scores 25/25 (100.0%, 0.9920 AUROC) versus 21/25 (84.0%, 0.8640) for TF-IDF. We further document: (1) a 69% Cohen's d collapse (4.57 → 1.41) if probes are read at decode-end rather than snapshotted at prompt-end, (2) live /mind leave-one-span-out L32 causal ablations (~240 ms) that surface active dampeners alongside triggers, and (3) the exact dual of NOTE 14: Layer-32 user-state axes are decodable without being steerable (nearly orthogonal to all 5 personality cores, mean |cos| = 0.082, with |Δlogit| ≤ 0.15 under ±8% residual-norm injection).
1. Transparency into the AI's hidden user model (not mind-reading)
When you message a 27B parameter model, its middle layers do not merely parse syntax, they infer who is on the other side of the prompt and what situational state they appear to be in. That implicit user model shapes tone, pacing, hedging, and sycophancy behind closed doors.
Our goal in Space Chat is reverse transparency: showing you, in real time and at zero added generation latency, what Qwen3.8-27B's Layer-32 residual stream is inferring about your state, and letting you inspect which exact phrases caused that inference via /mind, or switch the readout off entirely in the Core menu.
To be completely explicit up front: linear probes do not read your mind and are not clinical instruments. They read the language model's internal estimate of five conversational dimensions, affective friction (frustration), cognitive load (confusion), time pressure (urgency), open exploration (curiosity), and critical doubt (skepticism). Making that internal estimate visible turns an opaque assumption into an inspectable scientific signal.
/mind adds on-demand 7-layer emergence and causal span ablation in ~240 ms.2. How the five probes are extracted and orthogonalized
Using Basalt's read-only internal extractor (/v1/internal/extract), we collect prompt-end hidden states across seven layers (L18, L24, L30, L32, L36, L40, L44) of Qwen3.8-27B on 22 positive prompts, 12 opposite-pole prompts, and 16 neutral everyday baseline prompts per axis, plus cross-axis hard negatives (8 positive examples from each of the other four mental states). Hard-negative mining is essential: without it, a frustration probe happily fires on calm confusion or urgent incidents simply because all three share negative valence.
For each axis, we compute the unit-normalized Whitened-Fisher / LDA direction in R5120 via the Woodbury matrix identity (shrink = 0.28, total extraction time 4.6 seconds on one RTX 5090). At our shared live probe layer (L32), we explicitly project out the 5-vector orthonormal subspace spanned by Space Chat's three behavioral steering cores (anti_sycophancy, epistemic_honesty, concise_rigor), driving behavioral-steering leakage to ≤ 1.9e-9. Out-of-fold 5-fold cross-validation yields prompt-end AUROCs of 0.9977-1.0000 (Cohen's d = 3.88-8.16) and cross-axis pairwise cosines of |cos| ≤ 0.27. Each probe is written to a 40 KiB .cvec.gguf artifact loaded into Basalt's device-resident CoreBank, always with decode steering weight clamped strictly to 0.0.
3. Are the probes just matching keywords? Zero-keyword OOD & adversarial minimal pairs
High 5-fold cross-validation on clean prompts is necessary but easy to distrust: a skeptical reader should immediately ask whether a linear probe on a 27B model is doing anything smarter than a bag-of-words detector hunting for words like "exhausted", "confused", or "urgent".
To test that head-on, we constructed two strictly held-out benchmarks with zero retraining and compared our Layer-32 probes against a class-balanced word + bigram + 4-char TF-IDF Ridge classifier trained on the exact same training prompts:
- Experiment 1A (60 Zero-Keyword Implicit OOD Prompts): 10 prompts per axis plus 10 neutral controls, programmatically checked against a 47-term blocklist of explicit emotion/state words (0 violations). Frustration prompts rely on deadpan sarcasm and situational exasperation (e.g., "Great, another 502 right after rolling back the exact commit that used to pass").
- Experiment 1B (25 Adversarial Minimal Pairs = 50 Prompts): Matched pairs sharing the same technical topic and deliberate lexical traps, e.g., putting "five minutes" and "production" into calm planning questions, flipping a single outcome word inside sarcastic praise, or contrasting confused vs. fluent mastery using identical pointer/TLS/Kubernetes vocabulary.
| Mental-State Axis | OOD L32 AUROC (d) | OOD TF-IDF (d) | OOD ΔAUROC | Min-Pair L32 | Min-Pair TF-IDF |
|---|---|---|---|---|---|
user_frustration |
1.0000 (4.55) | 0.8260 (1.40) | +0.1740 | 5/5 (1.000) | 3/5 (0.640) |
user_confusion |
0.9960 (3.70) | 0.9500 (2.11) | +0.0460 | 5/5 (0.960) | 3/5 (0.720) |
user_urgency |
1.0000 (5.06) | 0.9960 (4.50) | +0.0040 | 5/5 (1.000) | 5/5 (0.960) |
user_curiosity |
1.0000 (4.75) | 0.9860 (3.83) | +0.0140 | 5/5 (1.000) | 5/5 (1.000) |
user_skepticism |
1.0000 (3.78) | 0.9960 (3.25) | +0.0040 | 5/5 (1.000) | 5/5 (1.000) |
| Macro / Overall | 0.9992 (96% 5-way) | 0.9508 (84% 5-way) | +0.0484 | 25/25 (0.992) | 21/25 (0.864) |
Two honest nuances stand out in that table. First, on user_urgency, user_curiosity, and user_skepticism, a strong character n-gram TF-IDF baseline is surprisingly competitive (0.986-0.996 AUROC) because stylistic syntax (imperative triage structure, open "why/how" causal questions, contrastive doubt clauses) carries strong surface cues. Second, the moment surface cues invert or collide, deadpan sarcasm in frustration (1.000 vs 0.826 OOD; 1.000 vs 0.640 minimal pairs) and jargon-matched confusion vs. mastery (0.960 vs 0.720 minimal pairs), bag-of-words degrades sharply while Qwen3.8-27B's Layer-32 residual stream stays near ceiling with 0/10 neutral false positives.
4. A critical systems lesson: prompt-end vs. decode-end residual collapse
When we first wired our five probes into Basalt and ran real 96-token replies, every single unseen prompt (neutral, furious, panicking, or confused) came back completely flat (~15-29%). We initially wondered if the probes had failed to generalize to live chat. They hadn't.
Inspecting Basalt's forward.cpp and request_finish.cpp revealed why: probe_cores_bf16 executed during prefill, and then executed again on every single decode window, overwriting st.last_probes until request completion emitted the Layer-32 state of the final punctuation/EOS token of the assistant's reply. By token 64 of a calm, structured assistant answer, the residual stream is busy planning its closing sentence, not holding the user's initial urgency or skepticism at full amplitude.
ids[n-1] (cyan).
Snapshotting prompt_probes_ inside SessionRequest::run_window() immediately after first_window == true (which feeds the exact final prompt token ids[n-1] before sampling token 0) restored 1.0000 AUROC across all five axes (mean Cohen's d = 4.57 vs. 1.41 at decode-end). Anyone instrumenting production LLM engines with activation monitors should take note: where in the generation lifecycle you latch the residual stream matters as much as the probe weights themselves.
5. Multi-turn trajectories and causal phrase dampeners
Real conversations evolve. In Experiment 3, we evaluated three 4-turn dialogues both in full conversation context and standalone (each turn fed in isolation):
- Confusion → Breakthrough → Curiosity: On Turn 1 (blocking
time.sleep(5)insideasync def), L32 reads 80% Confusion. On Turn 2 ("Hold on, so async def doesn't automatically spawn a background thread?"), the in-context probe reads 83% Confusion, whereas evaluating that exact sentence standalone readsCalm & Focused. Once the user understands on Turn 3 ("Oh! That finally clicks..."), confusion drops cleanly83% → 50% → 35%while curiosity climbs16% → 19% → 36% → 47%. - Live Outage → Resolution: During a Redis OOM incident, Turn 1 reads 89% Urgency; Turn 2 ("Memory is at 100% because session keys had no TTL!") retains 69% Urgency in context vs.
Calm & Focusedstandalone; the instant Turn 3 reports "memory is dropping back to 65% and 500s stopped," urgency plunges from 69% to 25%. - Honest nuance on terse carry-over: In our third dialogue (Nginx 403 debugging), Turn 2 spiked to 76% Frustration, but a terse 4-word Turn 3 ("Still broken. Same 403.") attenuated to 39% Frustration, stronger than baseline, yet below our 48% elevated badge threshold. Context clearly modulates L32, but short matter-of-fact follow-ups do not lock the probe permanently high.
Inside Space Chat, typing /mind (or clicking Deep Trace inside any turn's inspector) runs a 7-layer emergence sweep (L18 → L44) plus leave-one-span-out L32 causal ablation (~240 ms median on RTX 5090). Rather than just showing which words fired a probe, causal ablation exposes dampeners, clauses whose removal causes the model's mental-state estimate to jump up:
Removing "honestly exhausted," drops Layer-32 frustration alignment by Δcos = +0.0119. Removing the polite technical question at the end spikes frustration by +0.0638 (Δcos = −0.0638): without that grounding request, Qwen3.8-27B reads the remaining fragment as pure venting. We observed the same pattern on confusion: removing "so I'm totally tangled up;" dropped confusion (+0.0145), while removing the actionable ask "could you draw the handshake order?" increased perceived disorientation (−0.0243).
6. The exact dual of NOTE 14: Decodable Without Being Steerable
In NOTE 14 (Steerable Before Decodable), our autonomous GPU research engine showed that causal steering directions can operate in unembedding-orthogonal bottlenecks that are steerable before they become linearly decodable. Here we tested the converse question on Qwen3.8-27B's Layer-32 user-state axes: if a linear direction cleanly decodes the user's mental state, does injecting it at Layer 32 causally steer how the assistant responds?
We ran two checks across all 13 cores currently resident in Basalt's CoreBank (5 user mental-state probes, 3 behavioral cores, and the 5 independently extracted assistant personality cores from NOTE 15: assertiveness, creativity, formality, playfulness, warmth):
- Subspace Geometry: By construction, max
|cos|against the 3 behavioral steering cores is0.00. Against the 5 independently extracted assistant personality cores (with no orthogonalization applied between them), mean|cos|is only 0.0816 (max+0.288betweenuser_curiosityandcreativity; alluser_frustrationcosines are≤ 0.087). - Causal Steering Intervention (±8% residual norm at L32): Injecting
+α·vkand−α·vkat 8% of Layer-32 residual norm (||h32|| ≈ 71) on four neutral prompts produced negligible first-token response-style logit swings across all five axes:user_frustration(−0.115),user_confusion(+0.110),user_urgency(+0.146),user_curiosity(−0.152), anduser_skepticism(−0.015), roughly an order of magnitude smaller than single-layer behavioral steering cores, and inconsistent in sign.
|cos| = 0.082; behavioral cores 0.00). Right: Strong ±8% residual-norm injection at L32 shifts response-style logits by at most 0.15, showing that representing the user's state and steering the assistant's persona live in distinct linear subspaces.This gives a clean mechanistic picture of conversational Theory of Mind in Qwen3.8-27B: the model maintains an observer subspace (linearly encoding the user's inferred mental state with 0.9992 OOD AUROC) that is geometrically separated from its actor subspace (where behavioral and persona steering cores operate). Reading the observer subspace does not mean injecting it will flip the actor, just as NOTE 14 showed that actor-subspace steering vectors can flip generation before they are linearly readable via the logit lens.
7. Honest limitations and failure modes
Publishing only the headline AUROC would hide real failure modes we observed while testing this system live:
- Distributed / blended circuits break leave-one-span-out additivity: On our blended
Skeptical & Curiousprompt ("Every vendor deck claims 10x speedups on microbenchmarks, what hidden assumptions make that claim break on real production traffic?"), ablating any individual span produced a slightly negativeΔcoson skepticism (−0.005to−0.017). Because skepticism was distributed redundantly across multiple clauses while competing curiosity cues were concentrated, removing single phrases dropped curiosity faster than skepticism. Leave-one-out span ablation is cleanest on sharp, localized triggers and dampeners, not redundant multi-clause blends. - Multi-slot batching under heavy load: When Basalt runs solo or low-concurrency requests,
first_windowsnapshots exact tokenids[n-1](1.0000 AUROC across all 5 axes). Under heavy multi-slot continuous batch admission where a slot bypasses the solo first window, probes can fall back to the preceding chunk boundary; per-slot prompt-end latching in batch admission is next on our Basalt systems roadmap. - Single-model, English-calibrated scope: All five probes and Platt thresholds are calibrated specifically on Qwen3.8-27B (and explicitly report
unavailableon models without CoreBank probes, like Inkling-2-Mini). Subtle cultural registers, non-English prompts, and long multi-turn emotional drifts remain open evaluation frontiers.
Open Space Chat, send any message, and click the quiet Mind pill beneath the reply, or run /mind <your text> for the full 7-layer emergence curve and leave-one-span-out L32 causal phrase heatmap.