Source-linked AI summary

Towards Better Instruction Following Retrieval Models

Yuchen Zhuang, Aaron Trinh, Rushi Qiang, Haotian Sun, Chao Zhang, Hanjun Dai, Bo Dai

arXiv:2505.21439v1cs.CLcs.IR

TL;DR

Conventional retrieval models struggle to follow explicit user instructions, and existing training resources do not adequately support instruction-aware embedding models. The paper constructs InF-IR with instruction-query-passage examples and trains InF-Embed using contrastive learning and instruction-query attention. The reported results show improved instruction-following performance for embedding-based and auto-regressive models.

  • Problem

    Retrieval models struggle to interpret explicit instructions, while instruction-following datasets are primarily evaluation benchmarks with insufficient training data.

    Source: §1 · pp. 1–2
  • Method

    InF-IR provides instruction-query-passage positives and hard negatives, and InF-Embed uses contrastive learning with instruction-query attention.

    Source: §1 · p. 2
  • Results

    InF-Embed improves instruction-following performance by +9.0 p-MRR for embedding-based models and +4.2 p-MRR for auto-regressive LMs.

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

    The corpus supports contrastive training across embedding models and LMs of varying sizes for instruction-following retrieval.

    Source: §1 · p. 3

    Because InF-IR primarily extends general-domain MS MARCO, its effectiveness on specialized or domain-specific retrieval tasks may require further investigation and adaptation.

    Source: §A.1 · p. 16

Abstract

from arXiv · show

Modern information retrieval (IR) models, trained exclusively on standard <query, passage> pairs, struggle to effectively interpret and follow explicit user instructions. We introduce InF-IR, a large-scale, high-quality training corpus tailored for enhancing retrieval models in Instruction-Following IR. InF-IR expands traditional training pairs into over 38,000 expressive <instruction, query, passage> triplets as positive samples. In particular, for each positive triplet, we generate two additional hard negative examples by poisoning both instructions and queries, then rigorously validated by an advanced reasoning model (o3-mini) to ensure semantic plausibility while maintaining instructional incorrectness. Unlike existing corpora that primarily support computationally intensive reranking tasks for decoder-only language models, the highly contrastive positive-negative triplets in InF-IR further enable efficient representation learning for smaller encoder-only models, facilitating direct embedding-based retrieval. Using this corpus, we train InF-Embed, an instruction-aware Embedding model optimized through contrastive learning and instruction-query attention mechanisms to align retrieval outcomes precisely with user intents. Extensive experiments across five instruction-based retrieval benchmarks demonstrate that InF-Embed significantly surpasses competitive baselines by 8.1% in p-MRR, measuring the instruction-following capabilities.

1 Introduction

Instruction-following retrieval requires models to interpret detailed instructions alongside queries, but embedding models struggle with this while decoder-only models lack robust representation learning. The paper introduces InF-IR training data and InF-Embed, reporting improvements across embedding-based and auto-regressive models.

1 Introduction

  • Embedding models struggle with detailed instructions, while decoder-only models inadequately capture instruction-query-document interactions and existing datasets provide insufficient training data.Prior instruction-following datasets primarily serve as evaluation benchmarks.Source: §1 · p. 2
  • Existing training paradigms emphasize computationally intensive decoder-only reranking, while instruction-following datasets are primarily evaluation benchmarks.This leaves a shortage of training resources for efficient embedding-based instruction-aware retrieval.Source: §1 · p. 2
  • InF-IR expands query-passage pairs into instruction-query-passage positives and creates hard negatives by separately poisoning instructions and queries.An advanced reasoning model validates negative samples for semantic plausibility while maintaining instructional misalignment.Source: §1 · p. 2
  • InF-Embed combines contrastive learning with instruction-query attention to encode and interpret complex user instructions.The approach targets the efficiency-effectiveness trade-off between decoder-only and encoder-only retrieval models.Source: §1 · p. 2
  • +9.0 p-MRR for embedding-based models and +4.2 p-MRR for auto-regressive LMs are reported with InF-IR training.The paper also benchmarks contrastive learning objectives across embedding models and LMs of varying sizes.Source: §1 · pp. 2–3

2 Related Works

Prior instruction-following retrieval work includes evaluation datasets and decoder-based models, but high-quality training resources and efficient embedding-based approaches remain limited. InF-IR addresses dataset limitations with validated negatives that contrast instructions, queries, and documents.

