SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.20833 · 2026

ReFact: Adaptive Fact Restatement for Compact and Faithful Chain-of-Thought Reasoning

Maosong Sun, Zhenghao Liu, Ge Yu, Yu Gu, Chaojun Xiao, Huiyuan Xie, Zhensheng Jin, Xin Dai

arXiv · PDF · Open in the Atlas

Code that ran

15 of 18 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 13 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2607.20833.json · badge: /api/ran/2607.20833.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
NEUIR/REFACT community
Papers with Code archive
15 ran · 3 no recorded run
FunctionStatusWhere it lives
build_evidence_prompt Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("ebd6381b02520d2d")
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
from typing import Dict, Optional, List, Tuple

# Set up the arguments for build_evidence_prompt

# Create a list of evidence dictionaries
evidence_list = [
    {
        'index': 1,
        'content': 'The capital of France is Paris.'
    },
    {
        'index': 2,
        'content': 'Paris is located in the north-central part of France.'
    },
    {
        'index': 3,
        'content': '巴黎是法国的首都,位于法国北部中心区域。'
    }
]

# Create test questions in different languages
question_en = 'What is the capital of France?'
question_zh = '法国的首都是哪里?'

# Define ARGS with all parameters for build_evidence_prompt
ARGS = {
    'evidence_list': evidence_list,
    'question': question_en,
    'language': 'auto'
}
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
check_evidence_in_context Ran
ran, honoured the contract we drafted
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("b1880b7a6de2ae1e")
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 re
from typing import Dict, Optional, List, Tuple

# Set random seed for reproducibility
import torch
torch.manual_seed(0)

# Create test arguments for check_evidence_in_context function
evidence_content = "The quick brown fox jumps over the lazy dog"
context = "The quick brown fox jumps over the lazy dog in the forest"
threshold = 0.8

ARGS = {
    'evidence_content': evidence_content,
    'context': context,
    'threshold': threshold
}
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
compute_answer_reward Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("9e6b589fdfaeb537")
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 re
import string
from typing import Dict, Optional, List, Tuple

