Paper commentary
GraphNIAH: A Benchmark for Long-Context Reasoning over Real-World Graphs
Researchers build a citation-graph benchmark that tests long-context reachability in LLMs
- Problem Existing needle-in-a-haystack benchmarks use synthetic text or fixed chains of facts, so they miss search over several candidate proof paths. Real reasoning often needs that search, and models have not been measured on it.
- Method GraphNIAH turns citation links among papers published after the models' knowledge cutoff into reachability questions. It samples subgraphs from the Semantic Scholar citation graph and computes answers automatically, so no annotator is needed.
- Results At question depths of 16 and 32, GPT-5.6-LUNA and the QWEN3.5 models answer YES/NO questions no better than random guessing, mostly by answering NO.
Where existing needle tests stop
The needle-in-a-haystack test hides one relevant fact in a long context of unrelated text and asks the model to retrieve it. That single-lookup form doesn't match tasks where the relevant facts sit in several parts of the context. Multi-hop versions such as RULER, Sequential-NIAH and U-NIAH address that, but they bring their own gaps.
Many NIAH benchmarks are built on synthetic data or LLM-generated text, which may not reflect real use. Others reuse published NLP datasets, which leads to contamination when that data appears in training corpora. Hand-built benchmarks need more human effort to expand, and each released set eventually lands in later training data.
The sharpest gap is in the reasoning. Most benchmarks follow one fixed logical path, where each next retrieval step is unambiguous. Real applications often need the model to search over several candidate proof paths, a pattern the authors call non-linear reasoning. Most NIAH benchmarks don't test that search, so how models behave when many paths compete remains unmeasured.
Citation chains as needles
The needle in GraphNIAH is a citation relationship between two papers, so each example is built from real scientific papers rather than generated text. Each paper in the subgraph is published after the evaluated models' knowledge cutoff, which the authors use to avoid benchmark contamination. The pipeline samples a subgraph from the Semantic Scholar citation graph, where papers are nodes and cites or cited_by edges connect them.
Papers in the subgraph and their bibliographies form the context, so the answer comes straight from the subgraph without manual annotation.
The model answers one of three questions: YES/NO reachability, multiple-choice reachability, or reachability counting. Reachability asks whether a target paper can be reached from a source paper through a chain of citation edges. The chain is read as an undirected path inside the sampled subgraph, not in the full Semantic Scholar graph. Two papers in different connected components of the subgraph count as unreachable, even when the full graph links them.
The model must therefore use only the citation relationships stated in the context to answer.
For counting, the ground truth is the component size of the source paper's component minus one. The source paper itself is excluded from the count, so the answer is a non-negative integer. Since the answer comes from the subgraph, the pipeline needs no annotator to label any example.
Each example uses one of three question types, and the subgraph contains several connected components so that some targets are reachable and others are not. For a NO label, the source and target sit in different components, which the pipeline builds explicitly. The authors sample the source and target components so that the model cannot shortcut the search.
How one example is assembled
Each component starts from a backbone, which is an undirected path of 3k-2 distinct papers published on or after April 1, 2026. The path is split into three paths of k nodes each, with consecutive paths sharing one endpoint. The true path runs from s_c to t_c, and two distractor paths start and end at those nodes, so the search needs at least d=k-1 steps.
Components are sampled i.i.d., and no two components share a paper, which removes shortcuts across components.
The component then grows one leaf at a time, starting from the backbone. At each step, a parent node is picked with probability proportional to the children it has already received. A node with no children gets the weight alpha, which is set to 0.1 for most experiments. The rule resembles a one-parameter Chinese restaurant process, which favors nodes that already have children.
A candidate child is rejected if it would create an undirected cycle or already belongs to another component.
Each paper is rendered as a text block with its title, authors and publication information. The block is followed by an APA-style reference list limited to citations inside the component. Distractor blocks come from code, essays, books, Wikipedia, or an extra component, and are shuffled with the paper blocks. Distractors are added until no more fit within the target context length.
The authors check the length under three tokenizers, GEMMA-4 for GEMINI, the QWEN3.5 tokenizer, and o200k_base for GPT-5.6. A block is never split, so the prompt can fall short of the target length by up to one block.
The authors chose alpha by comparing generated in-degree distributions with the filtered Semantic Scholar graph. They measured the difference with KL divergence over ten candidate values from 0.1 to 1.0.
Accuracy under deeper chains and larger components
Accuracy falls as question depth rises, but the drop comes at different points for different models. GPT-5.6-LUNA and the QWEN3.5 models go from 63-66% at k=4 to 39-48% at k=8, then seem to level off at 34-42%. GEMINI-3.8-FLASH holds at 83-87% through k=16 before it drops to 59% at k=32.
Component size mostly hurts the stronger models, because GPT-5.6-SOL and the three GEMINI models fall from 69-88% to 43-67% as the component grows from 100 to 250. GPT-5.6-LUNA and the QWEN3.5 models stay between 36% and 54% over the same range. Those weaker models sit uniformly below GPT-5.6-SOL and the three GEMINI models at every component size.
Counting is the hardest task, and four of the eight models don't answer any counting example correctly. GPT-5.6-LUNA and all three QWEN3.5 models get no counting example right at any question depth or component size. For GEMINI-3.8-FLASH, accuracy falls from 79% to 25% as component size grows from 100 to 250. The other three models with nonzero accuracy drop to 5% or less.
Question depth has no consistent effect on counting, so component size drives the drop.
The YES/NO bias and the none option
GPT-5.6-LUNA and QWEN3.5-35B-A3B answer NO on 84 and 86 of the 100 YES/NO examples, so their scores track which answer they favor. For question depth 8 and above, their NO-label accuracy reaches 100%, but YES-label accuracy falls to 32% and 28%. Because the answer is mostly NO, the score says more about the answer habit than about how well the models search.
At question depths of 16 and 32, these models answer no better than random guessing, mostly by answering NO. Most of the YES/NO failures happen at depths of 16 or more, where the models fall back to one answer.
The authors hypothesize that multiple-choice reachability is easier because one option is always correct. The new option is never correct, so picking it counts as an error.
With the none option, GPT-5.6-LUNA dropped from 68% to 14%, and QWEN3.5-35B-A3B dropped from 72% to 15%. Both scores sit near the random guessing level of 20%, because these models chose the new option in 85 and 84 of 100 examples. GEMINI-3.8-FLASH stayed at 97% with the new option. The two weaker models also produced roughly half as many output and reasoning tokens.
The authors read this as the models stopping their search early once a negative answer is available. So the multiple-choice advantage over YES/NO disappears for these two models once a negative answer exists.
Context length, distractors and reasoning effort
Raising the target context length doesn't move GPT-5.6-LUNA much in GraphNIAH. GPT-5.6-LUNA stays between 38% and 44% across 200,000, 500,000 and 922,000 tokens. GEMINI-3.8-FLASH falls from 71% at 200,000 tokens to 64% at 500,000 tokens and 60% at 922,000 tokens. Fisher's exact test gives p above 0.1 for both changes, so the authors don't call either one significant.
Distractor type barely changes accuracy for the three models tested. GPT-5.6-LUNA stays between 41% and 50%, and QWEN3.5-35B-A3B stays between 38% and 46%. An overall chi-square test across the five distractor types gives p of 0.03 for GEMINI-3.8-FLASH. After Holm correction for ten pairwise comparisons, no pair of distractor types differs significantly.
Extra reasoning effort doesn't reliably help the models in this benchmark. GEMINI-3.8-FLASH reaches 71%, 75% and 66% at low, medium and high effort. QWEN3.5-35B-A3B stays around 39% and 40% across all three effort levels. That gain comes with a cost: high effort produces eight times as many output tokens on average. Response time rises by a factor of 4.7, and API cost rises by 30.26% compared to the low setting.
Where GraphNIAH's results stop applying
GraphNIAH covers one domain and one relation type, citations between scientific papers, so its results may not carry over to other relational data. The authors wrote every prompt in English, so the study says nothing about how models handle other languages. The claims therefore cover reachability questions over citation graphs, asked in English.
The authors evaluated eight models in total, but some experiments tested only two or three of them. Each model received at most 100 examples per setting, so many of the confidence intervals are fairly wide. The authors ran few examples because inference is costly, and they say more examples would add statistical power. Those larger runs would tighten the comparisons between models and strengthen the claims.
The reachability questions rely on a limited set of templates, so the wording of each task is narrow. Future work could add more templates or use LLMs to paraphrase the questions into more natural language. The authors report that, as complexity rises, models fall to chance and lean on the negative option. They propose methods that push models to search more deeply instead of falling back on a default response.
Paper info
- Authors
- Minh-Nam Tran, Abulhair Saparov
- Venue
- arXiv · Preprint
- First published
- 2026-10-30
- Added
- 2026-11-3
- Updated
- 2026-10-30
- Version
- v1
- arXiv
- 2610.41704
- Category
- cs.CL
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
The needle-in-a-haystack (NIAH) benchmark was introduced as a test for measuring a model's ability to find small relevant facts within a very large body of input text. However, existing NIAH benchmarks each suffer from one or more of the following limitations: (1) reliance on synthetic data, so their evaluations may not generalize to real-world settings; (2) reuse of previously published datasets, leading to the risk of benchmark contamination; (3) dependence on manual annotation, which requires human effort to create and update data and is prone to future benchmark contamination; and (4) unrealistic simplification of long-context multi-hop reasoning where each next step is trivial given previous steps, while real-world reasoning often requires planning over multiple possible proof paths. To address these limitations, we introduce \Benchmark, a dynamic benchmark built from real citation relationships among scientific papers published after the evaluated models' knowledge cutoff date, which utilizes real-world information while ensuring no benchmark contamination. The fully automated benchmark construction pipeline samples representative subgraphs of the citation graph formed by these papers and converts each subgraph into a long-context QA example with a verifiable answer. We use GraphNIAH to evaluate eight LLMs from the GPT-5.6, Gemini-3, and Qwen3.5 families. We find that accuracy falls as questions require longer reasoning paths: at question depths of 16 and 32, the GPT-5.6 and Qwen3.5 models answer YES/NO questions no better than random guessing, mostly by answering NO; four of the eight models answer no counting example correctly, and the others model get worse as the subgraph size increases. These findings suggest that current LLMs often stop searching the citation relationships in their context before they reach the answer, even though every fact they need is in the context.
Quote from the paper
Minh-Nam Tran, Abulhair Saparov (2026). GraphNIAH: A Benchmark for Long-Context Reasoning over Real-World Graphs. arXiv:2610.41704v1. https://arxiv.org/abs/2610.41704v1
BibTeX
@misc{tran2026graphniah,
title = {{GraphNIAH: A Benchmark for Long-Context Reasoning over Real-World Graphs}},
author = {Minh-Nam Tran and Abulhair Saparov},
year = {2026},
eprint = {2610.41704},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2610.41704v1}
}