Tutorials › Statistical Methods for Single-Cell RNA Sequencing › Sparse Priors for Interpretable Gene Programs

Latent Variable Models for Single-Cell Data · Tutorial 681 of 700

Sparse Priors for Interpretable Gene Programs

Learn how sparse Dirichlet concentrations and shrinkage penalties change inferred cell mixtures and gene programs, and how to distinguish prior-induced sparsity from evidence in the counts.

Advanced 12 min read

What You'll Learn

  • State the LDA-style count model and the conditional assumptions behind Dirichlet updates.
  • Calculate posterior mean topic proportions and gene profiles under different prior concentrations.
  • Distinguish sparse Dirichlet behavior from shrinkage in a nonnegative factor model.
  • Derive how an exponential prior changes a Poisson factor loading estimate.
  • Diagnose prior domination, weakly supported programs, and misleading exact zeros.

Why Put Sparsity in the Prior?

A topic model represents each cell as a mixture of programs and each program as a distribution over genes. In many applications, a useful summary would have a small number of active programs per cell and a short, interpretable set of genes per program. Sparsity priors can encourage that structure, but they do not establish that a program is biologically real: they express a modeling preference whose influence must be evaluated against the counts.

The introductory material on cell mixtures and gene programs describes how these two simplexes are interpreted. Here, the focus is how prior choice changes their estimates. The examples hold the number of topics fixed; they do not address how that number should be chosen.

Definition: In an LDA-style model with \(K\) topics and \(G\) genes, cell \(i\) has topic proportions \(\theta_i=(\theta_{i1},\ldots,\theta_{iK})\), where \(\theta_{ik}\geq 0\) and \(\sum_k\theta_{ik}=1\). Topic \(k\) has gene probabilities \(\phi_k=(\phi_{k1},\ldots,\phi_{kG})\), where \(\phi_{kg}\geq 0\) and \(\sum_g\phi_{kg}=1\). A symmetric Dirichlet prior uses \(\theta_i\sim\mathrm{Dirichlet}(\alpha,\ldots,\alpha)\) and \(\phi_k\sim\mathrm{Dirichlet}(\eta,\ldots,\eta)\).

In the basic count model, each observed gene count is associated with a latent topic assignment. Conditional on the assignments, let \(n_{ik}\) be the number of cell \(i\)'s counts assigned to topic \(k\), and \(m_{kg}\) the number assigned to gene \(g\) in topic \(k\). The assignments are drawn using the cell's topic proportions, and a topic's assigned counts use its gene probabilities. The Dirichlet prior is conjugate to these categorical probabilities. This gives a simple exact conditional update, even though the assignments themselves are unknown.

Theorem: Conditional on topic assignments, the posterior distributions are \(\theta_i\mid z\sim\mathrm{Dirichlet}(\alpha+n_{i1},\ldots,\alpha+n_{iK})\) and \(\phi_k\mid z,Y\sim\mathrm{Dirichlet}(\eta+m_{k1},\ldots,\eta+m_{kG})\). For a Dirichlet vector with parameters \(a_1,\ldots,a_J\), its mean in component \(j\) is \(a_j/\sum_{\ell=1}^{J}a_\ell\).

What the Concentration Parameters Do

For a symmetric prior on a \(J\)-component simplex, every component has prior mean \(1/J\), regardless of the common concentration \(c\). But changing \(c\) changes how much prior probability lies near the center versus near the boundaries. When \(c<1\), the Dirichlet density favors boundary regions and draws tend to have a few large components and many small ones. When \(c=1\), it is uniform over the simplex. When \(c>1\), it favors values closer to the center. These statements describe the prior distribution, not a guarantee that the posterior will be sparse or diffuse.

The total concentration \(Jc\) matters as well as the per-component value \(c\). For fixed \(J\), lowering \(c\) reduces total concentration. Across models with different numbers of components, keeping \(c\) fixed changes the total concentration; comparisons that aim to hold total concentration constant instead set \(c\) equal to the chosen total divided by \(J\). An asymmetric Dirichlet prior can also express unequal prior expectations: its component means are proportional to its component parameters.

A Dirichlet draw has strictly positive components with probability one when its parameters are positive. Thus “sparse Dirichlet” means near-zero components are encouraged, not that the prior assigns positive probability to exact zeros. Moreover, a posterior mean can look less sparse than typical posterior draws: averaging across uncertainty about which component is active spreads mass among components.

Worked Example: A Cell's Topic Proportions Under Two Priors

Suppose, hypothetically, that a conditional assignment step gives one cell topic counts \((8,1,0,0)\) across four topics. Compare the conditional posterior mean under a symmetric prior with \(\alpha=0.1\) and with \(\alpha=1\). The calculation treats assignments as given; in full inference they are uncertain.

With \(\alpha=0.1\), the posterior parameters are \((8.1,1.1,0.1,0.1)\). Their sum is \(8.1+1.1+0.1+0.1=9.4\), so the posterior mean is