Instruction-Following Retrieval Datasets

  • Instruction-following retrieval datasets mainly evaluate models, leaving a notable scarcity of sufficient, high-quality training resources.FollowIR has 104 instructions with binary relevance signals; Promptriever uses document contrasts for negatives and a small instruction-tuned model for quality assurance.Source: §2 · p. 3
  • InF-IR contrasts instructions, queries, and documents to generate challenging negatives, then validates a corpus of positive-negative triplets for instruction-aware contrastive learning.This design responds to limitations in prior dataset construction and quality assurance.Source: §2 · p. 3

Instruction-Following Retrieval Models

  • Prior instruction-following retrieval models often use decoder-only LMs for generation or reranking, whereas the authors hypothesize instruction-aware embedding models can address diverse requests.The paper characterizes autoregressive LMs as powerful but inefficient and less scalable retrieval backbones.Source: §2 · p. 3

3 Preliminaries

The preliminaries frame instruction-following retrieval as ranking passages conditioned on both a user instruction and a query. Training uses an in-batch noise-contrastive objective to align matching passage pairs and separate non-matches.

Noise Contrastive Estimation

  • The NCE framework models a conditional distribution P(y | x) with a parameterized scoring function that quantifies pair relevance.Training uses minibatches and a predefined negative-sampling distribution.Source: §3 · p. 4

Dense Passage Retrieval with Instructions

  • Instruction-following retrieval selects a concise subset of corpus passages that best satisfies a paired instruction and query.The setup treats passages as targets and the instruction-query pair as conditioning input.Source: §3 · p. 4
  • The NCE objective aligns matching instruction-query-passage triplets and separates non-matching triplets using in-batch negatives.At retrieval time, the learned score measures similarity between candidate passages and instruction-query pairs.Source: §3 · p. 4

4 InF-IR: Instruction-Following Information Retrieval Training Corpus

InF-IR builds instruction-query-passage training data from MS MARCO and filters synthetic positives and hard negatives for clear relevance judgments. Its samples show broader semantic coverage and greater diversity than FollowIR and Promptriever.

4.1 Data Curation

  • The corpus uses MS MARCO’s query-passage pairs as its seed data, relying on their coverage and annotations to focus curation on instruction generation.MS MARCO provides anonymized real-world queries paired with human-annotated relevant passages.Source: §4.1 · pp. 4–5
  • The curation pipeline generates positive instruction-query-passage tuples, creates negatives by altering instructions and queries, then filters tuples with o3-mini.The filtering targets ambiguous or unclear passage relevance.Source: §4.1 · p. 5
  • For each query-passage pair, gpt-4o-mini generates an instruction adding specificity or stylistic context to link the query to its relevant passage.The approach is intended to balance scalable generation, effectiveness, and computational efficiency.Source: §4.1 · p. 5
  • Negatives are made by separately poisoning the positive instruction and query, pairing each altered input with the other original input and a negative passage.The negatives remain semantically close to positives while changing tuple relevance.Source: §4.1 · p. 5
  • o3-mini retains only tuples with consistent, unambiguous relevance judgments across the positive and two negative scenarios.It evaluates each instruction-query pair against the positive passage, related negatives, and distractors.Source: §4.1 · p. 5
  • In a human annotation study, o3-mini achieved higher agreement with human judgments than FollowIR-7B, gpt-4o-mini, and gpt-4o.Figure 4 reports average Cohen’s kappa agreement scores.Source: Figure 4 · p. 5, §4.1 · p. 6

4.2 Data Visualization and Analysis

  • InF-IR samples cover a broader semantic space and show greater diversity than FollowIR and Promptriever.The comparison used 10,000 random samples from each corpus.Source: §4.2 · p. 6
  • InF-IR has lower average pairwise sample similarity and higher inter-sample N-gram frequency than FollowIR and Promptriever.Lower APS indicates fewer redundant samples, while higher INGF reflects greater textual diversity.Source: §4.2 · p. 6

5 InF-Embed: Instruction-Aware Embedding Training Paradigm

InF-Embed trains instruction-aware retrievers by combining instruction and query representations with contrastive objectives over passages, instructions, and instruction-aware queries. It proposes cross-attention and marginal negative sampling to model these interactions efficiently.

5.1 Instruction-Query Interaction and Representation

  • The dual encoder maps passages, instructions, and queries into a shared d-dimensional space, and retrieval scores passage–instruction-query pairs by cosine similarity.Source: §5.1 · pp. 6–7
  • Concatenating instruction and query as “<Instruction> <Query>” lets a decoder retriever incorporate instruction context through causal attention without architectural changes or added training parameters.Source: §5.1 · p. 6
  • Cross-attention integrates instruction embeddings into query embeddings, offering an alternative to the full forward pass required for each instruction-query pair by concatenation.The mechanism uses attention to form instruction-aware query embeddings.Source: §5.1 · pp. 6–7

