Papers › One Embedder, Any Task: Instruction-Finetuned Text Embeddings

One Embedder, Any Task: Instruction-Finetuned Text Embeddings

19 Dec 2022arXiv:2212.09741archive 2025-07-28

Hongjin Su, Weijia Shi, Jungo Kasai, Yizhong Wang, Yushi Hu, Mari Ostendorf, Wen-tau Yih, Noah A. Smith, Luke Zettlemoyer, Tao Yu

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2212.09741")

Code

Syntology Ran 10 of 20 code samples harvested from 2 repositories linked to this paper; 10 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 8 ran with no contract checked.

By repository: official repository: 18 samples from 1 repository, 8 ran; community (archive-listed): 2 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

HKUNLP/instructor-embedding officialmentioned on GitHubpytorchApache-2.0 report
avsolatorio/gistembed mentioned on GitHubpytorch report
shibing624/text2vec mentioned on GitHubpytorch report
xlang-ai/instructor-embedding mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

20 samples harvested; 10 ran; 0 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
8ran
10unverified

Licence: 0 of the 20 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

expand_to_aliases HKUNLP/instructor-embedding/evaluation/prompt_retrieval/utils.py official repository ran Apache-2.0 (permissive) · d51ed70aaef3b5d0 · report
format_dataset HKUNLP/instructor-embedding/evaluation/prompt_retrieval/get_task.py official repository ran Apache-2.0 (permissive) · 82fab1f6e6bddec2 · report
get_sub_answers HKUNLP/instructor-embedding/evaluation/prompt_retrieval/utils.py official repository ran Apache-2.0 (permissive) · 91631e556572af73 · report
is_commonword HKUNLP/instructor-embedding/evaluation/prompt_retrieval/bridge_content_encoder.py official repository ran Apache-2.0 (permissive) · b724cc2d4066a429 · report
is_number HKUNLP/instructor-embedding/evaluation/prompt_retrieval/bridge_content_encoder.py official repository ran Apache-2.0 (permissive) · f39fdc1ce6cffe08 · report
is_stopword HKUNLP/instructor-embedding/evaluation/prompt_retrieval/bridge_content_encoder.py official repository ran Apache-2.0 (permissive) · d56a1f9221823a48 · report
process_mnli_examples HKUNLP/instructor-embedding/evaluation/prompt_retrieval/get_task.py official repository ran Apache-2.0 (permissive) · 071f4dd2f4d4b22c · report
process_rte_examples HKUNLP/instructor-embedding/evaluation/prompt_retrieval/get_task.py official repository ran Apache-2.0 (permissive) · b775e4262bf408f6 · report
construct_prompt HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_geo.py official repository unverified Apache-2.0 (permissive) · 012e0e03723d52ec · report
conversion HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_mwoz.py official repository unverified Apache-2.0 (permissive) · 5deafd882c22eab9 · report
fast_votek HKUNLP/instructor-embedding/evaluation/prompt_retrieval/two_steps.py official repository unverified Apache-2.0 (permissive) · 5a28ddf2ee395e47 · report
find_indices_from_embeddings HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_amazon.py official repository unverified Apache-2.0 (permissive) · 75fa1b0ab7064c3c · report
get_repeat_num HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_mwoz.py official repository unverified Apache-2.0 (permissive) · d8b8be7ec3cf207f · report
maybe_add_quotes HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_geo.py official repository unverified Apache-2.0 (permissive) · 678526b83af152ab · report
mean_pooling HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_coda_title_gen.py official repository unverified Apache-2.0 (permissive) · 597e15632d2a22fb · report
postprocess_text HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_coda_title_gen.py official repository unverified Apache-2.0 (permissive) · eff19094fe0ec70e · report
postprocess_text HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_answerbility.py official repository unverified Apache-2.0 (permissive) · 8d5099dd630ccb92 · report
v2_vote_k_select HKUNLP/instructor-embedding/evaluation/prompt_retrieval/main_mwoz.py official repository unverified Apache-2.0 (permissive) · 4db411255e0de092 · report
batch_to_device xlang-ai/instructor-embedding/InstructorEmbedding/instructor.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · f567def389222696 · report
import_from_string xlang-ai/instructor-embedding/InstructorEmbedding/instructor.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · fc1006b014fb9c69 · report

Tasks

Information RetrievalLearning Word EmbeddingsRetrievalSemantic Textual SimilarityText Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections