NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Document Similarity for Texts of Varying Lengths via Hidden Topics

Hongyu Gong, Tarek Sakakini, Suma Bhat, Jinjun Xiong

Introduction

Comparing a 2,000-word research paper to a 100-word summary is a significant challenge in natural language processing. These texts operate at different levels of abstraction and detail, making traditional similarity metrics less effective. This paper introduces a geometric approach that extracts "hidden topics" from long documents using word embeddings and Singular Value Decomposition (SVD). This method bridges the gap between concise summaries and detailed texts by focusing on latent structures rather than surface-level word overlaps.

The Challenge of Varying Lengths

Most document similarity metrics, such as Cosine Similarity or Word Mover’s Distance (WMD), are optimized for texts of similar lengths and styles. However, many real-world applications—such as matching science curricula to educational projects or research summaries to full papers—require comparing short, abstract texts with long, detailed ones.

The authors identify three primary hurdles in this scenario:

  1. Vocabulary Mismatch: Summaries and full documents often use different terminology to describe the same concepts.
  2. Context Mismatch: Long documents provide extensive context, whereas summaries are too brief to offer similar depth.
  3. Abstraction Gap: Summaries focus on high-level concepts, while documents provide specific, detailed instances.

Existing tools like Doc2Vec often fail because the "noise" of non-essential words in long documents overwhelms the representation. Meanwhile, WMD becomes computationally prohibitive as document length increases.

Methodology: A Multi-View Topic Approach

The proposed method represents a document as a collection of hidden topics rather than a single vector. The process involves several key stages, moving away from word-to-word comparison toward a summary-to-latent-structure mapping.

The multi-view pipeline for generating topics and mapping relevance between documents and summaries.
  • Topic Generation: A document is treated as a matrix of word embeddings. Using Singular Value Decomposition (SVD), the system identifies a set of $K$ orthonormal vectors (the "hidden topics") that best reconstruct the document's vocabulary. This essentially finds the "geometric plane" inhabited by the majority of the document's words.
  • Topic Importance: Weights are assigned to each topic based on its contribution to reconstructing the document's vocabulary.
  • Relevance Mapping: To compare a summary to a document, the summary's word embeddings are projected onto these hidden topics. The final similarity score is a weighted average of how well the summary words align with the document's most important topics.

Key Insights: The Geometry of Similarity

A core contribution of this work is the geometric interpretation of document relevance. By extracting the top $K$ topics (typically 15–18), the model effectively filters out "noise" words—such as prepositions and common verbs—that often clutter long documents and confuse models like Doc2Vec.

Visualization of summary words (e.g., heredity, weather) projected onto the geometric planes formed by document topics.

As illustrated in the geometric visualization, words from a relevant summary lie significantly closer to the plane formed by the document's hidden topics than words from an irrelevant summary. This approach proves more robust than traditional matching because it relies on the underlying topic space.

Furthermore, the study highlights the importance of domain-specific embeddings. Using a science-domain corpus significantly improved performance over general-purpose embeddings by correctly capturing the context of terms like "forces" or "acceleration" within a scientific framework.

Evaluation and Results

The model was evaluated on two tasks: the Concept-Project Matching task (matching science concepts to project instructions) and the CL-SciSumm Shared Task (matching summaries to citing papers).

On the Concept-Project task, the topic-based model achieved an F1-score of 0.818, outperforming Doc2Vec (0.695) and WMD (0.679). In the research paper task, the model demonstrated superior Precision@k, indicating that correct documents were ranked higher in search results compared to state-of-the-art baselines.

Conclusion

The hidden topic approach offers a robust solution for comparing texts of varying lengths by focusing on underlying semantic structures. While highly effective, future work could address the computational overhead of performing SVD on massive databases and explore automated ways to tune the number of topics for different domains.

Summary updated

BibTeX
@inproceedings{gong2018document,
  author = {Hongyu Gong and Tarek Sakakini and Suma Bhat and Jinjun Xiong},
  title = {{Document Similarity for Texts of Varying Lengths via Hidden Topics}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1218},
}
Figure