SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.00942 · 2024

Evaluating the Factuality of Large Language Models using Large-Scale Knowledge Graphs

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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, 0 violated it and 0 have no contract verdict; 7 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/2404.00942.json · badge: /api/ran/2404.00942.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
xz-liu/grapheval canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
add_system_prompt Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/data_gen/llm_clients.py
code served (permissive licence) · get_code("6226e3dad016f9d2")
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)

# The function add_system_prompt takes:
# - question: str (required)
# - model_type: str or None (optional, defaults to None)
#
# The function uses these parameters by:
# - question: concatenated into strings
# - model_type: compared against string literals 'llama', 'gemma', 'chatgpt'
#
# We need to provide valid string arguments

ARGS = {
    'question': 'What is the capital of France?',
    'model_type': 'llama'
}
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
default_construct_instruct Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/data_gen/data_generator.py
code served (permissive licence) · get_code("a6c195c9c89ceadf")
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)

question = "What is the capital of France?"
option_str = "A) London\nB) Berlin\nC) Paris\nD) Madrid\nE) None of the above"

ARGS = {
    "question": question,
    "option_str": option_str
}
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
judge_construct_instruct Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/data_gen/data_generator.py
code served (permissive licence) · get_code("119ea02d1a7381e8")
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 = {
    "question": "The Earth orbits around the Sun.",
    "option_str": "Yes"
}
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
judge_label_transform Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/data_gen/data_generator.py
code served (permissive licence) · get_code("a4b513b497aa558a")
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 re

def judge_label_transform(answer, false_statement=False):
    print('-----------------')
    print('Set answer: ', answer)
    answer = re.sub('[^\\w\\s]', '', answer)
    answer = answer.split()
    answer = set(answer)
    final_label = 'E'
    if 'true' in answer or 'Yes' in answer:
        if false_statement:
            final_label = 'F'
        else:
            final_label = 'T'
    elif 'false' in answer or 'No' in answer:
        if false_statement:
            final_label = 'T'
        else:
            final_label = 'F'
    else:
        final_label = 'E'
    print('Set answer: ', answer)
    print('Set final label: ', final_label)
    print('Set false_statement: ', false_statement)
    print('-----------------')
    return final_label


ARGS = {
    'answer': 'Yes, that is true!',
    'false_statement': False
}
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 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
trained_clf_path Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/args/config.py
code served (permissive licence) · get_code("a767c526ef6de6f0")
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 os
import torch
import torch.nn as nn


# Create a minimal args object with the required attributes
class Args:
    def __init__(self):
        self.answer_cache_dir = '/tmp/answer_cache'
        self.which = 'test_classifier'


args = Args()

# Define arguments for trained_clf_path function
ARGS = {
    'model_name': 'resnet50',
    'test_case_name': 'validation_set',
    'cache_dir': '/tmp/answer_cache',
    'which': 'test_classifier'
}
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
trained_prompt_encoder_path Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/args/config.py
code served (permissive licence) · get_code("c0de8d188874159b")
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 os

# Create a minimal args object that the function depends on
class ArgsStandIn:
    def __init__(self):
        self.answer_cache_dir = '/tmp/cache'
        self.which = 'test_which'

args = ArgsStandIn()

ARGS = {
    'model_name': 'bert-base-uncased',
    'test_case_name': 'test_001',
    'cache_dir': '/tmp/cache',
    'which': 'test_which'
}
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 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
training_triples_path Ran
ran; our contract draft was wrong, not the code
xz-liu/grapheval/args/config.py
code served (permissive licence) · get_code("5392f7f93e7db6c3")
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 os
import torch
import torch.nn as nn

# Mock args object that the function depends on
class MockArgs:
    def __init__(self):
        self.answer_cache_dir = '/tmp/cache'
        self.which = 'train'

# Create global args instance
args = MockArgs()

# Define arguments for training_triples_path function
ARGS = {
    'model_name': 'bert-base-uncased',
    'test_case_name': 'test_001',
    'cache_dir': '/tmp/cache',
    'which': 'train'
}
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
prepare_pageview_based_triples Not yet run
unverified (harvested, no recorded run)
xz-liu/grapheval/data_gen/triple_sampler.py
code served (permissive licence) · get_code("ef1daf1476254943")
How it ran

no invocation recorded.

prepare_random_triples Not yet run
unverified (harvested, no recorded run)
xz-liu/grapheval/data_gen/triple_sampler.py
code served (permissive licence) · get_code("4cfdd6346fb4740a")
How it ran

no invocation recorded.

prepare_triples_based_on_entities Not yet run
unverified (harvested, no recorded run)
xz-liu/grapheval/data_gen/triple_sampler.py
code served (permissive licence) · get_code("0c87eb893d43e1cb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

The advent of Large Language Models (LLMs) has significantly transformed the AI landscape, enhancing machine learning and AI capabilities. Factuality issue is a critical concern for LLMs, as they may generate factually incorrect responses. In this paper, we propose GraphEval to evaluate an LLM's performance using a substantially large test dataset. Specifically, the test dataset is retrieved from a large knowledge graph with more than 10 million facts without expensive human efforts. Unlike conventional methods that evaluate LLMs based on generated responses, GraphEval streamlines the evaluation process by creating a judge model to estimate the correctness of the answers given by the LLM. Our experiments demonstrate that the judge model's factuality assessment aligns closely with the correctness of the LLM's generated outputs, while also substantially reducing evaluation costs. Besides, our findings offer valuable insights into LLM performance across different metrics and highlight the potential for future improvements in ensuring the factual integrity of LLM outputs. The code is publicly available at https://github.com/xz-liu/GraphEval.

For agents

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

get_harvested_code_for_paper("2404.00942")
get_code_for_paper("2404.00942")
have("2404.00942")

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

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

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

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

Connect an agent — have() is free.