Two-Hop Relational Reasoning (THR)
- Two-Hop Relational Reasoning (THR) is a method that infers connections by composing exactly two relations through an intermediate bridge, serving as the minimal case for multi-hop reasoning.
- It employs techniques like adjacency masking, latent retrieval, and structured query composition to enhance reasoning in knowledge graphs and open-domain question answering.
- Empirical benchmarks (e.g., MetaQA, HotPotQA, BioHopR) and mechanistic studies highlight THR’s effectiveness while also exposing challenges in scalability, distractor handling, and bridge alignment.
Two-Hop Relational Reasoning (THR) denotes inference by composing exactly two relations, facts, or evidence-bearing units through an intermediate bridge. In graph-centric formulations, it asks whether a source entity reaches a target entity by following an ordered pair of relations; in open-domain question answering it requires retrieving and composing two passages or sentences; in latent prompt-completion settings it requires internally resolving a bridge entity and then using it to produce the final answer. The topic is therefore treated as the minimal non-trivial case of multi-hop reasoning and as a diagnostic setting for compositionality, structural inductive bias, retrieval control, and mechanistic interpretability (Petersen et al., 2 Feb 2026, Khattab et al., 2021, Ye et al., 29 May 2025, Guo et al., 19 Feb 2025).
1. Formal definition and representational variants
A standard knowledge-graph formulation defines a graph with entities , relation types , and typed edges . A two-hop query fixes a source entity and an ordered relation sequence , and seeks the answer set
This form appears explicitly in work on transformer limitations over structured data and in the biomedical benchmark BioHopR, where the bridge node is medically constrained and answers may be multi-valued rather than singleton (Petersen et al., 2 Feb 2026, Kim et al., 28 May 2025).
The same composition can be written in adjacency form. If is the typed adjacency matrix for relation , then two-hop reachability under is encoded by 0. KinshipQA uses the same Boolean-matrix perspective for kin relations, where many familiar kin terms are exactly two-hop compositions, such as grandparent, aunt or uncle, niece or nephew, and parent-in-law (Sun et al., 12 Jan 2026).
Symbolic mechanistic studies use an equivalent but stripped-down formulation. One paper defines second-hop generalization as answering symbolic queries of the form 1, where the bridge 2 is implicit and never verbalized (Ye et al., 29 May 2025). Another casts the task as in-context composition of premises 3 and 4 to infer 5, with the query token naming only the source (Guo et al., 19 Feb 2025). In both settings, THR is the minimal compositional case in which success requires an internal intermediate.
Open-domain retrieval-based work shifts the ontology from typed edges to evidence units. Baleen defines two-hop reasoning as retrieving and composing evidence from two distinct passages in order to bridge entities or facts that are not co-located, such as two Wikipedia pages in HotPotQA or two verification pages in HoVer (Khattab et al., 2021). HUG similarly treats rationales as latent sets of documents and sentences whose union must support the answer, so THR becomes a two-evidence-chain selection problem rather than an explicit path query (Zhao et al., 2023).
2. Algorithmic realizations and structural inductive bias
The literature operationalizes THR through several distinct but convergent design patterns.
| Setting | Representative method | THR mechanism |
|---|---|---|
| Knowledge-graph transformers | RASA | edge-type biases and sparse adjacency masking |
| Open-domain retrieval | Baleen | condensed retrieval, FLIPR, latent hop ordering |
| KBQA search | IRN, UHop | hop-by-hop relation prediction and halting |
| Graph/rationale models | answer-centric RGCN, HUG | typed entity graphs or latent rationale sets |
| Looped parametric models | DiscoLoop | looped recurrence with discrete and continuous channels |
RASA modifies transformer attention in only two ways: learnable scalar edge-type biases 6 added to attention scores and sparse adjacency masking that blocks non-adjacent attention with 7. The paper’s code-level specification is scores += edge_bias[edge_types] followed by scores.masked_fill_(~adj, -inf). For THR this enforces a layered locality constraint: the first layer can aggregate only over 1-hop neighbors and the second can compose through the bridge, while the sparse mask reduces the attention search space from 8 to 9 patterns, or from 0 to 1 when 2 (Petersen et al., 2 Feb 2026).
Baleen addresses a different bottleneck: the search space explosion of multi-hop retrieval. Its pipeline retrieves top-3 passages for the current query, condenses them into a compact fact set, updates the query by appending selected facts, and then performs second-hop retrieval. The retriever, FLIPR, uses late interaction with top-4 and top-5 token filtering so that different subsets of the same query can match different passages, while latent hop ordering lets the retriever infer which gold passage should be retrieved first without brittle title-overlap heuristics (Khattab et al., 2021).
Classical KBQA methods make the hop structure explicit. IRN predicts a relation at each hop, updates the question representation by subtracting the analyzed sub-question, accumulates a reasoning state, predicts intermediate entities, and halts with a Terminal relation (Zhou et al., 2018). UHop replaces exhaustive path enumeration with transition-based search over outbound relations and a comparative stopping rule that halts when the current prefix path scores at least as highly as any one-step extension (Chen et al., 2019). DTKG routes queries through a prompt-based classifier into either a chained KG path-construction branch or a parallel fact-verification branch; THR belongs to the chained branch and is scored through two-stage relation retrieval and multiplicative path scoring (Wang et al., 18 Oct 2025).
Graph-based textual models apply the same principle at the sentence and entity level. The answer-focused reasoning model for multihop question generation builds an answer-centric entity graph and applies a two-layer RGCN so that length-2 cross-document chains are encoded before decoding the question (Ma et al., 2020). HUG formalizes latent rationales as sets with
6
allowing THR to be realized as a minimal document pair and sentence pair whose union suffices for answer generation (Zhao et al., 2023).
3. Depth requirements, internal circuits, and learning dynamics
Theoretical work places a sharp lower bound on THR in standard transformers. Tabula RASA states that standard transformers with bounded precision and constant depth compute exactly 7, that 8 cannot solve graph connectivity, and proves that any transformer computing 9-hop reachability requires 0 layers. For 1, one attention layer can aggregate only over 1-hop neighbors; a second round of message passing is needed to compose the second edge, so THR requires at least two layers (Petersen et al., 2 Feb 2026).
Synthetic mechanistic studies converge on a layered bridge-and-consume picture. In “How does Transformer Learn Implicit Reasoning?”, training from scratch yields a three-stage developmental trajectory: early memorization, then in-distribution THR, then cross-distribution THR when only the first hop is out of distribution. The reusable intermediate is localized at the 2 token in middle layers, especially layer 5 of an 8-layer model, where cross-query semantic patching succeeds and cosine-space clustering of bridge representations tracks behavioral performance. The same study also reports that second-hop generalization fails when the second hop is out of distribution, even if the relevant atomic facts are present elsewhere, indicating a specific bottleneck at the second compositional role (Ye et al., 29 May 2025).
“How Do LLMs Perform Two-Hop Reasoning in Context?” identifies a sharper circuit-level mechanism in a 3-layer attention-only transformer. After an initial phase of random guessing, the model undergoes an abrupt phase transition around step 3 into a sequential query mechanism: layer 1 copies the parent into a buffer, layer 2 uses the query to select the correct bridge, and layer 3 uses the bridge to retrieve the end token. MLP ablations are nearly lossless, so the reported mechanism is effectively attention-only (Guo et al., 19 Feb 2025).
Capacity-scaling work offers a complementary interpretation. “Examining Two Hop Reasoning Through Information Content Scaling” argues that latent two-hop QA in feedforward transformers is best explained by a two-function composition regime in which the model effectively learns each fact twice, once for the first hop and once for the second. In that account, chain-of-thought moves the task closer to a recurrent ideal and removes the apparent duplication cost, while very small models can be trapped in a regime that memorizes two-hop answers independently (Johnston et al., 5 Feb 2025).
Looped architectures directly target the depth-local storage problem. DiscoLoop reports that vanilla looped transformers make the bridge entity nearly perfectly decodable after the first loop yet leave it poorly aligned with the bridge token embedding; the paper diagnoses this as a representational bottleneck rather than a retrieval bottleneck. Its solution is to carry both a continuous hidden-state channel and a differentiable decode-then-encode discrete channel across loops, so that the second loop consumes an embedding-aligned bridge representation rather than a misaligned latent vector (Fu et al., 1 Jul 2026).
4. Benchmarks and empirical behavior
Empirical THR results are highly setting-dependent, because the benchmarks differ in answer cardinality, retrieval burden, ontology control, and whether the intermediate state is explicit, latent, or externalized.
| Benchmark/setting | Reported 2-hop result | Source |
|---|---|---|
| MetaQA | Rasa Hits@1: 4 | (Petersen et al., 2 Feb 2026) |
| HotPotQA retrieval (dev) | Baleen: P-EM 86.7, P-R@20 93.3, Ans-R@20 96.3 | (Khattab et al., 2021) |
| BioHopR | O3-mini Prec_HOP2 14.57% | (Kim et al., 28 May 2025) |
| DTKG appendix 2-hop regime | 83.6% accuracy on 2-hop tasks | (Wang et al., 18 Oct 2025) |
| KinshipQA | 2-hop non-override 98.8% EM; override 83.6% EM | (Sun et al., 12 Jan 2026) |
MetaQA illustrates both the strengths and limitations of structural bias. On the 2-hop split, EmbedKGQA scores 98.8 Hits@1, NSM 99.9, and Rasa 81.8 ± 3.6. Yet the same paper reports much sharper attention under Rasa: normalized entropy is 0.32 for Rasa versus 0.89 for a standard transformer, and layer-wise entropies are 0.70, 0.70, 0.73 for Rasa versus 2.41, 2.38, 2.35 for the standard transformer. The authors interpret this as evidence that adjacency masking and edge-type biases produce focused, topology-aligned attention even when shallow-hop top-1 ranking is weaker than KG-specific baselines (Petersen et al., 2 Feb 2026).
Open-domain retrieval shows a different pattern. On HotPotQA fullwiki retrieval, Baleen achieves P-EM 86.7, P-R@20 93.3, and Ans-R@20 96.3, which the paper describes as retrieval saturation for THR because over 96% of questions have the short answer in the top-20 passages. On HoVer, Baleen also reports 97.7 Retrieval@100 for two-hop supported claims, with degradation as hop count increases (Khattab et al., 2021).
Domain-specific biomedical THR remains markedly harder. BioHopR contains 7,633 unique 2-hop questions, 279,738 total answers, and an average of 36.65 answers per question. Under zero-shot prompting without retrieval or KG tools, O3-mini, GPT4O, and GPT4O-mini all reach 14.57% 2-hop precision, while open-source biomedical models are far lower; the benchmark therefore exposes a sharp gap between one-hop and two-hop biomedical reasoning, and between single-answer prompting and the more demanding multi-answer condition (Kim et al., 28 May 2025).
Synthetic mechanistic settings often show a stronger trainability story than natural-domain benchmarks. Pretrained LLMs on symbolic in-context THR tend toward random guessing under distractors, but LLaMA2-7B fine-tuned for 1,000 steps on 1,000 synthetic prompts with one distraction reaches near-perfect accuracy and generalizes from 5 chains to 6 (Guo et al., 19 Feb 2025). DiscoLoop likewise reports near-perfect ID and OOD performance on symbolic and synthetic-language THR, while a vanilla looped transformer on the same symbolic split fits training perfectly but reaches only 71.1% on test_id and 8.3% on test_ood before realignment (Fu et al., 1 Jul 2026).
5. Failure modes, disagreements, and recurring misconceptions
A central failure mode is bridge inference. BioHopR identifies implicit bridge discovery, ontology alignment, long-tail relation patterns, and multi-answer completeness as core obstacles. The paper notes that medically plausible outputs can still be scored as false negatives when they are outside the PrimeKG-derived gold set for that exact path, especially under the strict 7 BioLORD-2023-C matching threshold (Kim et al., 28 May 2025).
Distractors and search-space growth form a second family of errors. Baleen frames naïve multi-hop retrieval as a search-space explosion problem in which concatenating full passages inflates query length and beam search over paths is exponential in hops (Khattab et al., 2021). In synthetic prompt completion, pretrained LLMs also fail under distractors: with a single distraction, the probability assigned by LLaMA2-7B to the correct end token drops by about half relative to the no-distraction case, consistent with near-uniform guessing among candidate ends (Guo et al., 19 Feb 2025).
Process-level QA diagnostics show that answer correctness can obscure reasoning defects. “Hop, Skip, and Overthink” formalizes the gold hop count as 8 for THR and evaluates models using hop count, coverage, and overthinking markers. On HotpotQA, which is a two-hop setting with distractors, reported overthinking rates range from 12.0% for DeepSeek-R1-Distill-LLaMA-70B to 41.3% for DeepSeek-R1-Distill-Qwen-7B. The same work distinguishes early irrelevance from trailing irrelevance and argues that early irrelevant hops are more detrimental to final answer correctness (Yadav et al., 6 Aug 2025).
Mechanistic work complicates the common dichotomy between reasoning and memorization. “Do LLMs Latently Perform Multi-Hop Reasoning?” finds strong first-hop evidence for certain relation types, sometimes above 80%, but reports that evidence for the second hop and for full traversal is only moderate on average, with a clear scaling trend for the first hop but not for the second (Yang et al., 2024). “Reason to Rote” reaches a related but sharper conclusion: in synthetic THR with label noise, models continue to compute bridge entities and clean answers internally even when they output memorized noisy labels, and ablating the bridge representation harms both generalization and memorization. This directly contradicts the view that memorization simply overrides the reasoning circuit (Du et al., 7 Jul 2025).
Another misconception is that better bridge decoding is sufficient for THR. DiscoLoop shows that it is not: after the first loop the bridge can be decoded with probability 1.000 on both ID and OOD, while cosine alignment with the bridge embedding remains only 0.327 on test_id and 0.266 on test_ood. This suggests that decodability and consumability are distinct, and that a model may “know” the bridge without handing it off in a form the next step can use (Fu et al., 1 Jul 2026).
6. Adjacent tasks, evaluation practice, and future directions
THR functions as more than a QA subproblem. In multihop question generation, a two-layer answer-centric RGCN composes cross-document chains so that the decoder can ask complex answer-focused questions rather than single-hop ones (Ma et al., 2020). In comparative RGCN studies on WikiHop, adding reasoning entities and explicit path relations such as Query–reason and Reason–candidate yields the most consistent improvements for multihop QA, which suggests that explicitly encoding the bridge remains useful even in document-level graph settings (Staliūnaitė et al., 2022). In explainable QA without rationale supervision, HUG treats rationales as latent sets and uses answer generation to constrain them, making THR a minimal case of faithful rationale discovery (Zhao et al., 2023).
Two application areas have recently made THR especially concrete. KinshipQA uses procedural genealogies and proof-graph extraction to enforce exact path lengths and to separate biological from culture-specific classificatory reasoning. Its results show that two-hop inference is near-ceiling when no cultural override is needed, but drops by 15.2 points when the same biological chain must be re-labeled according to systems such as Hawaiian, Iroquois, Dravidian, Crow, or Omaha (Sun et al., 12 Jan 2026). BioHopR does something analogous in biomedicine by restricting entity types to Drug, Disease, Protein, and Phenotype, and by emphasizing one-to-many-to-many chains and multi-answer evaluation (Kim et al., 28 May 2025).
The practical guidance emerging from the literature is relatively consistent. THR systems benefit from preserving one-hop locality per layer or loop, verifying that at least two rounds of aggregation actually participate, and making the bridge explicit either architecturally or diagnostically. RASA recommends adjacency masking and per-relation biases with at least two attention layers; Baleen recommends condensed retrieval with latent hop ordering rather than title heuristics; DTKG recommends routing chained questions to a path-construction branch; KinshipQA and BioHopR both motivate stricter evaluation for set-valued and culturally or ontologically constrained answers (Petersen et al., 2 Feb 2026, Khattab et al., 2021, Wang et al., 18 Oct 2025, Sun et al., 12 Jan 2026, Kim et al., 28 May 2025).
Several future directions are stated directly in the benchmark and mechanism papers. BioHopR calls for richer relation compositions, temporal and probabilistic edges, calibrated set-sensitive metrics, KG-augmented tool use, and human-in-the-loop validation (Kim et al., 28 May 2025). DiscoLoop identifies larger-scale pretraining, continual pretraining of existing models, and length generalization beyond trained hop counts as open questions (Fu et al., 1 Jul 2026). KinshipQA points to broader cultural coverage and multilingual formulation (Sun et al., 12 Jan 2026). More generally, the literature suggests that THR will remain a central probe because it isolates the precise boundary between single-fact retrieval and genuine compositional inference.