ALR: A Retrieve-then-Reason Framework for Long-context Question Answering

Huayang Li, Pat Verga, Priyanka Sen, Bowen Yang, Vijay Viswanathan, Patrick Lewis, Taro Watanabe, Yixuan Su

TL;DR

Large language models (LLMs) struggle to reason effectively over increasingly long contexts, often getting overwhelmed and hallucinating information. This paper introduces ALR², a novel retrieve-then-reason framework that explicitly aligns LLMs with both retrieval and reasoning objectives, significantly improving performance on long-context question answering tasks.

What Problem Does This Paper Address?

As LLMs' context windows grow, their ability to accurately reason over that extended context degrades. This is because LLMs can become overwhelmed by the sheer volume of information, making it difficult to pinpoint and utilize the sparsely distributed relevant evidence needed to answer questions. Simply prompting LLMs to retrieve information often leads to them fabricating ("hallucinating") facts, which then results in flawed reasoning and incorrect answers. The paper aims to solve this by developing a method that guides LLMs to first retrieve relevant information and then reason over it.

Methods

The core of the paper is the ALR² (Aligning LLMs with Retrieval and Reasoning) framework. It's a two-stage process:

  1. Retrieval: The LLM is tasked with identifying and extracting the most relevant pieces of information from the long context that are crucial for answering a given question.
  2. Reasoning: The LLM then uses this retrieved, condensed information to formulate the final answer.

The novelty lies in explicitly aligning the LLM's objectives for both retrieval and reasoning. This is achieved through a joint optimization objective that trains the LLM to not only retrieve correct supporting facts but also to generate accurate answers based on those facts. This contrasts with standard Retrieval-Augmented Generation (RAG) approaches, which often treat retrieval and generation as separate or less tightly coupled processes.

Datasets

The paper uses existing datasets adapted for long-context evaluation:

  • HotpotQA: A multi-hop question-answering dataset.
  • SQuAD: A single-hop question-answering dataset.
  • Needle-in-a-Haystack (NIAH) variants: Used for evaluating retrieval performance. These include Single NIAH, Multi-keys NIAH, Multi-values NIAH, and Multi-queries NIAH.

The authors also mention using the RULER benchmark (Hsieh et al., 2024) for evaluation.

Key Insights and Ideas

  • Reasoning Degrades Faster Than Retrieval: A key observation is that while LLMs' performance on pure retrieval tasks is relatively stable even with long contexts, their reasoning capabilities degrade significantly as context length increases. This highlights the specific challenge of reasoning over long, complex documents.
  • Hallucination is a Major Hurdle: The paper emphasizes that modern LLMs often "hallucinate" retrieved facts when prompted to retrieve information. This fabricated information then poisons the reasoning process, leading to incorrect answers.
  • Alignment is Key: The core idea of ALR² is that explicitly training LLMs to optimize for both retrieval accuracy and reasoning correctness is crucial for overcoming long-context challenges. Simply asking an LLM to retrieve and then answer isn't enough; it needs to be guided on how to retrieve effectively for reasoning.
  • Generalization Matters: ALR² demonstrates good generalization capabilities, performing well on unseen datasets, suggesting its robustness.

Key Results

  • Significant EM Gains: ALR² achieved substantial improvements in Exact Match (EM) scores on long-context QA benchmarks. Specifically, it showed gains of at least 8.4 EM on HotpotQA and 7.9 EM on SQuAD compared to competitive baselines.
  • Outperforms Baselines: The method outperformed various prompting techniques (Direct Answering, Retrieve-then-Reason, Quote-First, System-2 Attention) and even fine-tuned models.
  • Reduced Hallucinations: ALR² significantly reduced hallucination rates in retrieval, as evidenced by lower hallucination rates and higher recall scores compared to baseline methods.
  • Consistent Performance: On HotpotQA, ALR² maintained consistent performance across context lengths from 4K to 128K tokens.

Limitations and Future Work

  • Summarization Challenges: Like other RAG-based methods, ALR² may struggle with summarization tasks where all information in the long context is important for the final prediction.
  • Granularity: The current approach primarily considers sentence-level retrieval. The authors suggest that allowing users to choose retrieval granularity (e.g., phrase, sentence, or passage) could be a valuable future direction.

Summary updated

Abstract

The context window of large language models (LLMs) has been extended significantly in recent years. However, while the context length that the LLM can process has grown, the capability of the model to accurately reason over that context degrades noticeably. This occurs because modern LLMs often become overwhelmed by the vast amount of information in the context; when answering questions, the model must identify and reason over relevant evidence sparsely distributed throughout the text. To alleviate the challenge of long-context reasoning, we develop a retrieve-then-reason framework, enabling LLMs to reason over relevant evidence collected during an intermediate retrieval step. We find that modern LLMs struggle to accurately retrieve relevant facts and instead, often hallucinate "retrieved facts", resulting in flawed reasoning and the production of incorrect answers. To address these issues, we introduce ALR$^2$, a method that augments the long-context reasoning capability of LLMs via an explicit two-stage procedure, i.e., aligning LLMs with the objectives of both retrieval and reasoning. We demonstrate the efficacy of ALR$^2$ for mitigating performance degradation in long-context reasoning tasks. Through extensive experiments on long-context QA benchmarks, we find our method to outperform competitive baselines by large margins, achieving at least 8.4 and 7.9 EM gains on the long-context versions of HotpotQA and SQuAD datasets, respectively.
BibTeX
@misc{li2024alr,
  author = {Huayang Li and Pat Verga and Priyanka Sen and Bowen Yang and Vijay Viswanathan and Patrick Lewis and Taro Watanabe and Yixuan Su},
  title = {{ALR: A Retrieve-then-Reason Framework for Long-context Question Answering}},
  year = {2024},
  eprint = {2410.03227},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.03227},
}
Figure