$$ \left(\frac{8.1}{9.4},\frac{1.1}{9.4},\frac{0.1}{9.4},\frac{0.1}{9.4}\right) \approx (0.8617,0.1170,0.01064,0.01064). $$

With \(\alpha=1\), the posterior parameters are \((9,2,1,1)\), which sum to \(9+2+1+1=13\), not 12. The posterior mean is therefore

$$ \left(\frac{9}{13},\frac{2}{13},\frac{1}{13},\frac{1}{13}\right) \approx (0.6923,0.1538,0.07692,0.07692). $$

The lower concentration leaves the observed imbalance more pronounced: the first topic has a larger posterior mean, while the two unobserved topics receive less mass. Neither calculation implies that those two topics are truly absent from the cell. The values are conditional posterior summaries under the assumed model and assignments.

The same conjugate calculation applies to topic gene profiles. With a small \(\eta\), genes receiving no assigned counts get little posterior mean probability; with a larger \(\eta\), the prior contributes more probability to those genes. This can make the inferred gene programs broader, but the effect depends on the amount and pattern of assigned data.

Worked Example: Prior Concentration Changes a Gene Program

Consider hypothetical assigned counts \((12,3,1,0)\) for four genes within one topic. Compare the posterior mean gene probabilities for symmetric \(\eta=0.2\) and \(\eta=1\). These are conditional on the topic assignments.

For \(\eta=0.2\), the posterior parameters are \((12.2,3.2,1.2,0.2)\), with sum \(12.2+3.2+1.2+0.2=16.8\). Thus the posterior mean profile is

$$ \left(\frac{12.2}{16.8},\frac{3.2}{16.8},\frac{1.2}{16.8},\frac{0.2}{16.8}\right) \approx (0.7262,0.1905,0.07143,0.01190). $$

For \(\eta=1\), the parameters are \((13,4,2,1)\), which sum to \(20\). The posterior mean is

$$ \left(\frac{13}{20},\frac{4}{20},\frac{2}{20},\frac{1}{20}\right) =(0.65,0.20,0.10,0.05). $$

The more concentrated prior pulls the profile toward the uniform mean \((0.25,0.25,0.25,0.25)\): it lowers the leading gene's mean probability and raises the probability of the gene with no assigned counts. These are probabilities within this topic, not expected raw counts; converting them to counts also depends on the cell library sizes and topic proportions.

Regularized Factor Priors: Shrinkage Instead of a Simplex Prior

A related approach uses a factorization of the expected counts and places shrinkage priors directly on nonnegative factor loadings. For example, with a fixed size factor \(s_i\), one may model \(Y_{ig}\) as Poisson with mean \(s_i\sum_k\theta_{ik}\beta_{kg}\). Here \(\theta_i\) is constrained to the topic simplex, while \(\beta_{kg}\geq 0\) is an unnormalized loading for gene \(g\) in topic \(k\). A common regularization is an exponential prior on each loading, \(\beta_{kg}\sim\mathrm{Exponential}(\lambda)\), with density \(\lambda e^{-\lambda\beta_{kg}}\) for \(\beta_{kg}\geq0\). In a maximum a posteriori fit, its log density contributes a penalty proportional to \(\lambda\beta_{kg}\).

This is not the same parameterization as LDA's simplex-valued gene profile. Exponential shrinkage acts on the size of an unnormalized loading, whereas a Dirichlet prior redistributes probability across a normalized profile. Scale constraints and size-factor conventions therefore matter when comparing fitted values. In particular, applying an ordinary \(L_1\) penalty to a nonnegative simplex vector has no effect on its composition: its \(L_1\) norm is always one. A regularizer must act on parameters that can vary in scale, or use a different penalty that genuinely varies over the simplex.

Worked Example: Exponential Shrinkage of a Poisson Loading

Suppose, hypothetically, a single loading \(\beta\) predicts a Poisson count with mean \(\beta\), and the observed count is \(y=4\). Use the prior \(\beta\sim\mathrm{Exponential}(\lambda)\). Ignoring constants that do not depend on \(\beta\), the log posterior is

$$ \ell(\beta)=4\log(\beta)-\beta-\lambda\beta,\qquad \beta>0. $$

