Skip to content

ReasonIR: Training Retrievers for Reasoning Tasks

main track #11corefrontierpaperrubric 10/122025 · ~35 min

Rulin Shao, Rui Qiao, Varsha Kishore, … Luke Zettlemoyer

Status

TL;DR. ReasonIR-8B is a Llama3.1-8B bi-encoder (bidirectional attention, contrastive loss) trained on public retrieval data plus two kinds of synthetic data from Llama3.1-70B-Instruct: varied-length (VL) queries of 300–2,000 words and hard queries (HQ) written from reasoning-worthy documents with a “brainstorming” prompt. Hard negatives are generated by the LLM in a second turn. On BRIGHT it reaches nDCG@10 24.4 with the original queries and 29.9 with GPT-4 rewritten queries; adding a tie-breaking LLM reranker reaches 36.9.

Why it matters now. Agents rarely send short keyword queries. They send long sub-queries full of reasoning, and they often rewrite queries before searching. Most embedders were trained on queries of about 20 tokens (NQ 20, MS MARCO 21) and stop improving as queries grow (BRIGHT queries average 194 tokens). ReasonIR is a clear recipe for a retriever that uses long, reasoning-heavy queries, and it gives a compute argument for doing that instead of reranking.

Pilot study (§3). On BRIGHT, longer GPT-4 rewrites help every retriever up to about 256 tokens. After that, GRIT-7B (trained with a 256-token query limit) and Nomic-v1.5 plateau, while BM25 keeps improving. Splitting the question into short sub-queries with a LangChain decomposer hurts (Nomic 12.1 → 10.5, GRIT 20.4 → 17.3). Two conclusions: train on reasoning-heavy queries, and extend the query length the retriever can use.

ReasonIR-Synthesizer (§4).

  • Public data (1,383,877 examples, including MS MARCO, NQ and HotpotQA) adapts the LLM to embedding.
  • VL data (244,970): the LLM writes a long query (300–2,000 words) and a positive document for it.
  • HQ data (100,521): seed documents come from the BRIGHT document collection, filtered by the FineWeb-Edu classifier (score ≥ 2). The LLM reasons about background knowledge, problem-solving patterns and realistic scenarios, then writes a self-contained hard question. The seed document is the positive.
  • Hard negatives for VL and HQ are generated in a separate turn, conditioned on the query and positive. Generating them in the same turn produced short, easy negatives.

Training uses InfoNCE with cosine similarity, temperature τ=0.02\tau = 0.02, a batch of 2,048 (GradCache and cross-device negatives) and 1,000 steps at a learning rate of 2e-5:

L=−log⁡exp⁡(cos⁡(q,d+)/τ)exp⁡(cos⁡(q,d+)/τ)+∑d−∈D−exp⁡(cos⁡(q,d−)/τ)\mathcal{L} = -\log \frac{\exp(\cos(q, d^{+})/\tau)}{\exp(\cos(q, d^{+})/\tau) + \sum_{d^{-} \in D^{-}} \exp(\cos(q, d^{-})/\tau)}

Test-time compute (§5.4, Appendix I). Encoding a query with NN non-embedding parameters costs about 2NLq2N L_q FLOPs. A pointwise reranker scoring kk documents of length LdL_d and generating LoL_o reasoning tokens costs about 2Nk(Lq+Ld+Lo)2N k (L_q + L_d + L_o). With the paper’s values (LqL_q = 128 normal or 1,024 rewritten, Ld=Lo=300L_d = L_o = 300, k=100k = 100), ReasonIR on a GPT-4 rewrite costs β=15.4×1012\beta = 15.4 \times 10^{12} FLOPs, against 61.6β61.6\beta for Rank1-7B and 293.9β293.9\beta for Rank1-32B. The count leaves out the cost of generating the rewrite.

