SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.14211 · 2024

Paths-over-Graph: Knowledge Graph Empowered Large Language Model Reasoning

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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; 0 honoured the contract we drafted, 2 violated it and 7 have no contract verdict; 0 failures of our instrument; 3 no recorded run), 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/2410.14211.json · badge: /api/ran/2410.14211.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
SteveTANTAN/PoG community (classifier label)
classifier basis not recorded on the link
9 ran · 3 no recorded run
FunctionStatusWhere it lives
abandon_rels Ran
ran, violated the contract we drafted
SteveTANTAN/PoG/PoG/freebase_func.py
code served (permissive licence) · get_code("8efd8b00e5ee004a")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

def abandon_rels(relation):
    if relation == 'type.object.type' or relation == 'type.object.name' or relation.startswith('common.') or relation.startswith('freebase.') or ('sameAs' in relation):
        return True

ARGS = {
    'relation': 'type.object.type'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
check_end_word Ran
ran, violated the contract we drafted
SteveTANTAN/PoG/PoG/freebase_func.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from IDEA-FinAI/ToG, is pointer only (licence: NONE) · get_code("ffbc2c4b715e9ad2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from IDEA-FinAI/ToG, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

check_in_path Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/check_answer.py
code served (permissive licence) · get_code("d1b8a0d48a7da6f9")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 check_in_path iterates through paths and checks if any answer
# from answer_list is contained in each path. It works with strings/sequences.

paths = [
    "user/documents/file.txt",
    "home/admin/config",
    "var/log/system.log"
]

answer_list = [
    "documents",
    "admin",
    "tmp"
]

ARGS = {
    "paths": paths,
    "answer_list": answer_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
entity_need_explore Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/subgraph_utilts.py
code served (permissive licence) · get_code("f04904e3d891cf41")
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 list, 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 collections import defaultdict

# Analyze the function:
# - topic_entity: a dict, we check if entity is in .values()
# - path_list: passed but never used in the function
# - high_sub_entities: iterable of tuples (entity1, entity2, similarity)
#   where similarity is comparable/numeric

# Construct valid arguments
topic_entity = {
    "topic_1": "entity_A",
    "topic_2": "entity_B",
}

path_list = [
    ["path_1", "path_2"],
    ["path_3", "path_4"],
]

high_sub_entities = [
    ("entity_C", "entity_D", 0.95),
    ("entity_E", "entity_F", 0.87),
    ("entity_A", "entity_G", 0.92),  # entity_A is in topic_entity.values(), should be skipped
    ("entity_H", "entity_I", 0.78),
    ("entity_C", "entity_C", 0.99),  # self-similarity case
]

ARGS = {
    "topic_entity": topic_entity,
    "path_list": path_list,
    "high_sub_entities": high_sub_entities,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
extract_entities Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/PoG_multi.py
code served (permissive licence) · get_code("76234c3134b81ef7")
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 list, 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.

import re

def extract_entities(text):
    match = re.search('entities:\\s*{([^}]*)}', text)
    if match:
        entities_str = match.group(1)
        entities_list = [entity.strip() for entity in entities_str.split(',')]
        return entities_list
    return []

# Setup code
text_with_entities = "Here are entities: {apple, banana, cherry}"

ARGS = {
    'text': text_with_entities
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
extract_top_list Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/PoG_multi.py
code served (permissive licence) · get_code("6fb549457e334782")
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 list, ndim 1, dtype family int; 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.

import re

def extract_top_list(text):
    """Extracts the top 3 paths from a given text.

    Args:
    text: The input text containing the top_list dictionary.

    Returns:
    A list of the top 3 paths.
    """
    match = re.search('ist:\\s*\\{([^}]+)\\}', text)
    if not match:
        return []
    top_list_str = match.group(1)
    numbers = re.findall('\\b\\d+\\b', top_list_str)
    return list(map(int, numbers))
    match = re.search('top_entity:\\s*\\{([^}]+)\\}', text)
    if match is None:
        return []
    exploration_required_content = match.group(1)
    entity_ids = re.findall('m\\.\\w+', exploration_required_content)
    return entity_ids

# The function takes a single parameter: text (a string)
# It uses re.search to find patterns in the text
# The function looks for 'ist:\\s*\\{([^}]+)\\}' pattern
# and extracts numbers from the matched content

text_input = "ist: {10 20 30 40} some other content"

ARGS = {
    "text": text_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
format Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/freebase_func.py
code served (permissive licence) · get_code("4b8d1e745df21f90")
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 str. 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

torch.manual_seed(0)

ARGS = {
    "entity_id": "entity_001"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
load_from_large_db Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/subgraph_utilts.py
code served (permissive licence) · get_code("2506a6cd6f20658c")
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 dict. 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 pickle
import sqlite3
import tempfile
import os

# Create a temporary database with test data
temp_dir = tempfile.mkdtemp()
db_path = os.path.join(temp_dir, 'test.db')

# Set up the database with a test table and data
conn = sqlite3.connect(db_path)
cursor = conn.cursor()
cursor.execute('''
    CREATE TABLE subgraphs (
        question_id INTEGER,
        chunk_index INTEGER,
        data BLOB
    )
''')

# Create test data to pickle
test_data = {
    'key1': 'value1',
    'key2': [1, 2, 3],
    'key3': {'nested': 'dict'}
}

# Pickle the data and split it into chunks
pickled_data = pickle.dumps(test_data)
chunk_size = 10
chunks = [pickled_data[i:i+chunk_size] for i in range(0, len(pickled_data), chunk_size)]

# Insert chunks into database
for idx, chunk in enumerate(chunks):
    cursor.execute(
        'INSERT INTO subgraphs (question_id, chunk_index, data) VALUES (?, ?, ?)',
        (1, idx, chunk)
    )

conn.commit()
conn.close()

# Define the arguments
ARGS = {
    'db_path': db_path,
    'question_id': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
retry_operation Ran
ran on a synthesized input
SteveTANTAN/PoG/PoG/subgraph_utilts.py
code served (permissive licence) · get_code("32b462cabe595aae")
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 function. 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 sqlite3
import time
import tempfile
import os

# Create a simple function to decorate for testing
def sample_db_operation(db_path):
    """A simple database operation function."""
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    cursor.execute("CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, value TEXT)")
    cursor.execute("INSERT INTO test (value) VALUES ('test_data')")
    conn.commit()
    conn.close()
    return "Success"

# Create a temporary database file
temp_db = tempfile.NamedTemporaryFile(delete=False, suffix='.db')
db_path = temp_db.name
temp_db.close()

try:
    # Test the decorator
    from retry_operation import retry_operation
except ImportError:
    # Define retry_operation locally if not available
    def retry_operation(func):
        """Decorator to retry database operations."""
        def wrapper(*args, **kwargs):
            attempts = 0
            max_retries = kwargs.pop('max_retries', 300)
            wait_time = kwargs.pop('wait_time', 6)
            while attempts < max_retries:
                try:
                    return func(*args, **kwargs)
                except sqlite3.OperationalError as e:
                    if 'database is locked' in str(e):
                        print(f'Database is locked, retrying in {wait_time} seconds...')
                        time.sleep(wait_time)
                        attempts += 1
                    else:
                        print('An error occurred:', e)
                        break
            print('Failed after several attempts.')
            return None
        return wrapper

# The retry_operation function takes a single parameter: func
# It is a decorator, so func should be a callable function
@retry_operation
def decorated_db_operation(db_path):
    """Database operation decorated with retry logic."""
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    cursor.execute("SELECT 1")
    conn.close()
    return "DB operation successful"

# ARGS dictionary for the retry_operation decorator
# The decorator is applied to a function, so we need to provide a function
ARGS = {
    'func': lambda db_path=db_path: decorated_db_operation(db_path)
}

# Clean up
try:
    os.unlink(db_path)
except:
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
retry_operation — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
count_tokens Not yet run
unverified (harvested, no recorded run)
SteveTANTAN/PoG/PoG/utils.py
code served (permissive licence) · get_code("dcb9359b01d13cbe")
How it ran

no invocation recorded.

num_tokens_from_string Not yet run
unverified (harvested, no recorded run)
SteveTANTAN/PoG/PoG/PoG_multi.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from TrustAIRLab/Comprehensive_Jailbreak_Assessment, is pointer only (licence: NONE) · get_code("51dbd68f4d5aba9e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from TrustAIRLab/Comprehensive_Jailbreak_Assessment, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_dataset Not yet run
unverified (harvested, no recorded run)
SteveTANTAN/PoG/PoG/utils.py
code served (permissive licence) · get_code("68fca283c8ee65c1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 1 later) and 9 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
abandon_rels 3 other papers
1 dated earlier, 1 the same month, 1 later
2307.07697 (2023-07)
Think-on-Graph: Deep and Responsible Reasoning of Large Language Model on Knowledge Graph
2410.23875 (2024-10)
Plan-on-Graph: Self-Correcting Adaptive Planning of Large Language Model on Knowledge Graphs
2601.11047 (2026-01)
CoG: Controllable Graph Reasoning via Relational Blueprints and Failure-Aware Refinement over Knowledge Graphs
num_tokens_from_string 2 other papers
2 dated earlier
2402.05668 (2024-02)
JailbreakRadar: Comprehensive Assessment of Jailbreak Attacks Against LLMs
2404.04960 (2024-04)
PairAug: What Can Augmented Image-Text Pairs Do for Radiology?
check_end_word 1 other paper
1 dated earlier
2307.07697 (2023-07)
Think-on-Graph: Deep and Responsible Reasoning of Large Language Model on Knowledge Graph

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

Large Language Models (LLMs) have achieved impressive results in various tasks but struggle with hallucination problems and lack of relevant knowledge, especially in deep complex reasoning and knowledge-intensive tasks. Knowledge Graphs (KGs), which capture vast amounts of facts in a structured format, offer a reliable source of knowledge for reasoning. However, existing KG-based LLM reasoning methods face challenges like handling multi-hop reasoning, multi-entity questions, and effectively utilizing graph structures. To address these issues, we propose Paths-over-Graph (PoG), a novel method that enhances LLM reasoning by integrating knowledge reasoning paths from KGs, improving the interpretability and faithfulness of LLM outputs. PoG tackles multi-hop and multi-entity questions through a three-phase dynamic multi-hop path exploration, which combines the inherent knowledge of LLMs with factual knowledge from KGs. In order to improve the efficiency, PoG prunes irrelevant information from the graph exploration first and introduces efficient three-step pruning techniques that incorporate graph structures, LLM prompting, and a pre-trained language model (e.g., SBERT) to effectively narrow down the explored candidate paths. This ensures all reasoning paths contain highly relevant information captured from KGs, making the reasoning faithful and interpretable in problem-solving. PoG innovatively utilizes graph structure to prune the irrelevant noise and represents the first method to implement multi-entity deep path detection on KGs for LLM reasoning tasks. Comprehensive experiments on five benchmark KGQA datasets demonstrate PoG outperforms the state-of-the-art method ToG across GPT-3.5-Turbo and GPT-4, achieving an average accuracy improvement of 18.9%. Notably, PoG with GPT-3.5-Turbo surpasses ToG with GPT-4 by up to 23.9%.

For agents

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

get_harvested_code_for_paper("2410.14211")
get_code_for_paper("2410.14211")
have("2410.14211")

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

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

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

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

Connect an agent — have() is free.