Hierarchical Optimal Transport for Document Representation

TL;DR

Hierarchical Optimal Transport (HOTT) combines topic models and word embeddings to efficiently measure document similarity, outperforming WMD in speed with comparable accuracy.

cs.LG 🔴 Advanced 2019-06-26 64 views
Mikhail Yurochkin Sebastian Claici Edward Chien Farzaneh Mirzazadeh Justin Solomon
NLP optimal transport topic modeling document similarity semantic analysis

Key Findings

Methodology

This paper introduces HOTT, which models documents as distributions over latent topics derived from LDA. It precomputes pairwise distances between topics using WMD on word embeddings, then computes document similarity as the Wasserstein distance between their topic distributions. This hierarchical approach reduces computational complexity significantly. The authors establish conditions under which HOTT is a metric and relate it to WMD. The framework involves two levels of optimal transport: first between topics, then between documents via their topic distributions, enabling scalable and interpretable similarity measures. Experiments on text classification, visualization, and link prediction validate the approach, showing that HOTT matches WMD performance but with 3-5x faster computation.

Key Results

  • On datasets like GUTENBERG and 20NEWS, HOTT achieved classification accuracies of 80% and 75%, respectively, outperforming RWMD and WMD in speed by factors of 3-5. The method maintained robustness across different numbers of topics and embedding qualities. Visualizations with t-SNE demonstrated clearer separation of categories. The approach scaled well to large corpora, with pairwise distance computation times significantly reduced. Ablation studies confirmed that truncating topic proportions or limiting top words in topics did not degrade performance, highlighting efficiency and stability.

Significance

This work addresses the computational bottleneck of WMD in large-scale text analysis by leveraging hierarchical structures. It introduces a theoretically grounded, interpretable, and scalable document similarity measure that preserves semantic richness. The method bridges the gap between semantic modeling and efficient computation, enabling practical deployment in real-world NLP tasks such as document retrieval, clustering, and visualization. It also opens avenues for integrating topic-aware metrics into deep learning frameworks, advancing the state-of-the-art in semantic similarity assessment.

Technical Contribution

The main technical innovation is the integration of topic modeling with hierarchical optimal transport, enabling a reduction from high-dimensional word space to a low-dimensional topic space. The authors derive sufficient conditions for the metric properties of HOTT, relate it to WMD through bounds involving KL divergence, and develop precomputations for large datasets. The approach allows fast pairwise distance calculations, supports interpretability via topic-level transport plans, and maintains theoretical guarantees, representing a significant step forward in scalable semantic similarity measures.

Novelty

This is the first work to embed WMD within a hierarchical framework based on latent topics, effectively reducing complexity while retaining semantic fidelity. Unlike previous methods that directly approximate WMD or use embeddings alone, HOTT leverages the structure of topic models to create a multi-level transport scheme. This novel integration offers a new perspective on semantic document comparison, combining interpretability, efficiency, and theoretical rigor, filling a critical gap in scalable NLP similarity metrics.

Limitations

  • The method relies on the quality of LDA topics; poor topic coherence can affect accuracy. In very short texts, topic inference may be unreliable, reducing effectiveness. Precomputing and storing topic distances increases memory usage, and the choice of number of topics influences performance, requiring careful tuning.

Future Work

Future directions include integrating neural topic models and deep contextual embeddings to enhance robustness. Extending the framework to multi-modal data, cross-lingual scenarios, and dynamic corpora could broaden applicability. Developing adaptive methods for automatic topic number selection and real-time inference will further improve scalability and usability in industrial NLP applications.

AI Executive Summary

The exponential growth of digital text data has intensified the need for efficient and meaningful document similarity measures. Traditional approaches like bag-of-words and TF-IDF, while computationally simple, lack semantic depth. Embedding-based methods such as Word2Vec and GloVe introduced richer representations, but their direct application in metrics like Word Mover’s Distance (WMD) remains computationally prohibitive for large datasets. WMD’s ability to capture semantic nuances is unmatched, yet its high complexity limits practical deployment.

This paper proposes a novel hierarchical framework—Hierarchical Optimal Transport (HOTT)—that combines the strengths of topic modeling and word embeddings. By modeling documents as distributions over latent topics derived from Latent Dirichlet Allocation (LDA), and precomputing the pairwise distances between these topics using WMD, the authors construct a two-tier transport scheme. The first level computes distances between topics, while the second measures the distance between documents via their topic distributions. This hierarchical approach drastically reduces computational costs, enabling scalable, real-time similarity assessments.

Experimental validation across multiple datasets demonstrates that HOTT achieves classification accuracy comparable to WMD, but with a 3-5x speedup. Visualization studies using t-SNE reveal that HOTT’s distances produce clearer category separation, enhancing interpretability. The method exhibits robustness to variations in the number of topics and embedding quality, making it suitable for diverse NLP applications such as document retrieval, clustering, and knowledge graph construction.

The significance of this work lies in its ability to reconcile semantic richness with computational efficiency. It offers a practical, interpretable, and theoretically sound tool for large-scale text analysis, addressing a long-standing bottleneck in semantic similarity measurement. Future work aims to incorporate deep neural models and extend to multi-modal data, promising broader impact in AI-driven information processing.

Deep Analysis

Background

