Abstract
Standard word embedding models produce static vectors that ignore document metadata, failing to capture how word meanings shift across different contexts. We present CoVeR (Covariate-Specific Vector Representations), a tensor decomposition model that learns context-specific embeddings by jointly training a shared base embedding with covariate-specific diagonal weight vectors. This approach achieves high data efficiency and produces interpretable, "topic-aligned" dimensions that outperform traditional methods in both quantitative and qualitative evaluations.
The Problem: Static Embeddings in a Dynamic World
Standard models like GloVe or Word2Vec assign a single, static vector to every word in a vocabulary. However, language is highly contextual; the word "rights" carries different semantic weight in a gun-rights forum compared to a healthcare subreddit.
Traditional solutions involve training separate models on different data slices, but these face two major hurdles:
- Data Scarcity: Individual slices (e.g., books by a specific author) are often too small to train robust models from scratch.
- Alignment Issues: Because embedding algorithms are rotationally invariant, models trained on different data will have their dimensions pointing in different directions, making direct comparison impossible.
Methods: Tensor Decomposition and Diagonal Scaling
CoVeR addresses these issues by framing embedding as a word-by-word-by-covariate tensor decomposition task. The model learns two primary components:
- Base Embeddings ($v_i$): A shared set of vectors for all words across the entire corpus.
- Covariate Weight Vectors ($c_k$): A specific vector for each context (e.g., an author or a subreddit).
To derive the embedding for a word $i$ in context $k$, the model performs an element-wise product: $c_k \odot v_i$. This simple linear transformation is the model's "secret sauce." By forcing every context to use the same base dimensions, it breaks rotational symmetry. This constraint forces the dimensions to align with specific, independent "topics," making the resulting vectors highly interpretable.
Datasets and Evaluation
The researchers evaluated CoVeR on two primary datasets:
- The Book Dataset: 29 books by four authors (J.K. Rowling, C.S. Lewis, George R.R. Martin, and Stephenie Meyer) to test authorship clustering.
- The Politics Dataset: A collection of Reddit comments from 2016 across six subreddits (e.g., r/The_Donald, r/SandersForPresident) to track political semantic drift.
Key Insights: Alignment and Sparsity
- Topic Alignment: Unlike standard GloVe dimensions, CoVeR dimensions naturally align with semantic topics (e.g., "military" or "domestic"). This occurs because the diagonal scaling forces the model to find a basis where dimensions are independent.
- Natural Sparsity: The covariate weight vectors ($c_k$) are naturally sparse. A specific community often "zeros out" irrelevant dimensions, providing a clear signature of that community's values.
- Data Efficiency: By learning a shared base, CoVeR can accurately represent words in small data slices by "borrowing" strength from the broader corpus.
Key Results
CoVeR outperformed baselines like S-EFE on standard semantic tasks, particularly in low-data scenarios like the Harry Potter subset. Qualitatively, the model captures "topical drift," measuring how words like "immigrant" shift toward different semantic poles depending on the political community.
In the Book Dataset, the model successfully clustered books by the same author using only the learned weight vectors. This suggests that the covariate weights successfully captured the unique "writing style" and thematic signatures of each author.
Conclusion and Future Work
CoVeR provides a robust framework for understanding how context shapes meaning. While its linear diagonal transformation is simple, it offers significant advantages in interpretability and data efficiency. Future directions include applying this framework to genomics—where "cell type" could act as a covariate—or to time-series analysis to track the evolution of language over decades.
Summary updated