Effective Dense Retrieval using Only In-Context Examples

Nour Jedidi, Abdul Basit Ali, Hang Li, Jimmy Lin
9/29/2026
cs.IRcs.CL

No confident code implementation found for this paper.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{jedidi2026effective,
  title  = {Effective Dense Retrieval using Only In-Context Examples},
  author = {Nour Jedidi and Abdul Basit Ali and Hang Li and Jimmy Lin},
  year   = {2026},
  eprint = {2609.38099},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.38099v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.38099.svg)](https://codeofpaper.com/paper/2609.38099)

Discussion