Abstract
GenEOL (Generative Embeddings Off-the-shelf) is a novel, training-free method that significantly improves sentence embeddings by leveraging the generative power of Large Language Models (LLMs). Instead of relying on a single prompt, GenEOL uses an LLM to generate diverse, meaning-preserving variations of a sentence and aggregates their embeddings. This approach outperforms existing training-free benchmarks by an average of 2.85 points, demonstrating that scaling inference-time compute is as effective for embeddings as it is for reasoning tasks.
Introduction
High-quality sentence embeddings are essential for downstream applications such as semantic search, clustering, and Retrieval-Augmented Generation (RAG). Traditionally, obtaining high-performance embeddings requires Contrastive Learning (CL), a process of fine-tuning models on massive datasets of similar and dissimilar text pairs. However, CL is computationally expensive and must be repeated for every new model iteration.
Existing training-free alternatives attempt to bypass this via specialized prompting. However, these methods often overlook the generative capabilities of modern LLMs. A notable "paradox" exists where instruction-tuned models, while excellent at generating text, often produce inferior embeddings compared to their raw, pretrained counterparts. GenEOL bridges this gap by utilizing the generator's skill to enhance the embedder's performance without additional training.
Methodology
The GenEOL framework decomposes the embedding task into two distinct roles:
- The Generator ($\mathcal{L}_{IT}$): An instruction-tuned model (e.g., Mistral-7B-Instruct) is prompted to create $m$ diverse transformations of the input sentence. These include syntax changes, concise paraphrasing (removing non-essential details), entailment (logical implications), and standard paraphrasing.
- The Embedder ($\mathcal{L}_{PT}$): A pretrained, non-fine-tuned model (e.g., Llama-3) processes the original sentence and its $m$ variations to produce individual embeddings.
- Aggregation: The final representation is the simple average of all $(m+1)$ embeddings.
The core intuition is statistical: by averaging multiple diverse estimates of a sentence's meaning, GenEOL reduces variance and error, leading to a more stable and accurate representation.
Experimental Results
GenEOL was evaluated across the Semantic Textual Similarity (STS) benchmark and the Massive Text Embedding Benchmark (MTEB).
Performance Benchmarks
On the STS benchmark, GenEOL (with $m=32$) outperformed the previous state-of-the-art training-free method by 3.88 points for Mistral-7B and 2.83 points for Llama-3-8B. Notably, GenEOL even surpassed some unsupervised models trained with contrastive learning, such as SimCSE, on several MTEB tasks.
Pretrained vs. Instruction-Tuned Models
A key empirical observation confirmed by the authors is that instruction tuning often degrades a model's internal representation for similarity tasks. GenEOL exploits this by using instruction-tuned models solely for generation and pretrained models for embedding.
Robustness and Stability
Unlike previous methods that are sensitive to minor prompt changes, GenEOL’s averaging approach provides significant robustness. Furthermore, while standard embedding methods are sensitive to layer selection, GenEOL maintains high performance consistently across almost all hidden layers of the LLM.
Conclusion and Future Work
GenEOL demonstrates that the generative power of LLMs can be harnessed to produce high-quality sentence embeddings without the need for expensive contrastive training. While the method introduces computational overhead due to multiple generations, it offers a highly effective and robust alternative for training-free scenarios. Future research will focus on optimizing inference latency and exploring task-specific transformations to preserve stylistic or emotional nuances.
Summary updated