Elamur Research

Efficient Methods for Incorporating Knowledge into Topic Models

Paper · 2015 · Yi Yang, Doug Downey and Jordan Boyd-Graber

Summary

A collection of documents can contain recognizable themes even when nobody has labeled them. Topic modeling tries to find those themes from patterns in the text. Latent Dirichlet allocation, or LDA, describes each document as a mixture of topics and each topic as a distribution over words. That gives readers a way to browse a collection, but some of the resulting topics are hard to make sense of. Information from outside the collection, such as a relationship between two words or a label attached to a document, can guide the analysis. The difficulty is that checking this information during training can become expensive as the number of possible topics grows. Latent Dirichlet Allocation

The authors propose Sparse Constrained LDA, or SC-LDA. It uses a factor graph to give proposed topic assignments extra weight when they agree with the supplied knowledge. A word relationship can make a topic more attractive when a related word already occurs there. A document label can restrict which topics its words may be assigned to. The speed comes from identifying where these adjustments matter. A related word typically has assignments in only a small part of the topic space, while a label restriction can be handled by sampling among the permitted topics. SC-LDA builds on SparseLDA, an existing sampler that already exploits sparsity in the underlying word and document counts.

The authors test word relationships on NIPS and NYT-News and document labels on 20NG. With word relationships, SC-LDA reaches a stable region of training log likelihood sooner than DF-LDA, Logic-LDA and MRF-LDA in the reported runs. In a separate NIPS comparison, after one hour of training with 500 topics, SC-LDA and ordinary LDA have approximately the same average topic coherence. Among each system’s top 20 topics by that metric, SC-LDA scores -36.6 and LDA scores -39.1, with higher scores indicating that the leading words occur together more consistently. In the 20NG label experiment with 500 topics and 1000 labeled documents, the mean time per sampling iteration is 0.72 seconds for SC-LDA and 8.05 seconds for Labeled-LDA.

The strongest evidence is for faster inference with the particular word relationships and document restrictions the authors test. The coherence result is narrower. It shows an improvement among the highest-scoring NIPS topics under a common training budget, alongside a similar collection-wide average. The two findings address different questions: whether prior knowledge can be incorporated efficiently and where its effect on the resulting topics can be measured.

Deep dive: Efficient Methods for Incorporating Knowledge into Topic Models

Sparse Constrained LDA uses word relationships and document labels to guide topic discovery while keeping Gibbs sampling efficient. · about 35 minutes to read

The problem and its context

The gap between a statistical pattern and a recognizable theme

Suppose a reader opens a collection of research papers and wants to know which subjects recur across it. Reading the papers individually would eventually reveal such patterns. A topic analysis offers a different starting point. It estimates groups of words that tend to feature in related documents and estimates how much each group contributes to a document. A single paper can then draw on several groups, and a group can recur in many papers. The lists of words with the highest probabilities in each group are often the reader’s first indication of what the topic represents.

That use depends on the lists being interpretable. LDA can discover regularities without anyone having to mark the documents in advance, which explains its appeal for exploration. Its training objective, however, rewards an account of how the observed words are distributed. A reader looking at a word list is asking whether the words suggest a meaningful subject. The paper cites human evaluation work showing that these judgments can diverge from the statistical criteria used to assess topic quality. A system that accounts for the words in a collection can still produce lists that readers struggle to interpret. Reading Tea Leaves

Prior knowledge gives the analysis evidence that word occurrence alone may supply unevenly. For instance, two expressions can refer to related subject matter even if the collection has few documents in which both expressions appear. A relationship supplied from elsewhere gives the analysis a reason to assign their occurrences to overlapping topics. A document label supplies a different signal. It applies across the document and identifies a set of topics that its words can express in a labeled analysis. The desired use of knowledge therefore depends on both what is known and which assignments it concerns.

The paper also points to evidence from interactive topic analysis. A reader can examine topics, identify a problem and supply feedback to guide a subsequent update. In that setting the analysis has to reach an interpretable result, and the time until a revised result appears also matters. The authors treat fast updates as a motivation for the work. Their main technical question is how to make knowledge-guided inference fast enough to support uses of this kind.

Why more topics make the usual sampler expensive

Under LDA, topic assignments are hidden. The text is observed, but the system has to infer which topic accounts for each occurrence of a word. A conventional Gibbs sampler updates those assignments repeatedly. For each occurrence, it looks at the other current assignments, evaluates the choices for that occurrence and draws a new topic. The procedure revisits the text over many passes, since changes to one assignment affect the counts consulted in later updates.

A straightforward calculation scores every topic at every update. Increasing the number of available topics increases the cost of processing a single word occurrence. Increasing the collection size adds more occurrences to process on every pass. The effects compound in large collections. The paper discusses search and online advertising as settings where many topics can help represent subjects that occur infrequently. It also cites work in which learning a large topic inventory helps reveal a hierarchy of subjects. These uses give the authors a reason to preserve a large set of possible topics even when a particular word or document uses relatively few of them.

That distinction is the basis of SparseLDA. The collection may have a large global inventory, while the current assignments for a particular word type occupy a relatively small subset. A similar distinction holds for a document. It may have tokens assigned to only a few topics even though all topics are possible under ordinary LDA. SparseLDA reorganizes the calculation so that it can use these small sets for most of the work and reuse other terms across updates. It still accounts for the possibility that a topic with no local assignments might be drawn. The gain comes from computing that part differently.

