QG-PPR: Personalized PageRank for Logic
- The paper introduces QG-PPR as a scalable framework that leverages personalized PageRank for efficient, query-guided inference in first-order logic.
- It constructs a localized proof graph using restart edges and probabilistic transitions to bias the search toward short, high-probability proofs.
- Empirical results show improved mean average precision and AUC over MLNs with significant gains in inference speed and scalability.
Question-Guided Personalized PageRank (QG-PPR) is a framework for efficient probabilistic inference in first-order logic representations, formulated to enable scalable, locally groundable reasoning over large databases. QG-PPR, as implemented in ProPPR, interprets query answering as a personalized PageRank process over a query-induced proof graph, leveraging local search and restart mechanisms to bias inference toward short proofs and high-probability answers. The approach supports efficient, parallelizable inference and learning, with empirical performance advantages over Markov Logic Networks (MLNs) on entity resolution tasks (Wang et al., 2013).
1. Formal Foundations and Semantics
QG-PPR is built atop a definite-clause logic program and a database of unit facts. A query is represented as a conjunction of literals . The proof state at any step is encoded as , where is the query with substitutions applied to date, and the subgoal list records the remaining goals to prove.
The initial or start node is , while a solution node has an empty subgoal list and is denoted by the symbol . The SLD proof graph —potentially infinite in size—captures the space of all proofs of using and . QG-PPR extends by adding restart edges to create .
Inference is defined as a random walk with restarts, seeded at , over . Personalized PageRank computes a probability distribution over solution nodes (ground answers ), structurally favoring nodes closer to through the restart mechanism.
2. Query-Induced Grounding Graph Construction
Each node in is a proof state of the form . For each and each clause in , if the leftmost subgoal unifies with via most general unifier , a proof edge is created:
- , where ,
- Each edge is annotated by a feature vector , reflecting user-defined feature literals instantiated under .
Additionally, each node receives a restart edge to with feature annotation , biasing the walk toward short proofs. Database facts (unit clauses) act as degenerate clauses with feature .
This query-guided construction ensures that only those nodes reachable from —i.e., relevant to the query—are included in the grounding, promoting scalability.
3. Personalized PageRank on Proof Graphs
Transitions within are governed by a row-stochastic matrix , with transitions parameterized as:
- , typically with ,
- Transition probabilities for each neighbor are normalized such that ,
- The restart edge from to is assigned probability , with the remaining mass distributed over proof edges.
The personalized PageRank vector is defined as the stationary distribution:
where is a unit vector at the start node. Power iteration is used in practice for convergence:
4. Local Inference via PageRank-Nibble-Prove
To achieve localized, query-specific inference, ProPPR employs the Andersen–Chung–Lang “PageRank-Nibble” method. This procedure simultaneously approximates for the seed and enumerates a compact subgraph sufficient for inference within controlled error.
A high-level pseudocode for PageRank-Nibble-Prove is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
define PageRank-Nibble-Prove(Q, α', ε):
let v0 = (Q, Q)
initialize residual r[v0] = 1, estimate p[v] = 0 for all v, Ĝ ← ∅
while ∃u with r[u]/|N(u)| > ε do
push(u)
return (p, Ĝ)
define push(u):
p[u] ← p[u] + α'·r[u]
δ ← (1–α')·r[u]
r[u] ← 0
for each neighbor v ∈ N(u):
Ĝ.addEdge(u→v)
r[v] ← r[v] + Pr(v|u)·δ |
Here, is a lower bound on the restart probability (typically set to ), and specifies the error tolerance. The algorithm ensures that after each push, remains an exact PPR vector for , and when the loop terminates, approximates with error per node. The constructed subgraph contains only visited edges—providing a “local grounding” for .
5. Theoretical Properties
The Andersen–Chung–Lang theorem asserts that if are the nodes successively pushed in PageRank-Nibble-Prove, then:
Hence, the number of edges in is at most . Both inference time and grounding size are thus , independent of the database size or the full proof graph's size. This establishes rigorous scalability guarantees.
6. Weight Learning and Parallelization
Supervised learning is supported using triples , where and are the sets of correct and incorrect answers for . After running PageRank-Nibble-Prove to obtain , pairwise learning examples are collected to impose for all pairs.
The pairwise squared-hinge loss is:
with total objective
using regularization with parameter . Gradients w.r.t. are computed by backpropagating through power-iteration, in the style of Backstrom & Leskovec. Stochastic gradient descent is applied, with learning rate .
Parallelization is realized by running independent threads over separate queries , grounding and updating asynchronously ("Hogwild!" style). Since each local grounding is small, the per-thread computational cost is low, and wall-clock speedup is nearly linear in thread count.
7. Empirical Results and Comparison
On the CORA citation entity resolution task (1,295 citations, 132 ground-truth papers), queries assess the predicate . The applied ProPPR program employs approximately 14 clauses over four predicates (author, title, venue, transitive closures) with feature annotations.
Performance metrics include:
- Mean average precision (MAP): Untrained ProPPR achieves compared to MLN's , with ProPPR demonstrating roughly 8× faster inference.
- After learning, AUCs for matching cite/author/venue/title attributes improve from (untrained) to , outperforming MLN’s range of .
- Inference time for ProPPR remains essentially constant as increases, while MLN inference time increases substantially.
- Learning scales nearly linearly with the number of threads; up to – speedups are observed with 16 cores.
All aspects of QG-PPR—graph construction, inference, and learning—are query-guided, ensuring the computation remains focused on those portions of the logic program and database relevant to , with a strong theoretical guarantee that the resulting computational cost is independent of database size (Wang et al., 2013).