SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.05093 · 2024

Order Matters in Hallucination: Reasoning Order as Benchmark and Reflexive Prompting for Large-Language-Models

arXiv · PDF · Open in the Atlas

Code that ran

11 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 11 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/2408.05093.json · badge: /api/ran/2408.05093.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
xiezikai/reflexiveprompting canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
generate_prompt Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/self_contradictory_comparison.py
code served (permissive licence) · get_code("a52bcb839042fe4e")
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.

ARGS = {
    'txt_file': {
        'prefix': 'The cat sat on the mat and',
        'triple': [['The', 'cat']]
    }
}
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 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
generate_prompt_bigbench Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_bigbench.py
code served (permissive licence) · get_code("4458b91a29c0bff8")
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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - Takes a dict 'data' as parameter
# - Accesses data['input'] (string)
# - Accesses data['target_scores'] (dict-like with .keys() method and len())
# - The function iterates through target_scores to build options

# Construct valid data dict
data = {
    'input': 'What is the capital of France?',
    'target_scores': {
        'Paris': 1.0,
        'London': 0.0,
        'Berlin': 0.0,
        'Madrid': 0.0
    }
}

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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, 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
generate_prompt_logiqa Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_logiqa.py
code served (permissive licence) · get_code("93e63c76186a7749")
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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - It takes a parameter 'data' which is a dictionary
# - The dict needs keys: 'text', 'question', 'options'
# - 'text' is a string (used in f-string)
# - 'question' is a string (used in f-string)
# - 'options' is an iterable/list that supports len() and indexing

data = {
    'text': 'The quick brown fox jumps over the lazy dog. This is a test context for the LogiQA dataset.',
    'question': 'What color is the fox?',
    'options': [
        'brown',
        'red',
        'black',
        'white'
    ]
}

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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, 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
generate_prompt_mmlu Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_mmlu.py
code served (permissive licence) · get_code("5fa2dca6449f4d11")
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.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "data": {
        "question": "What is the capital of France?",
        "choices": ["London", "Berlin", "Paris", "Madrid"]
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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, 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
generate_prompt_truthfulqa Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_truthfulqa.py
code served (permissive licence) · get_code("0164b085d9b5b165")
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.

import torch
import torch.nn as nn

# Construct the data dict with the expected structure
data = {
    'question': 'What is the capital of France?',
    'mc1_targets': {
        'choices': [
            'Paris',
            'London',
            'Berlin',
            'Madrid'
        ]
    }
}

ARGS = {
    'data': data
}
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 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
generate_review_prompt_bigbench Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_bigbench.py
code served (permissive licence) · get_code("404b38fae85eae6b")
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)

# Construct the data dict required by generate_review_prompt_bigbench
data = {
    'input': 'What is the capital of France?',
    'target_scores': {
        'Paris': 1.0,
        'London': 0.0,
        'Berlin': 0.0,
        'Madrid': 0.0
    }
}

# Construct result strings as they would be returned from the function
result1 = 'The logic is that France is a country in Western Europe. The capital of France is Paris. Therefore, the answer is {0}.'

result2 = 'The answer is {0}. Paris is the capital of France, which is located in Western Europe.'

ARGS = {
    'data': data,
    'result1': result1,
    'result2': result2
}
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
generate_review_prompt_logiqa Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_logiqa.py
code served (permissive licence) · get_code("e279c0cd745747e9")
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)

# Construct the data dict required by generate_review_prompt_logiqa
data = {
    'text': 'The cat sat on the mat and looked out the window. It was a sunny day.',
    'question': 'Where was the cat sitting?',
    'options': [
        'On the floor',
        'On the mat',
        'On the table',
        'On the chair'
    ]
}

# Construct result1 and result2 as strings representing model outputs
result1 = 'The correct option is {1}. The cat sat on the mat as stated in the context.'

result2 = 'According to the context, the cat was sitting on the mat. Therefore, the answer is {1}.'

# Define ARGS mapping all parameters
ARGS = {
    'data': data,
    'result1': result1,
    'result2': result2
}
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
generate_review_prompt_truthfulqa Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_mmlu.py
code served (permissive licence) · get_code("0a1438ac13b9c397")
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
import numpy as np

torch.manual_seed(0)

# Create a sample data dict with the structure expected by generate_prompt_mmlu
data = {
    'question': 'What is the capital of France?',
    'choices': ['London', 'Berlin', 'Paris', 'Madrid']
}

# Create sample results from two different answer attempts
result1 = """The capital of France is Paris. This is a well-known fact as Paris has been the capital city of France for centuries and is the largest city in France. {2}"""

result2 = """Let me think about this step by step. France is a country in Western Europe. The major cities include Paris, Lyon, and Marseille. Paris is the largest city and serves as the capital. Therefore the answer is {2}"""