The paper places SparseLDA in a wider line of research on fast inference. It describes work using an upper-bound approximation for Gibbs sampling, a later use of alias tables to speed LDA sampling, and an algorithm designed to sample in constant time for large topic inventories. It also discusses variational inference, an alternative way to estimate hidden structure, and notes work on parallel and online updates. These approaches address the cost of inferring topics. The additional challenge in SC-LDA is that an adjustment based on prior knowledge can make each topic require individual work again, even when the ordinary LDA calculation is sparse.

How earlier work incorporated knowledge

Several predecessors gave prior knowledge a formal role in inference. Dirichlet forest priors encoded word relationships that favor or discourage shared topics. Logic-LDA expressed domain information through rules in first-order logic and could use either word relationships or document labels. MRF-LDA used a Markov random field to connect topic assignments according to word relationships. The paper presents these approaches as evidence that there are multiple ways to express related information. Each chooses where knowledge enters the probabilistic structure, which in turn affects how its inference procedure works.

Document labels had an established treatment in Labeled-LDA. Topics correspond to labels, and the labels on a document determine the set of topics its words can use. A document can still mix its eligible topics. Evidence from its words determines how that mixture is expressed in the assignments. SC-LDA uses the same restriction when it demonstrates document labels, so the relevant question there is how efficiently the restriction can be sampled. Labeled LDA

The authors distinguish methods that use metadata to shape inferred topics from methods that use topic variables to predict metadata. They call the former upstream and the latter downstream. SC-LDA is upstream. A word relationship or document label is available during inference and changes the choices the sampler makes. A sentiment predictor based on inferred topics illustrates the other direction described in the paper: the topic variables help predict a target. This distinction explains why the label experiment measures inference time. The labels are inputs, and the experiment asks about the cost of honoring them.

The authors identify efficient tree-based topic inference as a close predecessor. That work had already applied SparseLDA’s factorization to a way of structuring word knowledge, and a subsequent extension parallelized updates to global parameters through variational inference. SC-LDA proposes a common way to express word relationships and document restrictions. Its computational requirement is that the evidence must have a sparse representation at the point where a topic is sampled. The two types of knowledge make that possible in different ways.

The method, step by step

What a sampling pass does

The starting point is a collection represented by word occurrences and their document memberships. A word type is a vocabulary entry. A token is an occurrence of that entry. Tokens of the same type can receive different topic assignments. This matters for a word relationship: an instruction to favor overlap between related words still allows individual occurrences to be assigned according to the documents in which they appear.

During a sampling update, the current assignment of a token is held out of the counts. The sampler considers how well each possible topic fits the remaining assignments. For a word relationship, it also consults the assignments of the related word types. For a document label, it limits the available choices to the permitted topics. It then draws a topic according to the resulting weights and puts the token back into the counts under its new assignment. Repeating this update gives later tokens evidence from the changed counts.

The document and word counts play different roles. The document counts indicate which topics are already in use in the document being processed. The word counts indicate which topics already account for occurrences of the type being processed across the collection. A total for each topic supplies the scale against which a word’s count is interpreted. The prior knowledge changes how those sources of evidence are combined for the eligible tokens. It can favor an already plausible choice or make a different choice more competitive.

How SC-LDA updates topic assignments

The steps in order.

How SC-LDA updates topic assignmentsStep 1: Prepare the corpus and index applicable knowledge1. Prepare the corpus and index applicable knowledgeStep 2: Remove a token’s assignment from the counts2. Remove a token’s assignment from the countsStep 3: Build sparse weights for ordinary LDA3. Build sparse weights for ordinary LDAStep 4: Adjust active topics or apply label restrictions4. Adjust active topics or apply label restrictionsStep 5: Draw a topic from the resulting weights5. Draw a topic from the resulting weightsStep 6: Restore the token under its new assignment6. Restore the token under its new assignmentStep 7: Repeat passes and estimate topic word distributions7. Repeat passes and estimate topic word distributions

The ordinary LDA weight

In LDA, every document has a distribution over topics, and every topic has a distribution over vocabulary entries. Dirichlet distributions provide priors for these probability vectors. The authors use symmetric priors. Before taking the assignments into account, the same contribution is available to each topic in a document and to each word type within a topic. The priors permit alternatives with zero observed counts to retain positive weight in ordinary LDA.

Collapsed Gibbs sampling integrates out the probability vectors. The sampler therefore updates assignments using counts, without drawing separate values of the document and topic distributions at each token update. The paper gives the following base weight for assigning a token to a topic.

P(z = t │ z₋, w) ∝ (n[d,t] + α) (n[w,t] + β) / (n[t] + Vβ)

Here P denotes conditional probability, and │ separates the event from the information it is conditioned on. z is the current token’s topic variable, t is a candidate topic, z₋ contains all other assignments and w is the current token’s word type. d is the document containing that token. The count n[d,t] records assignments to topic t in document d, n[w,t] records assignments of type w to that topic, and n[t] counts all tokens assigned to the topic. The counts exclude the current token. α is the symmetric prior parameter for document–topic distributions, β is the symmetric prior parameter for topic–word distributions, and V is the vocabulary size. The symbol ∝ means that the expression on the right is an unnormalized weight. The sampler divides all candidate weights by their total to obtain probabilities.

The first part of the product gives more weight to topics already represented in the document. The remaining part expresses how strongly the topic represents the word. A raw count for a word has to be interpreted relative to the total assignments to that topic. The same raw count carries a different meaning in a broadly used topic than it does in a small one. This is the role of the denominator. The prior contributions smooth each calculation so that a choice can remain possible while the counts are still being established.

Reorganizing the weight into sparse terms

