Improving Contextualized Topic Models with Negative Sampling
Paper · 2022 · Suman Adhya, Avishek Lahiri, Debarshi Kumar Sanyal et al.
Summary
A collection of documents becomes easier to explore when its recurring themes can be identified automatically. The difficulty is producing themes that people can recognize: a useful topic should contain words that belong together, while different topics should reveal different parts of the collection. “Improving Contextualized Topic Models with Negative Sampling” addresses this problem by changing how a contextualized topic system learns. Its central question is simple: if a document’s strongest topics really explain its content, should removing those topics make the document harder to reconstruct?
The authors build on CTM, which combines a document’s word frequencies with a contextual representation of its meaning. CTM learns a distribution over topics for each document, then uses that distribution to predict the document’s words. The proposed extension, CTM-Neg, adds a deliberately damaged topic distribution during training. It removes the largest topic weights, rescales the remaining weights, and reconstructs another word distribution from the result. A triplet loss encourages the ordinary reconstruction to resemble the original document while remaining distinguishable from the reconstruction based on the damaged topic distribution. The negative example therefore comes from an intervention on the document’s own inferred topics, rather than from a separate document selected elsewhere.
Experiments cover GoogleNews, 20NewsGroups, and M10, with several choices of topic count. The comparison includes CTM, ProdLDA, ETM, and LDA. Across topic counts, CTM-Neg has the highest reported mean NPMI coherence on every dataset: 0.142 on GoogleNews, 0.121 on 20NewsGroups, and 0.052 on M10. Results for the alternative coherence measure CV are less uniform: CTM-Neg leads on GoogleNews and 20NewsGroups, while CTM has the higher mean on M10. Topic diversity is high for CTM-Neg, although most competing systems also achieve high diversity. The extension also gives the highest document-classification accuracy in the paper’s M10 experiment, but the accompanying discussion does not state an exact accuracy value.
The evidence supports a focused conclusion. Training a topic representation to react meaningfully when its dominant components are removed can improve the coherence of the resulting topics under the tested conditions. Selected word lists help explain the quantitative results: CTM-Neg frequently places more distinctive subject words near the top of a topic. The study does not establish that the intervention always improves every metric, that its settings transfer unchanged to other collections, or that any single part of the added mechanism independently causes the gains. Its contribution is a compact training modification, evaluated across multiple collections and topic counts, with a clear account of what a useful latent topic should contribute to reconstruction.
Interesting ideas
Make important components earn their importance. A representation can assign a large weight to something without making that component indispensable to its output. Removing the strongest components creates a direct test of whether those weights correspond to useful explanatory work. The paper turns that test into a training signal. Similar reasoning can guide systems that rank evidence, select features, distribute attention across observations, or assign importance to rules: the selected component should have a measurable consequence when it is removed.
Generate difficult comparisons from the current example. CTM-Neg constructs its negative by changing the topic distribution already inferred for the input document. The resulting comparison stays connected to the same document and decoder. This avoids requiring a separately annotated collection of unsuitable examples. The broader idea applies when arbitrary negatives are too easy or poorly matched: start with the system’s own analysis, alter a meaningful part, and test whether the output reflects that alteration.
Evaluate coherence and separation together. A collection of topics can avoid repeating words while still containing confusing word groups. Conversely, related topics can share important vocabulary without being redundant. The paper therefore measures both within-topic coherence and between-topic diversity. This distinction is useful for clustering, dictionary sense proposals, document organization, and any system that must produce groups that are both internally understandable and usefully distinct.
Inspect behavior across operating settings. The number of topics changes the task itself: a coarse organization and a fine organization need not favor the same system. The authors examine several topic counts and report both individual settings and aggregate results. The transferable lesson is to test a proposed improvement across the range in which it will be used, while preserving the detailed results that an average can hide.
Combine numerical evaluation with concrete outputs. The study uses coherence scores, diversity scores, document classification, and selected topic word lists. These views answer different questions. A numerical gain establishes a pattern under a metric; an actual output can show whether that pattern corresponds to more distinctive or more confusing language. This combination is valuable wherever an automatic score only approximates the quality that users care about.
Check whether better representations help another task. The M10 classification experiment uses document-topic vectors as inputs to a linear classifier. It asks whether the learned representation carries useful information beyond producing attractive topic lists. Such an external check can help evaluate summaries, graph representations, semantic features, or induced categories. It remains necessary to state exactly which downstream task was tested, because success on that task does not establish universal usefulness.
Deep dive: Improving Contextualized Topic Models with Negative Sampling
How CTM-Neg uses topic removal and a contrastive loss to improve topic coherence, what its experiments show, and where the evidence stops. · about 36 minutes to read
How Mova uses it
Mova is a small, transparent language system written in Rust. Its native reading path builds dependency trees, derives frames, and maintains a world of entities and events. Its current direction favors explicit logic, rules, and statistics. CTM-Neg is a neural topic-learning method, so its architecture is not automatically a suitable replacement for Mova’s existing mechanisms. The useful connections concern intervention, candidate generation, statistical grouping, evaluation, and the distinction between a representation and evidence that it works.
The status marks below describe proposed relationships to documented Mova mechanisms. They do not report measured applications of CTM-Neg. “Mova: нове” identifies a proposed extension whose implementation is not established by the documented scope; it does not claim an exhaustive search of every Mova component. The paper’s results belong to its topic experiments. Each transfer would need its own evaluation.
Idea: Require important components to affect the result. Where: Introduction and Section 3.2. Area: reasoning and evaluation. Mova: частково є (regression gates and negative controls described in README.md and docs/architecture.md). Mova already checks whether changes improve held-out behavior and uses controls that should fail. The additional proposal is to remove a highly ranked rule, supporting fact, or observation from a particular answer and measure the consequence. This could reveal explanations that name an important-looking component without depending on it. The paper does not establish how such a test should operate over logical proofs.
Idea: Construct negative cases from the current analysis. Where: Section 3.2 and Figure 1. Area: data and evaluation. Mova: нове. A bounded evaluator could take a native frame or candidate interpretation and remove its dominant supporting relation, preserving the rest of the case. The resulting comparison would test a specific dependency rather than introduce an unrelated sentence. Why Mova: this could produce focused diagnostic cases from Mova’s own structures without treating automatically generated cases as reviewed linguistic truth. The validity of each transformation would still require a declared task and failure condition.
Idea: Perturb a representation before constructing an output. Where: Section 3.2. Area: semantic representation. Mova: нове. CTM-Neg changes topic weights before decoding words. An analogous Mova experiment could modify a retained observation or a candidate world relation, then ask the normal answer mechanism to run again. Why Mova: intervening before answer generation could expose which representation errors actually change an answer. Such a result would diagnose the selected task; it would not prove that deleting a relation corresponds to a valid alternative world.
Idea: Rescale retained weights after deleting selected components. Where: Equation 4. Area: mathematics and statistics. Mova: нове. For a Mova component that already uses non-negative normalized candidate weights, an intervention could remove selected candidates and normalize the survivors before comparison. Why Mova: this would help distinguish the effect of changing candidate composition from the effect of merely shrinking the total weight. The proposal applies only where the weights have a defined probabilistic or mixture interpretation. It should not be imposed on arbitrary rule scores or proof obligations.
Idea: Compare outputs through the same execution path. Where: Figure 1 and Section 3.2. Area: experimental design. Mova: частково є (CPU reference comparisons and declared approximants in docs/gpu-exec.md, as described in README.md). The ordinary and perturbed topic vectors share a decoder. Mova could use the same principle when testing an altered frame or graph: retain the answer procedure and change only the admitted input component. This would reduce ambiguity about whether an observed difference came from the intervention or from a different implementation.
Idea: Use a relative separation objective. Where: Equation 5. Area: statistics and parameter learning. Mova: нове. Where Mova already learns weights for competing candidates, an experimental objective could reward an accepted candidate for being closer to the observed evidence than a deliberately damaged alternative. Why Mova: relative comparisons may provide a more focused signal than rewarding an isolated score. The paper’s Euclidean triplet objective cannot simply be assumed appropriate for symbolic frames, categorical decisions, or proof graphs; each would need an explicit distance and a justified comparison.
Idea: Keep ordinary task quality alongside the new constraint. Where: Equation 6. Area: optimization and evaluation. Mova: частково є (student regression gates in docs/architecture.md). CTM-Neg adds its separation objective while retaining reconstruction and latent-distribution regularization. Mova similarly guards existing student behavior when extending knowledge. A proposed statistical learner should retain its main task checks while testing an added contrastive criterion. Otherwise, it could learn to distinguish damaged cases while becoming worse at reading ordinary ones.
Idea: Control the strength of an auxiliary objective. Where: Sections 3.2 and 4.3. Area: statistics. Mova: частково є (bounded parameter experiments and held-out self-play in docs/training.md, as described in README.md). CTM-Neg uses a tunable weight for its triplet term. If Mova adopts a comparable ranking penalty, its influence should be tested rather than fixed by intuition. Existing experiment journals and regression gates provide part of that process. The paper supplies no setting that can be transferred directly to Mova.
Idea: Vary how much of an analysis is removed. Where: Sections 3.2 and 4.3, and Table 1. Area: robustness evaluation. Mova: нове. A bounded diagnostic could compare removal of a small supporting component with removal of a larger supporting set. Why Mova: this could distinguish an answer that depends on one fragile observation from an answer supported by several independent paths. The paper tunes the number of deleted topics, but does not establish how deletion size should be defined for logical or linguistic structures.
Idea: Generate comparison cases without labels while preserving admission boundaries. Where: contributions and Section 3.2. Area: data. Mova: частково є (proposal, teacher review, staging, and separate admission in tools/enrich/README.md). CTM-Neg produces negatives without annotated negative documents. Mova can borrow that separation between cheap proposal generation and stronger claims about correctness. A transformed frame may be useful for stress testing without becoming a training annotation. The existing enrichment boundary already distinguishes generated drafts from admitted knowledge; a new diagnostic should preserve that distinction.
Idea: Combine complementary representations of the same text. Where: Section 3.1. Area: linguistic representation. Mova: частково є (trees, frames, worlds, and compiled knowledge in docs/architecture.md). CTM combines lexical counts with contextual embeddings. Mova already combines several explicit structural views, although not through CTM’s neural encoder. A suitable transfer is to compare what a lexical occurrence view and a frame-based view each contribute to a candidate interpretation. Their agreement could be recorded as evidence without assuming that either representation independently establishes meaning.
Idea: Evaluate internal coherence separately from separation. Where: Section 4.2 and Section 5.3. Area: evaluation and lexicography. Mova: частково є (overlapping statistical selectors and reviewed labels in tools/dictindex/README.md). Dictionary occurrence groups could be assessed for whether their members share a useful interpretation, separately from whether different groups overlap. This follows the paper’s distinction between coherence and diversity. Mova’s index already avoids treating statistical selectors as an automatic partition into senses. A coherence assessment would support review, rather than replace the existing admission checks.
Idea: Preserve rank when measuring overlap. Where: Equation 8 and Section 4.2. Area: statistics. Mova: нове. An evaluator for ranked dictionary collocates or topic-like candidate lists could distinguish overlap near the top from overlap among marginal entries. Why Mova: sharing a dominant feature may indicate stronger redundancy than sharing a low-ranked feature. The paper’s IRBO supplies a concrete example of that distinction. Whether it is suitable for Mova’s feature lists would depend on how their rankings are produced and what reviewers regard as redundant.
Idea: Detect collapse into generic recurring groups. Where: Section 5.3 and Table 5. Area: diagnostics. Mova: нове. A review report could flag candidate groups that repeatedly receive the same generic high-ranked features while failing to distinguish their examples. Why Mova: a dictionary worker or corpus explorer could otherwise appear to produce many categories while offering little useful separation. The paper’s ETM analysis motivates the warning pattern. It does not provide a threshold for declaring that a Mova selector has collapsed.
Idea: Inspect operating settings individually. Where: Figure 2 and Appendix A.1. Area: evaluation. Mova: частково є (bounded measurements and explicit coverage limits in tools/dictindex/README.md). An evaluation of statistical grouping should retain results for each candidate budget, support threshold, or grouping granularity. Mova already distinguishes bounded index probes from full-corpus claims. The proposed addition is a systematic setting-by-setting comparison for any new grouping method, so an aggregate improvement cannot hide a setting where the baseline remains preferable.
Idea: Use repeated runs without confusing randomness with deterministic checks. Where: Section 5.1. Area: statistics and reproducibility. Mova: частково є (identical repeated native runs required by README.md). The paper repeats stochastic training and summarizes the outcomes. Mova’s native deterministic checks answer a different question: whether the same computation repeats exactly. If a future experiment includes stochastic training, it should report variation across runs as well as retain deterministic verification for the native path. Repeating one deterministic output does not estimate training variability.
Idea: Report robust summaries with their aggregation order. Where: Section 5.1 and Table 2. Area: statistics. Mova: нове. A reporting component could explicitly record which observations were summarized first and which settings were then averaged. Why Mova: a median across repeated runs and an average across task settings answer different questions, and hiding that order makes results harder to compare. This proposal concerns report design; the paper does not establish that the median is the best summary for every Mova measurement.
Idea: Use more than one proxy for interpretability. Where: Section 4.2. Area: evaluation. Mova: частково є (multiple controls in school reports and explicit reasons described in docs/architecture.md). CTM-Neg is assessed through different coherence measures and a diversity measure. For Mova, occurrence support, structural compatibility, source evidence, and reviewer judgments could remain separate fields. A single score should not silently stand for all of them. Existing gates already separate several kinds of evidence, although they do not implement this paper’s topic metrics.
Idea: Examine real outputs alongside aggregate scores. Where: Section 5.3 and Tables 4–6. Area: interpretability. Mova: вже є (answer reasons, course traces, and retained source examples in docs/architecture.md and tools/dictindex/README.md). Mova already exposes reasons and corpus witnesses. The paper reinforces the usefulness of reviewing actual outputs when a metric improves: a reviewer should be able to see which words, relations, or examples changed. This existing practice remains relevant even when the new proposal concerns statistical grouping rather than native answers.
Idea: Test representations in a downstream task. Where: Section 5.2 and Figure 3. Area: evaluation. Mova: нове. A candidate document grouping or lexical representation could be tested on an independently defined retrieval or classification task, rather than judged only by its internal score. Why Mova: this would establish whether a more coherent-looking representation helps a concrete use. Any assessment items would remain separate from training and dictionary admission, following Mova’s existing boundaries. The paper does not supply evidence for a particular Mova downstream task.
Idea: Hold the downstream decision procedure fixed. Where: Section 5.2. Area: experimental design. Mova: нове. The paper compares topic representations through a linear support vector machine. A Mova experiment could similarly compare candidate representations through one unchanged retrieval or ranking procedure. Why Mova: this would make it easier to attribute an improvement to the representation being tested. The choice of evaluator would still limit the conclusion: failure under one simple decision procedure would not prove that the representation contains no useful information.
Idea: Align comparable outputs before qualitative review. Where: Section 5.3 and Table 4. Area: analysis. Mova: нове. When comparing dictionary selectors or document groups, reviewers could inspect groups covering a similar observed phenomenon rather than compare arbitrary output positions. Why Mova: this would make differences in specificity and generic vocabulary easier to see. The alignment itself should be recorded and should not imply that categories correspond exactly. The paper’s manual alignment is an inspection device, not an automatic equivalence test.
Idea: Distinguish meaningful overlap from duplication. Where: Section 5.3 and Table 6. Area: lexical semantics. Mova: частково є (overlapping selectors and reviewer merge/split decisions in tools/dictindex/README.md). Related uses of a word can share collocates while differing in a more specific pattern. Mova’s index already permits overlapping groups. The paper’s topic examples support retaining that flexibility: maximizing separation alone could fragment a useful lexical family. Whether two proposed groups express distinct senses still requires reviewed evidence.
Idea: Tune the target criterion while checking other outcomes. Where: Section 4.3 and Table 2. Area: evaluation. Mova: частково є (held-out improvement gates and journals described in README.md). CTM-Neg’s search maximizes NPMI, while the report also includes CV and IRBO. A Mova experiment should likewise state what its search optimized and preserve checks for other relevant behavior. The paper’s M10 result shows why this matters: leading on the selected coherence criterion does not require leading on every alternative criterion.
Idea: Keep dataset-specific settings visible. Where: Table 1. Area: experimental records. Mova: частково є (source/version fingerprints in tools/enrich/README.md and immutable source epochs in tools/dictindex/README.md). CTM-Neg’s selected settings vary with the collection and topic count. Mova could attach any learned grouping settings to the exact source snapshot and task configuration that justified them. Existing fingerprints supply part of this accountability. The paper offers no evidence that settings chosen for one collection are universal defaults.
Idea: Treat a plausible mechanism as a hypothesis until isolated. Where: Section 5.3 and Conclusion. Area: scientific evaluation. Mova: вже є (distinguishing mechanisms, measurements, and direction in docs/hybrid-system.md). The authors suggest that topic removal encourages distinctive vocabulary, but do not isolate every component experimentally. Mova already distinguishes configured behavior from broader architectural direction. The same discipline should apply to any borrowed idea: a successful combined change supports that tested combination, while an explanation of why it worked may still need a separate controlled comparison.
The problem and its context
Why reconstructing a document is not the whole problem
Topic modeling organizes a collection through recurring word distributions. A topic is not initially a human-written category name. It is a set of vocabulary items with different probabilities. A document is then represented through its relationship to those topics. A person inspecting the most probable words may recognize a theme and give it a name.
This approach is attractive when manual categorization would be difficult to maintain. The paper motivates its work through the scale and variety of document collections. A collection can contain many overlapping subjects, and documents can discuss more than one of them. Topic mixtures offer a way to represent that overlap without requiring every document to belong to a single hand-assigned category.
The quality of the resulting organization depends on more than whether words can be predicted. Suppose several topics all contain broadly useful words. Their combination might reconstruct many documents reasonably well, yet the topics could remain difficult to distinguish. Alternatively, a system might produce topics with little shared vocabulary while placing unrelated words together. Both outcomes weaken the value of the organization for a reader.
The paper focuses on a gap in the training objective of a neural contextualized topic system. Ordinary training rewards successful reconstruction and constrains the inferred latent distribution. It does not directly require the topics with the largest weights to be crucial to reconstruction. A prominent topic can therefore look important numerically without being tested through a corresponding intervention.
The proposed intervention gives that concern an operational form. Remove the most strongly weighted topics from a document’s representation. If those topics captured important content, the reconstructed word distribution should change in a meaningful way. CTM-Neg adds a training preference for that separation.
From classical topic mixtures to contextual input
The paper presents Latent Dirichlet Allocation as the classical starting point. LDA describes a document through a mixture of topics and describes each topic through probabilities over vocabulary items. This establishes the basic interpretation used throughout the study: document-topic weights describe thematic composition, while topic-word weights describe the content associated with each theme.
Neural alternatives change how these distributions are inferred and parameterized. The authors emphasize that neural inference can be separated from assumptions about the underlying topic distribution. This makes it easier to explore different architectures and priors without redesigning an inference procedure around each choice.
ProdLDA is the immediate architectural ancestor discussed in the paper. It uses a variational autoencoder and an approximate Dirichlet prior. The encoder receives word-count information, produces a latent representation, and the decoder converts that representation back into a distribution over words. Training links the inferred representation to the observed document while regularizing its latent distribution.
CTM adds a contextual document representation to that arrangement. The relevant earlier work is Pre-training is a Hot Topic. In the architecture used by Adhya and colleagues, lexical counts and contextual information enter the encoder together. The output target remains the document’s vocabulary distribution.
The contextual representation is obtained through Sentence-BERT. Its role is to supply a dense document vector that carries information beyond isolated word frequencies. CTM-Neg retains that input mechanism. The paper’s main architectural change is not a different contextual encoder; it is the extra reconstruction comparison generated from the inferred topic distribution.
The authors also compare against the Embedded Topic Model. As described in their related-work discussion, ETM represents both words and topics through distributed vectors. Its inclusion helps place the proposed method among approaches that use embedding information in different ways.
What negative sampling changes
The paper connects negative sampling to its use in Distributed Representations of Words and Phrases and their Compositionality. The general principle is to provide examples that a learner should distinguish from acceptable ones. The usefulness of that principle depends heavily on what the negatives are and how the comparison affects training.
The related-work section describes several ways earlier topic research had used negative or adversarial examples. One approach combines negative sampling with quantization for short texts. Other approaches employ adversarial generation. The authors argue that negatives drawn from an assumed artificial distribution may have limited resemblance to actual documents.
Another cited method changes a document representation using words selected by high TF-IDF values. CTM-Neg chooses a different intervention point. Rather than directly assembling an explicit negative document from selected word weights, it changes the latent topic mixture and lets the ordinary decoder produce the negative reconstruction.
That distinction matters to the paper’s claim. The intervention tests the relationship between inferred topics and decoded words. It asks the learner to make dominant topics carry information whose absence becomes visible downstream. It is therefore a constraint on the use of the latent representation, rather than merely a way to supply more input examples.
The method, step by step
The ordinary document path
The method begins with a document expressed in two forms. One form is a normalized bag-of-words vector. Each vocabulary position corresponds to a word, and the value records its contribution to the document without preserving word order. The other form is a dense contextual vector produced by the selected Sentence-BERT encoder.
Let V denote vocabulary size and T denote the requested number of topics. The bag-of-words representation has V positions. A linear transformation maps the contextual vector to V positions as well. Concatenating the lexical and contextual representations gives the encoder an input with 2V positions.
The encoder does not directly output a final topic label. It produces parameters for a distribution over latent vectors. The paper assumes a diagonal covariance structure: each latent coordinate has its own variance, while the covariance parameterization does not represent unrestricted dependencies between coordinates.
Sampling produces a latent vector through the reparameterization construction:
z = μ + Σ¹ᐟ² ⊙ ε
Here z is the sampled latent vector, μ is the encoder’s mean output, and Σ supplies the diagonal variance information. The square root gives the corresponding scale for each coordinate. The symbol ⊙ means elementwise multiplication. The noise vector ε is drawn from a standard normal distribution, which the paper writes as N(0, I), with I denoting the identity covariance. Each latent vector has T coordinates.
This construction separates the sampled noise from the encoder’s trainable outputs. The authors use it within ordinary back-propagation. The important interpretive point is that the encoder represents uncertainty over the latent document description, instead of assigning a fixed unconstrained vector alone.
A softmax transformation converts the latent vector into topic weights:
θ = σ(z)
The vector θ is the document-topic distribution. Its entries are non-negative and collectively form a probability distribution. The function σ is softmax. A larger entry means that the corresponding topic contributes more strongly to the document’s inferred mixture.
The decoder uses an unnormalized topic-word matrix β. Its shape is T × V: each topic has a value associated with every vocabulary item. The ordinary reconstruction is:
x̂ = σ(βᵀθ)
The vector x̂ contains the reconstructed probabilities over the V vocabulary items. The superscript ᵀ means transpose, so βᵀ maps the topic mixture into vocabulary space. Softmax then produces the predicted word distribution. This output is compared with x_BoW, the document’s normalized bag-of-words representation.
The baseline training objective
The baseline balances reconstruction against a constraint on the latent distribution:
L_CTM = L_RL + L_KL
L_CTM is the baseline loss being minimized. L_RL is the reconstruction term. The paper describes it as cross-entropy between the predicted vocabulary distribution x̂ and the input distribution x_BoW. L_KL is the divergence term that encourages the inferred latent distribution to remain compatible with the selected prior.
The divergence term is written as:
L_KL = D_KL(q_ϕ(z | x) ∥ p(z))
The distribution q_ϕ(z | x) is the encoder’s posterior approximation for a latent vector z given the combined input x. The symbol ϕ denotes encoder parameters. The distribution p(z) is the latent prior. D_KL denotes Kullback–Leibler divergence, and ∥ separates the distributions being compared.
The paper’s expanded baseline equation presents a negative expected generative term alongside this divergence. Its prose identifies the reconstruction calculation as cross-entropy. The displayed expansion does not explicitly show the logarithm normally associated with that likelihood description. The additive decomposition above preserves the operational explanation without silently treating that notational discrepancy as an additional methodological claim.
These baseline terms have complementary purposes. Reconstruction rewards an inferred representation that predicts the document’s vocabulary. The divergence term constrains the distribution from which that representation is drawn. Neither term alone expresses the paper’s additional requirement that deleting the strongest topics should produce an unsuitable reconstruction.
Constructing the negative topic distribution
After the ordinary topic distribution has been obtained, CTM-Neg selects its largest entries. The number selected is S, a hyper-parameter. These are the topics the current representation treats as most prominent for that document.
The intermediate perturbed vector is defined by:
θ̃_neg[i] = 0 if i ∈ argmax(θ, S); otherwise θ̃_neg[i] = θ[i]
The index i identifies a topic coordinate. For θ, argmax(θ, S) gives the indices corresponding to its S greatest entries. The symbol θ̃_neg denotes the intermediate vector after those selected entries have been set to zero. All other entries retain their original values.
This operation is targeted. It does not remove arbitrary topics and does not change the vocabulary directly. It suppresses the components that currently dominate the document’s inferred thematic composition. The remaining coordinates still contain their relative preferences from the original mixture.
The surviving values are normalized:
θ_neg = θ̃_neg / (Σᵢ₌₁ᵀ θ̃_neg[i])
The vector θ_neg is the final negative topic distribution. The summation in the denominator adds the retained weights across all T topic positions. Dividing by that total restores a normalized mixture. Since the original topic weights come from softmax, the retained values are non-negative.
Normalization is important to the intended comparison. The method seeks a different topic mixture, rather than merely a vector with reduced total weight. After normalization, the remaining topics take responsibility for the whole reconstructed distribution. The comparison therefore asks whether those topics can substitute for the deleted dominant ones.
The same decoder produces the negative word distribution:
x̂_neg = σ(βᵀθ_neg)
Here x̂_neg is the vocabulary distribution reconstructed from the perturbed mixture. The matrix β and softmax function σ are shared with the ordinary reconstruction. There is no separately described negative-document generator with independent topic-word parameters.
Sharing the decoder links the two outputs tightly. Their difference arises from the changed topic distribution under the same learned mapping to words. The negative is consequently generated from the current document representation and the current decoder, making its difficulty evolve with training.
How CTM-Neg adds a training comparison
The steps in order.
The triplet comparison
CTM-Neg adds a triplet loss involving three vocabulary-space representations. The anchor is the ordinary reconstruction x̂. The positive is the observed document distribution x_BoW. The negative is the reconstruction x̂_neg obtained after the topic intervention.
The added term is:
L_TL = max(‖x̂ − x_BoW‖₂ − ‖x̂ − x̂_neg‖₂ + m, 0)
L_TL denotes triplet loss. The notation ‖·‖₂ denotes Euclidean distance. The first distance measures how far the ordinary reconstruction lies from the document. The second measures how far it lies from the negative reconstruction. The parameter m is the margin. The maximum with zero prevents a negative loss once the desired relative separation has been achieved.
The objective is relative. It favors an ordinary reconstruction that is closer to the observed document than to the negative reconstruction by the required margin. The anchor is especially important: the comparison is centered on the ordinary decoder output, rather than directly contrasting two document inputs.
This term does not independently replace reconstruction learning. If separation were the only concern, making two outputs different would not necessarily make either one a good account of the document. Retaining the baseline objective keeps the ordinary vocabulary prediction tied to the observed input.
The full objective is:
L = (L_RL + L_KL) + λL_TL
L is the combined training loss. The terms L_RL and L_KL retain their baseline meanings. L_TL is the new triplet term. The hyper-parameter λ determines how strongly the added comparison influences optimization.
The authors set the margin m to 1. They search over S ∈ {1, 2, 3} and λ ∈ [0, 1], using Bayesian optimization in OCTIS to maximize NPMI. Their selected settings vary across datasets and topic counts. The method is trained end to end with Adam and back-propagation.
What the mechanism is intended to encourage
The intervention makes a particular kind of failure informative. A document’s dominant topics should help recover distinctive words. If those topics disappear but the reconstruction stays essentially interchangeable with the ordinary output, the representation has not made their dominance sufficiently consequential under the added criterion.
A successful response to the objective could make topics carry more specific lexical content. Removing a strongly weighted topic would then remove access to a characteristic part of the document’s vocabulary distribution. The qualitative discussion later interprets focused topic words in this way.
That interpretation should remain separate from what the loss formally measures. The objective operates on distances between vocabulary distributions. It does not directly assess whether a person can name a topic, whether each topic corresponds to an independent real-world subject, or whether the inferred weights provide a causal explanation of a document’s authorship. Those are broader interpretations that require additional evidence.
Experiments and results
Collections and implementation
The experiments use OCTIS, an integrated environment for training, tuning, and evaluating topic systems. The authors implement their extension within that setting and report a public code release named CTMNeg. GoogleNews is added to the framework for this study; the other collections are already available there.
GoogleNews, abbreviated GN, contains 11, 109 news items described as articles, titles, and snippets collected in November 2013. Its role is to test the approach on a news collection containing short textual material. The results show substantial variation with topic count, which makes the detailed appendix particularly useful.
20NewsGroups, abbreviated 20NG, contains 16, 309 documents. The paper describes them as distributed approximately evenly across 20 newsgroups. This collection also supports the qualitative analysis because several discovered topics can be related to recognizable discussion areas.
M10 contains 8355 scientific publications drawn from CiteSeer X. They cover 10 research areas. The scientific vocabulary gives the authors a setting in which topics may share broad technical words while differing in specialist terminology.
The comparison includes the original CTM alongside ProdLDA and ETM. LDA supplies the classical reference. For CTM-Neg, CTM, and ProdLDA, the encoder has two fully connected hidden layers, each containing 100 neurons. Their decoder is a fully connected layer.
CTM and CTM-Neg use paraphrase-distilroberta-base-v2 for contextual document representations. The vocabulary for every dataset is limited to its most frequent 2K words. This restriction matters when interpreting the output: the topics are distributions over that selected vocabulary, rather than over every word present in the original collection.
The topic counts are {10, 20, 30, 40, 50, 60, 90, 120}. The authors report 50 training epochs. For LDA, they use 5 passes because the default single pass produced topics they considered inadequate. Other settings retain their OCTIS defaults unless the paper specifies a change.
What the metrics measure
The study evaluates coherence through NPMI and CV. Both concern the relationship among the most highly ranked words within a topic. Diversity is assessed through IRBO, which instead concerns overlap between different topics. Each evaluation uses the top-10 words from a topic.
NPMI measures word association through observed co-occurrence. Its interpretation is that words belonging to a coherent topic should occur together more strongly than their individual frequencies alone would suggest. The relevant earlier evaluation work is Machine Reading Tea Leaves.
The paper gives the pairwise measure as:
NPMI(wᵢ, wⱼ) = log((p(wᵢ, wⱼ) + ε) / (p(wᵢ)p(wⱼ))) / (−log(p(wᵢ, wⱼ) + ε))
The symbols wᵢ and wⱼ denote vocabulary words. The quantity p(wᵢ, wⱼ) is their joint occurrence probability within a Boolean sliding context window. The terms p(wᵢ) and p(wⱼ) are marginal probabilities. The small positive constant ε avoids a zero argument in the calculation. The logarithmic numerator expresses association relative to independent occurrence, and the denominator normalizes it.
The stated range is [−1, +1]. At the lower endpoint, words do not co-occur; at the upper endpoint, they always do. Topic-level reporting summarizes associations among the selected topic words. The experiments use the implementation exposed by OCTIS through gensim, where this measure is named c_npmi.
CV combines an indirect cosine-based comparison with NPMI-related information from a Boolean sliding window. The paper points to Exploring the Space of Topic Coherence Measures for that measure. It also cautions that CV has known issues. The experiments use gensim’s c_v implementation through OCTIS.
IRBO measures how different ranked topic lists are from one another:
IRBO(ℵ) = 1 − (Σᵢ₌₂ᵀ Σⱼ₌₁ⁱ⁻¹ RBO(lᵢ, lⱼ)) / n
The symbol ℵ denotes the topic collection. Each lᵢ is a ranked word list for topic i. RBO is rank-biased overlap between two lists. The summations cover distinct topic pairs, and n is the number of those pairs, written in the paper as the binomial coefficient choosing 2 from T.
IRBO is 0 when topics are identical and 1 when they are completely dissimilar under the measure. Overlap among highly ranked words counts more strongly than overlap farther down the lists. This makes the measure appropriate to outputs that users often inspect through their leading words.
Higher values are preferred for every reported metric. That shared direction should not obscure their different meanings. A high diversity score does not establish that each topic is understandable, and a high coherence score does not establish that the topic collection covers many distinct subjects.
How repeated results are summarized
For each combination of dataset, system, and topic count, the authors conduct 5 independent runs. They use the median score at that topic count to reduce the influence of outlying runs. The detailed appendix reports these per-count medians.
The overview then summarizes performance across topic counts. Table 2 presents a mean and a median for each dataset, system, and metric. The mean NPMI values in the following charts are those overview values. They should not be confused with a score from one run or with a result at one selected topic count.
GoogleNews mean NPMI across topic counts
CTM-Neg leads the reported aggregate comparison.
The numbers
| System or setting | NPMI |
|---|---|
| CTM-Neg (this paper) | 0.142 |
| CTM | 0.081 |
| ProdLDA | 0.056 |
| ETM | -0.263 |
| LDA | -0.164 |
20NewsGroups mean NPMI across topic counts
The negative-sampling extension has the highest reported mean coherence.
The numbers
| System or setting | NPMI |
|---|---|
| CTM-Neg (this paper) | 0.121 |
| CTM | 0.093 |
| ProdLDA | 0.080 |
| ETM | 0.049 |
| LDA | 0.075 |
M10 mean NPMI across topic counts
CTM-Neg leads overall, although individual topic counts favor CTM.
The numbers
| System or setting | NPMI |
|---|---|
| CTM-Neg (this paper) | 0.052 |
| CTM | 0.048 |
| ProdLDA | 0.025 |
| ETM | -0.056 |
| LDA | -0.192 |
Coherence results and their exceptions
The aggregate NPMI result is consistent across collections: CTM-Neg leads. The alternative coherence measure gives a more qualified picture. On GN, mean CV is 0.530 for CTM-Neg and 0.485 for CTM. On 20NG, the corresponding values are 0.648 and 0.627.
M10 is the exception to that CV ranking. CTM records mean CV of 0.466, while CTM-Neg records 0.462. Their reported median CV values are both 0.461. This is a useful reminder that a method can lead on the criterion used for tuning while falling behind on another coherence measure.
The detailed topic-count results show why the aggregate should not become an unconditional claim. On GN with 10 topics, CTM-Neg’s NPMI is -0.096. At 90 topics it is 0.235. These values describe the behavior of the same method under different requested granularities, instead of a uniform quality level across all settings.
On 20NG, CTM-Neg reaches NPMI of 0.135 at 30 topics. At 120 topics, its NPMI is 0.107. The strongest setting on this dataset is therefore not simply the largest topic inventory.
M10 contains direct reversals between CTM and its extension. At 30 topics, CTM has NPMI of 0.069 and CTM-Neg has 0.065. At 90 topics, CTM records 0.04 and CTM-Neg records 0.031. These comparisons do not negate the aggregate advantage, but they define its scope: an average benefit does not mean dominance at every operating point.
The paper’s prose describes CTM-Neg as leading both coherence measures throughout GN and 20NG. The appendix supports a more precise reading for GN: at 20 topics, ProdLDA has CV of 0.403 while CTM-Neg has 0.424, but LDA has CV of 0.368; the overall pattern remains favorable to CTM-Neg. More broadly, the exact reported values should take precedence over a blanket description whenever an individual comparison matters.
Diversity results
CTM-Neg’s mean IRBO is 0.998 on GN and 0.991 on 20NG. These are the highest reported means for those collections. On M10, its mean is 0.986, while LDA has 0.989.
The diversity differences among CTM-Neg and most baselines are frequently small in the reported score scale. For GN, CTM has mean IRBO of 0.995 and ProdLDA has 0.996. Their topics are already highly separated under this measure. The principal advantage of the proposed method is therefore better coherence while retaining strong diversity, instead of a broad transformation from duplicated topics to wholly distinct ones.
ETM behaves differently in these experiments. Its mean IRBO is 0.627 on GN, 0.819 on 20NG, and 0.502 on M10. The qualitative analysis connects these lower values with repeated high-ranked generic words and overlapping topic content.
M10 also illustrates the danger of reading diversity alone. At 40 topics, LDA has IRBO of 0.993 and NPMI of -0.218. CTM-Neg has IRBO of 0.986 and NPMI of 0.06. The former topic collection is more separated under IRBO, but that separation accompanies much weaker measured coherence.
Classification as an external check
The paper also evaluates text classification using M10 labels. The corpus is divided into training, development, and test portions in the ratio 70:15:15. Topic learning is performed on the training portion with T = 10.
Each document is represented by its topic vector. A linear support vector machine is then trained on those representations and the training labels. Evaluation uses the held-out test portion. This procedure asks whether the topic representation helps distinguish the collection’s research-area categories.
CTM-Neg has the highest classification accuracy in Figure 3. The paper’s prose does not state its numerical accuracy, so the result can be reported as a ranking rather than assigned an exact value. The experiment adds evidence of practical representation quality, but it concerns this classifier, this collection, and this topic count.
What the ablations show
The paper contains no dedicated component ablation separating topic selection, normalization, decoder sharing, and triplet loss; it instead offers a CTM baseline comparison, topic-count sweeps, hyper-parameter selection, a classification experiment, and selected qualitative analyses.
What comparison with CTM establishes
The comparison with CTM is the closest test of the proposed addition. Both systems use the same contextual representation and the same described encoder and decoder structure. CTM-Neg adds the negative topic reconstruction and weighted triplet objective.
Its stronger aggregate NPMI results support the combined intervention under the reported setup. They do not identify which design choice is indispensable. For instance, there is no reported comparison between deleting the largest topic weights and deleting randomly chosen weights. There is also no isolated experiment showing what happens if the retained weights are left unnormalized.
Likewise, the study does not compare several alternative distance functions for its triplet term. The reported mechanism uses Euclidean distances between vocabulary distributions. A reader can understand why that supplies a separation signal without concluding that it is the best possible geometry for topic learning.
The hyper-parameter search is informative but serves a different purpose from ablation. It chooses settings intended to work well. It does not hold all other conditions fixed while removing one component to estimate that component’s contribution.
What the selected hyperparameters suggest
Table 1 shows that different dataset and topic-count combinations receive different settings. On GN with 10 topics, the selected pair is (2, 0.7). With 60 topics, it is (3, 0.94). On 20NG with 40 topics, the reported pair is (1, 0.12).
These examples establish that the optimization does not settle on one universal deletion size or triplet weight. They do not establish a simple law connecting topic count to either hyper-parameter. The paper does not provide a controlled explanation for why a particular pair is preferable in each case.
The search also uses NPMI as its optimization target. The favorable aggregate NPMI results should be understood in that context. CV and IRBO supply additional views that were not themselves the stated target of this search.
What the word lists reveal
The qualitative examples examine selected outputs from random runs. For 20NG with T = 20, the authors manually align related topics across systems. This lets the reader compare how different methods express a similar broad theme.
A CTM-Neg topic associated with Middle Eastern conflict includes words such as “turkish,” “israeli,” “genocide,” and “war.” The authors regard this as a more focused description than lists containing broadly applicable words such as “leave” or “start.” Their interpretation is that the extension encourages topic words that distinguish the relevant documents.
The sports example makes a similar point through specificity. CTM-Neg includes “hockey” and “baseball” in its selected sports topic. Other outputs emphasize more general sports vocabulary or include only one of those specific sports. This does not prove that every CTM-Neg topic is more specific, but it gives a concrete meaning to the coherence claim.
M10 supplies another kind of comparison. CTM and CTM-Neg frequently produce closely related scientific topics, yet the authors identify generic outliers in CTM’s selected lists. Examples include “processing,” “work,” and “approach” in contexts where surrounding words are more specialized.
The gene-expression topic from CTM-Neg includes “dna” and “motif.” The corresponding CTM list does not include those terms. The authors interpret their presence as evidence of a more domain-focused word group. This is an output-level observation, instead of a measurement of how every word changed during training.
Diversity, overlap, and collapse
The ETM examples show repeated generic vocabulary across topics. The authors report five topics whose leading words include “model,” “decision,” “method,” “analysis,” and “theory” in varying order. They interpret this as evidence of component collapse: nominally different topics produce very similar content.
That interpretation fits the low IRBO results in the tested configuration. It should not become a claim that ETM must collapse under every setup. The experiment establishes behavior for the implementation and settings used in this comparison.
The M10 comparison at T = 40 explores the opposite problem. LDA’s topics share relatively little vocabulary, which helps its diversity score. Yet some lists combine words that the authors find weakly connected.
CTM-Neg instead produces several topics containing “neural.” The authors distinguish themes related to language processing, pattern recognition, and neural or evolutionary computation. Shared vocabulary is therefore not automatically redundant: the same broad term can participate in several coherent specialist themes.
This analysis explains why maximizing disjointness is not the paper’s goal. A useful topic collection may allow related subjects to overlap while still producing interpretable distinctions. Coherence and diversity must be considered together.
Limitations
Limits the authors acknowledge
The authors explicitly recognize that automatic topic metrics do not always match the quality people perceive. Their manual inspection responds to this concern, but it covers selected examples. It does not replace a systematic human assessment of every system across all datasets and topic counts.
They also describe comparison with other contrastive topic approaches as future work. The related-work discussion positions CTM-Neg against earlier negative-sampling and adversarial ideas, but the experimental baseline set does not exhaust those alternatives. The study therefore supports an advantage over its reported baselines, rather than over every existing contrastive method.
Extending the mechanism to other neural topic architectures is another stated future direction. The experiments build on CTM. They do not establish that the same perturbation and triplet term will behave similarly with every encoder, decoder, or prior.
The paper’s own results also qualify the headline. CTM-Neg does not lead every metric in every setting. M10 contains topic counts where CTM has better coherence, and LDA can have stronger diversity. Those exceptions are part of the evidence, not incidental details to remove from the conclusion.
Limits visible in the experimental design
The reported architecture study is narrow. Contextual embeddings, encoder structure, decoder structure, and several default settings are fixed while the negative-sampling extension is examined. This makes the comparison concrete, but it leaves open how strongly the findings depend on those choices.
The vocabulary restriction is another boundary. Every collection is reduced to its most common 2K words for topic learning. Rare specialist terms outside that vocabulary cannot appear among the discovered topic words. The study does not show how the mechanism behaves with substantially different vocabulary selection.
Evaluation also focuses on the leading topic words. The top-10 entries are often what a person sees when inspecting a topic, so this is a relevant view. Nevertheless, the results do not describe all aspects of the full topic-word distribution. A topic’s lower-ranked vocabulary and its behavior on unusual documents remain less directly examined.
The article reports central summaries across repeated runs but no significance test or uncertainty interval for the main comparisons. Medians reduce sensitivity to extreme runs, yet they do not show the full distribution of outcomes. The numerical ordering is established by the reported summaries; the reliability of small differences is less fully characterized.
The tuning protocol deserves careful interpretation. The authors state the search ranges and target metric, and they publish the selected settings. They do not describe a clearly separated tuning and final-evaluation partition for the intrinsic topic metrics. Consequently, those results should not be read as an independently demonstrated guarantee of transfer to unseen collections.
Baseline configuration is practical rather than exhaustive. Most settings remain at OCTIS defaults, with specified changes such as the additional LDA passes. This compares concrete implementations under the stated arrangement. It does not establish the strongest performance each baseline could attain under equally extensive architecture and hyper-parameter exploration.
What the mechanism does not establish
Removing dominant topic weights is an intervention inside a learned representation. It does not identify a true counterfactual document. A reconstructed negative distribution need not correspond to something a person would naturally write, nor does it need to be a coherent document in its own right.
The intervention also assumes that suppressing top-weighted topics is a useful source of contrast. The experiments support the overall usefulness of that choice in the tested setting. Without a random-deletion control or another perturbation baseline, they do not establish that importance-based removal is uniquely responsible for the gains.
A larger distance between reconstructions is not itself a semantic explanation. The training objective can measure vocabulary-space separation, while a human question concerns whether the remaining topics represent a meaningful alternative subject. The paper connects the two through improved coherence and selected examples, but does not prove their equivalence.
The downstream experiment has a similarly bounded interpretation. A better M10 classifier indicates that the learned topic vectors help that supervised task. It does not demonstrate improved search, summarization, domain transfer, or document exploration by human users. Those applications remain possible motivations rather than measured outcomes.
Finally, the paper does not show that the mechanism reduces computational cost. Negative sampling is discussed broadly as a technique that can serve several purposes, but CTM-Neg uses an additional reconstruction and loss term to improve topic quality. Its reported evidence concerns quality, not a measured training-speed or memory advantage.
What came after
The later citation trajectory is not established by the evidence available for this account. No subsequent study can be identified here as having reproduced CTM-Neg, extended its perturbation mechanism, or demonstrated its transfer to another architecture. That leaves the paper’s future directions distinct from documented follow-up results.
The authors identify two clear next steps. One is a direct comparison with other contrastive approaches to topic learning. Such a comparison would help separate the value of contrastive training in general from the value of this particular way of constructing a negative topic mixture.
The other is integration with additional neural topic architectures. The relevant question would be whether removing dominant topic components remains useful when the representation and decoder change. The present results motivate that experiment, but do not answer it.
A further unresolved issue follows from the study’s own design: which part of the intervention matters most? Comparisons involving alternative topic selection, different perturbation strengths, or another separation objective could clarify the mechanism. These are research questions suggested by the evidence, rather than claims about completed later work.
The paper leaves a reusable principle even within those limits. A topic representation should be evaluated through what its components enable, and through what becomes difficult when those components are removed. CTM-Neg supplies one concrete implementation of that principle, with favorable aggregate coherence results and visible exceptions that help define where the claim holds.
Cite
Cite as Suman Adhya, Avishek Lahiri, Debarshi Kumar Sanyal and Partha Pratim Das. 2022. Improving Contextualized Topic Models with Negative Sampling. Proceedings of the 19th International Conference on Natural Language Processing (ICON).
@inproceedings{adhya2022improving,
title = {{Improving Contextualized Topic Models with Negative Sampling}},
author = {Suman Adhya, Avishek Lahiri, Debarshi Kumar Sanyal and Partha Pratim Das},
booktitle = {Proceedings of the 19th International Conference on Natural Language Processing (ICON)},
year = {2022},
url = {https://aclanthology.org/2022.icon-main.18/}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/adhya-2022-improving-contextualized-topic-models-negative/