TL;DR
GenEOL is a novel, training-free text embedding method that leverages the generative power of instruction-tuned LLMs to create diverse, meaning-preserving variations of a sentence. By averaging the embeddings of these transformations using a base pretrained LLM, GenEOL significantly reduces representation variance and outperforms existing training-free methods on semantic similarity and MTEB benchmarks without any costly contrastive fine-tuning.
What Problem Does This Paper Address?
Extracting high-quality sentence embeddings from Large Language Models (LLMs) typically requires contrastive learning (CL) to fine-tune the model. However, curating contrastive datasets is expensive and time-consuming, and the training process demands massive computational resources.
To bypass this, researchers have developed "training-free" inference-time embedding methods (like PromptEOL or KEEOL) that use clever prompting to pull embeddings directly from an LLM's hidden states. While promising, these methods have a major blind spot: they only optimize the embedding prompt and completely ignore the LLM's core strength—its ability to generate text. Furthermore, standard training-free methods suffer from high variance across different prompts and layers, and they struggle to bridge the gap between instruction-tuned models (which are great at generating text but poor at embedding it) and pretrained base models (which are great at embedding but poor at following complex generation prompts).
Methods
GenEOL introduces a simple yet highly effective two-stage framework that splits the responsibilities of generation and embedding between two distinct LLM roles:
- The Generator ($L_{IT}$): An instruction-tuned LLM is prompted to generate $m$ diverse, meaning-retaining transformations of an input sentence. The authors define four specific transformation types using few-shot prompts:
- $T_1$ (Syntax Change): Alters the sentence structure.
- $T_2$ (Concise Paraphrase): Removes non-essential details like adverbs.
- $T_3$ (Entailment): Generates a textually entailed alternative.
- $T_4$ (Regular Paraphrase): Standard meaning-preserving rephrasing.
- (Optional) A Compositional Summary transformation that stacks a summary operation on top of a paraphrase to maximize lexical diversity while keeping the core meaning intact.
- The Embedder ($L_{PT}$): A pretrained base LLM takes the original sentence plus the $m$ generated variations, applies a standard embedding prompt (like KEEOL), and extracts their hidden state representations.
Finally, GenEOL computes the Final Embedding by simply averaging the $m+1$ individual embeddings.
Datasets
The authors evaluated GenEOL across two major benchmarks:
- Semantic Textual Similarity (STS) Benchmark: Comprising 7 standard tasks (STS12, STS13, STS14, STS15, STS16, STS-Benchmark, and SICK-Relatedness) evaluated using Spearman's rank correlation.
- Massive Text Embedding Benchmark (MTEB): 10 diverse tasks spanning 4 categories: Classification (e.g., AmazonCounterFactual, Banking77, Emotion), Clustering (MedarxivP2P, TwentyNewsgroups), Reranking (AskUbuntu, SciDocs, StackOverflow), and Pair Classification (TwitterSemEval, SprintDuplicate).
Key Insights and Ideas
- The "Variance Reduction" Trick: The core statistical intuition behind GenEOL is that an LLM's raw embedding similarity scores are coarsely aligned with true semantic scores but contain significant noise (variance). By generating multiple pseudo-independent semantic variations of a sentence and averaging their embeddings, GenEOL acts as an inference-time ensemble, effectively shrinking the error variance by a factor of $k$.
- Division of Labor: Instruction-tuned models are notoriously worse at producing raw embeddings than their pretrained counterparts, but they excel at text generation. GenEOL exploits this asymmetry by using the instruction model strictly to generate variations and the base model strictly to encode them.
- Layer and Prompt Stabilization: Standard embedding techniques are highly sensitive to the specific layer chosen or minor whitespace changes in the prompt. GenEOL acts as a stabilizer; averaging across diverse text transformations makes the final representation robust to prompt perturbations and smooths out performance drops across different hidden layers.
Key Results
- STS Superiority: At $m=32$ generations, GenEOL outperformed the previous best training-free methods by an average of 2.85 points across multiple model families, achieving absolute gains of 3.88 on Mistral-7B, 1.83 on Llama2-7B, and 2.83 on Llama3-8B.
- MTEB Performance: GenEOL achieved state-of-the-art training-free results on clustering, reranking, and pair-classification tasks. Remarkably, it even outperformed strong unsupervised training methods like LLM2Vec (which utilizes contrastive learning).
- Prompt Robustness: When tested against minor prompt variations (e.g., adding or removing whitespaces), GenEOL maintained a remarkably low standard deviation ($\pm 0.01$ on Mistral) compared to baseline methods ($\pm 1.44$).
Limitations and Future Work
The primary drawback of GenEOL is its inference-time computational cost. Generating $m$ transformations requires multiple autoregressive decoding steps, making it significantly slower than single-pass embedding methods. However, the authors note that this cost can be mitigated using modern inference engines (like vLLM), speculative decoding, or adaptive compute scaling (generating fewer variations for "easy" sentences).
Additionally, GenEOL underperformed on certain MTEB Classification tasks (like Emotion or Intent classification). The authors attribute this to the fact that structural transformations often discard subtle nuances—like passive vs. active voice or specific emotional keywords—that classification tasks rely heavily upon. Future work will focus on developing task-specific transformations to preserve these fine-grained attributes.
Summary updated