TRANSMISSION // 2611.12935v1

TopicScope tracks an AI response’s subject as it is generated

Source published

A preprint describes small classifiers that read a language model’s internal activity to label topics token by token. Tests suggest useful transfer from training on completed text to monitoring generated responses, but exact topic-switch detection and real-world reliability remain unproven.

AI-generated conceptual illustration for TopicScope tracks an AI response’s subject as it is generated
AI-generated conceptual illustration; not documentary evidence.

A billing assistant can start by explaining a refund and finish by offering legal advice. Detecting that shift before the response ends could help keep specialised AI systems within scope. Researchers Rishikesh Mallagundla and Pranav Patel at Mercity present TopicScope, a framework for following a response’s subject as it unfolds, rather than assigning one label to the finished answer.

Learning from completed conversations

The preprint’s central idea is to train a monitor using text processed all at once, then apply it while a language model generates text one token—a word or word fragment—at a time.

These stages are called prefill and decode. In a causal language model, the internal representation at a position depends on the text up to that position, not future words. This makes training on completed examples compatible with monitoring an unfinished response. Whether the monitor handles the model’s own writing is a separate empirical question.

TopicScope reads internal activity from the final ten layers of Gemma 3 models with one billion and four billion parameters. Pretrained sparse autoencoders transform those signals into features, only a small fraction of which activate for each token. The researchers then select features and feed them into a topic classifier. Neither Gemma nor the autoencoders are updated; only the classifier is trained.

The team compared three classifier designs: a recurrent network that maintains a running memory, a convolutional network that examines a recent window, and a Transformer that can attend to earlier positions. All are constrained not to look ahead.

Strong results on synthetic examples

Training and evaluation used 10,000 synthetic prompt–response pairs generated and checked by GPT-5.6 Luna through the researchers’ Simula pipeline. The seven categories covered enterprise documents, news and content, customer service, legal matters, finance, human resources and healthcare.

Most examples contained several topics. The researchers varied transitions from explicit signposts to unmarked changes, reducing the usefulness of simply spotting phrases such as “on a separate note.” They reserved 7,000 records for training, 1,500 for validation and 1,500 for testing.

On labelled test text processed in prefill, the strongest autoencoder-based convolutional classifiers reached macro-F1 scores of 97.3% for Gemma 3 1B and 97.1% for Gemma 3 4B. Macro-F1 balances precision and recall within each topic, then averages the seven topic scores equally; it is not simply the percentage of tokens labelled correctly.

Feature selection mattered. Selecting features solely because they activated strongly worked less well for the larger model. Selecting features according to how well they distinguished the labelled topics largely removed that weakness.

Generation results need a different interpretation

The researchers next applied the trained monitors, unchanged, to responses Gemma generated for 1,000 held-out prompts. With topic-informed or per-token feature selection, roughly 90–98% of generated tokens received labels belonging to topics requested in the prompt.

That result supports transfer to generation, but it does not establish 90–98% classification accuracy. The generated responses lacked independently established token-level topic labels. Instead, the evaluation measured agreement with the requested topics and whether each requested topic received a substantial share of labels.

A response could omit a requested subject, or a monitor could mislabel it; these measures cannot fully separate those possibilities. Comparisons with teacher-written answers suggested that Gemma’s omissions contributed to lower topic coverage. Exact placement of topic boundaries during generation remains untested against gold-standard labels.

Robustness has limits

The team also edited held-out responses by inserting asides, removing topics, rearranging passages or replacing a passage with another on the same subject. With dynamically selected features, no tested edit reduced macro-F1 by more than five percentage points. The convolutional detector was particularly stable, losing at most 1.1 points.

However, inserted asides were excluded from the accuracy scoring. The experiment therefore measured whether interruptions disrupted labels on the remaining text—not whether the system reliably recognised the interruptions as off-topic.

There was no dedicated “none of these topics” category, so every aside still received one of the seven labels. Confidence sometimes helped distinguish asides, but the dynamic-feature convolutional detector performed close to chance on that task.

Smaller classifiers, not proven faster systems

Sparse autoencoders were not necessary for high accuracy: classifiers reading raw internal states matched or sometimes exceeded their results. Their main demonstrated advantage was compactness. Static-feature classifiers had about 1.4–3.6 million parameters, versus 7.6–20.7 million for raw-state classifiers on Gemma 3 4B.

Those classifier counts exclude feature-extraction machinery, and do not by themselves prove lower end-to-end latency or cost. The evidence also comes from synthetic, single-turn exchanges, two sizes of one model family and seven fixed topics. Testing real multi-turn conversations, unfamiliar subjects and accurately annotated generated text will be necessary before treating TopicScope as a dependable deployment guardrail.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.