Paper explainer · Knowledge graph question answering

Search for paths.
Verify the constraints.

CCoR lets a language model choose relations, while a knowledge graph executes the actual joins and filters. That separation makes complex answers easier to audit—and avoids throwing away good answers too early.

Chenhui Liu, Jianpeng Zhou & Jiahai Wang · Compositional Chain-of-Relations for Faithful Knowledge Graph Question Answering with Large Language Models

Original paper listing · Full paper · PDF

01 · First principles

A correct answer is not necessarily a grounded answer

Imagine asking: “Which American directors have worked with actors who won the Best Actor Oscar?” A model might remember some famous names. Even if it happens to return the right names, we still cannot tell whether it checked the award, the collaboration, and the nationality.

A knowledge graph stores explicit facts as triples: (subject, relation, object). For instance, a simplified graph might store (Best Actor Oscar, winner, Actor A) and (Actor A, worked_with, Director D). A graph query can bind variables to every matching entity and return the supporting facts.

Task 1: retrieve candidates

Start at the award, follow its winners, then follow their collaborations to directors.

Award → winner → Actor
Actor → worked_with → Director

This establishes who could answer the question. It does not establish nationality.

Task 2: enforce the constraint

For each candidate director, verify a graph path to the country specified in the question.

Director → nationality → USA

Only candidates with this matching graph evidence survive.

The paper’s key move is to make both tasks executable. Its predecessor, CoR, focuses on candidate retrieval. CCoR adds an on-demand constraint chain so that “American” is checked in the graph rather than guessed from the model’s memory.

Division of labor: the LLM interprets language and proposes a query path; the graph engine evaluates that path. This is not an LLM-free system, nor a guarantee that the chosen path expresses the question correctly.

Why searching over entities can lose answers

An entity-centric agent expands a node, sees many neighbors, and retains only a few for the next hop. If an award has 97 winners but a beam retains only 3, collaborators connected exclusively to the other 94 become unreachable. The problem gets worse when entities have opaque IDs and no readable names: a model cannot reliably rank a person it cannot identify.

Relation-centric exploration instead chooses a small number of relation types, such as winner, and leaves the matching entities as query variables. All winners along a retained relation path remain eligible. CCoR removes intermediate entity pruning, not all pruning: it still ranks and prunes relation alternatives.

02 · How the system works

Two chains, one shared search engine

1. InterpretStart from topic entities mentioned in the question.
2. Main chainExplore relations until the candidate answer space is reached.
3. Constraint chainFind an executable path to a specific constraint target.
4. ExecuteJoin the chains in a graph query and return the matching entities.

Let G be the graph and E_topic the linked topic entities. The paper separates candidate construction from constraint verification:

E_cand = ExecuteMain(G, E_topic, c_main)
E_con = ExecuteComposed(G, c_main, c_con, target)
E_final = E_cand ∩ E_con

If no explicit constraint remains, the final set is simply E_cand. In implementation, one composed SPARQL query can enforce the join without materializing two separate sets.

The relation-centric loop

  1. Search relations: ask the graph which predicates can extend the current path. Intermediate entities are implicit variables, not a list of names for the LLM to rank.
  2. Prune relations: score predicates for semantic alignment, consistency with the existing chain, and proximity to the answer. Keep the top k choices.
  3. Update memory: push alternative chains onto a stack in increasing score order, so the best one is popped first.
  4. Choose an action: extend the chain, backtrack to an alternative, stop, or hand off to constraint exploration.

Main-chain decisions

Forward when the answer space is not reached. Backtrack when the current branch is inconsistent. Stop when the chain is complete with no remaining constraint. Constraint when the answer space is reached but a condition is still unresolved.

Constraint-chain decisions

Extract the unresolved sub-question, its source variable, and then search. Forward if the target is not reached; Backtrack for an invalid branch; Stop when a concrete constraint target can be selected and the composed query executed.

The constraint source is not necessarily the final answer variable. The method selects the appropriate entity position along the main chain. For the directors example, nationality belongs to the director variable—not the Oscar-winning actor variable. Choosing the wrong source can produce an executable but semantically incorrect query.

A simplified executable query

# Teaching schema, not the original Freebase predicates.
SELECT DISTINCT ?director WHERE {
  :BestActorOscar :winner ?actor .
  ?actor :worked_with ?director .
  ?director :type :Director .
  ?director :nationality :USA .
}

Here ?actor can bind to every matching actor, including actors with no readable name. The last clause enforces the nationality condition. A type clause makes the simplified collaboration relation precise; the paper’s illustrative chains abstract away much of the actual graph schema.

Two fallback layers—and why they matter

OutcomeWhat produces the final answer?Paper’s state
Both chains succeed, or no constraint is neededExplicit graph executionstructured
Constraint-chain exploration failsGraph retrieves candidates; LLM applies Global Entity Filtering (GEF) in one passsynthesis
Main-chain exploration fails irrecoverablyLLM answers directly using chain-of-thought promptingparametric

