Source-linked AI summary

Gecko: Versatile Text Embeddings Distilled from Large Language Models

Jinhyuk Lee, Zhuyun Dai, Xiaoqi Ren, Blair Chen, Daniel Cer, Jeremy R. Cole, Kai Hui, Michael Boratko, Rajvi Kapadia, Wen Ding, Yi Luan, Sai Meher Karthik Duddu, Gustavo Hernandez Abrego, Weiqiang Shi, Nithi Gupta, Aditya Kusupati, Prateek Jain, Siddhartha Reddy Jonnalagadda, Ming-Wei Chang, Iftekhar Naim

arXiv:2403.20327v1cs.CLcs.AI

TL;DR

General-purpose embedding models need broad, high-quality training data, but collecting labeled examples across tasks and domains is costly. Gecko distills LLM knowledge through synthetic task-query generation and LLM-based relabeling of retrieved candidates, producing compact embeddings that perform strongly across MTEB. Its 768-dimensional model reaches an average MTEB score of 66.31 while competing with much larger or higher-dimensional systems.

  • Problem

    General-purpose embedding models require extensive data to cover diverse tasks and domains, while manually collecting such labeled examples is costly and limited.

    Source: §1 · p. 1
  • Method

    Gecko generates diverse task-query pairs from unlabeled passages, retrieves candidates, and uses LLM-based reranking to assign positive and hard-negative passages.

    Source: §1 · p. 1, §3.2 · pp. 4–6
  • Results

    Gecko-1B with 768-dimensional embeddings achieves the best MTEB performance among compatible models, while the full FRet mixture reaches an average score of 66.31.

    Source: §1 · p. 2, §4.3 · p. 9
  • Takeaways & Limitations

    LLM-generated and LLM-ranked data can support a compact, versatile embedding model with strong zero-shot generalization across multiple tasks.

    Source: §5 · p. 10

Abstract

from arXiv · show

We present Gecko, a compact and versatile text embedding model. Gecko achieves strong retrieval performance by leveraging a key idea: distilling knowledge from large language models (LLMs) into a retriever. Our two-step distillation process begins with generating diverse, synthetic paired data using an LLM. Next, we further refine the data quality by retrieving a set of candidate passages for each query, and relabeling the positive and hard negative passages using the same LLM. The effectiveness of our approach is demonstrated by the compactness of the Gecko. On the Massive Text Embedding Benchmark (MTEB), Gecko with 256 embedding dimensions outperforms all existing entries with 768 embedding size. Gecko with 768 embedding dimensions achieves an average score of 66.31, competing with 7x larger models and 5x higher dimensional embeddings.

1. Introduction

Gecko addresses the challenge of building versatile text embeddings without relying solely on costly, manually labeled data by distilling LLM knowledge into a compact retriever. Its LLM-generated and LLM-ranked training data supports strong MTEB performance across embedding sizes.

  • Gecko targets a single embedding model that supports retrieval, semantic similarity, classification, and other downstream tasks.Source: §1 · p. 1
  • LLM-generated synthetic data offers an alternative to collecting large, comprehensive training sets for general-purpose embedding models.The motivating question is how directly LLM knowledge can improve text embedding models.Source: §1 · p. 1
  • Gecko generates task-query pairs from unlabeled passages, retrieves candidate passages, and uses an LLM to rerank positives and negatives.The reranking step addresses cases where the source passage is not the best answer target for its generated query.Source: §1 · p. 1
  • Gecko is trained across document retrieval, semantic similarity, and classification using FRet, whose queries and passage labels are generated or mined by LLMs.Source: Figure 1 · p. 2
  • Gecko-1B with 768-dimensional embeddings achieves the best MTEB performance among models with compatible dimensions and sizes, often exceeding larger or higher-dimensional systems.The model combines LLM-generated and LLM-ranked data with human-annotated data.Source: §1 · p. 2

2. Related Work

Related work establishes the need for general-purpose embeddings that transfer across tasks and domains, while Gecko extends synthetic query generation and hard-negative mining through LLM-based passage selection. Its distinction is using real web passages and LLMs to identify both positive and negative targets.

  • Prior embedding models often struggle to generalize across tasks and domains, motivating unified training across diverse task types.Source: §2 · p. 2
  • Contrastive-learning research emphasizes selecting informative negatives, while Gecko also uses LLMs to identify better positive passages for each query.The selected positives and negatives fit the format of existing human-annotated training data.Source: §2 · p. 2
  • Synthetic-query methods typically address unavailable target-domain labels, whereas Gecko distills broader LLM knowledge into a versatile embedding model.Source: §2 · p. 3
  • Unlike related instruction-based approaches, Gecko generates task-query pairs from web passages and uses LLMs to choose positive and negative targets.Source: §2 · p. 3

3. Training Recipe for Gecko

Gecko trains a compact embedding model through pre-finetuning, two-step LLM distillation in FRet, and a unified mixture of synthetic and academic data. The recipe generates diverse task-aware queries, relabels retrieved passages with LLMs, and incorporates positives, hard negatives, classification data, and multiple embedding dimensions.

3. Training Recipe for Gecko

  • Gecko uses a 1.2B-parameter pretrained transformer followed by pre-finetuning and fine-tuning on a unified mixture of FRet and academic datasets.Each example is formatted with a task description, query, positive passage, and negative passage.Source: §3 · p. 3, §3.3 · p. 6

