Letting a Topic Model Absorb Its Own LLM Hallucinations

Topic models summarize a collection of documents by learning a small set of themes, called topics, and describing each document as a mixture of them. They fail on short texts such as headlines, tweets, and question titles, because a five-word snippet rarely shares words with any other snippet. A recent fix asks a large language model (LLM) to expand each snippet into a paragraph, then trains the topic model to reconstruct the paragraph's words. This works, but it brings in a new problem. LLMs invent content, and every invented word becomes something the topic model is trained to explain. The best current system admits this weakness and has no defense against it.

We propose to build the defense into the topic model's probabilistic story. The model explains each expanded paragraph as a mixture of two sources. The first is a "grounded" channel, driven only by topics inferred from the original snippet. The second is a "drift" channel that is free to explain whatever the LLM added beyond the snippet. Because the grounded topics must also reconstruct the snippet's own words, invented off-topic content cannot pull them away from what the snippet actually says, and the drift channel collects it instead. The model's estimate of how much of each expansion came from drift then works, at no extra cost, as a per-document hallucination score for the expansion.

Core Claim

A neural topic model is a variational autoencoder (VAE): an encoder network maps a document to topic proportions $\theta$, and a decoder reconstructs the document's word counts from $\theta$ through a topic-word matrix $\beta$. This line of models began with Discovering Discrete Latent Topics with Neural Variational Inference and is surveyed in A Survey on Neural Topic Models.

The closest prior work is PVTM, from Enhancing Short-Text Topic Modeling with LLM-Driven Context Expansion and Prefix-Tuned VAEs. PVTM uses an asymmetric VAE. The encoder sees only the short text, through a prefix-tuned sentence encoder, while the decoder reconstructs the bag of words of the LLM expansion. Because the encoder sees only the snippet, PVTM is protected at the input. It is not protected at the training target: the encoder is still trained to produce a $\theta$ that predicts every expansion word, invented or not. The authors acknowledge that PVTM degrades when expansions hallucinate in specialized domains.

Our claim is that adding an explicit drift component to the decoder and tying $\theta$ to a second reconstruction target, the snippet's own words, yields two things. Document representations stay robust to hallucinated expansion content, and the model produces a usable detector of that content as a by-product. Concretely, for document $d$ with snippet words $x_d$ and expansion words $e_d$, we use the following decoder. The encoder computes $\theta_d$ from the snippet alone. A second, small encoder computes drift proportions $\eta_d$ and a gate $\lambda_d \in [0,1]$ from the snippet and the expansion together.

$$p(w \mid x_d) = \mathrm{softmax}(\beta^\top \theta_d)_w, \qquad p(w \mid e_d) = (1-\lambda_d)\,\mathrm{softmax}(\beta^\top \theta_d)_w + \lambda_d\,\mathrm{softmax}(\beta^\top \eta_d + b)_w$$

Here $\beta$ is shared across both channels. The vector $b$ is a corpus-level background that absorbs the LLM's habitual filler vocabulary. A Beta prior on $\lambda_d$ favors small values, so drift must earn its share.

The design forces a useful split. An expansion word that agrees with the snippet's topics is cheapest to explain through $\theta_d$. A word that belongs to a different theme can only be explained cheaply through $\eta_d$. That is exactly where off-topic invention should go. Topic-word learning still sees invented words, but it assigns them to whatever topics they genuinely resemble, so they do not contaminate the snippet's own representation. At test time only the snippet encoder runs, so, as in PVTM, inference needs no LLM call.

Research Program

The first step is to build the model on top of a faithful reimplementation of PVTM. We will use the same sentence encoder, prefix tuning, and number of topics, and add only the second reconstruction head and the drift channel. This keeps the difference between the two systems to the ingredient we are testing.

We will cache expansions from two LLM sizes: one small open model and one larger one. Model size is the most natural lever on hallucination rate. We will also draw several samples per snippet, so that a consensus-filtering baseline can be run on identical text.

The second step is to measure hallucination in expansions directly rather than assume it. We will use two sources of ground truth. The first is controlled corruption. For a fraction $r$ of documents, part of the expansion is replaced with text generated from a different document, or from a prompt pointed at the wrong category. This gives known off-topic spans at known rates. The second is natural hallucination. On a held-out sample of StackOverflow and TagMyNews expansions, annotators mark sentences that are unsupported by the snippet or that wander off-topic. StackOverflow matters most here because PVTM's own concession concerns technical domains.

The third step is a set of analyses that test whether the model behaves as intended. We will check three questions. Does $\lambda_d$ track the corruption rate? Do drift-attributed words concentrate on corrupted spans? Does $\theta_d$ remain stable when a document's expansion is swapped for a corrupted one? We will also watch for the obvious failure mode, in which the gate opens fully and the model collapses into a plain short-text model plus an unrelated expansion model. We will report how sensitive the results are to the strength of the Beta prior.

Baselines

The naive reference points are ProdLDA and CTM trained on the snippets alone. CTM, from Pre-training is a Hot Topic, feeds sentence-transformer embeddings to the encoder while reconstructing the bag of words. These show what the expansion buys at all. For context on the size of the gap, Improving Topic Modeling by Distilling Soft Labels from Language Models reports a StackOverflow purity of 0.265 for ProdLDA.

