Skip to main content
QUICK REVIEW

[Paper Review] Can Long-Context Language Models Subsume Retrieval, RAG, SQL, and More?

Jinhyuk Lee, Anthony Chen|arXiv (Cornell University)|Jun 19, 2024
Natural Language Processing TechniquesComputer Science3 citations
TL;DR

This paper introduces LOFT, a benchmark with 35 datasets spanning text, vision, and audio, to evaluate long-context language models (LCLMs) on real-world tasks requiring up to one million tokens. LCLMs, using Corpus-in-Context (CiC) prompting, rival specialized retrieval and RAG systems at 128k tokens but struggle with complex compositional reasoning, highlighting the need for improved prompting and reasoning as context windows scale.

ABSTRACT

Long-context language models (LCLMs) have the potential to revolutionize our approach to tasks traditionally reliant on external tools like retrieval systems or databases. Leveraging LCLMs' ability to natively ingest and process entire corpora of information offers numerous advantages. It enhances user-friendliness by eliminating the need for specialized knowledge of tools, provides robust end-to-end modeling that minimizes cascading errors in complex pipelines, and allows for the application of sophisticated prompting techniques across the entire system. To assess this paradigm shift, we introduce LOFT, a benchmark of real-world tasks requiring context up to millions of tokens designed to evaluate LCLMs' performance on in-context retrieval and reasoning. Our findings reveal LCLMs' surprising ability to rival state-of-the-art retrieval and RAG systems, despite never having been explicitly trained for these tasks. However, LCLMs still face challenges in areas like compositional reasoning that are required in SQL-like tasks. Notably, prompting strategies significantly influence performance, emphasizing the need for continued research as context lengths grow. Overall, LOFT provides a rigorous testing ground for LCLMs, showcasing their potential to supplant existing paradigms and tackle novel tasks as model capabilities scale.

Motivation & Objective

  • To evaluate whether long-context language models (LCLMs) can replace traditional tools like retrieval systems, RAG pipelines, and SQL databases.
  • To identify the limitations of LCLMs in complex reasoning tasks despite their ability to process massive context windows.
  • To establish a rigorous, scalable benchmark that stresses LCLMs on real-world, long-context tasks beyond synthetic or fixed-length evaluations.
  • To explore the effectiveness of Corpus-in-Context (CiC) prompting as a unified paradigm for in-context learning across diverse modalities and tasks.
  • To assess how prompting strategies, such as chain-of-thought, influence LCLM performance on long-context reasoning and retrieval tasks.

Proposed method

  • Propose LOFT, a benchmark of 35 datasets across six tasks, supporting context lengths up to one million tokens and extensible to tens of millions.
  • Design Corpus-in-Context (CiC) prompting, where entire corpora are embedded in the prompt to enable in-context retrieval and reasoning without external tools.
  • Evaluate state-of-the-art LCLMs—Gemini 1.5 Pro, GPT-4o, and Claude 3 Opus—on LOFT using standardized prompts and evaluation protocols.
  • Use automatic data synthesis to scale context length across tasks, enabling stress-testing of LCLMs under realistic, long-context conditions.
  • Compare LCLM performance against specialized, hand-optimized models (e.g., Gecko for retrieval, CLIP for vision) to assess parity and gaps.
  • Conduct ablation studies on prompting strategies, including chain-of-thought and instruction tuning, to isolate their impact on reasoning and retrieval accuracy.
Figure 2: Corpus creation for retrieval and RAG. Given a set of test queries, we use their associated gold passages and other random passages to form the corpus.
Figure 2: Corpus creation for retrieval and RAG. Given a set of test queries, we use their associated gold passages and other random passages to form the corpus.

Experimental results

Research questions

  • RQ1Can long-context language models achieve performance comparable to specialized retrieval and RAG systems when processing corpora of up to one million tokens?
  • RQ2To what extent can LCLMs perform complex reasoning tasks such as those in SQL databases without formal query language conversion?
  • RQ3How do different prompting strategies, such as chain-of-thought, affect the robustness and accuracy of LCLMs on long-context tasks?
  • RQ4Can LCLMs effectively handle multi-hop, compositional reasoning tasks that require integrating information across multiple documents or tables?
  • RQ5How does the scalability of context length influence the generalization and reliability of LCLMs in real-world, multi-modal applications?

Key findings

  • At 128k tokens, LCLMs such as Gemini 1.5 Pro rival the performance of specialized retrieval systems like Gecko, demonstrating strong in-context retrieval capabilities.
  • Gemini 1.5 Pro outperforms CLIP, a leading multi-modal retrieval model, on visual retrieval tasks, indicating LCLMs can replace task-specific models.
  • LCLMs show significant performance variance depending on prompting strategy, with chain-of-thought prompting substantially improving reasoning accuracy.
  • Despite strong retrieval and RAG performance, LCLMs struggle with complex compositional reasoning tasks, such as multi-hop inference in SQL, indicating a critical gap in reasoning generalization.
  • The LOFT benchmark reveals that LCLMs can match specialized models in many tasks but still face challenges in robust, reliable reasoning under long-context conditions.
  • The study confirms that Corpus-in-Context prompting enables end-to-end, tool-free execution of retrieval, RAG, and few-shot learning, simplifying pipeline design.
Figure 3: Example of Corpus-in-Context Prompting for retrieval. CiC prompting leverages large language models’ capacity to follow instructions, leverage few-shot examples, and benefit from reasoning demonstrations to retrieve and reason over large corpora provided in context.
Figure 3: Example of Corpus-in-Context Prompting for retrieval. CiC prompting leverages large language models’ capacity to follow instructions, leverage few-shot examples, and benefit from reasoning demonstrations to retrieve and reason over large corpora provided in context.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.