[Paper Review] Complex Query Answering with Neural Link Predictors
This paper proposes Complex Query Decomposition (CQD), a framework that answers complex first-order logical queries on incomplete knowledge graphs by decomposing them into differentiable sub-queries scored via a pre-trained neural link predictor. It achieves state-of-the-art accuracy with orders of magnitude less training data than prior methods, while enabling model interpretability through intermediate variable assignments.
Neural link predictors are immensely useful for identifying missing edges in large scale Knowledge Graphs. However, it is still not clear how to use these models for answering more complex queries that arise in a number of domains, such as queries using logical conjunctions ($\land$), disjunctions ($\lor$) and existential quantifiers ($\exists$), while accounting for missing edges. In this work, we propose a framework for efficiently answering complex queries on incomplete Knowledge Graphs. We translate each query into an end-to-end differentiable objective, where the truth value of each atom is computed by a pre-trained neural link predictor. We then analyse two solutions to the optimisation problem, including gradient-based and combinatorial search. In our experiments, the proposed approach produces more accurate results than state-of-the-art methods -- black-box neural models trained on millions of generated queries -- without the need of training on a large and diverse set of complex queries. Using orders of magnitude less training data, we obtain relative improvements ranging from 8% up to 40% in Hits@3 across different knowledge graphs containing factual information. Finally, we demonstrate that it is possible to explain the outcome of our model in terms of the intermediate solutions identified for each of the complex query atoms. All our source code and datasets are available online, at https://github.com/uclnlp/cqd.
Motivation & Objective
- To address the challenge of answering complex logical queries—such as those with conjunctions, disjunctions, and existential quantifiers—on incomplete knowledge graphs where missing facts hinder traditional subgraph matching.
- To develop a framework that generalizes from simple 1-hop link prediction to complex queries without requiring large-scale, diverse training data for complex queries.
- To enable explainability in complex query answering by exposing intermediate variable assignments and sub-query scores.
- To achieve high accuracy in complex query answering while avoiding the intractable complexity of full KG completion or black-box neural query encoders.
Proposed method
- The framework translates each complex query into an end-to-end differentiable objective function, where each atomic sub-query is scored by a pre-trained neural link predictor.
- Truth values of query atoms are computed using differentiable link prediction models such as ComplEx or DistMult, which estimate the likelihood of a fact being true.
- The framework employs two optimization strategies: gradient-based optimization and combinatorial beam search (CQD-Beam) to identify high-scoring variable assignments.
- It uses t-norms (e.g., product t-norm) to aggregate scores across multiple atoms in a conjunctive query, modeling logical conjunctions in a differentiable manner.
- The method is query-agnostic and does not require retraining for new query types, enabling zero-shot generalization to unseen complex query structures.
- Intermediate variable assignments are preserved and used to explain the final answer, enabling transparency and failure mode analysis.
Experimental results
Research questions
- RQ1Can a neural link predictor trained only on 1-hop queries be effectively leveraged to answer complex, multi-hop logical queries on incomplete knowledge graphs?
- RQ2How can complex queries be formulated as differentiable optimization problems that preserve interpretability while achieving high accuracy?
- RQ3Can a framework outperform state-of-the-art black-box neural query encoders without requiring millions of complex query examples for training?
- RQ4To what extent can intermediate variable assignments in the query decomposition process be used to explain and debug model predictions?
- RQ5Does the framework generalize to out-of-distribution query structures not seen during training?
Key findings
- The CQD framework achieves relative improvements of 8% to 40% in Hits@3 across multiple knowledge graphs, outperforming state-of-the-art models like Query2Box and GQE.
- The method achieves higher accuracy than models trained on millions of synthetic complex queries, using orders of magnitude less training data.
- CQD-Beam produces correct answers in the top three ranks for complex queries, with intermediate variable assignments correctly identifying relevant entities such as movies or countries.
- The framework enables full explainability: intermediate scores and variable assignments can be inspected to trace how each answer was derived, even when the final answer is correct but based on flawed reasoning.
- In cases where answers are correct but intermediate assignments are incorrect (e.g., assigning the wrong nationality to Thomas Aquinas), the framework reveals such failure modes, which is not possible with black-box models.
- The use of ComplEx as a link predictor yields better performance than DistMult, but both outperform GQE and Query2Box on all evaluated benchmarks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.