SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.24630 · NeurIPS · 2025

Reasoning Models Hallucinate More: Factuality-Aware Reinforcement Learning for Large Reasoning Models

Junyi Li, Hwee Ng

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 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/2505.24630.json · badge: /api/ran/2505.24630.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
nusnlp/fspo canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
convert_to_regular_types Ran
ran; our contract draft was wrong, not the code
nusnlp/fspo/verl/trainer/fsdp_sft_trainer.py
code served (permissive licence) · get_code("f887d72c9492d9ee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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.

from omegaconf import ListConfig, DictConfig

# Test with various types that the function handles
nested_dict_config = DictConfig({
    "model": "bert",
    "layers": 12,
    "hidden_size": 768,
    "nested": DictConfig({"key": "value", "number": 42})
})

nested_list_config = ListConfig([1, 2, DictConfig({"a": "b"}), "test"])

regular_dict = {
    "name": "test",
    "values": [1, 2, 3],
    "nested": {"inner": "data"}
}

regular_list = [1, "string", {"key": "val"}, [1, 2, 3]]

mixed_tuple = (1, 2, {"nested": "dict"}, [4, 5])

simple_string = "hello"

simple_int = 42

simple_float = 3.14

ARGS = {
    "obj": nested_dict_config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
omegaconf — 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
extract_step Ran
ran, honoured the contract we drafted
this paper's copy was not recorded; identical code first harvested from optimization-ai/disco
pointer only · get_code("216e28c040173a61")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

load_data Ran
ran; our contract draft was wrong, not the code
nusnlp/fspo/evaluate/inference.py
code served (permissive licence) · get_code("787bc6ea79eed461")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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 tempfile
import os

# Create temporary files for testing
temp_dir = tempfile.mkdtemp()

# Create a halluqa format file (JSON array)
halluqa_file = os.path.join(temp_dir, "halluqa_data.json")
halluqa_data = [
    {"id": 1, "question": "What is 2+2?", "answer": "4"},
    {"id": 2, "question": "What is 3+3?", "answer": "6"}
]
with open(halluqa_file, 'w', encoding='utf-8') as f:
    json.dump(halluqa_data, f)

# Create a non-halluqa format file (JSONL - one JSON per line)
jsonl_file = os.path.join(temp_dir, "other_data.jsonl")
jsonl_data = [
    {"id": 1, "text": "First line"},
    {"id": 2, "text": "Second line"}
]
with open(jsonl_file, 'w', encoding='utf-8') as f:
    for item in jsonl_data:
        f.write(json.dumps(item) + '\n')

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

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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

# Construct a minimal data point dictionary
dp = {
    'question': 'What is the capital of France?'
}

# Define ARGS with all parameters for make_prefix
ARGS = {
    'dp': dp,
    'template_type': 'base'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
match_answer Ran
ran; our contract draft was wrong, not the code
nusnlp/fspo/evaluate/inference.py
code served (permissive licence) · get_code("2f9d8e7d769c59d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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
import string

def normalize_answer(s):

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation + ''.join([''', ''', '´', '`']))
        return ''.join((ch if ch not in exclude else ' ' for ch in text))

    def lower(text):
        return text.lower()

    def replace_underscore(text):
        return text.replace('_', ' ')
    return white_space_fix(remove_articles(remove_punc(lower(replace_underscore(s)))))

def match_answer(solution_str):
    answer_pattern = '<answer>(.*?)</answer>'
    matches = list(re.finditer(answer_pattern, solution_str, re.DOTALL))
    if not matches:
        return None
    else:
        answer_text = matches[-1].group(1).strip()
        return normalize_answer(answer_text)


# Setup code to construct valid arguments
solution_str_1 = "<answer>The quick brown fox</answer>"
solution_str_2 = "<answer>Paris_is_the_capital_of_France!</answer>"
solution_str_3 = "Some text <answer>an apple, a banana: the fruit</answer> more text"
solution_str_4 = "No answer tag here"
solution_str_5 = "<answer>Multiple</answer> text <answer>Final_Answer_Here!</answer>"

ARGS = {
    "solution_str": solution_str_3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
nusnlp/fspo/evaluate/inference.py
code served (permissive licence) · get_code("d22718d531542ab7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned 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
import string

def normalize_answer(s):

    def remove_articles(text):
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def white_space_fix(text):
        return ' '.join(text.split())

    def remove_punc(text):
        exclude = set(string.punctuation + ''.join([''', ''', '´', '`']))
        return ''.join((ch if ch not in exclude else ' ' for ch in text))

    def lower(text):
        return text.lower()

    def replace_underscore(text):
        return text.replace('_', ' ')
    return white_space_fix(remove_articles(remove_punc(lower(replace_underscore(s)))))


ARGS = {
    's': "The quick brown fox jumps over a lazy dog's tail_with_underscores!"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 3 the same month, 3 later) and 3 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
extract_step 19 other papers
4 dated earlier, 6 the same month, 7 later, 1 same year, order not determinable, 1 undated
2410.21236 (2024-10)
Flaming-hot Initiation with Regular Execution Sampling for Large Language Models
2025.findings-emnlp.1015 (2025 (year only))
MT-R1-Zero: Advancing LLM-based Machine Translation via R1-Zero-like Reinforcement Learning
2502.14768 (2025-02)
Logic-RL: Unleashing LLM Reasoning with Rule-Based Reinforcement Learning
and 16 more not named here
convert_to_regular_types 7 other papers
2 dated earlier, 2 the same month, 3 later
2410.21236 (2024-10)
Flaming-hot Initiation with Regular Execution Sampling for Large Language Models
2504.05520 (2025-04)
Efficient Reinforcement Finetuning via Adaptive Curriculum Learning
2505.04588 (2025-05)
ZeroSearch: Incentivize the Search Capability of LLMs without Searching
and 4 more not named here
normalize_answer 2 other papers
1 the same month, 1 later
2505.17005 (2025-05)
R1-Searcher++: Incentivizing the Dynamic Knowledge Acquisition of LLMs via Reinforcement Learning
2601.09402 (2026-01)
SEEK: Steering LLM Reasoning for RAG via Internal Reasoning Sketches

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 significantly advanced in reasoning tasks through reinforcement learning (RL) optimization, achieving impressive capabilities across various challenging benchmarks. However, our empirical analysis reveals a critical drawback: reasoning-oriented RL fine-tuning significantly increases the prevalence of hallucinations. We theoretically analyze the RL training dynamics, identifying high-variance gradient, entropy-induced randomness, and susceptibility to spurious local optima as key factors leading to hallucinations. To address this drawback, we propose Factuality-aware Step-wise Policy Optimization (FSPO), an innovative RL fine-tuning algorithm incorporating explicit factuality verification at each reasoning step. FSPO leverages automated verification against given evidence to dynamically adjust token-level advantage values, incentivizing factual correctness throughout the reasoning process. Experiments across mathematical reasoning and hallucination benchmarks using Qwen2.5 and Llama models demonstrate that FSPO effectively reduces hallucinations while enhancing reasoning accuracy, substantially improving both reliability and performance.

For agents

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

get_harvested_code_for_paper("2505.24630")
get_code_for_paper("2505.24630")
have("2505.24630")

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

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

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

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

Connect an agent — have() is free.