# Define ARGS dictionary with valid arguments for compute_answer_reward
ARGS = {
    'solution_str': '<think>Let me work through this step by step. First I need to analyze the problem carefully.</think>\nThe answer is 42',
    'ground_truth': '42',
    'language': 'auto',
    'debug': 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 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
compute_f1 Ran
ran, honoured the contract we drafted
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("ecc47b6b4d41b5db")
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 float, 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 re
import string
from typing import Dict, Optional, List, Tuple

# Define the functions from the provided code
def detect_language(text: str) -> str:
    """检测文本是中文还是英文"""
    if not text:
        return 'en'
    chinese_count = len(re.findall('[\\u4e00-\\u9fff]', text))
    total_chars = len(re.sub('\\s', '', text))
    if total_chars == 0:
        return 'en'
    return 'zh' if chinese_count / total_chars > 0.3 else 'en'

def get_tokens(s: str, language: str='auto') -> List[str]:
    """归一化后分词"""
    return tokenize(normalize_answer(s, language))

def normalize_answer(s: str, language: str='auto') -> str:
    """归一化答案:小写化、去标点、去冠词、规范空白"""
    if not s:
        return ''
    if language == 'auto':
        language = detect_language(s)

    def remove_articles(text):
        if language == 'zh':
            return re.sub('[的了吗呢啊嘛]', ' ', text)
        return re.sub('\\b(a|an|the)\\b', ' ', text)

    def remove_punc(text):
        if language == 'zh':
            all_punc = set(',。!?;:""()【】《》、·…—' + string.punctuation)
        else:
            all_punc = set(string.punctuation)
        return ''.join((ch for ch in text if ch not in all_punc))
    return ' '.join(remove_articles(remove_punc(s.lower())).split())

def tokenize(text: str) -> List[str]:
    """混合语言分词:英文按单词,中文按字"""
    if not text:
        return []
    return re.findall('[a-z0-9]+|[\\u4e00-\\u9fff]', text.lower())

def compute_f1(gold: str, pred: str, language: str='auto') -> float:
    """计算 F1 分数"""
    gold_toks = get_tokens(gold, language)
    pred_toks = get_tokens(pred, language)
    if not gold_toks and (not pred_toks):
        return 1.0
    if not gold_toks or not pred_toks:
        return 0.0
    common = set(gold_toks) & set(pred_toks)
    num_same = sum((min(gold_toks.count(t), pred_toks.count(t)) for t in common))
    if num_same == 0:
        return 0.0
    precision = num_same / len(pred_toks)
    recall = num_same / len(gold_toks)
    return 2 * precision * recall / (precision + recall)

# Set up valid arguments for compute_f1
ARGS = {
    'gold': 'The quick brown fox jumps over the lazy dog',
    'pred': 'A quick brown fox jumps over a lazy dog',
    'language': 'auto'
}
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 float, 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
compute_format_reward Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("db7ce8c1dc973b28")
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 re
from typing import Dict, Optional, List, Tuple

# Test case 1: Well-formatted solution with think tags, evidence pairs, and answer
solution_str_1 = """<think>
Let me analyze this problem.
<evidence 1>First key fact about the topic</evidence>
<evidence 2>Second supporting evidence</evidence>
Based on the evidence above, I can conclude.
</think>

The final answer is: correct conclusion based on evidence."""

# Test case 2: Solution with malformed evidence tag (evdience typo)
solution_str_2 = """<think>
Initial thoughts here.
<evdience 1>Information point 1</evdience>
</think>

Answer without proper formatting."""

# Test case 3: Solution without think tags
solution_str_3 = """Just a regular answer without any think tags or structure."""

# Test case 4: Solution with think tags but no evidence
solution_str_4 = """<think>
Some thinking process here without evidence tags.
</think>

Final answer."""

# Test case 5: Complex case with multiple evidence and proper sequential numbering
solution_str_5 = """<think>
Initial analysis.
<evidence 1>Core fact one</evidence>
<evidence 2>Core fact two</evidence>
<evidence 3>Core fact three</evidence>
Conclusion based on all three pieces of evidence.
</think>

The answer is derived from the sequential evidence."""

# Test case 6: Evidence tags without spaces (e.g., <evidence1>)
solution_str_6 = """<think>
Analysis phase.
<evidence1>First item</evidence1>
<evidence2>Second item</evidence2>
</think>

Result."""

ARGS = {
    "solution_str": solution_str_1,
    "debug": 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 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
compute_score Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("3cd1dee651cfd765")
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.

import torch
import torch.nn as nn
import string
import re
from typing import Dict, List, Tuple, Optional

# Helper functions that are referenced in the code
def normalize_for_matching(text: str) -> str:
    """Normalize text for matching by lowercasing and removing punctuation."""
    text = text.lower()
    text = re.sub(r'[^\w\s]', '', text)
    text = re.sub(r'\s+', ' ', text).strip()
    return text

def tokenize(text: str) -> List[str]:
    """Simple tokenization by splitting on whitespace."""
    return text.split()

def detect_language(text: str) -> str:
    """Detect language - returns 'zh' for Chinese, 'en' for English."""
    if any('\u4e00' <= c <= '\u9fff' for c in text):
        return 'zh'
    return 'en'

def extract_think_content(solution_str: str) -> Tuple[Optional[str], Optional[str]]:
    """Extract thinking and answer content from solution string."""
    # Simple extraction - look for answer markers
    lines = solution_str.strip().split('\n')
    answer_content = lines[-1] if lines else None
    think_content = '\n'.join(lines[:-1]) if len(lines) > 1 else None
    return (think_content, answer_content)

# Now define test arguments for compute_answer_reward
torch.manual_seed(0)

# Create sample evidence list
evidence_list = [
    {'index': 1, 'content': 'The capital of France is Paris.'},
    {'index': 2, 'content': 'Paris is located in northern France.'},
]

# Create sample question
question = "What is the capital of France?"

# Create sample solution string (what the model outputs)
solution_str = "The capital of France is Paris."

# Create sample ground truth
ground_truth = "Paris"

# Create sample context for evidence checking
context = "France is a country in Europe. The capital of France is Paris. Paris is located in northern France and is known for the Eiffel Tower."

# Build the ARGS dictionary with all parameters for compute_answer_reward
ARGS = {
    'solution_str': solution_str,
    'ground_truth': ground_truth,
    'language': 'auto',
    'debug': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
requests, torch — 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
detect_language Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("4d92d68ee8b1751a")
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 detect_language(text: str) -> str:
    """检测文本是中文还是英文"""
    if not text:
        return 'en'
    chinese_count = len(re.findall('[\\u4e00-\\u9fff]', text))
    total_chars = len(re.sub('\\s', '', text))
    if total_chars == 0:
        return 'en'
    return 'zh' if chinese_count / total_chars > 0.3 else 'en'


# Test with English text
ARGS = {
    'text': 'Hello world, this is a test.'
}
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
extract_context_from_prompt Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("674ae67e62634080")
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 extract_context_from_prompt(prompt_str: str) -> str:
    """
    从 user prompt 中提取 Context 部分(原文内容)。
    
    支持的格式:
    - "Context:
..."
    - "Context:
...

Question:"(Context 在 Question 之前)
    
    [修复] 增加更多格式兼容,并处理 prompt_str 本身就是纯文本的情况。
    """
    if not prompt_str:
        return ''
    match = re.search('Context:\\s*\\n(.*)', prompt_str, re.DOTALL)
    if match:
        context = match.group(1).strip()
        q_match = re.search('\\n\\s*Question:', context)
        if q_match:
            context = context[:q_match.start()].strip()
        return context
    match = re.search('Question:.*?\\n\\n(.*)', prompt_str, re.DOTALL)
    if match:
        return match.group(1).strip()
    return ''


ARGS = {
    "prompt_str": "Context:\nThis is the original text content that needs to be extracted.\n\nQuestion:\nWhat is the main topic?"
}
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
extract_evidence_pairs Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("c332380df390895f")
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
from typing import Dict, Optional, List, Tuple

# Test cases for extract_evidence_pairs function
think_content_1 = """
Let me analyze this:
<evidence 1>The first piece of evidence here</evidence>
<evidence 2>The second piece of evidence</evidence>
Some text in between
<evidence 3>Third evidence with more details</evidence>
"""

think_content_2 = """
Testing with typo:
<evdience 1>Evidence with typo in tag</evdience>
<evidence 2>Normal evidence tag</evidence>
"""

think_content_3 = """
Testing without spaces:
<evidence1>No space after evidence</evidence1>
<evdience2>Typo without space</evdience2>
"""

think_content_4 = """
Mixed formatting:
<evidence 1>Spaced version</evidence>
<evdience2>Typo no space</evdience2>
<evidence  3>Multiple spaces</evidence>
Some duplicate attempt:
<evidence 1>Duplicate index should be ignored</evidence>
"""

think_content_5 = """
Simple case with just one evidence tag:
<evidence 0>Basic evidence content here</evidence>
"""

ARGS = {
    "think_content": think_content_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 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_question_from_prompt Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("6cbc0e7d0d552639")
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 extract_question_from_prompt(prompt_str: str) -> str:
    """从 user prompt 中提取 Question 部分"""
    if not prompt_str:
        return ''
    match = re.search('Question:\\s*\\n?(.*?)(?:\\n\\nContext:|$)', prompt_str, re.DOTALL)
    if match:
        return match.group(1).strip()
    return ''


ARGS = {
    'prompt_str': 'Question:\nWhat is machine learning?\n\nContext:\nMachine learning is a subset of AI.'
}
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
extract_think_content Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("e7d2521232a52df8")
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 re
from typing import Dict, Optional, List, Tuple

# Test cases for extract_think_content function
def create_test_args():
    # Case 1: Valid think tags with content
    solution_str_1 = """<think>Let me think about this problem step by step.
First, I need to understand what's being asked.
Then I'll work through the solution.</think>
Now here is my answer: The solution is 42."""
    
    # Case 2: Malformed think tag (no opening)
    solution_str_2 = """Some content here.
</think>
This is the answer part."""
    
    # Case 3: No think tags at all
    solution_str_3 = """This is just a regular response with no thinking tags."""
    
    # Case 4: Empty think tags
    solution_str_4 = """<think></think>
Just the answer."""
    
    # Case 5: Think tag with newlines and whitespace
    solution_str_5 = """<think>
    Some thinking here
    with multiple lines
    
    and blank lines
</think>

The final answer goes here."""
    
    return solution_str_1

# Create the ARGS dictionary with test input
ARGS = {
    "solution_str": """<think>Let me think about this problem step by step.
First, I need to understand what's being asked.
Then I'll work through the solution.</think>
Now here is my answer: The solution is 42."""
}
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
get_tokens Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("ef36c60282378811")
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
import string
from typing import Dict, Optional, List, Tuple

# Define ARGS for the get_tokens function
ARGS = {
    's': '这是一个测试文本 with English words and 中文字符',
    'language': 'auto'
}
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
normalize_answer Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("445de90902805074")
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
import string

ARGS = {
    's': 'The quick brown fox jumps over the lazy dog',
    'language': 'auto'
}
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
normalize_for_matching Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("342dae28f0739a66")
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 normalize_for_matching(text: str) -> str:
    """轻量归一化,用于引用匹配:只做小写 + 压缩空白,保留标点"""
    if not text:
        return ''
    return re.sub('\\s+', ' ', text.lower()).strip()

# Setup code to construct valid arguments
ARGS = {
    'text': 'Hello   WORLD  !  This  is   a   TEST.'
}
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
tokenize Ran
ran; our contract draft was wrong, not the code
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("81a9940880b8ee28")
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 torch
import numpy as np
from typing import Dict, Optional, List, Tuple

torch.manual_seed(0)

# Construct arguments for the tokenize function
ARGS = {
    "text": "Hello世界123test中文abc"
}
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 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
call_llm_api Not yet run
unverified (harvested, no recorded run)
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("a454976b1cbb2d6e")
How it ran

no invocation recorded.

compute_evidence_reward Not yet run
unverified (harvested, no recorded run)
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("2ec851c317dbc4a5")
How it ran

no invocation recorded.

compute_faithfulness_reward Not yet run
unverified (harvested, no recorded run)
NEUIR/REFACT/verl/verl/utils/reward_score/evdience_reward.py
code served (permissive licence) · get_code("07cb88ee030c323c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 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 18 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

Large Language Models (LLMs) increasingly leverage long-form reasoning to solve complex tasks, yet their reasoning processes can deviate from the provided context when evidence is incomplete, noisy, or conflicts with parametric knowledge. Existing grounding approaches either append citations after generation or encourage LLMs to retrieve evidence during reasoning, but they often fail to ensure that cited information is sufficient to support intermediate inferences and final answers. To address this limitation, we propose ReFact, an adaptive fact-restatement citation framework that enables LLMs to determine when contextual grounding is needed and selectively restate source facts at appropriate levels of detail for reliable reasoning. To facilitate adaptive citation during reasoning, ReFact first leverages a teacher LLM to construct high-quality citation-aware reasoning trajectories under diverse context conditions with varying evidence lengths, and then optimizes the student LLM through a two-stage SFT-to-RL framework. Experiments on LongBench, LV-Eval, and ConFiQA demonstrate that ReFact improves long-context question answering and counterfactual faithfulness while substantially reducing the number of reasoning tokens. Further analysis reveals that ReFact achieves higher evidence density by preserving more answer-relevant facts with fewer restatements, producing reasoning traces that are more concise yet better grounded. All code and data will be released via https://github.com/NEUIR/REFACT. • Computing methodologies → Natural language processing; Machine learning approaches; Neural networks.

For agents

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

get_harvested_code_for_paper("2607.20833")
get_code_for_paper("2607.20833")
have("2607.20833")

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

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

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

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

Connect an agent — have() is free.