Proof of Concept Complete

Multi-Hop Reasoning

Benchmarking quantum-enhanced attention against classical transformers on compositional reasoning tasks requiring multiple inference steps.

The Task

Multi-hop reasoning requires composing multiple logical relationships to arrive at a conclusion. Given a set of facts and a query, the model must chain together several inference steps to produce the correct answer.

We use family relationships as a controlled testbed: understanding "Who is the father of the mother of X?" requires composing two relationships (father-of and mother-of) to identify the maternal grandfather. This task scales naturally in difficulty by increasing the number of relationship compositions required.

Why This Matters

Multi-hop reasoning is fundamental to complex question answering, knowledge graph traversal, and logical inference. Systems that excel at compositional reasoning can tackle real-world problems requiring multiple steps of deduction—from legal document analysis to scientific hypothesis generation.

Synthetic Dataset

We constructed a synthetic dataset of family relationship queries with controlled complexity levels. Each level requires a specific number of logical "hops" to reach the answer, allowing systematic evaluation of how reasoning depth affects model performance.

2-Hop

Basic Composition

Q: Who is the mother of the father of Alice?
A: Grandmother (paternal)
3-hop

Extended Chain

Q: Who is the sister of the father of the mother of Bob?
A: Great-aunt
4-hop

Complex Inference

Q: Who is the brother of the mother of the father of the sister of Carol?
A: Great-uncle
5-hop

Deep Reasoning

Q: Multi-step composition across five relationship layers
A: Requires tracking 5 sequential inferences

Experimental Setup

We compared our Quantum-Enhanced Transformer Multi-Head Attention (QETMHA) architecture against a classical transformer baseline with identical parameter counts. Both models were trained on the same dataset with equivalent training procedures, evaluated across all hop levels to assess how quantum advantages scale with reasoning complexity.

Results

85%
QETMHA Training Accuracy
70%
Classical Training Accuracy
+25pp
Validation Advantage
+35pp
2-Hop Advantage

Training Accuracy

QETMHA
Classical
90% 80% 70% 60% 1 2 3 4 5 Epoch

Validation Accuracy

QETMHA
Classical
70% 55% 40% 25% 1 2 3 4 5 Epoch

Final Test Accuracy by Reasoning Depth

QETMHA
Classical
100%
65%
2-hop
60%
35%
3-hop
20%
10%
4-hop
5%
~0%
5-hop

Quantum Advantage on 2-Hop Reasoning

+35pp
100% vs 65% accuracy on basic compositional tasks

Key Findings

Implications

These results demonstrate that quantum attention mechanisms provide measurable advantages on compositional reasoning tasks. The pronounced benefit on 2-hop and 3-hop problems—fundamental building blocks of complex inference—suggests significant potential for applications in knowledge graph reasoning, multi-step question answering, and logical inference systems. The challenge of deeper reasoning (4+ hops) for both architectures indicates an important direction for future research.

← Back to Quantum-Enhanced Transformers