SparseLDA separates contributions that only require smoothing from ones that also depend on a non-zero document count or word count. The paper calls these contributions buckets. Written for an individual candidate topic, their sum is the ordinary LDA weight.

bₜ = sₜ + rₜ + qₜ = αβ / (n[t] + Vβ) + n[d,t]β / (n[t] + Vβ) + (n[d,t] + α)n[w,t] / (n[t] + Vβ)

Here bₜ is the base weight of topic t. Its three pieces are sₜ, the smoothing-only contribution, rₜ, the contribution involving the document count, and qₜ, the contribution involving the word count. n[t], n[d,t] and n[w,t] are the same current topic total, document–topic count and word–topic count used above. d and w identify the current document and word type. α and β are the two prior parameters, V is the vocabulary size, and juxtaposition denotes multiplication. The mass of a bucket is the sum of its contributions across candidate topics.

The first bucket is shared across documents at a given state of the counts. A change to the assignment of one token affects only the topic totals involved in that change, making it possible to maintain this bucket without rebuilding it at every draw. The second bucket is specific to the current document. It can share calculations across tokens of that document, with updates when its topic counts change. Only topics represented in the document contribute to this bucket.

The third bucket depends on the word type of the token being processed. It has a contribution only where that word type already has assignments. The authors note that this bucket frequently contains much of the probability mass despite having relatively few non-zero entries. SparseLDA begins sampling from this part of the distribution. The other buckets still provide mass, including for topics in which the word has yet to be assigned. The decomposition changes how the weights are calculated and traversed. Their sum recovers the ordinary sampling weight.

Adding a factor that differs across every topic would undermine this organization. The individual bucket weights would have to be multiplied by a separate adjustment for every candidate before the sampler could use their totals. SC-LDA therefore sets up its knowledge terms so that many topics share a default multiplier or can be omitted from the set of permitted choices. The distinction between a shared default and an exception is what connects the knowledge representation to runtime.

Giving prior knowledge a weight

The factor graph supplies scores for configurations of the hidden assignments. Think of a factor as a function attached to the assignment or assignments to which a piece of knowledge applies. Its value expresses how the knowledge changes the relative weight of a proposed state. A word-based factor is relevant at occurrences of the associated type. A document-based factor applies across the tokens of the document. The paper uses exponentials to turn the factor scores into multipliers.

ψ(z, M) = ∏ᵢ ∏ₘ∈Mᵢ exp(fₘ(zᵢ, wᵢ, dᵢ))

Here ψ is the total knowledge weight, z is the vector of current assignments and M is the available knowledge. The outer ∏ is a product over token positions i. The inner ∏ is over the pieces of knowledge m in Mᵢ, the subset that applies to position i; ∈ denotes membership. zᵢ, wᵢ and dᵢ identify the assignment, word type and document at that position. fₘ is the potential score for the applicable knowledge and exp is the exponential function. A score of zero yields a neutral multiplier. A score of −∞ yields zero weight. The score for a word relationship can itself be calculated from counts induced by the current assignments.

The ordinary LDA contribution and the knowledge contribution have distinct places in the joint calculation. The factors depend on the assignments and on the associated knowledge. They can therefore be taken outside the integrals over the document and topic probability vectors.

J(w, z │ α, β, M) = ψ(z, M) ∫∫ p(w │ z, φ) p(φ │ β) p(z │ θ) p(θ │ α) dθ dφ

Here J denotes the joint weight before normalization, w is the vector of observed word types, and z is the vector of all topic assignments. α and β are the LDA prior parameters, and M is the knowledge. ψ is the multiplier from the factor graph. θ collects the document–topic distributions, and φ collects the topic–word distributions. p(w │ z, φ) gives the word likelihood conditional on the assignments and topic–word distributions. p(φ │ β) is the prior density of those topic–word distributions. p(z │ θ) gives the assignment likelihood conditional on the document mixtures, and p(θ │ α) is the prior density of those mixtures. The signs ∫∫ and the differentials dθ dφ indicate integration over the two families of distributions.

This form also explains why the paper’s scores can be used in a Gibbs update without calculating a normalization constant for all possible joint configurations. The posterior over complete assignment vectors has the usual normalized form.

P(z │ w, α, β, M) = J(w, z │ α, β, M) / ∑z′ J(w, z′ │ α, β, M)

Here P denotes posterior probability, w is the observed collection, and z is the complete assignment vector being evaluated. J is the joint weight just defined. z′ is an assignment vector used as a summation index, so ∑z′ totals the weights of all possible complete vectors for the same observed collection. α, β and M are held fixed. Dividing by the total would make the probabilities of all possible assignment vectors sum to one. For an individual Gibbs update, only vectors that agree on the other tokens are compared.

The paper expresses the conditional as the ordinary LDA weight multiplied by the change in the knowledge score. A convenient way to write the conditional before substituting a particular kind of knowledge is as follows.

P(z = t │ w, z₋, M) ∝ bₜ ψ((z₋, z = t), M) / ψ(z₋, M)

Here P is the conditional probability of assigning the current token to t. z is its topic variable, z₋ gives the other assignments, and w identifies the observed words with the current token understood. M is the supplied knowledge, bₜ is the ordinary LDA weight, and ψ((z₋, z = t), M) evaluates the knowledge score with the proposed assignment included. The denominator denotes the common reference score for the other assignments. Any common positive reference cancels when the candidate weights are normalized. For the sampler, the paper writes the knowledge adjustment in terms of the potential for the current token. The sparse representations below specify how that adjustment is evaluated.

