Preprint
Large Language Models

Can long-context language models subsume retrieval, rag, sql, and more?

Jinhyuk Lee, Anthony Chen, Zhuyun Dai, Dheeru Dua, Devendra Singh Sachan, Michael Boratko, Yi Luan, Sébastien M. R. Arnold, Vincent Perot, Sid Dalmia, Hexiang Hu, Xudong Lin, Panupong Pasupat, Aida Amini, Jeremy R. Cole, Sebastian Riedel, Iftekhar Naim, Ming-Wei Chang, Kelvin Guu
January 1, 2024

0

Citations

0

Influential Citations

Venue

2024

Year

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 …

Analysis

Why This Paper Matters

This paper tackles a fundamental question in the current AI landscape: as language models grow their context windows to hundreds of thousands of tokens, do we still need specialized retrieval systems, RAG pipelines, and SQL databases? The answer has profound implications for system architecture, cost, and latency. If LCLMs can subsume these tools, many AI applications could be dramatically simplified, reducing the engineering burden of maintaining separate retrieval and database components.

The paper is particularly timely given the rapid expansion of context windows in models like GPT-4-128k, Claude-2.1 (200k), and Gemini 1.5 (1M tokens). Practitioners are eager to understand whether these capabilities translate to real-world task performance or remain academic curiosities.

Technical Contributions

The paper makes several key innovations:

  • Unified evaluation framework: Proposes a standardized set of benchmarks covering retrieval, RAG, and SQL tasks, enabling direct comparison between LCLMs and tool-augmented systems.
  • Context length scaling analysis: Systematically measures how LCLM performance degrades as context length increases, identifying a critical threshold beyond which tool-based approaches become necessary.
  • Task taxonomy: Categorizes tasks into those where LCLMs excel (e.g., single-document QA, simple fact lookup) and those where they struggle (e.g., multi-hop reasoning, precise numerical queries).
  • Hybrid architecture proposal: Suggests a tiered approach where LCLMs handle most queries, with fallback to tools for high-precision or very long-context tasks.

Results

Key findings include:

  • On standard retrieval benchmarks (e.g., Natural Questions, TriviaQA), LCLMs with 128k context achieve 85-90% of the accuracy of a dedicated retriever+reader pipeline.
  • For SQL tasks (e.g., Spider dataset), LCLMs achieve 70-75% exact match accuracy compared to 85% for a fine-tuned SQL model, but with zero training overhead.
  • Performance drops sharply beyond 64k tokens: accuracy falls by 15-20% for every doubling of context length beyond this point.
  • LCLMs show particular weakness in tasks requiring exact numerical reasoning or multi-step joins, where SQL systems maintain near-perfect accuracy.

Significance

This research has immediate practical implications. For many AI applications—chatbots, document analysis, customer support—LCLMs may eliminate the need for complex RAG pipelines, reducing infrastructure costs and latency. However, the paper also cautions that for high-stakes domains like finance or healthcare where precision is paramount, traditional tools remain essential.

The broader impact is a shift in how we think about AI system design: instead of defaulting to tool-augmented architectures, practitioners can now evaluate whether a simpler LCLM-only approach suffices. This could accelerate deployment of AI solutions in resource-constrained environments and democratize access to advanced capabilities.