cs.IRSep 29, 2026

Effective Dense Retrieval using Only In-Context Examples

Authors: Nour Jedidi, Abdul Basit Ali, Hang Li, Jimmy Lin

Organizations: University of Waterloo · The University of Queensland

Abstract

Turning decoder-only large language models (LLMs) into strong dense retrievers typically requires some form of retriever training. In this paper, we ask whether LLMs can instead be prompted to produce effective representations for dense retrieval given only a few in-context examples. To answer this, we introduce RICE (Representations from In-Context Examples), a simple "training-free" approach that extracts high-quality dense representations from LLMs. To do so, RICE conditions the LLM on examples that provide a shared context for query and document encoding. Our results demonstrate that RICE embeddings can substantially improve the accuracy of prompt-based LLM embeddings, establishing it as a simple method to build LLM-based dense retrievers that do not require training. We release our code at https://github.com/nourj98/RICE.

Figures & tables

Explore similar work

CardsList
  1. DREAM: Dense Retrieval Embeddings via Autoregressive Modeling

    Jun 23, 2026Yixuan Tang, Yi YangRetrieval LayerAutoregressive Token Prediction

  2. GEM: A Generative Embedding Model Bridging Reasoning and Retrieval

    Aug 13, 2026Zhili Shen, Craig MacdonaldMultimodal Embeddings

  3. On the Robustness of LLM-Based Dense Retrievers: A Systematic Analysis of Generalizability and Stability

    Apr 17, 2026Yongkang Li, Panagiotis Eustratiadis, Yixing Fan +1Retrievers