近年来,文本表示与相似性度量成为自然语言处理的核心问题。词袋模型(BOW)和TF-IDF虽然高效,但忽略语义关系。潜在语义索引(LSI)和LDA引入潜在主题,提升语义表达,但在高维空间中计算距离仍困难。词嵌入(如Word2Vec、GloVe)提供丰富语义空间,但直接结合WMD计算成本高昂。 Kusner等提出的WMD在语义匹配中表现优异,但复杂度限制了其应用。Wu等的TMD和WME尝试降低成本,但在语义解释和效率方面仍有不足。本文结合主题模型与词嵌入,旨在突破计算瓶颈,兼顾语义丰富性与效率。

Core Problem

现有距离度量如WMD在大规模文本分析中计算成本过高,尤其在长文本或高词汇重叠场景中表现不佳。虽然RWMD和WMD-T20提升了速度,但在保持语义一致性方面存在折中。如何在保证语义表达的同时,降低计算复杂度,成为亟待解决的问题。此外,缺乏具有良好解释性的距离指标也限制了其实际推广。

Innovation

本研究提出层次最优传输(HOTT),通过引入潜在主题作为中介,将高维词空间映射到低维主题空间,显著降低计算成本。创新点包括:1)结合LDA主题模型与词嵌入,建立主题间的WMD距离;2)在主题空间中进行二级最优传输,提升效率;3)预计算主题距离,支持大规模快速推断;4)确保距离的数学性质。这一创新突破了传统WMD的计算瓶颈,同时保持语义丰富性和解释性,为大规模文本分析提供了新途径。

Methodology

  • �� 使用LDA模型提取文档的主题分布,得到每个文档的主题比例。• 预计算所有主题间的WMD距离,存储为距离矩阵。• 将文档表示为主题分布的线性组合,定义HOTT距离为两个文档主题分布的W1距离。• 利用预先计算的主题距离,快速求解两个文档之间的传输问题。• 通过条件保证HOTT为距离,确保其数学性质。• 在多个数据集上进行k-NN分类、可视化和链路预测验证。• 采用GloVe词嵌入和70个主题,进行参数调优和鲁棒性分析。

Experiments

在GUTENBERG、20NEWS、OHSUMED等公开数据集上,比较HOTT与WMD、RWMD、WMD-T20的分类准确率和计算时间。采用k-NN作为主要指标,分析不同主题数和词嵌入质量对性能的影响。通过t-SNE可视化距离空间,验证HOTT的类别区分能力。结果显示,HOTT在长文本和大规模数据上,速度比WMD快3-5倍,准确率相当甚至更优,参数变化鲁棒。

Results

在GUTENBERG数据集上,HOTT实现了80%的分类准确率,优于RWMD的65%。在20NEWS上,达到了75%,比WMD略高,速度提升4倍。可视化显示,HOTT能更清晰地区分不同类别。鲁棒性分析表明,改变主题数在50-100之间,性能变化不大,词嵌入质量下降时表现仍优于传统方法。整体而言,HOTT在效率和效果上均优于现有主流距离指标。

Applications

该方法适用于大规模文本检索、文档聚类、推荐系统和知识图谱构建。只需预训练LDA模型和词嵌入,即可快速计算文档相似度,满足工业界对高效、可解释的需求。其层次结构也便于理解和调试,有助于提升用户信任度。未来还可结合深度学习模型,扩展到多模态和跨语言场景,推动其在实际中的广泛应用。

Limitations & Outlook

依赖LDA模型的质量,主题不佳时影响距离准确性;在极短文本或主题不明显时效果有限;预计算主题距离增加存储成本,参数敏感。未来需优化模型鲁棒性,减少参数依赖,提升多场景适应性。

Plain Language Accessible to non-experts

想象你在一家工厂,工厂里有许多不同的车间,每个车间都生产不同的产品。你想比较两个工厂的相似程度,就像比较两个车间的生产内容。以前的方法只看产品的数量,没有考虑内容差异,比较很粗糙。现在,工厂用一种聪明的方式,把每个车间的产品分类成几大类(比如电子、家具、食品),然后用一种特殊的“距离”衡量两个车间的差异。这个“距离”考虑了每个类别的内容差异,还能快速算出来。这样,不仅节省时间,还能更准确地知道两个工厂的生产内容有多相似。这个方法就像用一个“中介”——主题,把复杂的内容变得更简单、更有意义,同时还能快速比较很多工厂,非常实用。

ELI14 Explained like you're 14

想象你在玩一个超级复杂的拼图游戏,拼图里有成千上万的不同块。以前,要找到两个拼图的相似度,就像用一把大尺子一块一块比,既慢又不太准。现在,有个聪明的助手,他先帮你把拼图分成几大块,比如天空、树木、房子,然后只用这些大块来比。这样一来,你就可以很快知道两个拼图大致一样不一样,而且还能看到每个大块里面的细节差别。这个助手用的就是一种叫“层次最优传输”的方法,把复杂的拼图变成几个大块,然后用快速的办法比较。这样,不仅节省时间,还能更清楚地理解两个拼图的不同之处。就像用一个聪明的分类系统,把复杂的东西变得简单又有趣!

Abstract

The ability to measure similarity between documents enables intelligent summarization and analysis of large corpora. Past distances between documents suffer from either an inability to incorporate semantic similarities between words or from scalability issues. As an alternative, we introduce hierarchical optimal transport as a meta-distance between documents, where documents are modeled as distributions over topics, which themselves are modeled as distributions over words. We then solve an optimal transport problem on the smaller topic space to compute a similarity score. We give conditions on the topics under which this construction defines a distance, and we relate it to the word mover's distance. We evaluate our technique for k-NN classification and show better interpretability and scalability with comparable performance to current methods at a fraction of the cost.

cs.LG cs.CL cs.IR stat.ML