GEF preserves a useful graph-derived candidate set but gives up graph verification of the constraint. Direct generation gives up executable graph evidence altogether. The system logs the fallback layer and cause rather than treating every answer as equally grounded.

03 · Interactive teaching simulation

Watch answers disappear—or acquire evidence

This synthetic graph has four award-winning actors and four director candidates. Names, IDs, and nationality facts below are invented. The simulator compares a deliberately simple entity beam with full relation-path execution; it does not run an LLM or reproduce benchmark scores.

Toy award, actor, and director graphAn award connects to four actors. Ada connects to Rowan and Blake, Ben to Blake, Cy to Morgan, and an unnamed actor to Jules. Rowan, Morgan, and Jules have USA nationality; Blake has UK nationality.Best ActorAwardwinnerworked_withAdaBenCym.opaque (no name)RowanBlakeMorganJulesnationality → USAnationality → UKnationality → USAnationality → USA*
* You can remove Jules’s nationality edge below. “Unnamed” does not mean disconnected: the ID can still participate in a join.

Toy “model memory” incorrectly believes Blake is American, and correctly remembers the other three.

Try this: widen the beam to 4 but keep “skip unnamed” on—Jules still disappears. Then turn skipping off. Switch to model memory to see a wrong nationality judgment. Finally remove Jules’s nationality edge: even a correct relation chain cannot verify a missing fact.

The reference answers stay {Rowan, Morgan, Jules} when the nationality edge is removed: this intentionally contrasts the toy’s known world truth with what an incomplete graph can establish. Relation search, backtracking, query interpretation, and automatic failure detection are not simulated; the relation chains are fixed.

04 · A minimal runnable idea

The core is a join followed by a verified filter

This small JavaScript prototype is the successful-execution kernel, not the whole CCoR agent. It assumes entity linking and relation selection have already supplied the correct chains. The playground uses this same graph-traversal pattern.

const T = [
  ['award', 'winner', 'a1'],
  ['award', 'winner', 'opaque-id'],
  ['a1', 'worked_with', 'Rowan'],
  ['opaque-id', 'worked_with', 'Jules'],
  ['Rowan', 'nationality', 'USA'],
  ['Jules', 'nationality', 'USA']
];
const hop = (sources, relation) => new Set(
  T.filter(([s,r]) => sources.has(s) && r === relation)
   .map(([, , o]) => o)
);
const run = (start, chain) => chain.reduce(hop, start);
const candidates = run(new Set(['award']),
                       ['winner', 'worked_with']);
const answers = [...candidates].filter(d =>
  run(new Set([d]), ['nationality']).has('USA')
);
console.log(answers); // ['Rowan', 'Jules']

No name lookup is required for opaque-id. There is no instruction to keep only the “most relevant” actors: relation-path execution preserves all bindings along that path.

What a complete implementation still needs

Do not mistake this kernel for a generic query language: comparisons, temporal conditions, negation, and multiple interacting constraints may require richer operators than these two fixed paths.

05 · Evaluation and results

Where the gains show up

The evaluation covers four KGQA benchmarks and two graph sources. WebQSP, CWQ, and GrailQA use Freebase; QALD10-EN uses Wikidata. Main experiments include GPT-3.5-turbo, GPT-4.1-mini, and DeepSeek-V3.1. GPT-5.4-mini is additionally evaluated on a 500-question constrained CWQ subset.

DatasetQuestions evaluatedWhat makes it useful here?
WebQSP1,639Mostly 1–2 hops, mostly unconstrained
CWQ3,5202,266 constrained questions; many multi-hop paths
GrailQA1,000974 constrained questions, despite mostly single-hop main chains
QALD10-EN333Different graph and diverse compositional constraints

These are the evaluation counts reported by the paper, not claims about each dataset’s complete size. The authors cannot compute comparable depth/constraint statistics for QALD10 because they report no parseable SPARQL annotations.

Agent searches use beam width k = 3, maximum depth 3 for WebQSP/QALD10/GrailQA and 4 for CWQ, and model temperature 0.01. CCoR is training-free and uses at most five in-context examples. Several tuning/retrieval baseline numbers are imported from original papers; the closest ToG and PoG baselines are also reproduced for the faithfulness analysis.

Answer accuracy: GPT-3.5-turbo

Method / metricWebQSPCWQQALD10GrailQA
ToG · Hits@176.258.950.268.7
PoG · Hits@182.063.2—76.5
CCoR · Hits@185.166.067.979.8
CCoR · F177.957.564.976.1

Source: paper Table III; values are percentages. Hits@1 is defined here as at least one predicted answer matching a gold entity; it is not a measure of complete answer-set recovery.

CCoR leads the reported training-free agent comparisons, but does not dominate every supervised baseline. Pangu reports F1 of 79.6 on WebQSP and 81.7 on GrailQA. ELMK reports 60.6 F1 on CWQ, above CCoR’s 57.5, although its Hits@1 of 63.0 is below CCoR’s 66.0. This distinction matters: improvements in “finding at least one answer” do not always mean improvements in the full set.

Constraint-heavy subset: a clearer separation

