“The output signals, the only externally visible indication of the internal state…”
But today, we can look inside.
Electroencephalography (EEG) turned the brain’s electrical activity into a measurable, clinically useful signal. Large language models offer a related opportunity: their internal states can be measured directly.
SPINiverse studies what those statesreveal before the model speaks.
Research
Text classification
SPIN: Sparsifying and Integrating Internal Neurons in Large Language Models for Text Classification
Sparse probes identify task-relevant units at multiple layers, which are then integrated for text classification.
Content safety
LLM Safety From Within: Detecting Harmful Content with Internal Representations
A continuous harmfulness score is estimated from a frozen LLM’s internal representations without generative decoding.
Visual document retrieval
MINER: Mining Multimodal Internal Representation for Efficient Retrieval
Retrieval signals from internal layers are aligned and fused into one dense embedding for visual document search.
Agentic LLM safety
Detecting Harmful Agent Trajectories from LLM Internal Representations
Sparse representations selected across the model’s layers are combined to detect harmful content and context-dependent unsafe tool use in agent trajectories.
SPINiverse visualization
01 · Representations
Layer activations
For one input, SPIN collects each internal unit’s activation at every token position and layer.
02 · Pooling
Sequence-level pooling
Max pooling retains each unit’s strongest response across token positions, removing the token axis.
03 · Probing
Layer-wise sparse probes
An L1-regularized linear probe is fitted to each layer; coefficient magnitude provides a task-specific saliency score.
04 · Selection
Cumulative-weight selection
SPIN retains the smallest subset whose normalized probe weights account for a chosen share of each layer’s decision.
05 · Integration
Cross-layer representation
The selected activations are concatenated across layers into multi-grained features for classification.
06 · Prediction
Classification head
The frozen backbone runs once; the classification head requires no token generation and can use a validated early exit.
Visualisation adapted from the interactive SPIN demo by Yilun Liu. Activation values shown are synthetic.