ARGS = {
    'data': data,
    'result1': result1,
    'result2': result2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
get_reasoning_data_bigbench Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils_bigbench.py
code served (permissive licence) · get_code("c89f00b344150505")
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 json
import os
import tempfile

# Create a temporary directory and file for the test
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data')
os.makedirs(data_dir, exist_ok=True)

# Create a mock bigbench_task.json file
mock_data = {
    'examples': [
        {'input': 'What is 2+2?', 'output': '4'},
        {'input': 'What is 3+3?', 'output': '6'},
        {'input': 'What is 4+4?', 'output': '8'},
        {'input': 'What is 5+5?', 'output': '10'},
    ]
}

json_path = os.path.join(data_dir, 'bigbench_task.json')
with open(json_path, 'w') as f:
    json.dump(mock_data, f)

# Change to temp directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'start': 0
}
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
read_txt_file Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/self_contradictory_comparison.py
code served (permissive licence) · get_code("8baf7ca3db1e6bbd")
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 json
import tempfile
import os

# Create a temporary JSON file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.json")

# Write valid JSON data to the temporary file
test_data = {"key": "value", "number": 42, "list": [1, 2, 3]}
with open(temp_file, 'w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    "file_path": temp_file
}
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
result_correction Ran
ran; our contract draft was wrong, not the code
xiezikai/reflexiveprompting/utils.py
code served (permissive licence) · get_code("9a661f243d6318b2")
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 result_correction(result):
    """
    Detect different bracket symbol and 'None of above' results for LLM outputs
    """
    first_sentence = result.split('\n')[0]
    last_sentence = result.split('\n')[-2]
    pattern1 = '\\(\\d\\)'
    pattern2 = '\\d\\)'
    last_sentence_matching_1 = re.findall(pattern1, last_sentence)
    last_sentence_matching_2 = re.findall(pattern2, last_sentence)
    first_sentence_matching_1 = re.findall(pattern1, first_sentence)
    first_sentence_matching_2 = re.findall(pattern2, first_sentence)
    if len(last_sentence_matching_1) > 0:
        return last_sentence_matching_1[0][1]
    elif len(last_sentence_matching_2) > 0:
        return last_sentence_matching_2[0][0]
    elif len(first_sentence_matching_1) > 0:
        return first_sentence_matching_1[0][1]
    elif len(first_sentence_matching_2) > 0:
        return first_sentence_matching_2[0][0]
    return 9


# Test case 1: result with (digit) pattern in last sentence
result_1 = "Some initial text\nMiddle line\nThe answer is (3)\n"

# Test case 2: result with digit) pattern in first sentence
result_2 = "The correct option is 2)\nSome middle content\nFinal line\n"

# Test case 3: result with (digit) pattern in first sentence
result_3 = "Choose option (1)\nMiddle content\nEnd\n"

# Test case 4: result with no matching patterns
result_4 = "Just some text\nNo brackets here\nMore text\n"

ARGS = {
    "result": result_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 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_reasoning_data_logiqa Not yet run
unverified (harvested, no recorded run)
xiezikai/reflexiveprompting/utils_logiqa.py
code served (permissive licence) · get_code("8661f4d51670c645")
How it ran

no invocation recorded.

get_reasoning_data_mmlu Not yet run
unverified (harvested, no recorded run)
xiezikai/reflexiveprompting/utils_mmlu.py
code served (permissive licence) · get_code("1e6dd951c6a8a447")
How it ran

no invocation recorded.

get_reasoning_data_truthfulqa Not yet run
unverified (harvested, no recorded run)
xiezikai/reflexiveprompting/utils_truthfulqa.py
code served (permissive licence) · get_code("41bbba1590f51850")
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, 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 14 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-22.

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 generated significant attention since their inception, finding applications across various academic and industrial domains. However, these models often suffer from the "hallucination problem", where outputs, though grammatically and logically coherent, lack factual accuracy or are entirely fabricated. A particularly troubling issue discovered and widely discussed recently is the numerical comparison error where multiple LLMs incorrectly infer that "9.11$>$9.9". We discovered that the order in which LLMs generate answers and reasoning impacts their consistency. Specifically, results vary significantly when an LLM generates an answer first and then provides the reasoning versus generating the reasoning process first and then the conclusion. Inspired by this, we propose a new benchmark method for assessing LLM consistency: comparing responses generated through these two different approaches. This benchmark effectively identifies instances where LLMs fabricate answers and subsequently generate justifications. Furthermore, we introduce a novel and straightforward prompt strategy designed to mitigate this issue. Experimental results demonstrate that this strategy improves performance across various LLMs compared to direct questioning. This work not only sheds light on a critical flaw in LLMs but also offers a practical solution to enhance their reliability.

For agents

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

get_harvested_code_for_paper("2408.05093")
get_code_for_paper("2408.05093")
have("2408.05093")

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

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

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

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

Connect an agent — have() is free.