The strongest direct competitor is PVTM itself. It is the only method in the file that uses the same expansion-as-target recipe, so beating it isolates the value of the drift channel. PVTM reports a $C_V$ coherence of 0.632 on TagMyNews at 20 topics, against 0.618 for CTM. It also reports an SVM classification accuracy of 0.825 on StackOverflow topic proportions, against 0.672 for ProdLDA and 0.656 for CTM.

The strongest competitor on clustering is DSL, from the same soft-label paper. DSL skips expanded text entirely: it trains the decoder to match a small language model's next-token distribution for a one-word theme label, and it reports a StackOverflow purity of 0.803. TSCTM, from Mitigating Data Sparsity for Short Text Topic Modeling by Topic-Semantic Contrastive Learning, represents the no-LLM route. It reports a TagMyNews purity of 0.610 and a $C_V$ of 0.445 at 50 topics.

These cross-paper figures come from different setups and topic counts, so we treat them only as sanity anchors. All methods will be rerun on our splits with identical vocabularies, identical cached expansions where applicable, the same encoder backbone, the same topic counts (20 and 50), and an equal hyperparameter search budget per method.

Two ablations isolate the key ingredient. The first removes the snippet reconstruction head but keeps the drift channel. The second keeps the snippet head but removes the drift channel. If either ablation matches the full model, our account of why it works is wrong.

To count as beating PVTM, the full model must match PVTM on clean expansions. It must also clearly beat PVTM on purity, normalized mutual information, and SVM accuracy once corruption is present, at both corruption rates and on natural StackOverflow expansions. Gains on coherence alone will not count.

Why not just…?

Why not just filter expansion words by consensus across several LLM samples, or by similarity to the snippet? This is the real threat, and it may work well, because random fabrications rarely repeat across samples. Its blind spot is the case the hallucination literature flags: models that are confidently wrong produce the same drift every time. Do Language Models Know When They're Hallucinating References? shows that confident fabrications survive direct questioning and only surface under indirect cross-examination. Consensus filtering also makes a hard, binary decision outside the model. We will run majority-vote token filtering and sentence-similarity filtering on the same cached samples, both feeding PVTM. If either matches our model on corrupted and natural data, we will say so plainly. The remaining contribution would then be the drift score as a detector, which we evaluate separately.

Why not just use DSL's soft labels and avoid expanded text altogether? DSL already reports strong purity, but it copies the small model's raw next-token distribution, including any mass the model invents for ambiguous snippets. Its authors also note sensitivity to the prompt. We will compare head-to-head on purity. We will also test whether DSL degrades under the same off-category prompting we use for corruption. If DSL proves equally robust, the honest conclusion is that a one-word target is too narrow to carry much hallucination, and our method would matter only when richer expansions are needed.

Why not just avoid LLMs, using contrastive learning (TSCTM) or pseudo-document aggregation as in GloCOM? These methods cannot hallucinate. However, they can only work with vocabulary already in the corpus, and the reported coherence for TSCTM sits well below LLM-expanded models. We include TSCTM so that, if the LLM's gains vanish once hallucination is controlled for, the comparison shows it.

Why not just use a larger LLM for expansion? Larger models hallucinate less but cost more, and the file's evidence says even strong models fabricate often: Do Language Models Know When They're Hallucinating References? reports a 46.8% fabricated-reference rate for GPT-4. Our two-model design measures directly whether the drift channel narrows the gap between cheap and expensive expansions.

Proposed Experiments

The datasets are TagMyNews (mean length 5.78 words), StackOverflow (4.49 words), Google News (6.11 words), and AG News titles. Each is run under clean expansions, controlled corruption at $r \in \{0.1, 0.3\}$, and natural expansions from both LLM sizes.

Representation quality will be measured by purity, normalized mutual information, and SVM accuracy on topic proportions. We will also report $C_V$, NPMI, and inverted rank-biased overlap (IRBO, a topic-diversity score), but only as secondary measures. Is Automated Topic Model Evaluation Broken? found that automated coherence declares spurious model differences roughly 20% of the time and rewards narrow, obscure topics. We therefore add a human word-intrusion study comparing our model, PVTM, and CTM on two datasets. That check is missing from the LLM-expansion papers, whose coherence gains could themselves reflect LLM-generated word clusters.

Detection quality will be measured by the area under the ROC curve (AUC) of $\lambda_d$, and of per-word drift responsibility, against corrupted spans and annotator labels. The comparison detectors are sentence-embedding distance between snippet and expansion, cross-sample disagreement, and a topic-posterior distance computed from a separately trained model.

The decisive check is the corruption curve. As $r$ grows, PVTM's purity and accuracy should fall. Ours should stay close to its clean level, $\lambda_d$ should rise in step with $r$, and the drift-attributed words should fall mostly on injected spans. If PVTM's curve is flat, hallucination was never the bottleneck and the proposal fails at its premise. If the consensus filter's curve matches ours, the contribution reduces to the detector.