On 500 randomly sampled CWQ questions with explicit constraints, GPT-4.1-mini CCoR raises Hits@1 from PoG’s 54.2 to 68.4, F1 from 51.6 to 62.3, and KGR from 36.4 to 61.9. With GPT-5.4-mini, CCoR reaches Hits@1 of 70.2, F1 of 65.1, and KGR of 77.3. The stronger-model row is CCoR-only, so it is not a same-backbone comparison against stronger ToG/PoG variants.

Faithfulness comparison: CWQ, GPT-4.1-mini

ToG · KGR
30.3%
PoG · KGR
37.1%
CCoR · KGR
69.1%

In this comparison, CCoR’s F1 is 57.8 versus PoG’s 42.2, and Faithful-F1 is 39.9 versus 15.7. DeepSeek-V3.1 shows the same directional pattern: CWQ CCoR has F1 60.3 and KGR 74.2 versus PoG’s 41.4 and 35.8.

Efficiency: fewer calls does not always mean fewer tokens

Mean LLM calls / questionWebQSPCWQQALD10
ToG7.7619.4315.26
PoG7.3819.7511.83
CCoR4.5110.205.51

GPT-4.1-mini; paper Figure 4 discussion.

CCoR uses about 59.2 million total tokens on CWQ, compared with 62.3 million for ToG and 113.2 million for PoG. On WebQSP, however, CCoR uses more tokens: 12.2 million versus 11.6 and 11.3 million. Its call savings are consistent; its token savings are workload-dependent. These measurements do not establish end-to-end latency, database execution cost, or a universal dollar-cost advantage.

Ablations: remove components carefully

Cumulative removal, CWQ / GPT-4.1-miniHits@1F1KGR
Full CCoR67.057.869.1
Remove constraint chain → CoR with GEF60.352.049.8
Also remove relation backtracking57.250.042.6
Also remove GEF48.242.829.8

The cleanest first comparison supports the constraint-chain contribution: +5.8 F1 and +19.3 percentage points KGR over CoR. Later rows remove modules cumulatively, so their drops are not isolated estimates of each component’s effect inside full CCoR.

Depth also matters. Increasing CWQ’s maximum depth from 2 to 4 raises F1 from 43.7 to 57.8. Increasing it to 5 lowers F1 to 53.9 without expanding the paper’s reported question-depth coverage. More exploration is not automatically better.

The paper’s concrete case study

For “What team with fight song Bow Down to Washington did Nate Robinson play for?”, CCoR follows pro_athlete.teams → team_roster.team to eight candidates, then applies fight_song → Bow Down to Washington. It returns the benchmark gold entity Washington Huskies football in six calls. CoT, ToG, and PoG instead return University of Washington; ToG and PoG use 32 and 30 calls. The example illustrates why entity granularity and an explicit final constraint both matter. It demonstrates success on this benchmark item, not that every graph-derived fact is independently verified real-world truth.

06 · Understanding the proposed metrics

How much of the answer came from executable evidence?

The paper assigns a grounding state per question: structured gets weight 1, synthesis gets 0.5, and parametric gets 0. The Knowledge Grounded Rate is the average of those weights.

KGR = (N_structured + 0.5 × N_synthesis) / N
Faithful-F1 = KGR × F1

KGR is a weighted score—not simply “the percentage of fully grounded answers.” For example, 60% structured plus 40% synthesis yields KGR 80%, although only 60% are fully structured. The 0.5 partial-grounding weight is a design choice, not a calibrated probability.

Metric calculator Hypothetical batch, not paper results

Clamped to the remaining share; the remainder is parametric.

Important interpretation: “structured” concerns the answer-producing execution step. The LLM still selects the query. A wrong query can receive full grounding credit while returning the wrong answer; F1 is needed to detect that error.

Faithful-F1 multiplies two aggregate metrics. It does not measure the average correctness of each grounded answer. A batch where correct answers are grounded and a batch where incorrect answers are grounded can have the same F1 and KGR. Per-question correctness-by-state reporting would reveal that difference.

07 · What to trust—and what to question

Grounding narrows the failure modes; it does not eliminate them

Small inconsistencies worth noticing

The paper’s prose describes CCoR as best on CWQ, but Table III gives ELMK a higher CWQ F1 (60.6 versus 57.5); CCoR is higher on Hits@1. Also, WebQSP’s depth and constraint counts in Table II sum to 1,634 rather than the stated 1,639, with the five-question discrepancy unexplained. These do not negate the central experiment, but they argue for reading the numerical tables rather than relying on broad superiority claims.

Bottom line: the strongest supported lesson is architectural: avoid ranking partially understood intermediate entities, and turn constraints into executable graph operations wherever possible. The reported benchmarks support both better answer sets and stronger execution grounding, especially on constrained questions—but not universal correctness or universal efficiency.

Closing platform note: For a context graph, this suggests a useful boundary: let language models propose relation paths, let a graph service execute them, and preserve an explicit record of whether the final answer was fully executed, partially synthesized, or recalled.