Skip to content

Menu

WorksComputer Science

ImplicitHop: Evaluating knowledge integration across context and memory

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_84y46y92. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

Abstract

The ability to integrate new information and deduce its consequences is central to learning, understanding, and reasoning in large language models (LLMs). Whether information arrives during training or in-context, models must not only store local facts, but propagate their long-range implications globally. To explore information integration in LLMs, we introduce two complementary natural language benchmarks for large-scale evaluation of deductive reasoning as a function of inference depth. The first is a formal graph benchmark enabling controlled evaluation over a wide range of graph topologies and integration tasks; the second is a knowledge composition benchmark grounded in real-world knowledge graphs. We use these benchmarks to compare knowledge integration from information encoded in context versus information encoded in model weights during pretraining, evaluating a set of open models implicitly, without chain of thought. We find that accuracy decays sharply with increased composition length for both pretrained and in-context knowledge. Information presented in-context, however, substantially outperforms deduction over information encoded in weights. These results quantify a fundamental limitation of current models with direct implications for prompt-based control of agent behavior and for continual learning strategies, and they provide a foundation for developing training, prompting, and integration methods that support deeper reasoning.

Introduction

AI systems receive information from pretraining, prompts, tool outputs, and weight updates. To reason and act effectively, knowledge must not only be stored, but combined to infer new information. Models often fail at integrating information, even when they know the necessary facts. A model that learns that X has been elected president may recall the new fact, yet fail to answer “Who is the president’s spouse?” even though it knows that X is married to Y [3, 1]. Models that answer two questions correctly also often fail the question that composes them [2].

To measure knowledge integration we create two benchmarks over varied tasks that quantify integration by inference depth, measured in hops: the number of facts that must be integrated to reach an answer. In the first, a random graph is given in the prompt as a list of edges, and the model answers questions about the nodes exactly kk hops from a start node. In the second, the model answers questions that compose kk real Wikidata facts, such as “In what year was the director of Jaws born?” at k=2k = 2. The facts are given in the prompt, stored only in the model’s weights, or both, so we can compare how well models integrate knowledge from context and from memory.

Across 15 open models with reasoning off, accuracy falls sharply with hops. On graphs, models name a neighbor of the start node 99–100% of the time, but a node two hops away only 9–40% of the time. On Wikidata, models compose facts given in the prompt at ≥94%\ge94\% up to k=3k = 3, but facts in memory at only 37–64% at k=2k = 2 and ≤12%\le12\% from k=4k = 4, although every fact is known. Models integrate information in context far better than information in their weights, and both only to shallow depth.

Datasets

Synthetic Graph

Problem instances: A problem instance is defined by a finite, simple, undirected graph G=(V,E)G = (V, E) with a vertex set VV, ∣V∣=n|V| = n, and edge set E⊆(V2)E \subseteq\binom{V}{2}, ∣E∣=m|E| = m, together with a question qq about GG and its answer y=fq(G)y = f_q(G). Note that the mean degree is dˉ=2m/n\bar{d} = 2m/n. A hop is the traversal across a single edge in GG. The graph distance dist⁡G(u,v)\operatorname{dist}_G(u, v) is the minimum number of hops on any path from uu to vv, with dist⁡G(u,u)=0\operatorname{dist}_G(u, u) = 0 and dist⁡G(u,v)=∞\operatorname{dist}_G(u, v) = \infty when no path exists. For an anchor vertex a∈Va \in V and an integer k≥0k \ge0, the exactly-kk-hop shell of aa is

Sk(a)={u∈V:dist⁡G(a,u)=k}(1)S_k(a) = \{u \in V : \operatorname{dist}_G(a, u) = k\} \tag*{(1)}

For example, S1(a)S_1(a) is the neighborhood of aa, and S2(a)S_2(a) contains the vertices reachable in two hops but not in fewer hops. Being exactly kk hops from aa refers to only the shortest path. A vertex that is adjacent to aa and can also be reached by a two-hop path from aa belongs in S1(a)S_1(a) and not S2(a)S_2(a). Every vertex outside of the connected component of aa has distance ∞\infty and lies in no shell.

Random graph model: All graphs are generated using the G(n,p)G(n, p) Erdős–Rényi model, in which each of the (n2)\binom{n}{2} possible edges is included independently with probability pp. Rather than fixing pp, we fix a target expected mean degree d⋆d_\star and set

