Abstract
Knowledge Graphs (KGs) are essential for structured data representation, yet traditional Complex Query Answering (CQA) models often treat numerical attributes as discrete entities, ignoring their inherent mathematical properties. This paper introduces the Number Reasoning Network (NRN), a novel framework designed to bridge the gap between logical entity reasoning and numerical attribute reasoning. By representing numerical values as probabilistic distributions and introducing specialized logic projections, NRN enables models to handle queries involving ranges and mathematical constraints. Experimental results across multiple benchmarks demonstrate that NRN significantly outperforms existing baselines, providing a robust solution for hybrid reasoning in incomplete KGs.
1. Introduction
Knowledge Graphs serve as the backbone for many modern information retrieval and recommendation systems. While these graphs excel at representing relationships between entities (e.g., "A is the capital of B"), they are frequently incomplete. Complex Query Answering (CQA) aims to predict missing links by performing multi-hop logical reasoning. However, a significant "blind spot" remains: the integration of numerical values such as dates, prices, and sizes.
Most current CQA models treat the number "1927" no differently than the entity "London." This categorical approach fails to capture the continuous nature of numbers, meaning models cannot inherently understand that 1926 precedes 1927 or perform operations like "twice as large." This paper addresses this limitation by proposing a framework that treats numbers as continuous distributions rather than static labels.
2. The Number Reasoning Network (NRN)
The authors propose the Number Reasoning Network (NRN), which bifurcates the reasoning process into two distinct phases to accommodate the different semantic requirements of entities and numbers.
2.1 Two-Phase Encoding
NRN operates by toggling between an Entity Phase and a Numerical Phase. In the Entity Phase, the model utilizes standard embedding techniques (such as vectors or boxes) to navigate the graph's logical structure. When a query requires numerical filtering or calculation, the model shifts into the Numerical Phase.
2.2 Probabilistic Numerical Representation
To represent sets of numerical values (e.g., "all years before 1927"), NRN utilizes parameterized probability density functions, specifically multi-variant Gaussians. This probabilistic approach allows the model to represent a range of values and account for uncertainty in the data, rather than relying on single, brittle points.
2.3 Specialized Logic Projections
To facilitate movement between these two phases, the authors introduced three new operations:
- Attribute Projection: Maps an entity to its numerical attribute (e.g., from a Person to their Birth Year).
- Reverse Attribute Projection: Maps a numerical range back to a set of entities (e.g., from Years < 1927 back to People).
- Numerical Projection: Applies mathematical constraints or comparisons, such as GreaterThan or TwiceEqualTo, directly within the numerical space.
2.4 Numerical Encodings
To preserve the geometric relationships between raw numbers, NRN employs deterministic encoding methods. These include DICE (polar-to-Cartesian transformation) and Sinusoidal encodings. The latter, borrowed from Transformer architectures, proves highly effective at helping the model grasp the magnitude and scale of numerical attributes.
3. Experimental Setup
The researchers evaluated NRN by augmenting three standard KG benchmarks—FB15k, DB15k, and YAGO15k—to include numerical attributes. They sampled eight general query types (e.g., 1p, 2i, pi, up) that require the model to transition between entity and numerical spaces. Additionally, "dummy" numerical edges were added to test specific mathematical relations like TwiceGreaterThan.
4. Results and Discussion
NRN was integrated as an enhancement to three popular CQA baselines: GQE (vectors), Query2Box (hyper-rectangles), and Query2Particles (multiple vectors).
- Performance Gains: NRN provided consistent improvements across all datasets. Notably, on the FB15k dataset using the Query2Particles backbone, the Mean Reciprocal Rank (MRR) increased from 22.84 to 25.09.
- Complex Query Handling: The most significant improvements were observed in queries involving intersections (2i, 3i) and numerical projections, areas where traditional models typically fail due to their inability to process ranges.
- Computational Efficiency: Despite the added complexity of probabilistic modeling, NRN remains highly efficient. Inference takes approximately 0.14ms per query, making it suitable for real-time applications like dialogue systems.
5. Conclusion and Future Work
The NRN framework demonstrates that treating numerical reasoning as a distribution problem is a powerful paradigm for CQA. By allowing the computational graph to "ping-pong" between entity and numerical spaces, the model achieves a more holistic understanding of Knowledge Graphs.
Future research may explore moving beyond Gaussian distributions to capture more complex, multi-modal data. Additionally, there is potential to develop "on-the-fly" mathematical reasoning capabilities that do not require pre-defined edges for every possible comparison, further increasing the flexibility of the system in noisy, real-world environments.
Summary updated