5.2 Contrastive Learning Objectives

  • Training tuples treat identical passage, instruction, and query indices as matched positives, while differing indices represent unpaired hard negatives.Source: §5.2 · p. 7
  • Marginal negative sampling varies one input at a time while fixing the others to positives, reducing sampling complexity from combinatorial to O(|B| · |y|).The general multivariate setup can require combinatorial sampling as batch size grows.Source: §5.2 · p. 7
  • The univariate objective uses separate contrastive terms to model P(P|I, Q), P(I|P, Q), and P(IQ|P).Source: §5.2 · p. 7
  • The multivariate objective retains instructions among contrasting inputs and introduces more hard negatives, potentially making it more robust to competition among contrastive terms.The objective can model combinations such as (P, I), (P, IQ), (I, IQ), and (P, I, IQ).Source: §5.2 · p. 7

6 Experiments

InF-IR improves instruction-following and retrieval results across embedding-based and auto-regressive models, with comparisons against similar-sized and larger retrieval systems. Ablations examine loss designs, model configurations, and data quality.

6.1 Experiments Setup

  • The evaluation covers FollowIR, MAIR, and Bright, using MAP, p-MRR, and nDCG, with p-MRR as the main instruction-following metric.The setup compares non-instruction retrieval models, instruction-following retrieval models, and instruction-tuned language models, and includes embedding and decoder-only backbones.Source: §6.1 · p. 8

6.2 Main Experiment Results

  • +1.36@p-MRR for embedding-based models, while fine-tuned e5-base-v2 gains +14.3@nDCG and +8.2@p-MRR.Auto-regressive LMs also reach retrieval effectiveness (@nDCG) comparable to similarly sized embedding models.Source: §6.2 · p. 8
  • InF-Embed consistently outperforms baseline retrievers of similar size and achieves competitive performance against larger-scale or proprietary retrieval models.Figure 5 compares instruction-following p-MRR across architectures grouped by parameter count; standard retrieval metrics are scaled by 10 for visual comparison.Source: §6.2 · pp. 8–9, Figure 5 · p. 9

6.3 Configuration and Ablation Study

  • Multivariate contrastive loss outperforms other variants, and multivariate objectives surpass simpler univariate objectives on FollowIR.The findings emphasize contrasting instructions and passages together and jointly modeling interactions among instructions, queries, and passages.Source: §6.3 · p. 9
  • For decoder-only LLMs, a shared encoder for instruction-aware queries and passages with last-token pooling gives the best tested performance.The configuration comparison uses Qwen2.5-1.5B as the base model.Source: §6.3 · p. 10, Table 4 · p. 10
  • Despite being substantially larger, unfiltered training data degrades performance relative to quality-filtered InF-IR under identical training conditions.Figure 6 compares performance with and without quality filtering.Source: §6.3 · p. 10, Figure 6 · p. 10

7 Conclusion

The paper presents InF-IR and InF-Embed as resources and a model for instruction-following retrieval, reporting gains for embedding-based and auto-regressive models. It also identifies computational, domain, scalability, societal, licensing, and privacy considerations.

7 Conclusion

  • InF-Embed uses contrastive learning and instruction-query attention, and the paper reports gains of +9.0 p-MRR for embedding-based models and +4.2 p-MRR for auto-regressive models.The paper also reports systematic benchmarking of contrastive objectives and describes applicability to diverse IR settings, including RAG.Source: §7 · p. 10

A.1 Limitations

  • The authors identify three limitations: computationally intensive generation and quality checks, a general-domain MS MARCO foundation, and scaling multivariate objectives to very large batches or models.They note that specialized-domain effectiveness may require additional investigation and adaptation.Source: §A.1 · p. 16

A.2 Broader Impacts

  • The paper notes that instruction-following retrieval could amplify biases or misinformation in source data and could facilitate misuse, motivating responsible deployment and continual oversight.Source: §A.2 · p. 16

A.3 Data Privacy and Licensing

  • MS MARCO is distributed under a non-commercial license, and derived datasets must follow similar terms; practitioners should also observe privacy standards when using sensitive or user-specific data.The authors state that they followed source-dataset licenses and took steps to prevent test-set contamination.Source: §A.3 · p. 16, §A.4 · p. 16