The general factor notation describes where an adjustment could enter. Speed still depends on which entries can be handled together. It is possible to write a potential for an input that supplies a different preference for every topic. In that case, the factor graph alone provides no shortcut for evaluating the new weights. The specific potentials are therefore as important to the method as the general expression for the joint weight.

Word relationships change the weights locally

The paper distinguishes must-links from cannot-links. A must-link expresses a preference for two word types to use similar topics. A cannot-link expresses a preference against their being prominent in the same topics. The authors illustrate the distinction with fumble. The word quarterback supports a football interpretation, so a topic that already contains assignments of quarterback is more attractive for fumble. An association with bank can be treated as a cannot-link, so current assignments of bank can make the same topic less attractive for fumble. A document’s own counts and the ordinary word counts still contribute to the decision.

The preference is about the distribution of topics for each word. A common word and a rare word can draw their occurrences from similar topics even though their probabilities within a given topic differ. This is why the authors frame their goal in terms of the topic given the word. A requirement that both words have similar probabilities within a topic would be harder to reconcile with large differences in how often they occur. The potential implements the preference through the counts of the linked types under the candidate topic.

fₘ(t, w, d) = ∑ᵤ∈Mʷ₊ log(max(λ, n[u,t])) + ∑ᵥ∈Mʷ₋ log(1 / max(λ, n[v,t]))

Here fₘ is the aggregate log potential for the word relationships applicable to the token of type w in document d, evaluated at candidate topic t. Mʷ₊ and Mʷ₋ are the must-link and cannot-link partner sets for w. The summation sign ∑ totals a term for each partner, with u indexing must-link types and v indexing cannot-link types. n[u,t] and n[v,t] are their counts in candidate topic t, excluding the token being updated from the current assignment counts. λ is the positive count floor the authors call correlation strength. max chooses the larger of the floor and the count, log takes its logarithm, and 1 / forms the reciprocal for a cannot-link. The document argument is retained from the general factor notation. In this particular score, the adjustment is determined by the word’s partners and their counts.

If a must-link partner has a count above the floor, that candidate receives a greater multiplier from the partner than a topic at the floor receives. An above-floor count from a cannot-link partner has the opposite effect because that term is inverted. If both types of relationship affect a candidate, all the contributions enter the same weight. As assignments change, the preferences implied by the relationships also change. The list of partners is supplied in advance, but there is no need to supply the topics in which those partners should be found.

The floor establishes the default. For a fixed partner, every candidate whose partner count is at or below λ has the same contribution from that partner. Lowering the floor lets more of the non-zero counts become exceptions. Raising it limits the effect to topics in which partners have larger counts. The authors note that different relationships could have different strengths according to confidence. Their experiments use the same value, λ = 1, for the word relationships.

Exponentiating the log potential turns its sums into products. Combining that multiplier with the three SparseLDA components yields the word-relationship sampling rule.

P(z = t │ w, z₋, M) ∝ (sₜ + rₜ + qₜ) (∏ᵤ∈Mʷ₊ max(λ, n[u,t])) (∏ᵥ∈Mʷ₋ 1 / max(λ, n[v,t]))

Here P is the conditional probability of assigning topic t to the current token, z is its assignment, w is its type, z₋ contains the other assignments and M denotes the knowledge. The first parenthesis contains the smoothing, document and word weights sₜ, rₜ and qₜ defined above for that token. The ∏ signs multiply over the must-link partner set Mʷ₊, indexed by u, and the cannot-link partner set Mʷ₋, indexed by v. The counts n[u,t] and n[v,t] describe the partners’ assignments to t; max applies the floor λ. The reciprocal 1 / makes an above-floor cannot-link count reduce its contribution. The proportionality sign indicates that the product must be normalized across candidate topics for the draw.

With the experimental floor, topics at or below it have a unit multiplier from the corresponding partner. The sampler can leave those contributions alone. It has to adjust a candidate where at least one partner has an above-floor count. In particular, it must be able to consider a topic in which the current word has no assignments when a linked word does have an above-floor count there. The existing word bucket and the set of exceptions from the linked words are based on different counts. Their overlap depends on the current assignment state.

The paper illustrates why this saves work using NIPS and NYT-News. In a 100-topic NIPS run, 87.2% of word types have non-zero counts in fewer than ten topics. In a 500-topic NYT-News run, 81.9% of word types have non-zero counts in fewer than 50 topics. The exceptions for any one partner are drawn from its non-zero counts and can occupy less support once the floor is applied. The cost for a token also depends on how many partners it has and how widely their supports extend across different topics. The sampler’s advantage comes from this observed pattern of counts, together with the ability to start from the SparseLDA buckets.

Document labels narrow the set of eligible topics

Document labels give the factor a different job. The paper follows Labeled-LDA in treating labels as having corresponding topics. The label set on a document becomes a set of eligible topics for its tokens. The potential has a constant finite value within that set and a weight of zero outside it after exponentiation.

fₘ(z, w, d) = 1 if z ∈ m[d]; −∞ otherwise

Here fₘ denotes the label potential for a token of type w in document d, and z is the topic under consideration. m[d] is the document’s label set expressed as corresponding topic identifiers. ∈ means that the candidate belongs to the set. The finite score 1 is shared by all eligible topics, while −∞ gives an excluded topic zero weight when exponentiated. The semicolon separates the cases. The word type w does not change which topics are eligible, so tokens of the same document share the restriction.

All eligible topics receive the same finite multiplier, which cancels when their probabilities are normalized. Their relative weights still come from LDA’s document and word evidence. This is a hard restriction. A strong word count cannot make an excluded topic available. The word-relationship potential instead gives positive relative weights to alternatives and permits the data to favor a topic that a linked word tends to avoid.

