Abstract
Non-negative matrix factorization (NMF) is a technique for finding latent representations of data. The method has been applied to corpora to construct topic models. However, NMF has likelihood assumptions which are often violated by real document corpora. We present a double parametric bootstrap test for evaluating the fit of an NMF-based topic model based on the duality of the KL divergence and Poisson maximum likelihood estimation. The test correctly identifies whether a topic model based on an NMF approach yields reliable results in simulated and real data.
Introduction
Topic modeling via Non-negative Matrix Factorization (NMF) has become a standard approach for uncovering latent structures in large document corpora. By decomposing a document-term matrix $X$ into topic ($W$) and weight ($H$) matrices, researchers can extract meaningful thematic clusters. However, when optimizing this decomposition using the generalized Kullback-Leibler (KL) divergence, there is an implicit statistical assumption: the word counts follow a Poisson distribution.
In practice, real-world text data frequently violates this assumption due to zero-inflation (extreme sparsity) and heteroscedasticity. While heuristic metrics like coherence or perplexity offer a sense of "human-readability," they do not provide a formal statistical validation of the underlying model. This paper introduces the Double Parametric Bootstrap Test (DPBS), a rigorous diagnostic tool that provides a p-value to determine if an NMF model is a statistically valid fit for a given corpus.
Methodology: The Double Parametric Bootstrap
The DPBS test leverages the mathematical duality between minimizing KL divergence and Maximum Likelihood Estimation (MLE) for Poisson random variables. To assess goodness-of-fit, the authors employ a bootstrap approach:
- Synthetic Generation: Bootstrap datasets are generated from a Poisson distribution using parameters estimated from the initial NMF.
- Double Bootstrapping: Standard bootstrap tests can be biased if the test statistic is not "pivotal." To correct for this, the authors implement a nested second bootstrap loop. This "double" approach ensures that the resulting p-value converges to the true value more reliably, even with finite sample sizes.
- Diagnostic Visualization: The test compares the reconstruction error of the original model against the distribution of errors in the synthetic data. A valid model fit should result in p-values that are uniformly distributed.
Experimental Evaluation
The authors validated the DPBS test using both synthetic and real-world datasets:
- Synthetic Corpora: Data was generated from Poisson, Gamma, Normal, and Zero-Inflated Poisson distributions across various matrix sizes (e.g., $10 \times 16$ to $92 \times 23$).
- New York Times (NYT) Annotated Corpus: A collection of articles from 2004–2007, categorized by "desks" (e.g., Foreign, Arts), used to test the model's performance on complex, structured real-world data.
Key Results and Insights
The primary strength of the DPBS test lies in its ability to correctly identify distributional mismatches. In simulations where the data was truly Poisson, the test produced uniformly distributed p-values, avoiding false positives. Conversely, when the data followed non-Poisson distributions—such as Gamma or Normal—the test yielded a p-value of 0.0, signaling a clear model rejection.
In the real-world NYT application, the test initially rejected the NMF model for the entire corpus ($p=0.0$). However, when the data was segmented by year or department (e.g., the Foreign desk in 2004), the p-values increased significantly (e.g., $p=0.32$). This suggests that NMF's failure on the full dataset was likely due to unmodeled temporal or categorical structures, highlighting the test's utility in identifying when more complex models (like Dynamic Topic Models) are required.
Conclusion and Future Directions
The DPBS test provides a much-needed formal diagnostic for NMF-based topic modeling. While computationally intensive due to the nested bootstrap loops, it offers a statistically sound "red flag" for practitioners. Future research aims to extend this framework to other divergence measures, such as the Frobenius norm or $\beta$-divergence, which correspond to Gaussian or Tweedie distributional assumptions, and to improve the interpretability of why a specific model fit fails.
Summary updated