A.4 Ethical Statements

  • The authors report following source-dataset licenses and OpenAI API data-use guidelines, and state that they do not foresee other ethics issues.Source: §A.4 · p. 16

B.1 Additional Data Quality Checks

The appendix describes a rule-based text filter and extensions of the curation process to additional datasets.

B.1 Additional Data Quality Checks

  • Synthetic instructions and queries are truncated at the first newline to remove irrelevant or extraneous text.Source: §B.1 · p. 17

B.2 Additional Data Sources

  • The curation approach extends to Robust 2004, Leetcode, and MetaMath, with domain-specific instructions for programming and mathematics tasks.For Leetcode negatives, the programming language is held constant so language cues alone cannot distinguish samples.Source: §B.2 · p. 17

C InF-Embed: Additional Method Details

The appendix provides detailed definitions of univariate and multivariate contrastive objective functions.

C.1 Univariate Contrastive Loss Details

  • The appendix presents detailed definitions of univariate contrastive objective functions.Source: §C.1 · p. 17

C.2 Multivariate Contrastive Loss Details

  • The appendix presents detailed definitions of multivariate contrastive objective functions.Source: §C.2 · p. 17

D Evaluation Dataset Details

The evaluation datasets span realistic instruction-following search, broad multi-domain retrieval, and reasoning-intensive tasks. Baselines include embedding retrievers, instruction-conditioned models, and rerankers.

D Evaluation Dataset Details

  • FollowIR evaluates realistic TREC narrative instructions, MAIR covers 126 tasks across domains, and Bright tests reasoning-intensive retrieval across 12 datasets.FollowIR uses pairwise annotations; MAIR includes 10,038 queries and 805 instructions; Bright has 1,384 queries and human-validated relevance labels.Source: D Evaluation Dataset Details · p. 18

E Baseline Details

  • Contriever, FLAN-T5, and E5 represent general-purpose dense retrieval, prompted relevance generation, and weakly supervised dual-encoder retrieval, respectively.E5 models explicitly use query and passage instructions for generalized semantic representation.Source: E Baseline Details · p. 18
  • MonoT5 is a generation-based cross-encoder reranker that jointly models queries and documents to score relevance.Source: E Baseline Details · p. 19
  • Other baselines include instruction-free Bge, instruction-conditioned Instructor and Tart-contriever, and LLaMA-based GritLM and Repllama.Source: E Baseline Details · p. 19

F Implementation Details

The human agreement study found o3-mini most aligned with annotators among the evaluated models. Additional results report advantages for dense retrieval, larger models, and instruction-tuned systems.

F.1 Human agreement study details

  • o3-mini achieved the highest Cohen’s Kappa agreement with human annotators among the evaluated models.The study compared three annotators’ judgments with o3-mini, FollowIR-7B, gpt-4o-mini, and gpt-4o.Source: §F.1 · p. 19

G.1 Additional Instruction-Following IR Results

  • Dense retrievers outperform sparse methods such as BM25; larger models generally perform better, and instruction-tuned models outperform models without explicit instruction tuning.The comparison covers multiple instruction-following retrieval datasets summarized in Table 5.Source: §G.1 · pp. 19–20, Table 5 · p. 20

G.2 Additional Configuration Benchmarks

The configuration comparisons favor multivariate contrastive objectives, while the prompt details instruct synthetic query and instruction generation to create clearly distinguishable but domain-relevant negatives.

G.2 Additional Configuration Benchmarks

  • The ℓmulti P,I configuration performs best by contrasting instructions and passages together.Instruction contrasts model their guiding role, while passage contrasts reinforce alignment between instruction-aware queries and relevant passages.Source: §G.2 · p. 20
  • Multivariate contrastive objectives outperform simpler univariate objectives, including those used by Promptriever.The comparison emphasizes jointly modeling interactions among instructions, queries, and passages.Source: §G.2 · p. 20
  • Decoder-only models outperform encoder-only models in retrieval effectiveness and instruction-following, an advantage attributed primarily to capacity and pretraining data.Source: §G.2 · p. 20

H Prompt Details

  • Query-synthesis prompts seek documents distinct from the original while preserving domain relevance through changes in entities, outcomes, perspective, or specificity.The prompt asks for at least three significant differences and clear distinction between original and synthetic documents.Source: H Prompt Details · pp. 21–23
  • Instruction-synthesis prompts identify core document claims, then target semantic opposites while keeping the topic relevant and the synthetic document distinguishable.Suggested changes include time, location, entities, outcomes, causal direction, perspective, and granularity.Source: H Prompt Details · pp. 22–23
Loading 2505.21439v1…