The label rule also influences later updates. Since a labeled document’s tokens cannot be assigned outside its permitted set, its document–topic counts are confined to that set. That helps keep the document bucket sparse. The authors also describe how sentence labels or relations between documents could enter the same general framework. For linked documents, their suggestion is to use document–topic counts in place of word–topic counts in a relationship potential. The experiments evaluate word relationships and document labels.

Preparing the knowledge and running inference

For the word experiments, the authors combine a lexical resource with word embeddings, which represent words as vectors derived from patterns of usage. WordNet 3.0 supplies sets of related lexical items, called synsets. Pretrained word2vec vectors supply a distributional similarity check. The paper cites prior approaches that use either a lexical resource or embedding similarity directly. Its own procedure combines them, so an embedding comparison is made for a candidate produced by the lexical resource. Distributed Representations of Words and Phrases

The procedure starts from noun types in the corpus and retrieves WordNet candidates. To produce a must-link, a candidate has to appear in the corpus vocabulary and its embedding similarity to the original type has to exceed 0.2. The vocabulary condition makes the relationship usable by the sampler, which needs counts for the partner. The similarity condition filters the lexical candidates using distributional evidence. The paper’s NIPS example links randomness with noise, entropy and stochasticity. The resulting input is a collection of word pairs. The sampler then works with those pairs and the current counts, while the vectors have already served their role in selecting candidates.

For the label experiments, the authors use the labels supplied on the news group documents. There is no analogous lexical candidate generation step. The relevant input is the set of permitted topics for a labeled document. This difference in preparation corresponds to a difference in what each kind of evidence says. An automatically selected word pair suggests where topic use might overlap. A supplied document label determines whether a particular topic assignment is allowed under the stated rule.

The experiments use symmetric LDA priors with α = 1.0 and β = 0.01. These are shared settings for the document and topic word distributions, while the knowledge potential determines how a particular link or label affects the updates. The paper names a public SC-LDA implementation, sparse-constrained-lda. It uses the UCI bag-of-words releases for the unlabeled corpora and Mallet for preprocessing the labeled news group corpus and for the ordinary SparseLDA comparison.

Experiments and results

What the datasets are used to test

The word experiments use NIPS and NYT-News. Neither dataset provides document labels for these experiments. Both are distributed in preprocessed bag-of-words form, which keeps the counts of each type in a document. The authors use those versions directly to make the setup repeatable. They use 20Newsgroup, abbreviated 20NG, to test document labels. For 20NG, they tokenize the text and remove stopwords with Mallet, then discard types with fewer than 10 occurrences. The vocabulary sizes are the reported numbers of types, while the token totals are approximate.

DatasetDocumentsWord typesApproximate tokens
NIPS1,50012,4191,900,000
NYT-News3,000,000102,660100,000,000
20NG18,82821,5141,946,000

The paper uses the corpora for different comparisons. NIPS and NYT-News both contribute evidence about log likelihood over elapsed time when word links are active. NIPS also supplies the fixed-budget coherence comparison. The 20NG experiment times the use of document labels and varies the number of topics and the amount of labeled material. The article’s results therefore concern several questions under different conditions. A speed measurement with word relationships and a quality measurement with document labels would require their own corresponding comparisons.

The authors report running the experiments on a machine with an 8-Core 2.8GHz CPU and 16GB RAM. They describe their inference work as single-processor learning. The hardware description identifies the setting for the timings. The reported timings do not establish how performance changes with more workers.

Baselines and settings

The word-relationship convergence comparison uses DF-LDA, Logic-LDA and MRF-LDA. DF-LDA is the Dirichlet forest method. The authors run it with FAST-RB-SDW, the efficient implementation cited in the paper, and set η = 100. Logic-LDA is the rule-based method. Its package settings are a sample rate of 1.0 and a step rate of 10.0. MRF-LDA is the Markov random field approach. It uses the package’s default γ = 1.0. The paper gives these settings to identify the tested implementations and refers to their original papers for the parameter meanings.

For coherence, the authors also run ordinary LDA using Mallet’s SparseLDA implementation. This baseline matters because it already has the main speed technique for inference without supplied knowledge. Comparing against it addresses whether adding word links changes coherence under a shared training budget. Comparing SC-LDA with the other word-knowledge methods addresses how much useful progress their respective inference procedures make when each has the same elapsed time.

Labeled-LDA is the comparison for document labels. It also uses Gibbs sampling and restricts the topics eligible for a labeled document, which makes per-iteration cost a meaningful point of comparison. The authors report averages across sampling iterations and random seeds. This measurement focuses on computational work for a pass of the sampler. It answers a different question from the log-likelihood trajectories, where the relevant outcome is the time taken to reach a stable region.

How quickly the word experiments approach convergence

Training log likelihood tracks how well the current estimates account for the observed collection under the likelihood calculation. A trajectory over elapsed time shows how quickly that quantity rises and levels off. The paper uses leveling off as an indicator of convergence. This comparison combines the speed of an iteration with the progress made over successive updates. A cheap iteration matters only to the extent that repeated iterations bring the analysis to a useful state.

On NIPS the convergence experiment uses 100 topics and 100 must-links. On NYT-News it uses 500 topics and 100 must-links. In both cases SC-LDA reaches a stable region sooner than the three word-knowledge baselines. The paper presents these results as curves. The comparison establishes the direction of the timing result on each dataset, with the larger news corpus showing that the method can use the tested word links in an inference run with a large number of tokens. The curves do not furnish a tabulated time at a common likelihood threshold, so the magnitude of this advantage should be read from the reported trajectories rather than expressed as a single runtime ratio.