p=d⋆n−1,so thatE[deg⁡(v)]=(n−1)p=d⋆,(2)p = \frac{d_\star}{n - 1}, \qquad\text{so that} \quad\mathbb{E}[\deg(v)] = (n - 1)p = d_\star, \tag*{(2)}

which keeps the expected degree fixed across graph sizes. For each graph, nn is drawn uniformly from an integer range [nmin⁡,nmax⁡][n_{\min}, n_{\max}], and pp is then set from the drawn nn. Vertices are given random labels: nn distinct two-character strings are generated from A through Z without I and O. Random labels ensure that neither the label order nor the label identity carries information about the structure. Each graph is generated from its own seed, derived from a global seed (fixed at 0) and its index in the graph pool, so every graph can be reproduced.

Connectivity is not a condition that is required. At the target expected mean degree d⋆=3d_{\star}=3, graphs need not be connected, and conditioning on connectivity would change the sampling distribution. Empty shells and unreachable vertices are part of the benchmark and have defined answers.

Sub-tasks: On each graph we have four operations at each hop level k∈{0,1,2,3}k \in\{0,1,2,3\}, giving a 4×44 \times4 grid of sub-tasks Top,k\mathrm{Top,k}. For k≥1k \ge1, every operation is posed over the shell Sk(a)S_k(a) of an anchor aa:

verify:(a,b)↦{1,b∈Sk(a)0,else\begin{aligned} \text{verify}: (a,b) &\mapsto\begin{cases} 1, & b \in S_k(a) \\ 0, & \text{else} \end{cases} \end{aligned}

“Is bb exactly kk hops from aa?”

count:a↦∣Sk(a)∣\text{count}: a \mapsto\lvert S_k(a)\rvert

“How many vertices are exactly kk hops from aa?”

name_one:a↦any v∈Sk(a)\text{name\_one}: a \mapsto\text{any }v \in S_k(a)

“Name one vertex exactly kk hops from aa.”

enumerate:a↦Sk(a)\text{enumerate}: a \mapsto S_k(a)

“List every vertex exactly kk hops from aa.”

Each column in the grid (one operation, varying kk) would then isolate the scale, and each row (one kk, varying operation) would then isolate the level of output, ranging from one bit (verify) to an exact set (enumerate). The level k=0k=0 requires a different approach because S0(a)={a}S_0(a)=\{a\}, making all four questions trivial. At k=0k=0 the four operations are posed against the whole vertex set: whether a given label is in VV, ∣V∣\lvert V\rvert, any element of VV, and all of VV.

Natural language representation: Each problem instance must be turned into text before it can be given to a language model. The prompt states that the graph is undirected, lists the vertices by their labels, then lists the edges (Edges: AB-CD, YE-LY, …), and ends with the question.

Wikidata Graphs

A knowledge graph (V,R,E)(V,R,E) is a set of entities VV, a set of relations RR, and for each relation r∈Rr \in R a set of directed edges Er⊆V×VE_r \subseteq V \times V, where (u,v)∈Er(u,v) \in E_r states that vv is the rr of uu. A kk-hop chain is a path c=(v0,r1,v1,…,rk,vk)c=(v_0,r_1,v_1,\ldots,r_k,v_k) composed of local 1-hops (vi−1,ri,vi)(v_{i-1},r_i,v_i) with (vi−1,vi)∈Eri(v_{i-1},v_i) \in E_{r_i} for i=1,…,ki=1,\ldots,k.

We build the graph from Wikidata, using 30 single-valued relations (e.g. director, founder, father, birth year) between popular entities. We sample chains of k=1,…,6k=1,\ldots,6 hops by random walks, removing any chain that can be answered without composing: no two non-consecutive entities may be directly linked in Wikidata, and no entity may appear in the name of an earlier one. We keep 200 chains per length kk.

For each kk-chain, the required kk one-hop facts are retrieved from model weights, provided in context, or both. If the facts are in the weights, we ensure that the model correctly answers each 1-hop fact posed as a question; otherwise, the kk-chain is not used in the model’s evaluation. For the in-context condition, the chain’s facts are stated in the prompt with every entity given an invented name, so the model cannot rely on memory. Sixteen decoy chains with the same relations are mixed in, so the model must follow the chain from its start and cannot take semantic shortcuts.

Results

Synthetic Graphs

Accuracy collapses at two hops

Accuracy collapses when a question requires ≥2\ge2-hop reasoning. DeepSeek, Kimi, and Nemotron name a neighbor of the start node 99–100% of the time, but a node two hops away only 9–40% of the time and a node three hops away only 12–24% (Figure 1c). The same drop occurs across tasks: from k=2k = 2, counting falls to ≤16%\le16\% and enumerating to ≤12%\le12\%, and verifying is near chance by k=3k = 3 (Figure 1a,Figure 1b,Figure 1d). The other 12 models, from 0.8B to 2.8T parameters, follow the same pattern.

Figure 1. Models receive graph adjacency in-context but integrate the information poorly, failing at long-range inferences. DeepSeek, Kimi, Nemotron, and 12 other models answer questions about a random graph of 50–60 nodes given in the prompt as a list of edges, with reasoning off. Each question concerns the nodes exactly kk hops from a start node, so k=1k = 1 questions require only direct-neighbor information. a) Verify: is a given node exactly kk hops away? Accuracy falls from 93–100% at k=1k = 1 to 49–56% at k=3k = 3, close to chance. b) Count: how many nodes are exactly kk hops away? Models count correctly 43–69% of the time at k=1k = 1 and ≤16%\le16\% from k=2k = 2. c) Name one: name a node exactly kk hops away. Models name a neighbor at 99–100%, but a node two hops away at only 9–40%. d) Enumerate: list every node exactly kk hops away. Models list all neighbors at 71–100%, but no model lists more than 12% of sets correctly from k=2k = 2.

