Train on prefill, monitor at decode: Using sparse autoencoders for topic monitoring
On the map: Mechanistic interpretability → SAE features and their applications
Abstract (arXiv)
Topic monitoring is the task of labelling the topic of each token in a model's response during generation. Activation-based monitors that run at generation time have so far been trained to detect harmful content and are limited to two or three classes. We introduce TopicScope, a framework for training causal topic classifiers on SAE features that assign a topic to every token, so that the label can change partway through a response. We train three detector architectures on synthetic multi-topic conversations covering seven topics. Across Gemma-3 1B and 4B, monitors trained on features extracted from prefill hidden states were able to generalise to decoding. We also found that the classifiers are robust to perturbations, losing at most 5 macro-F1 points when off-topic asides are inserted, topics are removed or sections are reordered. Ablations conducted to understand the contribution of the SAE revealed that classifiers reaching baseline performance without it were several times larger. Our findings show that compact topic monitors can be trained inexpensively in prefill and deployed during generation. More broadly, our work shows where SAEs are useful beyond safety classification. Our code, dataset and checkpoints are available at https://github.com/Mercity-AI/SAE-Guardrails and https://huggingface.co/collections/Mercity/online-guardrails-using-sparse-autoencoders-6ac602940468c62fefb2b9e8
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in SAE features and their applications, one of 13 directions in Mechanistic interpretability. Builds on 37 of its 54 references that are in the map. Submitted 6 Nov 2026.
Builds on
37 of 54 references.
Closest ancestors · 5
Same direction, newest first
- 2025Are Sparse Autoencoders Useful? A Case Study in Sparse Probing23 Feb
- 2025Sparse Autoencoder Features for Classifications and Transferability17 Feb
- 2025AxBench: Steering LLMs? Even Simple Baselines Outperform Sparse Autoencoders28 Jan
- 2024Jumping Ahead: Improving Reconstruction Fidelity with JumpReLU Sparse Autoencoders19 Jul
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Models15 Sep
Other references · 32
- 2017Attention Is All You Needcited by 62,125
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,222
- 2022A ConvNet for the 2020scited by 3,746
- 2025Gemma 3 Technical Reportcited by 2,058
- 2018An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modelingcited by 1,578
- 2016Understanding intermediate layers using linear classifier probescited by 1,541
- 2017Learning Important Features Through Propagating Activation Differencescited by 1,481
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,337
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 971
- 2022BERTopic: Neural topic modeling with a class-based TF-IDF procedurecited by 854
- 2024WildGuard: Open One-Stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMscited by 566
- 2023NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Railscited by 397
20 more
- 2024ShieldGemma: Generative AI Content Moderation Based on Gemmacited by 276
- 2025Qwen3Guard Technical Reportcited by 184
- 2017Autoencoding Variational Inference For Topic Modelscited by 177
- 2025Detecting Strategic Deception Using Linear Probescited by 87
- 2018Text Segmentation as a Supervised Learning Taskcited by 78
- 2025Detecting High-Stakes Interactions with Activation Probescited by 68
- 2026Constitutional Classifiers++: Efficient Production-Grade Defenses against Universal Jailbreakscited by 56
- 2025From Judgment to Interference: Early Stopping LLM Harmful Outputs via Streaming Content Monitoringcited by 27
- 2024CantTalkAboutThis: Aligning Language Models to Stay on Topic in Dialoguescited by 16
- 2025Model Directions, Not Words: Mechanistic Topic Models Using Sparse Autoencoderscited by 9
- 2023Multi-Granularity Prompts for Topic Shift Detection in Dialoguecited by 7
- 2026Predict, Don't React: Value-Based Safety Forecasting for LLM Streamingcited by 6
- 2024A Flexible Large Language Models Guardrail Development Methodology Applied to Off-Topic Prompt Detectioncited by 5
- 2025Sparse Autoencoders are Topic Modelscited by 5
- 2026SentGuard: Sentence-Level Streaming Guardrails for Large Language Modelscited by 4
- 2026kNNGuard: Turning LLM Hidden Activations into a Training-Free Configurable Guardrailcited by 3
- 2026Conversational Context Classification: A Representation Engineering Approachcited by 2
- 2026FreoStream:Enhancing Stream Guardrails via Future-Aware Reasoning and Safety-Aligned Optimizationcited by 1
- 2026Fence: Specialized SLM Guardrails for LLM Applicationscited by 1
- 2026Beyond Top Words: MonoTM for Topic Modeling with Interpretable Monosemantic Featurescited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Building Auditable AI Text Detectors with Sparse Autoencoders
- 2025SAE-SSV: Supervised Steering in Sparse Representation Spaces for Reliable Control of Language Models
- 2025Unveiling Decision-Making in LLMs for Text Classification : Extraction of influential and interpretable concepts with Sparse Autoencoders
- 2024Provable unlearning in topic modeling and downstream tasks
- 2026SAS: Simple Attention Sparsification via End-to-End Optimization of Context Ranking
- 2025Adamas: Hadamard Sparse Attention for Efficient Long-Context Inference
- 2025Calibrating Lightweight Sparse Autoencoder Feature Steering
- 2025Sparse Autoencoders for Hypothesis Generation