[Paper Review] Topic Compositional Neural Language Model
This paper proposes the Topic Compositional Neural Language Model (TCNLM), a joint framework that integrates a neural topic model with a Mixture-of-Experts (MoE) language model using matrix factorization to enable efficient, end-to-end training. TCNLM achieves state-of-the-art perplexity reduction by leveraging topic-probability-weighted RNN experts, outperforming both standard RNNs and prior topic-guided models while generating coherent, topic-conditioned sentences.
We propose a Topic Compositional Neural Language Model (TCNLM), a novel method designed to simultaneously capture both the global semantic meaning and the local word ordering structure in a document. The TCNLM learns the global semantic coherence of a document via a neural topic model, and the probability of each learned latent topic is further used to build a Mixture-of-Experts (MoE) language model, where each expert (corresponding to one topic) is a recurrent neural network (RNN) that accounts for learning the local structure of a word sequence. In order to train the MoE model efficiently, a matrix factorization method is applied, by extending each weight matrix of the RNN to be an ensemble of topic-dependent weight matrices. The degree to which each member of the ensemble is used is tied to the document-dependent probability of the corresponding topics. Experimental results on several corpora show that the proposed approach outperforms both a pure RNN-based model and other topic-guided language models. Further, our model yields sensible topics, and also has the capacity to generate meaningful sentences conditioned on given topics.
Motivation & Objective
- To address the limitation of RNN-based language models in capturing long-range document-level semantics by integrating global topic coherence.
- To overcome the inefficiency and poor generalization of existing topic-guided language models that treat topics as external features or post-hoc reweighting.
- To design a unified, end-to-end trainable architecture that jointly optimizes topic modeling and language modeling for improved performance and interpretability.
- To enable meaningful sentence generation conditioned on specific topics or topic combinations, enhancing model interpretability.
Proposed method
- The model uses a variational autoencoder to learn latent topic distributions per document, capturing global semantic coherence.
- Each topic corresponds to a dedicated RNN-based expert in a Mixture-of-Experts (MoE) setup, with expert weights determined by document-specific topic probabilities.
- Matrix factorization is applied to RNN weight matrices, decomposing them into topic-dependent components to reduce parameters and prevent overfitting.
- The model is trained end-to-end by maximizing the variational lower bound, enabling joint optimization of topic and language modeling objectives.
- The MoE structure allows dynamic routing of hidden states based on topic relevance, enabling context-aware word prediction.
- A topic-conditioned LSTM generator is constructed using only the relevant expert’s weights, enabling controlled sentence generation.
Experimental results
Research questions
- RQ1Can a joint neural topic model and language model architecture improve perplexity beyond standard RNNs by incorporating global topic coherence?
- RQ2How effectively can topic-probability-weighted experts in a MoE framework model local word-ordering while maintaining global semantic consistency?
- RQ3Does the matrix factorization-based parameter sharing in the MoE structure prevent overfitting and improve training efficiency compared to naive MoE?
- RQ4Can the model generate semantically coherent sentences when conditioned on individual or mixed topics, demonstrating interpretability and compositional understanding?
Key findings
- TCNLM achieves the lowest test perplexity across all datasets: 82.67 on APNEWS, 94.64 on IMDB, and 125.09 on BNC, outperforming both basic LSTM and naive MoE models.
- On APNEWS and IMDB, TCNLM achieves the highest topic coherence scores, demonstrating superior topic quality compared to LDA and other baselines.
- The model generates meaningful, topic-relevant sentences when conditioned on individual topics, including semantically divergent topic pairs like 'animal' and 'lottory'.
- Despite using fewer parameters and less computational cost, TCNLM outperforms a naive MoE implementation by a non-trivial margin, indicating the effectiveness of the matrix factorization design.
- The model shows that larger architectures may slightly degrade topic coherence, suggesting a trade-off between sequential modeling strength and topic interpretability.
- Qualitative analysis confirms that TCNLM effectively composes topic semantics into coherent sentence generation, validating its interpretability and compositional reasoning capacity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.