The paper separately times individual SC-LDA iterations at different stages of training, using its C0, C100, C500 and C1000 settings for the number of correlations. These measurements are elapsed seconds for the selected iteration. They are distinct from the time needed to arrive at that iteration. The runtime table does not identify a dataset, so the values describe the reported correlation-count experiment without a corpus attribution.

Sampling passC0C100C500C1000
1st iteration2.022.142.302.50
50th iteration0.530.560.580.62
100th iteration0.480.500.530.56
200th iteration0.480.490.520.56

Two trends are visible. Later iterations are faster in every correlation setting, including the setting with no correlations. At a fixed iteration, the settings with more correlations take longer. For instance, at the 200th iteration C0 takes 0.48 seconds and C1000 takes 0.56 seconds. The experiment puts the added work from word links alongside the change in the base sampler as assignments become sparser. A late iteration time would give a different impression of training cost if reported without the earlier measurements.

How the paper measures topic coherence

The coherence evaluation treats a topic as a ranked list of its most probable words. Words high on that list should tend to occur in the same documents if the list expresses a recognizable subject. The paper uses a document co-occurrence metric motivated by work on semantic coherence. It also cites human evaluation research because held-out perplexity, a measure of predictive fit, can disagree with readers’ judgments. The authors use coherence as a quantitative proxy for the quality of the word lists. They do not collect new reader judgments in this experiment. Optimizing Semantic Coherence in Topic Models

C(t, V⁽ᵗ⁾) = ∑ₘ₌₂ᴹ ∑ₗ₌₁ᵐ⁻¹ log((F(vₘ⁽ᵗ⁾, vₗ⁽ᵗ⁾) + ε) / F(vₗ⁽ᵗ⁾))

Here C is the coherence score for topic t, and V⁽ᵗ⁾ is its ranked list of M leading words. In this formula the superscript on V⁽ᵗ⁾ identifies the list for a topic, so this use of V differs from the vocabulary size in the sampler. m and l are positions in the ranked list, and vₘ⁽ᵗ⁾ and vₗ⁽ᵗ⁾ are the types at those positions. The outer sum runs from position 2 to M, and for each such position the inner sum runs from 1 through m−1, covering each pair once with the earlier word in the denominator. F with two arguments counts documents containing both types. With one argument it counts documents containing that type. ε is a positive smoothing constant added to keep the logarithm defined when a pair never shares a document, and log is the logarithm.

In each term, the denominator counts the documents containing the earlier-ranked word. The numerator asks how frequently the other word occurs in those same documents, with smoothing. A pair whose occurrences overlap substantially contributes a larger value than a pair whose words rarely appear together. The experiment uses M = 10, so it evaluates the words a reader would see near the top of the list. The authors set ε to 10 raised to the power −12, following work that found smaller smoothing values more stable than the earlier choice of ε = 1. Exploring the Space of Topic Coherence Measures

The experiment uses NIPS with 500 topics and 100 word correlations in the knowledge-guided setup. Every system trains for one hour. The authors then examine two aggregates. The mean across all topics includes the difficult or weakly interpretable ones. The mean over the top 20 scores asks how coherent the best-ranked topics are under the same metric. The set of topics contributing to the latter mean is selected separately for each run by its own coherence scores. It represents the upper end of each resulting inventory.

Mean coherence of the top 20 NIPS topics after one hour

SC-LDA has the higher mean among the topics ranked highest by coherence.

Mean coherence of the top 20 NIPS topics after one hourOrdinary LDA: -39.1Ordinary LDA-39.1SC-LDA (this paper): -36.6SC-LDA (this paper)-36.6
The numbers
System or settingtopic coherence
Ordinary LDA-39.1
SC-LDA (this paper)-36.6

The two aggregates give the result its scope. The paper describes the overall mean for SC-LDA as approximately the same as ordinary LDA’s. The higher top 20 mean therefore shows a gain among the strongest topics under the metric. The authors attribute it to the tendency of word links to bring related types towards the same topics’ leading lists. The paper does not report a matching of topics across the two runs, so the result is a comparison between the leading groups rather than a claim about changes to individual themes.

DF-LDA, Logic-LDA and MRF-LDA yield considerably worse coherence than SC-LDA and ordinary LDA within the hour. The authors explain that the other methods have yet to converge at the time of evaluation. That makes the result informative for a fixed compute budget. A reader who needs topics after an hour receives the output available at that time. Eventual coherence after each method has had sufficient training is a separate comparison.

What label restrictions cost as the topic space grows

For 20NG, the authors average the running time per iteration over 100 iterations and then across 5 seeds. Their starting configuration has 100 topics and 1000 labeled documents. They then vary the topic inventory with the number of labeled documents held fixed, or vary the number of labeled documents with the topic inventory held fixed. The topic sweep tests whether the sparse sampler retains its advantage as the global set of topics grows.

20NG mean iteration time by topic count with 1000 labeled documents

Increasing the topic inventory raises iteration time more sharply for Labeled-LDA than for SC-LDA.

