ModelRefs / RULER — AI Glossary

RULER — AI Glossary

A long-context benchmark with synthetic tasks at controlled context lengths to stress-test retrieval and reasoning across 4K–128K tokens.

Overview

RULER (Hsieh et al. 2024, NVIDIA) tests: needle in a haystack (single/multi), variable tracking, and aggregation tasks at lengths 4K, 8K, 16K, 32K, 64K, 128K. Unlike NIAH, RULER requires multi-hop retrieval and counting. Reveals that many models claiming 128K context show significant degradation beyond 32K on hard tasks.

Reference details

Topicevaluation
Last reviewed2026-06-24

How it works

  1. Every task is synthesised rather than collected, so the correct answer is known by construction and context length can be set exactly without changing task difficulty.
  2. That separation is the design: the same task is instantiated at each length, which makes the comparison across lengths a controlled one rather than a confound.
  3. Needle retrieval appears in single and multiple variants, establishing a floor by testing whether specified information can be found at all.
  4. Variable tracking chains assignments so a value must be followed through several referring steps, which requires multi-hop retrieval rather than one lookup.
  5. Aggregation tasks ask for counts or frequent items over the whole context, which cannot be answered from any single span and so test whether the window was read rather than searched.
  6. Results are reported per length, because the output of interest is the point at which behaviour changes rather than any single figure.

Example: Why multi-hop separates usable context from advertised context

Take the hop structure that distinguishes variable tracking from needle retrieval. Suppose a model resolves a single reference correctly with probability 0.95 at some length, and that successive hops fail roughly independently. One hop succeeds 0.95 of the time, two hops 0.95^2 = 0.9025, four hops 0.95^4 ≈ 0.815, and eight hops 0.95^8 ≈ 0.663. The per-hop skill never changed, yet an eight-hop chain completes only about 66.3% of the time — which is the arithmetic reason a single-needle result overstates what a long window supports in practice, and why a benchmark that only places one needle cannot reveal it. The length schedule has its own consequence worth planning for. Six doubling points from 4K to 128K span a factor of 32, so a model's usable ceiling is located only to within a factor of two: a system that degrades at 40K and one that degrades at 60K both show the same pattern of passing at 32K and failing at 64K. Pinning the ceiling to within 25% would need steps of 1.25x, and ln(32) / ln(1.25) ≈ 15.53, so about 16 lengths rather than 6 — roughly 2.67 times as many points, with the token cost concentrated in the longest of them.

Commonly confused with

RULER is not needle-in-a-haystack with more lengths, and the difference is what fails. Needle retrieval asks whether a specified string can be located, which is a search problem a model can solve by attending to one position. Variable tracking and aggregation require combining information from several positions, which is the capability that degrades first and that a single-needle test cannot distinguish from success. This is why models can appear to handle their full advertised window on one benchmark and not on the other. It is also not a measure of context length as a capacity. The window size is a configuration fact; what RULER reports is the length at which particular task structures stop working, and those two numbers are routinely far apart.

When to use it

Reach for it when:

  • When deciding whether an advertised context length is usable for a given task structure, which is the gap the benchmark exists to expose.
  • On workloads needing multi-hop retrieval, where the compounding above is the mechanism that matters.
  • Read as a degradation curve per length, since the informative output is where behaviour changes.
  • To set a working context budget below the advertised maximum, which is the practical decision it supports.

Reach for something else when:

  • As a single headline figure, which discards the per-length structure that is the entire result.
  • To predict performance on natural long documents, given every task is synthetic by design.
  • In place of needle retrieval, which establishes the floor that multi-hop results are read against.
  • To locate a degradation point precisely, since six doubling steps resolve it only to within a factor of two.

Primary source

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to RULER — AI Glossary.

Frequently asked questions

What is RULER?

A long-context benchmark with synthetic tasks at controlled context lengths to stress-test retrieval and reasoning across 4K–128K tokens.

What concepts are related to RULER?

Closely related concepts include needle in haystack, long context, open llm leaderboard.