DocSplit: Simple Contrastive Pretraining for Large Document Embeddings

Yujie Wang, Mike IzbickiEMNLP 2023

Abstract

DocSplit is an unsupervised pretraining method designed to enhance the semantic representation of long documents. By partitioning a document's sentences into two distinct summaries and employing contrastive learning, the model shifts its focus from local word-level patterns to global document context. This approach consistently outperforms existing baselines in document classification and retrieval tasks, particularly in few-shot scenarios.

Introduction: The Challenge of Global Context

Modern Natural Language Processing (NLP) models primarily rely on "local" pretraining objectives, such as Masked Language Modeling (MLM). While effective for sentence-level tasks, MLM often fails to capture the overarching semantic structure of long documents. Even architectures specifically designed for long sequences, like Longformer and BigBird, frequently inherit these local objectives, resulting in models that can process long inputs but struggle to represent their holistic meaning effectively.

The DocSplit Method

To address this, we introduce DocSplit, a model-agnostic and fully unsupervised pretraining strategy. The process involves four key steps:

  1. Sentence Splitting: A document is decomposed into its constituent sentences.
  2. Random Assignment: Each sentence is randomly assigned to one of two buckets, creating two "summaries" ($x^+_1$ and $x^+_2$).
  3. Contrastive Learning: These summaries, despite containing different sentences, share the same global topic and are treated as a positive pair. The model is trained to minimize the distance between their embeddings in vector space.
  4. Negative Sampling: Summaries generated from different documents serve as negative pairs, with the model trained to maximize their distance.
Overview of the DocSplit pretraining strategy.

This method forces the model to ignore local word-to-word transitions and focus on the high-level semantic theme of the document. The random assignment also serves as a robust data augmentation technique, preventing overfitting to specific phrasing.

Experimental Setup

The models were pretrained on English Wikipedia and evaluated across five diverse document datasets: FakeNews, arXiv, 20News, NYT, and BBCNews. Retrieval performance was assessed using the ACL Anthology Network (AAN) dataset from the Long Range Arena (LRA) benchmark.

Evaluation and Results

DocSplit demonstrates significant performance gains over established baselines such as SimCSE, Contriever, and INSTRUCTOR.

Few-shot text classification performance across five datasets.

Key findings include:

  • Few-Shot Superiority: In low-data regimes (e.g., 20News), DocSplit-BERT significantly outperforms standard BERT and SimCSE. In some few-shot settings, DocSplit showed up to a 24.3% macro-F1 improvement over standard Longformer models.
  • State-of-the-Art Retrieval: On the LRA benchmark, DocSplit-Longformer achieved state-of-the-art (SOTA) results, surpassing the original Longformer and BigBird models.
  • Efficiency: Even when compared to models trained on much larger corpora, DocSplit held its own, proving the efficiency of its objective function.

Conclusion and Future Work

DocSplit provides a simple yet powerful objective for document-level representation learning. By prioritizing global context over local word patterns, it enables models to better understand long-form content. Future research will explore its application to complex tasks like question answering and its scalability to even larger datasets and "infinite" document lengths.

Summary updated

BibTeX
@inproceedings{wang2023docsplit,
  author = {Yujie Wang and Mike Izbicki},
  title = {{DocSplit: Simple Contrastive Pretraining for Large Document Embeddings}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.945},
}
Figure