Abstract
Paragraph Vectors has been recently proposed as an unsupervised method for learning distributed representations for pieces of texts. In their work, the authors showed that the method can learn an embedding of movie review texts which can be leveraged for sentiment analysis. That proof of concept, while encouraging, was rather narrow. Here we consider tasks other than sentiment analysis, provide a more thorough comparison of Paragraph Vectors to other document modelling algorithms such as Latent Dirichlet Allocation, and evaluate performance of the method as we vary the dimensionality of the learned representation. We benchmarked the models on two document similarity data sets, one from Wikipedia, one from arXiv. We observe that the Paragraph Vector method performs significantly better than other methods, and propose a simple improvement to enhance embedding quality. Somewhat surprisingly, we also show that much like word embeddings, vector operations on Paragraph Vectors can perform useful semantic results.
Introduction
Representing documents in a way that captures semantic meaning is a fundamental challenge in natural language processing. Traditional methods like Bag-of-Words (BoW) rely on word counts, ignoring context and order. Latent Dirichlet Allocation (LDA) introduced topic modeling but often struggles with computational complexity and subtle semantic nuances. While Paragraph Vectors (Doc2Vec) were introduced as a promising neural alternative, their initial evaluation was limited to narrow tasks like sentiment classification.
This study expands the scope of Paragraph Vectors, demonstrating their effectiveness as a powerhouse for measuring document similarity across massive datasets like Wikipedia and arXiv. We show that these vectors capture deep semantics, enabling "document algebra" and consistently outperforming traditional baselines.
Methods
The primary focus of this work is the Distributed Bag of Words (PV-DBOW) model. Unlike the Distributed Memory (PV-DM) variant, PV-DBOW ignores context words and trains the model to predict words randomly sampled from a paragraph using only the paragraph's unique ID vector.
A key contribution of this paper is the introduction of joint training. By learning word embeddings (similar to the Skip-gram model) simultaneously with paragraph vectors, the model is forced to develop high-quality representations that capture both local and global semantic information. Performance is evaluated using a triplet method: given two related documents and one unrelated "distractor," the model must identify the related pair based on vector similarity.
Datasets and Evaluation
The models were benchmarked on two large-scale corpora:
- Wikipedia: 4.49 million articles.
- arXiv: 886,000 scientific papers.
To rigorously test similarity, the authors developed two new benchmark sets:
- Hand-built Wikipedia Triplets: 172 human-curated triplets (e.g., "Deep Learning" is closer to "Machine Learning" than to "Computer Network").
- Generated Wikipedia Triplets: ~20,000 triplets automatically derived from Wikipedia’s category hierarchy.
Key Results and Insights
The experimental results demonstrate the clear superiority of Paragraph Vectors over traditional topic models. On the hand-built Wikipedia triplet task, Paragraph Vectors achieved a peak accuracy of 93.0%, significantly outperforming LDA (82.0%) and BoW (86.0%).
Beyond quantitative metrics, the embeddings exhibit remarkable qualitative properties. t-SNE visualizations reveal that the model naturally clusters documents into high-level categories such as "Species," "Albums," and "Films" without explicit supervision.
Furthermore, the study confirms that Paragraph Vectors support semantic arithmetic, or "document algebra." For example, the operation Vector("Lady Gaga") - Vector("American") + Vector("Japanese") results in vectors closest to Japanese pop stars like Ayumi Hamasaki. This suggests that the learned representations capture complex relational concepts.
On the arXiv dataset, Paragraph Vectors and LDA showed comparable peak performance (~85%), but Paragraph Vectors demonstrated greater stability across different dimensionalities. While LDA's performance is highly sensitive to the chosen number of topics, Paragraph Vectors remain robust.
Conclusion
Paragraph Vectors represent a significant advancement in unsupervised document modeling. By capturing granular semantic relationships and supporting intuitive vector operations, they offer a powerful alternative to traditional keyword-based or topic-modeling approaches. Future work may explore their application in recommendation systems, where "intuitive vector operations" could transform how users navigate large research repositories or digital libraries.
Summary updated