Transformer-based Models for Long-Form Document Matching: Challenges and Empirical Analysis

Akshita Jha, Adithya Samavedhi, Vineeth Rakesh, Jaideep Chandrashekar, Chandan K. Reddy

Introduction

In the race for NLP supremacy, bigger isn't always better. This paper demonstrates that for matching long-form documents (like patents or research papers), simple neural models using "old-school" embeddings like GloVe and Doc2Vec actually outperform complex Transformers while being up to 15 times faster and significantly more energy-efficient.

Methodology

The researchers compared two "camps" of models using a Siamese architecture. In this setup, two identical encoders process a pair of documents and compare their vector representations via cosine similarity to determine relevance.

The Siamese architecture used for document matching, featuring source and target document encoders.

The study evaluated two primary groups:

  • Simple Models: DSSM (feed-forward) and ARC-I (CNN-based) paired with non-contextual embeddings like GloVe and Doc2Vec. These models can ingest entire documents (8,000+ tokens) at once.
  • Transformer Models: BERT, Longformer, and SMITH (a specialized hierarchical Transformer for long text).

Key Insights: Efficiency vs. Complexity

Transformer models like BERT have revolutionized NLP, but they hit a wall when dealing with long documents due to the Quadratic Bottleneck. The computational cost grows quadratically with input length, making them massive "resource hogs" in terms of memory and energy. Furthermore, most Transformers have a hard cap on input size (e.g., 512 tokens for BERT), forcing them to truncate text and lose vital information.

The authors found that for long-form matching, the "shallow" global view provided by Doc2Vec or GloVe is often more useful than the "deep" local context captured by Transformers. Additionally, Transformers exhibit a strong Position Bias; when paragraph order is shuffled, their performance drops significantly, whereas simple models remain stable because they focus on the overall "bag of concepts."

Empirical Results

The empirical analysis across three datasets (ACL Anthology, Wikipedia, and USPTO Patents) revealed a stark contrast in resource utilization and performance.

Comparison of training time, memory consumption, and energy consumption across different models and document lengths.
  • Performance: Simple models (specifically ARC-I with Doc2Vec) achieved the best average F1 score (0.916) across all datasets, slightly edging out BERT (0.915) and significantly beating SMITH (0.821).
  • Efficiency: Simple models like DSSM and ARC-I required only 1/12 to 1/15 of the training time of their Transformer counterparts.
  • Sustainability: Training simple models consumed < 100kJ of energy, compared to ~500kJ for BERT and a staggering > 6MJ for Longformer.

Conclusion

The study concludes that the massive overhead of contextual embeddings is not always necessary for long-form document matching. Simple models offer a more sustainable and often more accurate alternative, especially when processing the full length of a document is critical. Future work may explore hybrid systems that combine the speed of CNNs with the nuance of Transformers.

Summary updated

BibTeX
@inproceedings{jha2023transformer,
  author = {Akshita Jha and Adithya Samavedhi and Vineeth Rakesh and Jaideep Chandrashekar and Chandan K. Reddy},
  title = {{Transformer-based Models for Long-Form Document Matching: Challenges and Empirical Analysis}},
  booktitle = {EACL (Findings)},
  year = {2023},
  doi = {10.18653/v1/2023.findings-eacl.178},
}
Figure