Differentiating gives \(\ell'(\beta)=4/\beta-(1+\lambda)\). Setting the derivative to zero yields the posterior mode \(\hat{\beta}=4/(1+\lambda)\); the second derivative, \(-4/\beta^2\), is negative, so this stationary point is a maximum. For \(\lambda=0.25\), the mode is \(4/1.25=3.2\). For \(\lambda=1\), it is \(4/2=2\). The loading is in the model's count-per-exposure scale, and stronger shrinkage reduces its mode.

If \(y=0\), the log posterior is \(-(1+\lambda)\beta\), which is maximized at the boundary \(\beta=0\). That boundary MAP estimate does not mean the continuous exponential prior assigns positive probability to an exact zero. A posterior distribution can still have uncertainty over small positive values. This distinction is important when describing “selected” genes from a penalized fit.

Derivation and Practical Comparison

The conditional Dirichlet update follows directly from multiplying the prior density by the assignment likelihood. For a simplex vector \(q=(q_1,\ldots,q_J)\), the Dirichlet density is proportional to \(\prod_j q_j^{a_j-1}\). If the assignments contribute counts \(c_j\), their likelihood is proportional to \(\prod_j q_j^{c_j}\). Multiplication adds the exponents:

$$ \prod_{j=1}^{J}q_j^{a_j-1}\prod_{j=1}^{J}q_j^{c_j} =\prod_{j=1}^{J}q_j^{(a_j+c_j)-1}. $$

The resulting kernel is the density of a Dirichlet distribution with parameters \(a_j+c_j\), which justifies the conditional update used above. This proof assumes categorical assignments and a Dirichlet prior; it does not say that the same update is exact after integrating out uncertain assignments or in a different count factorization.

For LDA, the concentration parameters \(\alpha\) and \(\eta\) have a direct interpretation on normalized mixtures and gene probabilities. In a regularized factor model, a penalty such as the exponential prior instead controls loading magnitude and may create boundary MAP estimates. These approaches differ in their likelihoods, parameter scales, and inferential summaries, so a numerical loading from one is not automatically comparable with a gene probability from the other.

1
Check the parameterization.
Confirm which quantities sum to one, which are unnormalized loadings, and how size factors enter the count mean.
2
Check prior influence.
Refit or recompute summaries under a scientifically plausible range of concentrations or penalty strengths, keeping the likelihood and data fixed.
3
Check fit, not only sparsity.
Compare observed and model-implied count patterns, especially gene totals and the prevalence of zeros; sparse-looking programs alone are not evidence of adequate fit.
4
Describe uncertainty honestly.
Separate a small posterior mean, a boundary MAP estimate, and an exact-zero selection rule. They are different claims.

Diagnostics, Limitations, and a Common Pitfall

Prior sensitivity is a central diagnostic. If modest changes to \(\alpha\), \(\eta\), or the shrinkage strength substantially change which topics dominate cells or which genes define a program, the data may not strongly distinguish those alternatives under the fitted model. Also inspect whether the fit systematically misses high-count genes, cell-specific patterns, or observed zero frequencies. A prior that produces visually concise programs can still yield poor predictive count behavior.

These priors do not solve all identifiability problems. Topics can be permuted without changing the model, and correlated programs may share genes or exchange counts. Sparse priors can favor simpler representations, but the resulting decomposition can remain dependent on initialization and modeling assumptions. Likewise, zero inflation, batch effects, or an inadequate count likelihood are not automatically repaired by stronger sparsity. The prior should not be used to make a weakly supported program appear definitive.

Common mistake: “The prior concentration is below one, so every cell has exact zeros for inactive topics.” The correction is that a Dirichlet with positive parameters has support only on simplex interiors: it favors draws near boundaries but does not assign mass to exact zeros. A reported zero may instead be rounding, a thresholding rule, or a boundary estimate from another procedure. State which one was used.

Key takeaway: Dirichlet concentration changes how strongly simplex-valued topic proportions and gene probabilities are pulled toward or away from the simplex center. Regularized factor priors shrink loading magnitudes under a chosen parameterization. In both cases, apparent sparsity must be interpreted alongside the count fit, uncertainty, and sensitivity to the prior.

Check Your Understanding

Answer each question, then compare your reasoning with the brief solutions.

  1. For four topics, what are the prior mean proportions under a symmetric Dirichlet with \(\alpha=0.2\)? What does changing \(\alpha\) change besides that mean?
  2. A cell has conditional topic assignment counts \((5,0,0)\). Under symmetric \(\alpha=1\), calculate its conditional posterior mean.
  3. Why does an \(L_1\) penalty on a nonnegative gene profile constrained to sum to one fail to encourage sparsity?
  4. For the Poisson loading example with count \(y=4\), what is the posterior mode under an exponential prior with \(\lambda=0.5\)?
  5. Does a Dirichlet prior with positive parameters assign positive probability to an exact zero component? Explain the interpretation of near-zero mass.

Solutions. (1) Each component has prior mean \(1/4\); changing \(\alpha\) changes concentration and the tendency of draws toward the center or simplex boundaries. (2) The posterior parameters are \((6,1,1)\), with sum 8, so the mean is \((6/8,1/8,1/8)=(0.75,0.125,0.125)\). (3) Every such profile has \(L_1\) norm \(\sum_g\phi_g=1\), so the penalty is constant over the feasible set. (4) The mode is \(4/(1+0.5)=4/1.5\approx2.667\). (5) No. Every component is positive almost surely; near-zero values are favored by sparse settings, but exact zeros require a separate mechanism or a reporting rule.

Clinical Biostats