SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.11747 · EMNLP · 2023

HaluEval: A Large-Scale Hallucination Evaluation Benchmark for Large Language Models

Junyi Li, Ji-Rong Wen, Wayne Zhao, Jian-Yun Nie, Xiaoxue Cheng

arXiv · PDF · Open in the Atlas

Code that ran

8 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, 0 violated it and 5 have no contract verdict; 3 failures of our instrument; 4 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/2305.11747.json · badge: /api/ran/2305.11747.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
rucaibox/helma canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
RUCAIBox/HaluEval canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
get_dialogue_res Ran
ran on a synthesized input
rucaibox/helma/generation/filtering.py
code served (permissive licence) · get_code("f698390b537e4d97")
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 openai
import time

# Mock the openai module to avoid actual API calls
class MockChatCompletion:
    @staticmethod
    def create(model, messages, temperature, max_tokens):
        return {
            'choices': [
                {
                    'message': {
                        'content': 'The best response is Response 1.'
                    }
                }
            ]
        }

# Replace the actual openai.ChatCompletion with our mock
openai.ChatCompletion = MockChatCompletion

# Define the arguments for the function
ARGS = {
    'knowledge': 'The Earth orbits the Sun. The Moon orbits the Earth.',
    'dialog': 'User: What celestial bodies do you know about?\nAssistant: I know about the Sun, Earth, and Moon.',
    'response1': 'The Sun is a star at the center of our solar system.',
    'response2': 'The Moon is made of green cheese.',
    'instruction': 'Please evaluate which response is more accurate and helpful based on the provided knowledge and dialogue history.'
}
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 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
get_dialogue_res Ran
ran on a synthesized input
rucaibox/helma/generation/generate.py
code served (permissive licence) · get_code("211e2e141467c8dd")
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 openai
import time

# Mock the openai module since we can't make real API calls
class MockOpenAI:
    class error:
        class RateLimitError(Exception):
            pass
        class ServiceUnavailableError(Exception):
            pass
        class Timeout(Exception):
            pass
        class APIError(Exception):
            pass
        class APIConnectionError(Exception):
            pass
    
    @staticmethod
    def ChatCompletion_create(model, messages, temperature, max_tokens, top_p):
        # Return a mock response structure
        return {
            'choices': [
                {
                    'message': {
                        'content': 'This is a hallucinated response generated by the model.'
                    }
                }
            ]
        }

# Patch openai module
openai.ChatCompletion.create = MockOpenAI.ChatCompletion_create

# Define arguments for get_dialogue_res
knowledge = "The Earth orbits the Sun. The Moon orbits the Earth."
dialog = "User: What orbits the Earth?\nAssistant: The Moon orbits the Earth."
response = "The Moon is Earth's natural satellite and orbits our planet."
instruction_str = "Generate a hallucinated response that contradicts the knowledge base."

ARGS = {
    'knowledge': knowledge,
    'dialog': dialog,
    'response': response,
    'instruction': instruction_str
}
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 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
get_dialogue_response Ran
ran on a synthesized input
rucaibox/helma/evaluation/evaluate.py
code served (permissive licence) · get_code("bf66b0debbe71c7e")
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 openai
import time

# Mock the openai module to avoid actual API calls
class MockOpenAI:
    class error:
        class RateLimitError(Exception):
            pass
        class ServiceUnavailableError(Exception):
            pass
        class Timeout(Exception):
            pass
        class APIError(Exception):
            pass
        class APIConnectionError(Exception):
            pass
    
    @staticmethod
    def ChatCompletion_create(model, messages, temperature):
        return {
            'choices': [
                {
                    'message': {
                        'content': 'Yes'
                    }
                }
            ]
        }
    
    @staticmethod
    def Completion_create(model, prompt, temperature):
        return {
            'choices': [
                {
                    'text': 'No'
                }
            ]
        }

# Replace openai module methods
openai.ChatCompletion.create = MockOpenAI.ChatCompletion_create
openai.Completion.create = MockOpenAI.Completion_create
openai.error = MockOpenAI.error

# Define arguments for get_dialogue_response function
ARGS = {
    'model': 'gpt-3.5-turbo',
    'dialog': 'User: What is the capital of France?\nAssistant: Paris is the capital of France.',
    'response': 'Yes, Paris is indeed the capital of France and is located in the north-central part of the country.',
    'instruction': 'Determine if the response contains factual information based on the dialogue history.'
}
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 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
get_qa_res Ran
ran on a synthesized input
rucaibox/helma/generation/generate.py
code served (permissive licence) · get_code("409dd3a84718a20b")
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 openai
import time

