SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.15210 · NeurIPS · 2025

Deliberation on Priors: Trustworthy Reasoning of Large Language Models on Knowledge Graphs

Hongbin Pei, Pinghui Wang, Jing Tao, Jun Liu, Jie Ma, Lingyun Song, Ning Qu, Zhitao Gao, Rui Xing, Jiang Xie, Zhou Su

arXiv · PDF · Open in the Atlas

Code that ran

5 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 9 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their level, measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.15210.json · badge: /api/ran/2505.15210.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
mira-ai-lab/deliberation-on-priors canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
reml-group/deliberation-on-priors marked official in Papers with Code
Papers with Code archive
1 ran · 9 no recorded run
FunctionStatusWhere it lives
read_jsonl Ran
ran; our contract draft was wrong, not the code
mira-ai-lab/deliberation-on-priors/reasoning/instantiation.py
code served (permissive licence) · get_code("3d5343ae289698e8")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:24:19Z). If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import json
import os

# Create a temporary JSONL file with test data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.jsonl")

test_data = [
    {"id": 1, "text": "hello world"},
    {"id": 2, "text": "foo bar"},
    {"id": 3, "text": "test data"}
]

with open(temp_file, 'w', encoding='utf-8') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "file_path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unique_list_of_lists Ran
ran, honoured the contract we drafted
mira-ai-lab/deliberation-on-priors/reasoning/instantiation.py
code served (permissive licence) · get_code("1e11b1bf8e1981da")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:48:30Z). If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes a list of lists and returns unique sublists
# It converts each sublist to a tuple for hashability and deduplication

ARGS = {
    "lst": [
        [1, 2, 3],
        [4, 5, 6],
        [1, 2, 3],
        [7, 8, 9],
        [4, 5, 6]
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
chat_llm Ran
ran; our contract draft was wrong, not the code
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("c9255be856cbdcd6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from unittest.mock import Mock
from openai import OpenAI

# Create a mock OpenAI client
client = Mock(spec=OpenAI)

# Create a mock response object with the expected structure
mock_message = Mock()
mock_message.content = "Knowledge graphs are powerful for reasoning tasks."

mock_choice = Mock()
mock_choice.message = mock_message

mock_usage = Mock()
mock_usage.prompt_tokens = 10
mock_usage.completion_tokens = 15
mock_usage.total_tokens = 25

mock_response = Mock()
mock_response.choices = [mock_choice]
mock_response.usage = mock_usage

# Configure the client's chat.completions.create method to return our mock response
client.chat.completions.create = Mock(return_value=mock_response)

# Define arguments for the function
ARGS = {
    'client': client,
    'model': 'gpt-3.5-turbo',
    'input': 'What is a knowledge graph?'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_possible_endpoints Ran
ran, honoured the contract we drafted
mira-ai-lab/deliberation-on-priors/reasoning/instantiation.py
code served (permissive licence) · get_code("d541befd0d18141c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Build a small graph structure that matches what the function expects
# The graph is a dict where keys are nodes and values are dicts of neighbors
# Each neighbor has an 'attr' dict that may contain 'relations'

graph = {
    "entity_A": {
        "entity_B": {"relations": ["relation_1", "relation_2"]},
        "entity_C": {"relations": ["relation_3"]},
    },
    "entity_B": {
        "entity_D": {"relations": ["relation_1"]},
        "entity_E": {"relations": ["relation_2", "relation_4"]},
    },
    "entity_C": {
        "entity_F": {"relations": ["relation_3"]},
    },
    "entity_D": {
        "entity_G": {"relations": ["relation_1"]},
    },
    "entity_E": {
        "entity_H": {"relations": ["relation_2"]},
    },
    "entity_F": {},
    "entity_G": {},
    "entity_H": {},
}

# Start nodes - these should be in the graph
start_node = ["entity_A"]

# Relation path - a sequence of relations to follow through the graph
relation = ["relation_1", "relation_1"]

ARGS = {
    "graph": graph,
    "start_node": start_node,
    "relation": relation,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_data Ran
ran; our contract draft was wrong, not the code
mira-ai-lab/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("2fad8c014befa093")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct the data dictionary with all required keys
data = {
    'question': 'What is the capital of France?',
    'q_entity': ['France', 'capital'],
    'is_instance': [1, 0, 1],  # Mix of 1s and 0s to test filtering
    'gen_rel_paths': [
        [('relation1', 'entity1')],
        [('relation2', 'entity2')],
        [('relation3', 'entity3')]
    ],
    'reasoning_tree': [
        [[['France', 'type1']], [('rel1', 'Paris')]],
        [[['Germany', 'type2']], [('rel2', 'Berlin')]],
        [[['Spain', 'type3']], [('rel3', 'Madrid')]]
    ],
    'a_entity': ['Paris']
}

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
answer_trying Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("de4e81515c073cf7")
How it ran

no invocation recorded.

constraint_extract Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("77154254149468e7")
How it ran

no invocation recorded.

llms_only_answering Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("3a8571bfeb3b11f7")
How it ran

no invocation recorded.

log_error Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("b52a4c4d3f2af70d")
How it ran

no invocation recorded.

log_function_call Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("fda81d888ca408ec")
How it ran

no invocation recorded.

log_ground_truth Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("3c8242558bdffcf8")
How it ran

no invocation recorded.

log_llm_calls Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("49dd4a41475a6c0f")
How it ran

no invocation recorded.

reasoning_by_multi_agent Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("73d42c7cfa0dafbe")
How it ran

no invocation recorded.

select_path Not yet run
unverified (harvested, no recorded run)
reml-group/deliberation-on-priors/reasoning/introspection.py
code served (permissive licence) · get_code("43a5e6e045f0a363")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
read_jsonl 2 other papers
1 dated earlier, 1 later
2405.11874 (2024-05)
xFinder: Large Language Models as Automated Evaluators for Reliable Evaluation
2604.27998 (2026-04)
Latent-GRPO: Group Relative Policy Optimization for Latent Reasoning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Knowledge graph-based retrieval-augmented generation seeks to mitigate hallucinations in Large Language Models (LLMs) caused by insufficient or outdated knowledge. However, existing methods often fail to fully exploit the prior knowledge embedded in knowledge graphs (KGs), particularly their structural information and explicit or implicit constraints. The former can enhance the faithfulness of LLMs' reasoning, while the latter can improve the reliability of response generation. Motivated by these, we propose a trustworthy reasoning framework, termed Deliberation over Priors (DP), which sufficiently utilizes the priors contained in KGs. Specifically, DP adopts a progressive knowledge distillation strategy that integrates structural priors into LLMs through a combination of supervised fine-tuning and Kahneman-Tversky optimization, thereby improving the faithfulness of relation path generation. Furthermore, our framework employs a reasoning-introspection strategy, which guides LLMs to perform refined reasoning verification based on extracted constraint priors, ensuring the reliability of response generation. Extensive experiments on three benchmark datasets demonstrate that DP achieves new state-of-the-art performance, especially a H@1 improvement of 13% on the Com-plexWebQuestions dataset, and generates highly trustworthy responses. We also conduct various analyses to verify its flexibility and practicality. Code is available at https://github.com/mira-ai-lab/Deliberation-on-Priors. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.15210")
get_code_for_paper("2505.15210")
have("2505.15210")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.15210.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.15210.svg)](https://syntology.ai/paper/2505.15210)

Connect an agent — have() is free.