Wikidata Graphs

Composition accuracy decreases sharply with number of hops

Composition accuracy decreases sharply as chains grow longer. When information is presented in context, Kimi composes 99% of chains at k=3k = 3, 81% at k=4k = 4, 58% at k=5k = 5, and 29% at k=6k = 6, while DeepSeek and Nemotron are indistinguishable from chance by k=5k = 5 and k=6k = 6, respectively (Figure 2a). Similar accuracy decay with composition length occurs when information is in the weights or is available both in context and in memory. Even when every fact is known or given in the prompt, models struggle to compose information.

Figure 2. Models compose facts from the prompt far better than from memory. DeepSeek, Kimi, and Nemotron answer kk-hop Wikidata questions with reasoning off and information given in context, in memory, or both. a) The chain’s facts are given in the prompt under invented names, among 16 decoy chains with the same relations. All models compose at ≥94%\ge94\% up to k=3k = 3, but at k=6k = 6, Kimi composes at 29%, while DeepSeek and Nemotron Ultra fall to chance. b) The facts are recalled from memory without supporting facts in the prompt. Composition reaches only 37–64% at k=2k = 2 and ≤12%\le12\% from k=4k = 4, although every fact is known. c) The facts are given in the prompt under their real names, among 16 real decoy chains, so the model can use both the prompt and memory. Accuracy reaches 36–71% at k=6k = 6.

Models compose facts in context but not from memory

Models compose information given in context far better than information recalled from memory. At k=2k = 2, every model composes 100% of chains in context but only 37–64% from memory, and from k=4k = 4 memory composition falls to ≤12%\le12\% (Figure 2b). Giving the facts in context under their real names, so models can use both prompt and memory, yields the highest composition accuracy, with k=6k = 6 accuracy reaching 36–71%, compared to 4–29% in context alone and 2–6% in memory alone (Figure 2c). These results suggest that models compose known facts reliably only when the information is in context.

References

  1. [1]Lingwen Deng, Yifei Han, Shijie Li, Yue Du, and Bin Li. Consistency-aware parameter-preserving knowledge editing framework for multi-hop question answering, 2026. URL https://arxiv.org/abs/2509.18655.
  2. [2]Ofir Press, Muru Zhang, Sewon Min, Ludwig Schmidt, Noah A. Smith, and Mike Lewis. Measuring and narrowing the compositionality gap in language models. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 5687–5711, Singapore, 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-emnlp.378. URL https://aclanthology.org/2023.findings-emnlp.378.DOI
  3. [3]Zexuan Zhong, Zhengxuan Wu, Christopher D. Manning, Christopher Potts, and Danqi Chen. MQuAKE: Assessing knowledge editing in language models via multi-hop questions. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 15686–15702, Singapore, 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.971. URL https://aclanthology.org/2023.emnlp-main.971.DOI

AI tools statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

No code, data or supplementary files were declared for this version.

Pick where to look, or just type