20NG mean iteration time by topic count with 1000 labeled documentsLabeled-LDA, T50: 0.93Labeled-LDA, T500.93SC-LDA, T50 (this paper): 0.38SC-LDA, T50 (this paper)0.38Labeled-LDA, T100: 1.89Labeled-LDA, T1001.89SC-LDA, T100: 0.45SC-LDA, T1000.45Labeled-LDA, T200: 3.60Labeled-LDA, T2003.60SC-LDA, T200: 0.51SC-LDA, T2000.51Labeled-LDA, T500: 8.05Labeled-LDA, T5008.05SC-LDA, T500: 0.72SC-LDA, T5000.72
The numbers
System or settingseconds per iteration
Labeled-LDA, T500.93
SC-LDA, T50 (this paper)0.38
Labeled-LDA, T1001.89
SC-LDA, T1000.45
Labeled-LDA, T2003.60
SC-LDA, T2000.51
Labeled-LDA, T5008.05
SC-LDA, T5000.72

Both methods take longer per pass as the topic count increases. The difference between them becomes more pronounced at the high end of the tested range. At 500 topics, the paper describes SC-LDA as more than ten times faster per iteration than Labeled-LDA. This is a comparison of average pass times for the specified setup. It gives a measure of how each sampler responds to a growing inventory while using the same number of labeled documents.

The second sweep examines what happens when more documents can make use of label restrictions. As that number rises, the reported mean time per pass falls for both methods. SC-LDA remains faster throughout the sweep. The direction of the change is consistent with the authors’ explanation that applying labels to more documents restricts more document–topic counts.

20NG mean iteration time by number of labeled documents with 100 topics

Both samplers take less time per iteration as more documents carry labels.

20NG mean iteration time by number of labeled documents with 100 topicsLabeled-LDA, C500: 1.95Labeled-LDA, C5001.95SC-LDA, C500 (this paper): 0.51SC-LDA, C500 (this paper)0.51Labeled-LDA, C1000: 1.88Labeled-LDA, C10001.88SC-LDA, C1000: 0.45SC-LDA, C10000.45Labeled-LDA, C2000: 1.75Labeled-LDA, C20001.75SC-LDA, C2000: 0.41SC-LDA, C20000.41Labeled-LDA, C5000: 1.48Labeled-LDA, C50001.48SC-LDA, C5000: 0.31SC-LDA, C50000.31
The numbers
System or settingseconds per iteration
Labeled-LDA, C5001.95
SC-LDA, C500 (this paper)0.51
Labeled-LDA, C10001.88
SC-LDA, C10000.45
Labeled-LDA, C20001.75
SC-LDA, C20000.41
Labeled-LDA, C50001.48
SC-LDA, C50000.31

The 20NG timings establish how efficiently the systems sample under the label restrictions. They give no measure of label prediction or topic coherence. The available labels determine admissible topics, and the observation is that more such restrictions go with lower iteration times. The paper’s coherence claim comes from the separate NIPS word-relationship experiment.

What the ablations show

The price of linking more words

The paper varies the amount of word knowledge directly by timing SC-LDA with several correlation counts, including C0. The zero-correlation run is a useful control because it shows the change in iteration time when the ordinary sparse counts are the only ones involved. Comparing settings at the same pass shows the added workload when the sampler must also look up linked types and adjust their active topics. The added workload remains visible late in training, even after the word counts have become sparser.

This is an ablation of the amount of supplied information for the timing outcome. It cannot tell whether supplying more links gives better topics. Adding links changes which word types are associated with knowledge, how many partners there are to consult and which candidate topics receive adjustments. Those properties determine the runtime. A quality comparison would have to examine the learned word lists as the number or identity of links changes. The reported coherence test instead evaluates a single word-relationship setting.

There is also a distinction between the number of correlations supplied globally and the work done for any one token. A link can matter on many updates if it involves a type that occurs often. A partner concentrated in a small number of topics can be cheaper to consult than one spread widely across the inventory. The timing table measures the combined effect in the tested configuration. It does not provide a cost per relationship independent of the words involved.

How count sparsity develops during sampling

The paper compares early and late iteration times and analyzes the number of topics with non-zero counts for word types. These observations fit together. Later in training, the authors find assignments become sparser, and the measured iterations become cheaper. If a word type is used in fewer topics, the word bucket involves fewer candidates. If a partner of that type is used in fewer topics, the potential adjustment can also be confined to fewer candidates. The same broad pattern of concentration therefore helps both parts of the word sampler.

The NYT-News histogram describes the support of counts after inference. Its statistic concerns vocabulary types, not the share of token updates that use those types or the fraction of time attributable to the knowledge term. A frequently occurring word can matter more to runtime than a rare word with similar support because the sampler processes each occurrence. The histogram explains why a sparse representation is plausible on the larger dataset. The timing curves and the correlation experiment supply the direct evidence of faster processing.

The paper does not hold the assignment state fixed and independently switch the sparse knowledge update on and off. The change in iteration cost over training therefore measures the combined effect of a changing state and the computation that uses it. Still, the no-correlation setting shows that later iterations can get cheaper without a knowledge term. This is consistent with the authors’ attribution of that part of the timing pattern to the underlying sparse counts.

Separating label availability from topic count

The two 20NG sweeps address changes that would be hard to interpret if varied together. The topic-count sweep holds the number of labeled documents fixed. It raises the size of the possible global topic space without increasing the amount of label supervision, and shows that SC-LDA’s per-iteration advantage grows over the tested range. The labeled-document sweep holds that global space fixed. Changing the amount of supplied label information then shows the effect of applying restrictions to a larger part of the collection.

Having more labeled documents makes more assignments subject to an eligibility set. The falling times in both systems are evidence that restrictions can make the sampling problem cheaper. Since SC-LDA is faster at every reported point, the relative result persists at different levels of label availability. The sweep does not compare two label potentials under the same implementation. Its contribution is a controlled comparison of the two samplers as the amount of label knowledge changes.

