Two-dimensional visualization of large document libraries using t-SNE

Rita González-Márquez, Philipp Berens, Dmitry KobakGTRL @ ICLR 2022

Abstract

We benchmarked different approaches for creating 2D visualizations of large document libraries, using the MEDLINE (PubMed) database of the entire biomedical literature as a use case (19 million scientific papers). Our optimal pipeline is based on log-scaled TF-IDF representation of the abstract text, SVD preprocessing, and t-SNE with uniform affinities, early exaggeration annealing, and extended optimization. The resulting embedding distorts local neighborhoods but shows meaningful organization and rich structure on the level of narrow academic fields.

Introduction

As digital libraries grow into the tens of millions of documents, researchers face a "curse of dimensionality." Organizing and exploring 19 million abstracts in a way that a human can actually perceive is a significant challenge. While tools like t-SNE and UMAP are popular for dimensionality reduction, they were not originally designed for datasets of this magnitude. Standard implementations often run out of memory or produce "fragmented" maps where related topics are split into disjointed islands. This research provides a systematic benchmark to determine which preprocessing steps and algorithmic adjustments are necessary when dealing with the entire corpus of biomedical literature.

Methodology

The researchers developed an optimized pipeline consisting of four main stages:

  1. Text Representation: Abstracts are converted into a log-scaled TF-IDF (Term Frequency-Inverse Document Frequency) matrix to highlight unique, meaningful words while downplaying common ones.
  2. Dimensionality Reduction (SVD): Singular Value Decomposition (SVD) is used to compress the millions of word features down to the 300 most important dimensions.
  3. t-SNE with Uniform Affinities: Instead of the standard memory-intensive Gaussian approach, the pipeline uses a k-nearest-neighbor graph ($k=10$) with uniform weights. This significantly reduces RAM usage while maintaining layout quality.
  4. Optimization Refinements:
    • Extended Iterations: For 19 million points, the authors found that at least 2,250 (and ideally 10,250) iterations are required for the map to stabilize.
  5. Early Exaggeration Annealing: A novel tweak where the "attractive forces" between points are gradually lowered rather than abruptly cut off, preventing small clusters from getting "trapped" in the wrong part of the map.

Key Insights: The Accuracy-Recall Trade-off

A critical finding of the study is the trade-off between classification accuracy and local neighborhood preservation. While SVD and t-SNE are effective at keeping papers within the same broad field (e.g., "Cancer") near each other, they are less effective at preserving a paper's exact nearest neighbors.

kNN recall as a function of the number of SVD components used for preprocessing.

As shown in the figure above, kNN recall increases with the number of SVD components, yet remains relatively low overall. This indicates that while these maps are excellent for "big picture" browsing and identifying thematic continents, they are not suitable for finding specific, highly similar individual papers.

Results and Performance

The final visualization successfully organized 19 million papers into a coherent "galaxy" where fields like Immunology, Genetics, and Surgery form distinct but interconnected regions.

The final t-SNE visualization of 19 million PubMed abstracts, labeled by major biomedical fields.

In terms of performance, the TF-IDF representation achieved a kNN accuracy of 0.71. After SVD compression, accuracy dropped slightly to 0.66. The final 2D t-SNE map maintained an accuracy of 0.57, which is a significant achievement given the reduction from 300 dimensions to just two. Creating the high-fidelity "gold standard" map required over three days of computation on a high-end server, though a functional version can be produced in approximately four hours with specific trade-offs.

Limitations and Future Work

The authors identify two primary limitations: local distortion (low kNN recall) and high memory requirements. Future research may explore Random Projections as an alternative to SVD or replace TF-IDF with modern Large Language Models (such as PubMedBERT) to capture deeper semantic meanings within the abstracts.

Summary updated

BibTeX
@inproceedings{gonzalezmarquez2022two,
  author = {Rita González-Márquez and Philipp Berens and Dmitry Kobak},
  title = {{Two-dimensional visualization of large document libraries using t-SNE}},
  booktitle = {GTRL @ ICLR},
  year = {2022},
  url = {https://openreview.net/forum?id=Hebl3EZ16lq},
}
Figure