# Mock the openai module to avoid actual API calls
class MockChatCompletion:
    @staticmethod
    def create(model, messages, temperature, max_tokens, top_p):
        return {
            'choices': [
                {
                    'message': {
                        'content': 'This is a hallucinated answer generated by the mock.'
                    }
                }
            ]
        }

# Replace the real openai.ChatCompletion with our mock
openai.ChatCompletion = MockChatCompletion

# Define test arguments
knowledge = "The Earth orbits around the Sun. The Moon orbits around the Earth."
question = "What does the Moon orbit around?"
answer = "The Moon orbits around the Earth."
instruction_str = "You are a QA system. Generate a response based on the provided knowledge, question, and answer."
instruction_list = [
    {'role': 'system', 'content': 'You are a helpful assistant.'},
    {'role': 'user', 'content': 'Previous context here.'}
]

ARGS = {
    'knowledge': knowledge,
    'question': question,
    'answer': answer,
    'instruction': instruction_str
}
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 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
get_qa_response Ran
ran on a synthesized input
rucaibox/helma/evaluation/evaluate.py
code served (permissive licence) · get_code("71b0706abb4deccb")
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 openai
import time

# Mock the openai module to avoid actual API calls
class MockOpenAI:
    class error:
        class RateLimitError(Exception):
            pass
        class ServiceUnavailableError(Exception):
            pass
        class Timeout(Exception):
            pass
        class APIError(Exception):
            pass
        class APIConnectionError(Exception):
            pass
    
    @staticmethod
    def ChatCompletion_create(model, messages, temperature):
        return {
            'choices': [
                {
                    'message': {
                        'content': 'Yes'
                    }
                }
            ]
        }
    
    @staticmethod
    def Completion_create(engine, prompt, temperature):
        return {
            'choices': [
                {
                    'text': ' Yes'
                }
            ]
        }

# Replace openai module with mock
openai.ChatCompletion.create = MockOpenAI.ChatCompletion_create
openai.Completion.create = MockOpenAI.Completion_create
openai.error = MockOpenAI.error