Where the coherence improvement appears

Plain LDA’s comparison with SC-LDA provides a quality check under a common runtime limit. The broadly similar overall averages and the higher score for SC-LDA’s top-ranked group show that aggregation matters. A system can offer stronger candidate topics for a reader to inspect even when the average across the inventory barely changes. Conversely, selecting only the best topics leaves open what happened elsewhere in the inventory. Both reported aggregates help locate the improvement described by the paper.

This comparison does not break the word procedure into separate lexical and distributional contributions. WordNet supplies the candidates and the embeddings help filter them, but the paper does not report corresponding coherence runs using only one source at a time. It also gives no comparison of must-links against cannot-links or a sweep over the correlation floor. The controlled results speak to the tested pair-generation procedure and the specified settings. They leave open which links or parameter changes would provide the strongest signal.

Limitations

Limits the authors state

The authors focus on single-processor inference. They point out that existing parallelization techniques could be applied, but report no parallel performance experiment for SC-LDA. The measured advantage concerns the sparse calculation under the hardware and implementations tested. It gives no empirical estimate of scaling across processors or of costs introduced by distributing the counts.

They also flag that fitting 500 topics to 20NG may overfit the data. The high-topic setting is included to demonstrate computational scaling. Its iteration time can establish that the sampler runs efficiently there even if a smaller topic inventory would be preferable for interpreting that corpus. The experiment’s purpose and the possible quality concern can both be true.

The conclusion presents interactive updates and personalized topics as applications that could benefit from fast inference. The experiments do not measure how quickly an interactive session responds to a particular correction, how users judge the revised topics or how well a personalized topic structure represents someone’s interests. The authors also describe sentence-level knowledge and document relations as extensions of the factor framework. The paper supplies their proposed representations, while the reported benchmarks cover word relationships and document labels.

Limits visible in the evaluation

The observed quality improvement is bounded by the coherence test. It uses NIPS, a fixed training duration and document co-occurrence among the leading words. A better top 20 average is compatible with an essentially unchanged overall mean. The experiment includes neither a human comparison of the resulting word lists nor a held-out prediction result for the tested systems. Prior work motivates coherence as a proxy for human judgment. How the readers of these particular topics would rate them remains open.

The fixed-time comparison also combines inference speed and the kinds of topics each method prefers. The authors attribute the weaker coherence of several baselines to their failure to converge within the hour. That explanation is consistent with the convergence curves, and it makes fixed-time performance useful for the practical question posed. To compare the systems’ attainable coherence independently of this timing constraint would require quality measurements after enough training for each method. Iteration time on 20NG similarly measures the cost of a pass and leaves the total number of passes needed for a comparable endpoint unmeasured.

The strongest empirical speed argument depends on the support of the knowledge terms. Word links are cheap to apply when partners have above-floor counts in relatively few topics. A word with many partners or partners spread across the topic space can require many adjustments. A label set that admits a large part of the topic inventory grants less opportunity to skip candidates. The paper makes the dense case explicit in its discussion of the conditional: if knowledge gives a different adjustment throughout the inventory, the sampler has to account for those weights. The reported counts establish useful sparsity in the tested settings, with no general bound on the work for arbitrary knowledge.

The word benchmark exercises automatically generated must-links. The method includes cannot-links, but the reported experiments do not isolate their effects or show the behavior of heavily conflicting relationship sets. The paper gives one shared floor and one similarity threshold for the reported word settings. It therefore provides limited evidence about sensitivity to link confidence, noisy lexical matches or a change in how partner candidates are generated. The label experiment likewise uses existing labels; it does not assess the effect of misleading label restrictions.

Finally, the general factor-score expression leaves a detail to check whenever a new potential is proposed. A count-based potential can read assignments beyond the token to which it is attached. If changing that token also changes a factor attached elsewhere, the full joint-weight ratio depends on that factor as well. The paper gives a local count-based sampling rule for its word relationships and demonstrates that procedure empirically. Applying the general factor notation to a different count-dependent construction requires verifying which factors change and whether those changes can still be evaluated sparsely.

What came after

Bianchi and colleagues’ later work Pre-training is a Hot Topic cites SC-LDA and also asks how to improve topic coherence with information beyond the observed word counts. Its focus is on contextualized document embeddings, vector representations that capture information about words as they appear in a document. This places the additional information at the document level. It revisits the quality problem from the perspective of the representations supplied to topic discovery. Pre-training is a Hot Topic

The two studies identify different roles for external information. In SC-LDA, the distributional evidence helps select word pairs before inference. The pair subsequently changes the probability of a topic assignment through its partner’s current counts. Labels provide a separate form of document-level knowledge by declaring eligible topics. Bianchi and colleagues put contextualized document representations at the center of their coherence study. A representation can supply information about the content of a document without taking the form of an explicit relationship between a pair of types or a set of topic labels. The citation connects the studies’ concern with coherent topics. It does not establish reuse of SC-LDA’s factor graph or sparse Gibbs updates.

Cite

Cite as Yi Yang, Doug Downey and Jordan Boyd-Graber. 2015. Efficient Methods for Incorporating Knowledge into Topic Models. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/d15-1037

@inproceedings{yang2015efficient,
  title = {{Efficient Methods for Incorporating Knowledge into Topic Models}},
  author = {Yi Yang, Doug Downey and Jordan Boyd-Graber},
  booktitle = {Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing},
  year = {2015},
  doi = {10.18653/v1/d15-1037},
  url = {https://doi.org/10.18653/v1/d15-1037}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/yang-2015-efficient-methods-incorporating-knowledge-into/