Skip to main content
QUICK REVIEW

[Paper Review] One Embedder, Any Task: Instruction-Finetuned Text Embeddings

Hongjin Su, Weijia Shi|arXiv (Cornell University)|Dec 19, 2022
Topic ModelingComputer Science13 citations
TL;DR

This paper introduces InstructOR, a single text embedder that generates task- and domain-aware representations by conditioning on natural language instructions describing the downstream task. Trained on 330 diverse datasets with human-annotated instructions using contrastive learning, InstructOR achieves state-of-the-art performance across 70 downstream embedding tasks—66 unseen during training—outperforming prior models by an average of 3.4% with only 335M parameters.

ABSTRACT

We introduce INSTRUCTOR, a new method for computing text embeddings given task instructions: every text input is embedded together with instructions explaining the use case (e.g., task and domain descriptions). Unlike encoders from prior work that are more specialized, INSTRUCTOR is a single embedder that can generate text embeddings tailored to different downstream tasks and domains, without any further training. We first annotate instructions for 330 diverse tasks and train INSTRUCTOR on this multitask mixture with a contrastive loss. We evaluate INSTRUCTOR on 70 embedding evaluation tasks (66 of which are unseen during training), ranging from classification and information retrieval to semantic textual similarity and text generation evaluation. INSTRUCTOR, while having an order of magnitude fewer parameters than the previous best model, achieves state-of-the-art performance, with an average improvement of 3.4% compared to the previous best results on the 70 diverse datasets. Our analysis suggests that INSTRUCTOR is robust to changes in instructions, and that instruction finetuning mitigates the challenge of training a single model on diverse datasets. Our model, code, and data are available at https://instructor-embedding.github.io.

Motivation & Objective

  • To address the poor zero-shot generalization of existing text embedding models across new tasks and domains.
  • To explore whether task and domain instructions can enable a single model to generate effective, tailored embeddings without further fine-tuning.
  • To develop a unified, instruction-fine-tuned embedding model that performs well across diverse downstream applications.
  • To demonstrate that instruction-based finetuning improves robustness and performance on heterogeneous datasets.

Proposed method

  • InstructOR encodes both the input text and a natural language instruction describing the task or domain, producing task-aware embeddings.
  • The model is trained on a multitask mixture of 330 diverse text embedding datasets using a contrastive loss to maximize similarity between semantically related pairs.
  • The MEDI dataset, comprising 330 instruction-annotated datasets, is constructed with human-written task and domain descriptions for each input pair.
  • A Siamese network architecture is used to compute embeddings for text-instruction pairs, with contrastive loss optimizing for semantic similarity.
  • The model is evaluated on 70 downstream embedding benchmarks, including classification, retrieval, clustering, and semantic similarity tasks.
  • Performance is compared against prior state-of-the-art models like GTR and SimCSE, with ablation studies to isolate the contribution of instruction finetuning.

Experimental results

Research questions

  • RQ1Can a single text embedding model generate high-quality, task-specific representations using only natural language instructions?
  • RQ2Does instruction-based finetuning improve zero-shot generalization across diverse downstream tasks and domains?
  • RQ3How does instruction finetuning affect robustness to paraphrased or varied instruction formulations?
  • RQ4Can a smaller model (335M parameters) outperform larger models (1.5B parameters) when trained with instruction supervision?
  • RQ5To what extent does instruction finetuning mitigate distribution shift across heterogeneous datasets?

Key findings

  • InstructOR achieves a 3.4% average improvement over the previous state-of-the-art across 70 diverse downstream embedding tasks, including 66 not seen during training.
  • Despite having only 335M parameters, InstructOR outperforms the larger 1.5B-parameter GTR model on 63 out of 70 evaluation tasks.
  • InstructOR demonstrates robustness to paraphrased instructions, with performance stable across different formulations of the same task description.
  • Ablation studies confirm that instruction finetuning is critical—training without instructions leads to significantly worse performance.
  • InstructOR achieves state-of-the-art results on all MTEB benchmark categories, including retrieval, classification, clustering, and semantic textual similarity.
  • The model performs particularly well on low-resource domains such as medicine and finance, showing strong zero-shot transfer capability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.