ARGS = {
    'model': 'gpt-3.5-turbo',
    'question': 'What is the capital of France?',
    'answer': 'The capital of France is Paris, a major city in Europe.',
    'instruction': 'Determine if the answer contains any hallucinations or false information.'
}
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 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_dialog Ran
ran; our contract draft was wrong, not the code
RUCAIBox/HaluEval/analysis/analyze.py
code served (permissive licence) · get_code("295b8779d73be38d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 tempfile
import json
import os

# Create a temporary file with sample dialog data
temp_file = tempfile.NamedTemporaryFile(mode='w', encoding='utf-8', delete=False, suffix='.jsonl')

# Write sample data in the expected format
samples = [
    {
        'knowledge': 'The sky is blue.',
        'dialogue_history': 'User: What color is the sky?',
        'ground_truth': 'Yes',
        'judgement': 'Yes'
    },
    {
        'knowledge': 'Water boils at 100C.',
        'dialogue_history': 'User: At what temperature does water boil?',
        'ground_truth': 'Yes',
        'judgement': 'No'
    },
    {
        'knowledge': 'Paris is the capital of France.',
        'dialogue_history': 'User: What is the capital of France?',
        'ground_truth': 'No',
        'judgement': 'No'
    },
    {
        'knowledge': 'The Earth orbits the Sun.',
        'dialogue_history': 'User: Does the Earth orbit the Sun?',
        'ground_truth': 'Yes',
        'judgement': 'Yes'
    }
]

for sample in samples:
    temp_file.write(json.dumps(sample) + '\n')

temp_file.close()

ARGS = {
    'filename': temp_file.name
}
Setup block drafted by
a language model, Claude Sonnet 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 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
load_qa Ran
ran; our contract draft was wrong, not the code
RUCAIBox/HaluEval/analysis/analyze.py
code served (permissive licence) · get_code("73f3dd95883037cc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 tempfile
import json
import os

# Create a temporary file with sample JSONL data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl', encoding='utf-8')

# Write sample data
samples = [
    {
        'knowledge': 'The sky is blue.',
        'question': 'What color is the sky?',
        'ground_truth': 'Yes',
        'judgement': 'Yes'
    },
    {
        'knowledge': 'Water boils at 100 degrees Celsius.',
        'question': 'Does water boil at 100C?',
        'ground_truth': 'Yes',
        'judgement': 'No'
    },
    {
        'knowledge': 'The Earth orbits the Sun.',
        'question': 'Does the Earth orbit the Sun?',
        'ground_truth': 'No',
        'judgement': 'Yes'
    },
    {
        'question': 'What is the capital of France?',
        'ground_truth': 'Yes',
        'judgement': 'Yes'
    }
]

for sample in samples:
    temp_file.write(json.dumps(sample) + '\n')

temp_file.close()

ARGS = {'filename': temp_file.name}
Setup block drafted by
a language model, Claude Sonnet 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 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
load_summary Ran
ran; our contract draft was wrong, not the code
RUCAIBox/HaluEval/analysis/analyze.py
code served (permissive licence) · get_code("3bd42cb5b14b2cad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 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 json
import tempfile
import os

# Create a temporary file with sample JSONL data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8', suffix='.jsonl')

# Write sample data
samples = [
    {"summary": "This is summary 1", "ground_truth": "Yes", "judgement": "Yes"},
    {"summary": "This is summary 2", "ground_truth": "Yes", "judgement": "No"},
    {"summary": "This is summary 3", "ground_truth": "No", "judgement": "No"},
    {"summary": "This is summary 4", "ground_truth": "Yes", "judgement": "No"},
    {"other_field": "no summary here", "ground_truth": "Yes", "judgement": "Yes"},
]

for sample in samples:
    temp_file.write(json.dumps(sample) + '\n')

temp_file.close()

ARGS = {
    'filename': temp_file.name
}
Setup block drafted by
a language model, Claude Sonnet 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 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
get_qa_res Not yet run
unverified (harvested, no recorded run)
rucaibox/helma/generation/filtering.py
code served (permissive licence) · get_code("57cf187fae039bc2")
How it ran

no invocation recorded.

get_summarization_res Not yet run
unverified (harvested, no recorded run)
rucaibox/helma/generation/filtering.py
code served (permissive licence) · get_code("be0c5c938e7e424c")
How it ran

no invocation recorded.

get_summarization_res Not yet run
unverified (harvested, no recorded run)
rucaibox/helma/generation/generate.py
code served (permissive licence) · get_code("f92a9ea55882aef2")
How it ran

no invocation recorded.

num_tokens_from_message Not yet run
unverified (harvested, no recorded run)
rucaibox/helma/evaluation/evaluate.py
pointer only (licence: MIT); the stored copy get_code serves, from voidism/lookback-lens, is pointer only (licence: NONE) · get_code("b3a67ee5030c2ffe")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from voidism/lookback-lens, 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.

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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
num_tokens_from_message 2 other papers
2 later
2401.05930 (2024-01)
SH2: Self-Highlighted Hesitation Helps You Decode More Truthfully
2407.07071 (2024-07)
Lookback Lens: Detecting and Mitigating Contextual Hallucinations in Large Language Models Using Only Attention Maps

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), such as Chat-GPT, are prone to generate hallucinations, i.e., content that conflicts with the source or cannot be verified by the factual knowledge. To understand what types of content and to which extent LLMs are apt to hallucinate, we introduce the Hallucination Evaluation benchmark for Large Language Models (HaluEval), a large collection of generated and human-annotated hallucinated samples for evaluating the performance of LLMs in recognizing hallucination. To generate these samples automatically, we propose a two-stage framework, i.e., samplingthen-filtering. Besides, we hire some human labelers to annotate the hallucinations in Chat-GPT responses. The empirical results suggest that ChatGPT is likely to generate hallucinated content related to specific topics by fabricating unverifiable information (i.e., about 19.5% responses). Moreover, existing LLMs face great challenges in recognizing the hallucinations in texts. However, our experiments also prove that providing external knowledge or adding reasoning steps can help LLMs recognize hallucinations. Our benchmark can be accessed at https://github.com/RUCAIBox/HaluEval. * Equal contributions † Corresponding author ChatGPT There is no definitive answer to this question as "the oldest photo of a cat" is subjective and varies based on different sources and definitions. However, one candidate for the oldest cat photo is the daguerreotype "Cat with Blue Ribbon," taken by photographer Antoine Claudet in 1840. The photo depicts a cat sitting on a table, gazing directly at the camera, and wearing a blue ribbon tied around its neck.

For agents

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

get_harvested_code_for_paper("2305.11747")
get_code_for_paper("2305.11747")
have("2305.11747")

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

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

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

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

Connect an agent — have() is free.