Abstract
Traditional Natural Language Processing (NLP) models often treat topic modeling and word embedding as separate tasks, failing to capture the interplay between global themes and local word polysemy. We present the Joint Topic Word-embedding (JTW) model, a neural generative framework based on the Variational Auto-Encoder (VAE). JTW jointly learns global topics and topic-specific word embeddings by conditioning word generation on both local context and latent topical distributions. Experimental results on word similarity benchmarks and lexical substitution tasks demonstrate that JTW outperforms state-of-the-art "one-vector-per-word" and Bayesian embedding methods.
Introduction
A persistent challenge in NLP is the "chicken and egg" problem between topic modeling and word embeddings. Static word embeddings like Word2Vec or GloVe assign a single vector to each word, failing to account for polysemy (e.g., "patient" in medical vs. behavioral contexts). Conversely, topic models like Latent Dirichlet Allocation (LDA) identify global document themes but often overlook the nuanced local semantic relationships captured by embeddings. While previous research has attempted to bridge this gap using pre-trained embeddings to guide topic models, these "two-step" processes often miss the mutual benefits of joint learning.
Methodology: The JTW Model
The Joint Topic Word-embedding (JTW) model utilizes a VAE architecture to bridge the gap between local semantics and global topics.
Encoder and Decoder
- The Encoder: The model takes a "pivot word" and its surrounding context (represented as a Bag-of-Words) and maps them to a latent semantic vector ($z_n$). This vector represents the specific "sense" of the word within its given context.
- The Decoder: The latent vector $z_n$ serves two purposes: it reconstructs the pivot word and transforms into a topical distribution ($\zeta_n$). This distribution, combined with a global topic matrix ($\beta$), is used to generate context words.
Optimization and Integration
The model is trained by maximizing the Evidence Lower Bound (ELBO), allowing for the simultaneous optimization of word embeddings and topic distributions. This joint learning ensures that word embeddings naturally become topic-dependent. Furthermore, JTW can be integrated with deep contextualized models like BERT or ELMo by replacing the Bag-of-Words input with pre-trained vectors, further refining domain-specific semantics.
Experimental Setup
The model was trained on a balanced subset of the Yelp Dataset, containing approximately 865,000 reviews across categories such as Restaurant, Shopping, Beauty & Spas, Automotive, and Clinical. Evaluation was conducted across several dimensions:
- Word Similarity: Seven standard benchmarks, including WS353, SimLex-999, and SCWS (Stanford’s Contextual Word Similarities).
- Lexical Substitution: The SemEval 2007 task 10 dataset was used to evaluate word sense disambiguation.
- Topic Coherence: Measured using the Palmetto coherence metric.
Results
JTW demonstrated superior performance across multiple semantic tasks. In word similarity benchmarks, JTW achieved the highest average Spearman rank correlation (0.575), outperforming strong baselines like Bayesian Skip-Gram (BSG) and Mixed Membership Skip-Gram (MMSG).
Furthermore, in lexical substitution tasks, JTW achieved an accuracy of 0.487, indicating a robust ability to select contextually appropriate synonyms. The model also produced highly coherent topics, peaking at a score of 0.416 with 50 topics. Integration with BERT (JTW-BERT) further improved 5-class sentiment classification on Yelp reviews, reaching a Micro-F1 score of 0.7806, outperforming vanilla BERT.
Conclusion
JTW provides a powerful "middle ground" between static embeddings and fully contextualized "black box" models. By learning a finite set of shared meanings across a corpus, it offers both high performance and interpretability. Future work will explore discourse relationships to understand how topics and word meanings evolve across neighboring sentences or paragraphs within a document.
Summary updated