Abstract
Embedding representations of text are useful for downstream natural language processing tasks. Several universal sentence representation methods have been proposed with a particular focus on self-supervised pre-training approaches to leverage the vast quantities of unlabelled data. However, there are two challenges for generating rich embedding representations for a new document. 1) The latest rich embedding generators are based on very large costly transformer-based architectures. 2) The rich embedding representation of a new document is limited to only the information provided without access to any explicit contextual and temporal information that could potentially further enrich the representation. We propose efficient retrieval-augmented text embeddings (ERATE) that tackles the first issue and offers a method to tackle the second issue. To the best of our knowledge, we are the first to incorporate retrieval to general purpose embeddings as a new paradigm, which we apply to the semantic similarity tasks of SentEval. Despite not reaching state-of-the-art performance, ERATE offers key insights that encourages future work into investigating the potential of retrieval-based embeddings.
Introduction
Modern NLP relies on "embeddings"—mathematical vectors that represent the meaning of text. Currently, the best embeddings come from massive models like Sentence-T5 or GPT-3. These models are "rich" (highly accurate) but "costly," requiring enormous GPU power for every new sentence processed. Furthermore, standard embeddings are "isolated"; the model only looks at the specific string of text provided, lacking access to external context or recent information in larger databases.
This paper, presented at the Fourth Workshop on Insights from Negative Results in NLP, explores whether the performance of massive, billion-parameter embedding models can be approximated using a tiny fraction of the compute through a framework called ERATE (Efficient Retrieval Augmented Text Embeddings).
Methodology
The ERATE paradigm splits the embedding process into two distinct spaces: a Light Space and a Rich Space.
The process involves four main steps:
- Light Embedding: A query sentence is processed by a computationally inexpensive model (e.g., GloVe word averages).
- Retrieval: The system searches a massive datastore to find the $K$ nearest neighbors in the Light space.
- Rich Retrieval: The corresponding "Rich" embeddings (pre-computed once by a heavy model like Sentence-T5-XXL) for those neighbors are retrieved.
- Aggregation: These Rich embeddings are averaged to create the final representation for the query.
To improve neighbor quality, the authors employed Dropout Masks, randomly zeroing out dimensions of the light embedding during retrieval to find a more diverse set of neighbors and stabilize the final average.
Datasets
Evaluation was conducted using SentEval, specifically the Semantic Text Similarity (STS) tasks (STS-12 through STS-16, STS-B, and SICK-R). The retrieval datastore combined 1 million Wikipedia sentences with unique sentences from SNLI and MNLI. An expanded version utilized 100 million sentences from Common Crawl (CC) to test the impact of scale.
Results and Analysis
ERATE offers a massive 3,000x reduction in computational cost. For a 512-token sentence, ERATE requires roughly $3 \times 10^9$ FLOPs, compared to $8.7 \times 10^{12}$ FLOPs for Sentence-T5-XXL.
Despite the efficiency gains, the results represent a "negative" success. As shown in the performance table, vanilla ERATE (55.3% avg correlation) performed worse than the lightweight GloVe model (62.8%) used for retrieval. Key insights include:
- The "Anisotropy" Gap: Query documents often lie on the periphery of their neighbor clusters in light space, making simple averaging inaccurate.
- The Oracle Ceiling: An "Oracle" version using rich space for retrieval achieved 72.3% correlation—better than ERATE but still below the full rich model (84.8%), suggesting limits to simple averaging.
- Scale and Ensembling: Increasing the datastore to 100 million sentences provided a 2.5% boost. Using dropout masks as an ensemble method was more effective than a single search.
Conclusion
The primary limitation of ERATE is the alignment between light and rich spaces; the "cheap" model does not group sentences identically to the "expensive" model. Future work may explore better alignment via projection layers, self-attention for combining neighbors, or applying retrieval to document-level context.
Summary updated