ReasonIR: synthetic training data and the test-time pipeline Training: varied-length data (long queries with generated positives) and hard-query data (questions brainstormed from BRIGHT document-pool seeds) both get a hard negative generated in a second LLM turn; together with 1.38 million public pairs they train ReasonIR-8B, a bidirectional Llama3.1-8B bi-encoder with InfoNCE loss. Test time: the question is optionally rewritten into a long reasoning query, retrieved with ReasonIR-8B optionally fused with BM25, and optionally reranked by an LLM whose tied scores are broken by the retriever score. BRIGHT nDCG@10 goes from 24.4 to 29.9 with a GPT-4 rewrite, 32.0 with the BM25 hybrid and 36.9 with the reranker. Training (ReasonIR-Synthesizer, Llama3.1-70B-Instruct) VL: long query + positive 300–2,000 words, 245k HQ: hard query (101k) seed doc from BRIGHT pool 2nd LLM turn write a hard negative given query + positive (generated, not mined) ReasonIR-8B Llama3.1-8B base bidirectional attention InfoNCE, τ = 0.02 + 1.38M public pairs Test time (each stage optional) question ~194 tokens long rewrite GPT-4 or 8B model ReasonIR-8B + BM25 hybrid LLM rerank, 0–5 tie-break: retriever BRIGHT nDCG@10: 24.4 (original) → 29.9 (GPT-4 rewrite) → 32.0 (hybrid) → 36.9 (rerank) Rewrite generation cost is not counted in the paper's FLOP comparison.
Original sketch. Training (top): public data plus two LLM-generated sets, varied-length (VL) and hard queries (HQ) seeded from BRIGHT's document pool, with negatives generated in a second turn. Test time (bottom): an optional long rewrite, the bi-encoder, an optional BM25 hybrid, and an optional reranker whose ties are broken by the retriever score.
  • BRIGHT nDCG@10 (Table 1). Original queries: ReasonIR 24.4 vs GritLM-7B 20.9, Google 19.5, OpenAI 17.8, BM25 14.8. GPT-4 Reason-queries: ReasonIR 29.9 vs BM25 26.5, GritLM 23.4, Rank1-7B 27.5 and Rank1-32B 29.4 (both rerank BM25’s top 100). With a Llama3.1-8B rewriter, ReasonIR gets 28.0. Hybrid with BM25: 32.0. With QwenRerank: 36.9 in the table (the text says 36.8).
  • Data ablation (Table 3). Base 9.5 → Public 19.6 → +HQ 20.9 → +VL 23.2 → +HQ+VL 24.4 (original queries). An easy-query control (EQ) on the same seed documents does not help (22.3).
  • RAG (Table 2). On MMLU the closed-book score of 71.1 rises to 75.0 with ReasonIR on the original question (75.6 with a rewrite). On GPQA, 31.3 rises to 38.4, but the rewrite lowers it to 35.4 (the reader writes the rewrite). The you.com search API gets 33.8 / 36.4 on GPQA.
  • Complementarity (Appendix G.5). BM25 and ReasonIR share only about 28% of their top-100 documents.
  • Possible corpus leakage. HQ positives come from the BRIGHT document collection that is later used for evaluation. The EQ control shows that seeing the documents is not sufficient on its own, but the paper does not, as far as I could find, report BRIGHT results with the seed pool decontaminated. Later results on BRIGHT-Pro rank ReasonIR 11th of 13 retrievers on α-nDCG@25.
  • Compute accounting. The 200× claim excludes the GPT-4 rewrite. Table 15’s “β = 5.6α” is inconsistent with its own values (15.4 / 1.9 ≈ 8.1).
  • Rewrites from small models can hurt. On GPQA, rewrites from the 7B reader lowered all dense retrievers.
  • Single-step retrieval. All evaluations are single-shot retrieval or single-shot RAG. The paper lists combining the retriever with multi-turn reasoning models as future work.
  • BRIGHT: the benchmark ReasonIR targets, and BRIGHT-Pro, which re-ranks it.
  • Promptriever: another synthetic-data recipe, for instructions instead of reasoning.
  • Rank1: the reasoning reranker ReasonIR compares against on compute.
  • GritLM and E5-Mistral: the bidirectional-LLM embedder and synthetic-data recipes ReasonIR builds on.
  • Test-time compute: the broader framing of where to spend inference FLOPs.
  • ITER: conditions the query on the agent’s search history instead of a single rewrite.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    ReasonIR's Appendix I estimates test-time FLOPs as 2N·Lq for a bi-encoder and 2N·k·(Lq + Ld + Lo) for a pointwise reranker, with N non-embedding parameters. Use the paper's values: normal query 128 tokens, GPT-4 Reason-query 1,024 tokens, document 300 tokens, reranker output 300 tokens, k = 100, Rank1-7B N ≈ 6.5B, Rank1-32B N ≈ 31B. (a) Compute Rank1-7B's cost on a normal query and check it against the paper's 946 × 10¹² FLOPs. (b) The paper sets ReasonIR on the GPT-4 rewrite to β = 15.4 × 10¹² and on a normal query to α = 1.9 × 10¹², and writes β = 5.6α. Check that ratio. (c) Which cost does the "over 200× less compute than Rank1-32B" comparison leave out, and does that change the conclusion?

    What a strong answer covers
    • (a) 2 × 6.5e9 × 100 × (128 + 300 + 300) = 2 × 6.5e9 × 72,800 ≈ 9.46e14 = 946 × 10¹². Rank1-32B: 2 × 31e9 × 72,800 ≈ 4.5 × 10¹⁵.
    • (b) 15.4 / 1.9 ≈ 8.1, not 5.6, so the table's ratio is inconsistent with its own numbers. A ratio near 8 is what you expect from 1,024 vs 128 query tokens. The headline ratios 61.6β (Rank1-7B) and about 294β (Rank1-32B) are consistent with the FLOP counts.
    • (c) β counts only ReasonIR encoding the rewritten query. Generating that 1,024-token rewrite with GPT-4 is not counted. A large model decoding 1,024 tokens costs at least 2·N_gpt4·1,024 FLOPs, which for any model much larger than 8B is many times β.
    • So the fair comparison is "rewrite + bi-encoder" against "reranker on the original query". The bi-encoder is still far cheaper per document scored, but the claimed 200× gap shrinks once the rewriter is included. The paper also notes autoregressive decoding takes more wall-clock time than encoding.
  2. Mechanism

    Explain why ReasonIR generates its hard negatives with the LLM, in a separate turn, instead of mining them with BM25 or a dense retriever. Give the paper's three reasons, and explain what goes wrong in the contrastive loss if a mined "negative" is actually helpful for the query.

    What a strong answer covers
    • Reason 1: existing retrievers do poorly on reasoning-intensive queries, so their top results are a weak source of hard negatives.
    • Reason 2: relevance now means "helps the reasoning", so many retrieved documents from the same knowledge source are partly helpful; mining from the corpus risks false negatives.
    • Reason 3: the query is generated from one seed document without seeing the whole datastore, so other documents may be as relevant as the seed.
    • A false negative in the InfoNCE denominator pushes the query away from a useful document, which teaches the model the wrong notion of relevance.
    • Generating the negative in the same turn as the query produced short, easy negatives. A second turn conditioned on the query and the positive yields negatives that look similar but do not help.
  3. Critique

    ReasonIR's hard-query (HQ) data is generated from seed documents taken from BRIGHT's own document collection (filtered with the FineWeb-Edu classifier), and the seed document is used as the positive. Evaluation is on BRIGHT. Critique what this does to the interpretation of the BRIGHT results. Use the easy-query (EQ) ablation and the per-task changes from adding HQ in your answer, and propose a cleaner evaluation.

    What a strong answer covers
    • Training positives may include documents that are gold for BRIGHT test queries. The model can learn to embed those specific documents near reasoning-style queries, which is a form of corpus leakage even though the test queries themselves were not used.
    • The EQ control uses the same seed documents and the same negative generation but easy queries, and it does not help (Public+EQ+VL 22.3 vs Public+VL 23.2). So simply seeing the documents is not enough for the gain; the hard query style matters.
    • But Public+HQ vs Public changes by task: TheoremQA-Q rises from 21.4 to 33.7 and TheoremQA-T from 15.2 to 24.4, while Sustainable Living drops from 18.8 to 14.3. Large gains concentrated in a few tasks deserve a check against document overlap.
    • Cleaner protocol: seed HQ from a disjoint corpus (or remove all BRIGHT gold documents from the seed pool), report BRIGHT with and without that removal, and add an evaluation whose corpus was not used for training, such as the paper's MMLU and GPQA RAG tests or BRIGHT-Pro.
  4. What if…

    Table 3 trains five data mixes for 1,000 steps each. With original BRIGHT queries the scores are: base Llama3.1-8B 9.5, Public 19.6, Public+HQ 20.9, Public+VL 23.2, Public+EQ+VL 22.3, Public+HQ+VL 24.4. With GPT-4 Reason-queries they are 16.0, 27.1, 27.1, 28.0, 27.9, 29.9. Which data component matters most for which query type, and what does the HQ-alone row tell you about how to combine hard data with easier data?

    What a strong answer covers
    • Public data does most of the work (9.5 → 19.6 original; 16.0 → 27.1 rewritten): it turns a causal LM into an embedder at all.
    • VL helps both query types (+3.6 original, +0.9 rewritten over Public); it extends the query lengths the model handles.
    • HQ alone barely helps (+1.3 original, 0.0 rewritten), but HQ on top of VL gives the best result (24.4 / 29.9). The paper's reading is that HQ is too far from public data for the model to learn from it without VL bridging the gap in length and difficulty.
    • Practical rule: mix hard synthetic data with intermediate data, rather than adding the hardest data alone. Check gains under both raw and rewritten queries, because they can differ.
  5. Design

    You are choosing the retrieval stack for an agent that rewrites each sub-question into a long reasoning query before searching a fixed corpus. Use ReasonIR's findings on query length, query decomposition, BM25 hybrids and tie-breaking rerankers to propose a design and the measurements that would confirm each choice.

    What a strong answer covers
    • Use a retriever whose training covers long queries. GRIT-7B and Nomic plateau as rewritten queries grow, while ReasonIR keeps gaining; measure nDCG at several rewrite lengths on your own corpus.
    • Prefer one long, information-rich rewrite over decomposing into short sub-queries on reasoning tasks: LangChain decomposition lowered BRIGHT scores (Nomic 12.1 → 10.5, GRIT 20.4 → 17.3). Multi-hop factual tasks may behave differently, so test both.
    • Add a BM25 hybrid with long rewrites: ReasonIR+BM25 (0.5 interpolation) reaches 32.0 vs 29.9. The two retrievers' top-100 overlap only about 28%, which is why they combine well.
    • If you add an LLM reranker, break its ties with the retriever score: QwenRerank with no tie-breaking gives 30.3, with BM25 tie-breaking 34.9, with the ReasonIR score 36.9.
    • Measure end-to-end answer accuracy too. On GPQA, rewrites by a small reader hurt every dense retriever (ReasonIR 38.4 → 35.4).
  6. Research idea

    ReasonIR treats the rewritten query's length as a new axis of test-time compute. Propose an experiment that maps the compute frontier between "spend tokens on the query rewrite" and "spend tokens on reranking", including the rewriter's cost, and say what result would show that long-query retrievers are a better use of compute than reasoning rerankers.

    What a strong answer covers
    • Fix a corpus and query set (for example BRIGHT and BRIGHT-Pro). Vary rewrite length (64 to 2,048 tokens), the rewriter size, the reranker depth k and the reranker's reasoning length.
    • Count all FLOPs, including the rewriter's decoding, using the paper's 2N·tokens approximation; also report wall-clock time, since decoding is slower than encoding.
    • Plot nDCG@10 (and α-nDCG on BRIGHT-Pro) against total compute and compare the Pareto frontiers of the two strategies.
    • Evidence for long-query retrievers: their frontier dominates at the budgets agents actually use (several searches per question), and the result holds when a small, open rewriter replaces GPT-4.

Done with this page?

Status