3.1. Pre-finetuning

  • Pre-finetuning exposes the model to diverse unsupervised text pairs from community question-answer data and web title-body pairs, using task features and in-batch negatives.The objective uses cosine similarity with a temperature parameter and omits hard negatives during pre-finetuning.Source: §3.1 · pp. 3–4

3.2. FRet: Two-Step LLM Distillation

  • FRet first prompts an LLM to generate diverse retrieval tasks and queries from sampled web passages, including question-answering and fact-checking intents.Web topics and styles provide additional diversity, while task descriptions guide the generated queries.Source: §3.2 · pp. 4–5
  • FRet retrieves nearest-neighbor candidates with an embedding model, has the same LLM rank them using query likelihood and relevance classification, and ensembles the rankings with reciprocal rank fusion.The resulting ranking supports mining both positive passages and hard negatives.Source: Figure 2 · p. 5, §3.2 · pp. 5–6
  • About 15% of examples relabel the positive passage because the LLM-selected passage differs from the randomly sampled seed, while FRet contains 6.6M task-query-positive-negative examples.This relabeling approximates the LLM’s preference over the corpus rather than assuming the seed passage is optimal.Source: §3.2 · p. 6

3.3. Unified Fine-tuning Mixture

  • The unified fine-tuning mixture combines FRet with academic datasets, handles classification through same-label positives and different-label hard negatives, and supports 768- and 256-dimensional embeddings.A unique ID prevents overlapping classification positives from becoming false in-batch negatives.Source: §3.3 · pp. 6–7

4. Experiments

Gecko is evaluated across MTEB and multilingual retrieval, with experiments examining its overall performance and the contributions of LLM relabeling, task diversity, and training mixtures.

4.1. Main Results

  • Gecko significantly surpasses similarly sized baselines across every MTEB text embedding task, while Gecko-1b-768 often matches or exceeds larger models using higher-dimensional embeddings.The model particularly balances retrieval and STS performance and sets state-of-the-art results on classification, STS, and summarization.Source: §4.1 · p. 8

4.2. Multilingual Retrieval Results

  • English-only LLM-generated training data transfers well to multilingual retrieval tasks when used with multilingual language models and MIRACL data.The multilingual model is evaluated on retrieval across 18 languages.Source: §4.2 · p. 8, Table 2 · p. 8

4.3. Analysis

  • LLM-selected positives outperform original seed passages, showing that generated queries can have more relevant targets elsewhere in the corpus.The relabeled positive differs from the seed passage in about 15% of the dataset, and qualitative examples show this occurs often.Source: §4.3 · p. 9, Table 5 · p. 10
  • Training on uniformly sampled examples from all four FRet tasks yields superior cross-task performance, while unified formatting helps separate task behaviors.The evaluated tasks include question answering, search result, fact checking, and sentence similarity.Source: §4.3 · p. 9, Table 4 · p. 9
  • Adding symmetric formatting, same-tower negatives, NLI data, and classification data improves semantic similarity and classification, with the full FRet mixture reaching 66.31.The STS improvement is 1.6 on average, while classification improves without significant degradation on other tasks.Source: §4.3 · p. 9
  • Qualitative examples show that LLM-generated queries are diverse, LLM-mined positives can answer them more directly, and ranked hard negatives create nuanced distinctions.These examples illustrate how the two-step distillation transfers domain knowledge and ranking preferences into the embedding model.Source: §4.3 · p. 10

5. Conclusion

Gecko is a versatile text embedding model distilled from large language models through the synthetic FRet dataset. The conclusion emphasizes LLM-based relabeling, unified multi-task training, and strong zero-shot generalizability.

5. Conclusion

  • Gecko combines LLM-ranked positives and negatives in the synthetic FRet dataset to improve targets for synthesized queries.The model uses this data in a unified format alongside multiple task types.Source: §5 · p. 10
  • Combining synthetically generated data in a unified format enables strong performance across multiple tasks at the same time.The conclusion attributes this finding to the combined training strategy rather than to a single task.Source: §5 · p. 10
  • Ablations identify LLM-based relabeling and dataset diversity as important components while demonstrating strong zero-shot generalizability.These findings summarize the paper's analysis of Gecko and FRet.Source: §5 · p. 10

A. Enhancing Few-shot LLM Ranking with Ensembling

The study evaluates few-shot LLM reranking on BEIR using query likelihood, relevance classification, and their Reciprocal Rank Fusion ensemble. The ensemble consistently improves the initial retriever across tasks except FEVER, supporting high-quality retrieval data for FRet.

B. Formatting in FRet

FRet and other mixture datasets use a unified encoding format for every input and target. Performance is format-sensitive for asymmetric BEIR tasks but relatively stable for symmetric tasks.

  • A unified encoding format standardizes inputs and targets across datasets and tasks in the FRet mixture.Source: B. Formatting in FRet · p. 16, Table 7 · p. 16
  • BEIR performance is sensitive to formatting, whereas symmetric-task performance is relatively stable across formats.The comparison covers asymmetric BEIR and symmetric STS tasks.Source: B. Formatting in FRet · p. 16
  • Table 7 compares the unified format with alternative formats for BEIR and STS.Source: Table 7 · p. 16

C. Full MTEB Results and Instructions

The paper reports full results for each dataset in MTEB and documents the instructions used during evaluation. Most tasks use consistent instructions, while BEIR uses multiple intents.

Loading 2403.20327v1…