The Syntactic Topic Model (STM) moves beyond the "bag-of-words" limitation of traditional topic models by incorporating the structural information of parse trees. By blending document-level themes with local syntactic constraints using a "product of experts" approach, the STM achieves better predictive performance and uncovers more nuanced linguistic patterns than models that rely on either syntax or theme alone.
The Problem with "Bags of Words"
Most probabilistic topic models, like Latent Dirichlet Allocation (LDA), rely on the assumption of exchangeability. This means they treat documents as "bags of words," ignoring the order and grammatical structure of sentences. While this simplification makes the underlying mathematics tractable and works well for high-level document classification, it fails at more granular linguistic tasks.
For example, a bag-of-words model knows that "eat" and "cheesecake" often appear together, but it doesn't understand selectional preferences—the grammatical rules that dictate how those words relate (e.g., "eat" usually takes a food item as a direct object). Standard models also struggle with polysemy (words with multiple meanings) because they lack the local syntactic context to distinguish between "fly" the insect and "fly" the baseball term. The STM aims to bridge this gap by creating a model that is "aware" of the parse tree of a sentence.
Methods: Combining Thematic and Syntactic Context
The STM is a nonparametric Bayesian model that extends the Hierarchical Dirichlet Process (HDP). Its core innovation lies in how it generates the topic assignment for a given word.
Instead of drawing a topic solely from a document's overall distribution, the STM combines two distinct influences:
- Thematic Context: The per-document topic weights ($\theta_d$), which represent what the document is broadly "about."
- Syntactic Context: A topic transition distribution ($\pi_k$), which represents the probability of moving from a parent node's topic to a child node's topic within a parse tree.
The model uses a "product of experts" approach: it multiplies these two vectors together and renormalizes them. This ensures that a word's topic must be both thematically relevant to the document and syntactically consistent with its parent in the parse tree.
Because this multiplicative combination breaks the mathematical "conjugacy" (which usually makes these models easy to solve), the authors developed a custom approximate posterior inference method using variational inference, introducing a "slack parameter" to handle the complex normalization.
Datasets
The authors evaluated the STM using two primary sources:
- Synthetic Data: A custom-generated corpus where words followed strict rules (e.g., verbs only in head positions, specific themes for nouns). This allowed the authors to verify if the model could actually recover known underlying structures.
- The Penn Treebank: A classic benchmark in NLP consisting of hand-parsed Wall Street Journal articles. The authors converted these into dependency parses to provide the "ground truth" syntactic structure for the model.
Key Insights and Ideas
- The "Lens" Effect: By multiplying the thematic and syntactic vectors, the model effectively views one distribution through the "lens" of another. This forces the model to choose topics that satisfy both constraints, rather than just picking the most likely one from either category.
- Functional vs. Topical Classes: The model naturally learns to distinguish between "functional" topics (like pronouns or auxiliary verbs that appear in almost every document) and "topical" topics (specialized nouns like "shares" or "market" that only appear in specific contexts).
- Syntax as a Regularizer: Incorporating syntax helps disambiguate words. If the document is about "Travel" and the syntax requires a "Direct Object," the model is much more likely to correctly predict a destination name than a random travel-related verb.
Key Results
- Lower Perplexity: On the Penn Treebank, the STM achieved lower held-out perplexity (a measure of how well the model predicts unseen data) compared to both the standard HDP and the "Infinite Tree" model (which uses syntax but ignores document themes).
- Better Part-of-Speech Handling: In synthetic tests, the STM was the only model able to simultaneously recover thematic groupings (e.g., "livestock" vs. "economy") and maintain the distinct roles of different parts of speech.
- Qualitative Coherence: When looking at the learned topics, the STM produced clusters that were both grammatically and semantically tight—for instance, grouping "media-related nouns" that specifically function as subjects for "communication verbs."
Limitations and Future Work
The primary limitation is that the STM is not a full parser. It requires the parse trees to be provided as input (either hand-annotated or generated by another tool). This means the model's performance is somewhat dependent on the quality of the initial parsing.
The authors suggest that future work could involve integrating the STM directly into the parsing process itself. Instead of just using a tree to find topics, the thematic information from the STM could be used to help a parser make better decisions about ambiguous sentence structures. Additionally, the current variational inference method is computationally intensive; scaling this to massive, "web-scale" datasets would likely require further optimization.
Summary updated