From Topic Model Quantities to Biological Summaries
A topic model provides two complementary summaries: for each cell, a distribution over topics; and for each topic, a distribution over genes. In a single-cell setting, a topic can be read as a probabilistic gene program, while a cell’s topic distribution describes how strongly the model represents that cell with each program. These are not hard cell labels. Nor are the model’s probabilities the same thing as the random topic assignments that would be generated for individual count tokens.
That distinction matters because the word “proportion” can refer to different quantities. A cell’s topic-assignment probability is a model parameter. The fraction of its tokens actually assigned to a topic is a random realized quantity. The former determines the distribution of the latter, but they are not generally equal. The same care is needed when interpreting topic-gene probabilities: they describe a gene distribution conditional on a topic, not a cell-type label or a causal mechanism.
The Two Distributions in LDA
Let \(x_{cg}\) be the observed count of gene \(g\) in cell \(c\), and let \(N_c=\sum_g x_{cg}\) be the total number of modeled gene tokens in that cell. A token is one counted gene occurrence. With \(K\) topics and \(G\) genes, LDA represents each cell by a probability vector \(\boldsymbol{\theta}_c\) and each topic by a probability vector \(\boldsymbol{\beta}_k\).
In the generative model, each token in cell \(c\) first receives a topic assignment \(z_{cn}\) drawn from a categorical distribution with probabilities \(\boldsymbol{\theta}_c\). Given that assignment, its gene \(w_{cn}\) is drawn from the categorical distribution \(\boldsymbol{\beta}_{z_{cn}}\). The standard LDA formulation treats tokens as exchangeable conditional on these distributions: their ordering is irrelevant, and each token has one topic assignment. In the usual single-cell interpretation, topics share their gene distributions across cells, while cells can have different topic mixtures.
The topic assignment is latent: the observed data are gene counts, not a known topic label for every token. Model fitting therefore estimates or approximates distributions over latent quantities. When interpreting fitted values, it is useful to write \(\hat{\theta}_{ck}\) and \(\hat{\beta}_{kg}\) for estimates, while keeping the same distinction between probabilities and realized assignments.
What the Mixture Implies for Gene Counts
A cell’s topic mixture induces a gene distribution by averaging the topic-specific gene probabilities with the cell’s topic weights. For a token from cell \(c\), the probability of observing gene \(g\) is obtained by summing over the possible topic assignments. This is the law of total probability: a token can be gene \(g\) through any topic \(k\).
Define \(\pi_{cg}=\sum_k\theta_{ck}\beta_{kg}\). Conditional on the cell’s total token count \(N_c\) and the model probabilities, the gene-count vector has a multinomial distribution with probabilities \(\boldsymbol{\pi}_c\). Thus, expected counts are \(N_c\pi_{cg}\). They are expectations, not promises that the observed counts equal those values.
This derivation conditions on \(N_c\), the topic mixture, and the topic-gene distributions. It describes the model’s allocation of the fixed number of modeled tokens. It does not, by itself, model why one cell has a larger total count than another. Any interpretation also inherits the model’s assumptions: one topic per token, shared topic-gene distributions, and a cell-specific mixture that applies to all of that cell’s tokens.
Worked Example: A Cell With Two Mixed Programs
Consider a hypothetical cell with \(N_c=100\) modeled tokens and two topics. Suppose its fitted topic probabilities are \(\hat{\theta}_{c1}=0.70\) and \(\hat{\theta}_{c2}=0.30\). For three genes, suppose the fitted topic-gene probabilities are:
| Gene | \(\hat{\beta}_{1g}\) | \(\hat{\beta}_{2g}\) |
|---|---|---|
| Gene A | 0.60 | 0.10 |
| Gene B | 0.30 | 0.20 |
| Gene C | 0.10 | 0.70 |
The estimated probability of Gene A for a token from this cell is \(\hat{\pi}_{cA}=0.70(0.60)+0.30(0.10)=0.42+0.03=0.45\). For Gene B it is \(\hat{\pi}_{cB}=0.70(0.30)+0.30(0.20)=0.21+0.06=0.27\). For Gene C it is \(\hat{\pi}_{cC}=0.70(0.10)+0.30(0.70)=0.07+0.21=0.28\). The probabilities sum to \(0.45+0.27+0.28=1.00\).
The corresponding expected counts are \(100(0.45)=45\) for Gene A, \(100(0.27)=27\) for Gene B, and \(100(0.28)=28\) for Gene C. These expected counts need not be the observed counts in this hypothetical cell; the actual multinomial draw can differ. Similarly, \((0.70,0.30)\) gives the probabilities for topic assignments, not a guarantee that exactly 70 tokens receive Topic 1 and 30 receive Topic 2.
Program Weights Are Not Hard Cell Labels
A topic proportion vector retains information about mixtures. A common compression is to assign each cell the single topic with the largest \(\theta_{ck}\). This “largest-weight” rule creates a hard label, but it is an added summarization choice, not the basic LDA representation. It discards the size of the other weights and can make nearly tied cells appear as different as cells with very concentrated mixtures.
For example, a cell with weights \((0.51,0.49)\) and one with weights \((0.98,0.02)\) both receive Topic 1 under the largest-weight rule. Yet the first is represented as a substantial mixture, while the second is represented mostly by Topic 1. Neither label establishes that the cell belongs to a discrete biological type. A topic model describes patterns in the modeled counts; interpreting a topic as a biological program requires context and validation beyond the numerical label.
Worked Example: A Hard Label Hides a Near Tie
Suppose two hypothetical cells have estimated topic probabilities \((0.51,0.49)\) and \((0.98,0.02)\), respectively, for Topics 1 and 2. Under the largest-weight rule, both receive the hard label “Topic 1,” because \(0.51>0.49\) and \(0.98>0.02\).
That shared label does not mean the cells have similar mixtures. In the first cell, the difference between the two topic weights is \(0.51-0.49=0.02\). In the second, it is \(0.98-0.02=0.96\). The first cell is nearly balanced in the model’s representation; the second is strongly weighted toward Topic 1. A report that keeps the full vectors communicates this distinction, whereas the hard labels alone do not.
The values are probabilities, not direct measurements of biological activity. The supported description is that the fitted model assigns different relative weights to its two programs, not that the first cell has two measured activities in an exact 51-to-49 ratio.
Expected Pooled Mixtures and Realized Assignments
The distinction between probabilities and realized assignments also applies when cells are pooled. Let \(M_{ck}\) be the number of tokens in cell \(c\) assigned to topic \(k\) in a generative draw. Given \(N_c\) and \(\boldsymbol{\theta}_c\), the assignment counts follow a multinomial distribution. Therefore their expected values are \(E[M_{ck}]=N_c\theta_{ck}\). A pool weighted by cell token counts can be formed from these expected assignment counts, but that is an expected pooled mixture, not necessarily the realized pooled assignment proportion.
Worked Example: Pooling Expected Topic Counts
Consider two hypothetical cells. Cell 1 has \(N_1=100\) tokens and topic probabilities \((0.80,0.20)\); Cell 2 has \(N_2=900\) tokens and probabilities \((0.20,0.80)\). The expected Topic 1 assignment counts are \(100(0.80)=80\) and \(900(0.20)=180\). The expected Topic 2 counts are \(100(0.20)=20\) and \(900(0.80)=720\).
Pooling these expected counts gives \(80+180=260\) expected Topic 1 assignments and \(20+720=740\) expected Topic 2 assignments, out of 1,000 tokens. The expected pooled topic mixture is therefore \((260/1000,740/1000)=(0.26,0.74)\). Equivalently, \((100(0.80)+900(0.20))/(100+900)=0.26\) for Topic 1.
The value 0.26 is not necessarily the realized fraction assigned to Topic 1 in a particular draw. If the actual latent assignments were available, the realized pooled fraction would be the actual Topic 1 assignment count divided by 1,000. In fitted single-cell data, assignments are latent, so the weighted calculation is best described as pooling expected assignments under the stated model probabilities.
Interpreting Topic-Gene Probabilities
A topic’s \(\beta_{kg}\) values describe its composition: conditional on a token being assigned to topic \(k\), they give the model probability of each gene. A larger \(\beta_{kg}\) means that gene has more probability mass within that topic’s gene distribution. It does not mean that the gene is exclusive to that topic, that it is expressed only in cells with a particular hard label, or that the topic causes its expression.
The conditional direction matters. \(\beta_{kg}\) is the probability of a gene given a topic. It is not the probability that a token came from topic \(k\) given that its gene was observed. For a particular cell with known mixture \(\boldsymbol{\theta}_c\), the latter conditional probability for a token observed as gene \(g\) is, when the denominator is positive,
This expression combines the cell’s topic probabilities with each topic’s probability for the observed gene. Consequently, even a gene that is relatively probable in one topic may not identify that topic on its own: the cell’s mixture and the competing topics’ gene probabilities also matter.
Worked Example: A Gene Does Not Determine Its Topic
Suppose a hypothetical cell has topic probabilities \((0.60,0.40)\), and a gene has topic-gene probabilities \(\beta_{1g}=0.40\) and \(\beta_{2g}=0.05\). The model’s probability for this gene is \(0.60(0.40)+0.40(0.05)=0.24+0.02=0.26\).
For a token known to be this gene, the conditional probability of Topic 1 is \(0.60(0.40)/0.26=0.24/0.26\approx0.9231\), and for Topic 2 it is \(0.40(0.05)/0.26=0.02/0.26\approx0.0769\). The two conditional probabilities sum to 1. Topic 1 is much more plausible for this token under the model, but the probability is not 1: the gene remains possible under Topic 2.
Assumptions, Checks, and Alternatives
The mixture interpretation is meaningful only relative to the model. LDA assumes each token has one topic assignment and that, conditional on a cell’s topic mixture and the topic-gene distributions, tokens follow the specified categorical draws. It also represents each topic with one gene distribution shared across cells. These assumptions make a compact summary possible, but biological expression may include dependencies or structure not represented by this model.
Useful checks at this stage are checks of the quantities and their interpretation, not proof that the model is biologically correct. Confirm that every estimated topic vector and topic-gene vector is nonnegative and sums to one (allowing for rounding). Check that \(\sum_k\hat{\theta}_{ck}\hat{\beta}_{kg}\) is a valid gene probability distribution: summing it over genes gives \(\sum_k\hat{\theta}_{ck}\sum_g\hat{\beta}_{kg}=\sum_k\hat{\theta}_{ck}=1\). When expected counts are presented, verify that they sum to \(N_c\). If they do not, a normalization, indexing, or arithmetic error may have occurred.
A further warning sign is an interpretation that treats tiny differences in fitted weights as certain biological distinctions. Estimates can have uncertainty, and fitted latent topics may not have a unique biological naming. Variational inference and posterior summaries, covered in the earlier material on variational inference for single-cell topic models, are relevant when uncertainty in the latent quantities matters. A point estimate alone should not be presented as exact knowledge of a cell’s program composition.
Hard labels are useful when a downstream task explicitly requires one category per cell, but they sacrifice mixture information and can depend on arbitrary decision rules. Keeping the continuous topic weights is usually more faithful to LDA’s representation. The earlier material on Poisson factorization provides a different count-modeling approach; regardless of the model used, a probabilistic factor or component should not automatically be equated with an exclusive cell type. Topic models also differ from direct cell-type classification: their topics summarize recurring gene distributions, and their cell weights describe mixtures under the chosen model.
Common Mistakes and Limitations
- Calling \(\theta_{ck}\) the realized fraction of tokens assigned to topic \(k\). It is the assignment probability. The realized count \(M_{ck}\) is random, with expected value \(N_c\theta_{ck}\).
- Calling a weighted average of cell probabilities a realized pooled assignment fraction. Weighting by cell token totals pools expected counts. A realized fraction requires the actual assignment counts.
- Reading \(\beta_{kg}\) as \(P(\text{topic }k\mid\text{gene }g)\). It is \(P(\text{gene }g\mid\text{topic }k)\); reversing the conditional requires Bayes’ rule and the cell’s mixture.
- Treating the largest topic weight as the whole cell representation. The label suppresses all other weights and can hide substantial mixtures.
- Calling a topic a causal pathway or exclusive cell type from its probabilities alone. The model describes statistical patterns in counts; biological claims need additional evidence and appropriate validation.
These limits do not make topic weights uninformative. They specify what the quantities support: a cell-specific probability distribution over modeled programs, and a topic-specific probability distribution over modeled genes. Keeping that conditional, probabilistic meaning intact makes comparisons and biological follow-up more defensible.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- A cell has \(\theta=(0.25,0.75)\) and 200 modeled tokens. What are the expected topic assignment counts? Are those counts guaranteed to occur?
- For a gene, \(\beta_{1g}=0.30\) and \(\beta_{2g}=0.10\). Is \(0.30\) the probability that a token observed as this gene came from Topic 1? Explain.
- Two cells have topic weights \((0.52,0.48)\) and \((0.95,0.05)\). What information is lost if both are given the largest-weight hard label?
- Two cells have token totals 50 and 150, and Topic 1 probabilities 0.40 and 0.80. Calculate the expected pooled Topic 1 fraction. State what it is, and what it is not.
Solutions. (1) The expected counts are \(200(0.25)=50\) and \(200(0.75)=150\). They are not guaranteed: the assignments are random draws, and realized counts can differ. (2) No. \(0.30\) is the probability of the gene conditional on Topic 1. To find the probability of Topic 1 conditional on observing the gene, one also needs the cell’s topic mixture and the gene probability under every topic. (3) Both receive Topic 1, but the first cell is nearly balanced and the second is strongly weighted toward Topic 1; the hard label discards that difference and the nonleading weight. (4) Expected Topic 1 counts are \(50(0.40)=20\) and \(150(0.80)=120\), for 140 out of 200 expected assignments. The expected pooled fraction is \(140/200=0.70\). It is not necessarily the realized pooled fraction, which would require the actual latent assignment counts.