Task-aware Retrieval with Instructions

Akari Asai, Timo Schick, Patrick Lewis, Xilun Chen, Gautier Izacard, Sebastian Riedel, Hannaneh Hajishirzi, Wen-tau Yih

Introduction

Traditional Information Retrieval (IR) systems typically operate on a simple premise: a user provides a short query, and the system returns the most relevant documents based on keyword matching or semantic similarity. However, a standalone query often fails to capture the full scope of a user's intent. For instance, a search for "batch normalization" could imply a need for a Python implementation, a mathematical proof, or a high-level conceptual overview.

To address this ambiguity, researchers have introduced TART (Task-aware ReTriever), a system designed to follow explicit natural language instructions alongside queries. By leveraging multi-task instruction-tuning, TART moves away from specialized, brittle models toward a more universal search engine capable of adapting to diverse user needs without task-specific retraining.

The Problem: Query Ambiguity and Model Specialization

In standard IR, the lack of context often forces developers to build separate, specialized models for different domains—such as one for medical QA and another for code search. This approach is inefficient and requires vast amounts of task-specific labeled data.

Comparison between traditional retrieval and instruction-based retrieval, highlighting how instructions resolve query ambiguity.

As illustrated above, a single explicit query can map to multiple implicit user intents. Without instructions, a retriever might return a mix of results that satisfy the query but fail the user's specific task. TART solves this by accepting a natural language description of the task (e.g., "Find a Python code snippet that implements this"), allowing the system to "steer" its retrieval logic dynamically.

Methods: Multi-Task Instruction-Tuning

TART is built using a multi-task instruction-tuning approach and is implemented in two primary architectures:

  1. TART-dual (Dual-encoder): This model independently encodes the [instruction; query] pair and the document. It utilizes maximum inner product search (MIPS) for high efficiency, making it suitable for large-scale production environments.
  2. TART-full (Cross-encoder): This model jointly encodes the [instruction; query; document] triplet. While more computationally intensive, it allows for deep interaction between the task description and the document content, resulting in significantly higher accuracy.

A critical component of the training process is the use of instruction-unfollowing negatives. The model is intentionally trained on documents that are semantically relevant to the query but violate the specific instruction. This forces the model to prioritize task constraints over simple keyword matching.

Datasets and Benchmarks

The researchers introduced BERRI (Bank of Explicit RetRieval Instructions), a massive collection of 37 retrieval datasets repurposed into a unified format with expert-written instructions. This collection covers a wide array of tasks, from fact-checking to code search.

The BERRI collection: 37 diverse retrieval datasets categorized by task type.

To test generalization, the model was evaluated on the BEIR and LOTTE benchmarks, which consist of completely unseen tasks. Additionally, the authors introduced $X^2$-Retrieval (Cross-task Cross-domain), a realistic setup where documents from Wikipedia, Science, Tech, and Code are pooled into a single 3.7-million-document corpus. This forces the model to use instructions to navigate a noisy, multi-domain environment.

Key Insights and Results

  • State-of-the-Art Zero-Shot Performance: TART-full (1.5B parameters) outperformed significantly larger models, such as MonoT5 (3B parameters), on the BEIR benchmark. This suggests that instruction-tuning is more effective than raw parameter scaling for retrieval tasks.
  • Robustness in Mixed Corpora: In the $X^2$-Retrieval setup, TART was far less likely to be distracted by irrelevant documents from other domains compared to standard retrievers. The instructions acted as a filter, allowing the model to ignore high-scoring but task-irrelevant noise.
  • Cross-Task Interdependence: Training on 37 different tasks allowed the model to learn shared features across domains. For example, knowledge gained from Question Answering tasks improved performance on Fact Checking, even when the domain was previously unseen.

Limitations and Future Work

Despite its success, TART faces challenges. The Dual-Encoder Bottleneck suggests that smaller dual-encoders may struggle to fully capture complex instructions compared to cross-encoders. Furthermore, the computational cost of cross-encoders necessitates a two-stage pipeline: a fast model for initial retrieval followed by TART for re-ranking.

Future research may explore "late interaction" architectures (like ColBERT) to combine the speed of dual-encoders with the instruction-sensitivity of cross-encoders. There is also a call for the community to expand the BERRI dataset to include even more diverse and niche retrieval tasks.

Summary updated

BibTeX
@inproceedings{asai2023task,
  author = {Akari Asai and Timo Schick and Patrick Lewis and Xilun Chen and Gautier Izacard and Sebastian Riedel and Hannaneh Hajishirzi and Wen-tau Yih},
  title = {{Task-aware Retrieval with Instructions}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.225},
}
Figure