Skip to main content
QUICK REVIEW

[Paper Review] RULER: What's the Real Context Size of Your Long-Context Language Models?

Cheng-Ping Hsieh, Simeng Sun|arXiv (Cornell University)|Apr 9, 2024
Topic ModelingComputer Science9 citations
TL;DR

RULER introduces a synthetic benchmark with four task categories to evaluate long-context LMs beyond retrieval, showing most models degrade as context length grows and only a few maintain performance at very long contexts.

ABSTRACT

The needle-in-a-haystack (NIAH) test, which examines the ability to retrieve a piece of information (the "needle") from long distractor texts (the "haystack"), has been widely adopted to evaluate long-context language models (LMs). However, this simple retrieval-based test is indicative of only a superficial form of long-context understanding. To provide a more comprehensive evaluation of long-context LMs, we create a new synthetic benchmark RULER with flexible configurations for customized sequence length and task complexity. RULER expands upon the vanilla NIAH test to encompass variations with diverse types and quantities of needles. Moreover, RULER introduces new task categories multi-hop tracing and aggregation to test behaviors beyond searching from context. We evaluate 17 long-context LMs with 13 representative tasks in RULER. Despite achieving nearly perfect accuracy in the vanilla NIAH test, almost all models exhibit large performance drops as the context length increases. While these models all claim context sizes of 32K tokens or greater, only half of them can maintain satisfactory performance at the length of 32K. Our analysis of Yi-34B, which supports context length of 200K, reveals large room for improvement as we increase input length and task complexity. We open source RULER to spur comprehensive evaluation of long-context LMs.

Motivation & Objective

  • Motivate a more comprehensive evaluation of long-context LMs beyond retrieval tasks.
  • Provide a flexible benchmark (RULER) to test models on varied context lengths and task complexities.
  • Investigate how current models handle retrieval, tracing, aggregation, and QA with long inputs.
  • Identify failure modes and factors that enable or hinder long-context understanding.

Proposed method

  • Propose RULER, a synthetic benchmark with four task categories and configurable context length and complexity.
  • Extend needle-in-a-haystack (NIAH) to multiple retrieval variants (S-NIAH, MK-NIAH, MV-NIAH, MQ-NIAH).
  • Introduce Multi-hop Tracing (Variable Tracking) to test coreference-like chaining over long contexts.
  • Add Aggregation tasks (CWE and FWE) to evaluate information consolidation across long inputs.
  • Incorporate QA tasks with distracting information to assess long-context question answering.
Figure 1: In aggregation tasks, we sample words from a vocabulary following the two distributions above. The common words extraction (CWE) samples from uniform distributions. In the frequent words extraction (FWE), the frequency of each word is determined by its rank in the vocabulary and the parame
Figure 1: In aggregation tasks, we sample words from a vocabulary following the two distributions above. The common words extraction (CWE) samples from uniform distributions. In the frequent words extraction (FWE), the frequency of each word is determined by its rank in the vocabulary and the parame

Experimental results

Research questions

  • RQ1How do long-context LMs perform on retrieval tasks when context length is extended and distractors vary?
  • RQ2Can models reliably perform multi-hop tracing and entity tracking in long contexts?
  • RQ3Do models effectively aggregate information spanning long sequences, and how do Zipf-like word distributions affect this?
  • RQ4How does context size impact QA performance when distractors are added, and do models hallucinate or rely on parametric knowledge?

Key findings

  • All models show large performance degradation as context length increases, despite strong vanilla NIAH results.
  • Only a subset of models (e.g., GPT-4, Command-R, Yi-34B, Mixtral) maintain satisfactory performance at very long contexts (32K), and many fall short of their claimed context sizes.
  • Non-retrieval tasks (multi-hop tracing, aggregation, QA) reveal significant failure modes such as copying from context, reliance on parametric knowledge, and incomplete information retrieval.
  • Model size, training context length, and Transformer architectures influence long-context capabilities, with larger models generally performing better and non-Transformer architectures lagging behind.
  • Yi-34B-200K exhibits notable degradation with increased input length and task complexity, including incomplete answers and difficulty locating relevant information.
  • Scaling context length during training does not universally improve RULER performance, and there is notable degradation when extrapolating to unseen lengths.
  • The benchmark highlights distinct failure modes not captured by vanilla NIAH, underscoring the need for broader long-context evaluation.
Figure 5: Correlation heatmap among 18 tasks with diverse task configurations. We remove redundant tasks (in red ) and only preserve 13 representative tasks in Ruler . (W: words; N: numbers; U: UUIDs; Full: entire haystack)
Figure 5: Correlation heatmap among 18 tasks with diverse task configurations. We remove redundant tasks (in red ) and only preserve 13 representative tasks in Ruler . (W: words; N: numbers; U: UUIDs; Full: entire haystack)

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.