SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.emnlp-main.67 · EMNLP · 2025

Think Wider, Detect Sharper: Reinforced Reference Coverage for Document-Level Self-Contradiction Detection

Chao Zhang, Tong Xu, Yuhao Chen, Shuochen Liu, Yuanjie Lyu, Junhui Lv

Open in the Atlas

Code that ran

1 of 23 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 1 has no contract verdict; 0 failures of our instrument; 22 no recorded run), measured 2026-11-24; 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/2025.emnlp-main.67.json · badge: /api/ran/2025.emnlp-main.67.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
isyuhaochen/RRC-DSCD canonical (classifier label)
classifier basis: census
1 ran · 22 no recorded run
FunctionStatusWhere it lives
format_example Ran
ran on a synthesized input
isyuhaochen/RRC-DSCD/code/sft/sft.py
code served (permissive licence) · get_code("27282e44111d98c4")
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 torch
from unittest.mock import Mock

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self, is_qwen=False):
        self.is_qwen = is_qwen
        self.eos_token = "<|end_of_text|>"
    
    def __call__(self, text, add_special_tokens=False, max_length=8192):
        # Return mock tokenized output with input_ids and attention_mask
        token_count = len(text.split()) + 5
        return {
            'input_ids': [101, 2054, 2003, 1045] + [103] * (token_count - 4),
            'attention_mask': [1] * token_count
        }
    
    def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=True):
        # Return formatted prompt for Qwen models
        return "<|im_start|>user\nThe task is to determine whether the article contains any self-contradictions.<|im_end|>\n<|im_start|>assistant\n"

example = {
    'input': 'The sky is blue. The sky is green.',
    'output': 'Judgment: yes\nEvidence: ["The sky is blue.", "The sky is green."]'
}

tokenizer_llama = MockTokenizer(is_qwen=False)
tokenizer_qwen = MockTokenizer(is_qwen=True)

ARGS = {
    'example': example,
    'tokenizer': tokenizer_llama,
    'model_name': 'llama'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
accuracy_reward Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/rl/rewards.py
code served (permissive licence) · get_code("82e8cc4611bb22a4")
How it ran

no invocation recorded.

analyze_string_lengths Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/analyze_cot_stat.py
code served (permissive licence) · get_code("2c87f9d42e22d77b")
How it ran

no invocation recorded.

build_prompt_and_evidence_labels Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/rl/rl.py
code served (permissive licence) · get_code("68743b17d671664a")
How it ran

no invocation recorded.

calculate_cosine_similarity Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/cal_sim.py
code served (permissive licence) · get_code("24eb913d16fbf46e")
How it ran

no invocation recorded.

contains_bracketed_integer Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/cot_data_distill.py
code served (permissive licence) · get_code("fbbc1be4e2318b2b")
How it ran

no invocation recorded.

count_matching_elements_ratio Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/cal_sim.py
code served (permissive licence) · get_code("d7e19764d4e4d7b1")
How it ran

no invocation recorded.

format_reward Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/rl/rewards.py
code served (permissive licence) · get_code("70ba7655c5039f8f")
How it ran

no invocation recorded.

get_model_ans_local Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/eval_metric.py
code served (permissive licence) · get_code("f57a6095671a2080")
How it ran

no invocation recorded.

get_model_response Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/model.py
code served (permissive licence) · get_code("2ba35ebf177c6ba3")
How it ran

no invocation recorded.

get_model_response_with_reasoning Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/model.py
code served (permissive licence) · get_code("bc3690de4f10d815")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/short_cot.py
code served (permissive licence) · get_code("5acff0feaba69910")
How it ran

no invocation recorded.

load_dataset Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/rl/rl.py
code served (permissive licence) · get_code("e55860ba872f94b7")
How it ran

no invocation recorded.

load_dataset Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/sft/sft.py
code served (permissive licence) · get_code("6ebc36c5d7040030")
How it ran

no invocation recorded.

load_docs_evis_infos Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/analyze_cot_stat.py
code served (permissive licence) · get_code("96dc59bc12e41afb")
How it ran

no invocation recorded.

load_docs_evis_infos Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/cot_data_distill.py
code served (permissive licence) · get_code("317336fb4fef2b87")
How it ran

no invocation recorded.

load_docs_with_evidence Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/eval_metric.py
code served (permissive licence) · get_code("d839e1488fe676e4")
How it ran

no invocation recorded.

load_json Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/merge_data.py
code served (permissive licence) · get_code("8f887c241039bc44")
How it ran

no invocation recorded.

load_prompted_doc Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/cot_data_distill.py
code served (permissive licence) · get_code("018698ddb860f59e")
How it ran

no invocation recorded.

load_prompted_docs Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/eval_metric.py
code served (permissive licence) · get_code("2575506494ae351a")
How it ran

no invocation recorded.

merge_datasets Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/data_processing/cot_data_distill/merge_data.py
code served (permissive licence) · get_code("381929da2fa6fae2")
How it ran

no invocation recorded.

read_data Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/eval/cal_sim.py
code served (permissive licence) · get_code("85d53d4883e6edb4")
How it ran

no invocation recorded.

sentence_cover_reward Not yet run
unverified (harvested, no recorded run)
isyuhaochen/RRC-DSCD/code/rl/rewards.py
code served (permissive licence) · get_code("38f6a6349db54e77")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 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 22 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
load_data 1 other paper
1 later
2601.06966 (2026-01)
RealMem: Benchmarking LLMs in Real-World Memory-Driven Interaction

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Detecting self-contradictions within documents is a challenging task for ensuring textual coherence and reliability. While large language models (LLMs) have advanced in many natural language understanding tasks, document-level self-contradiction detection (DSCD) remains insufficiently studied. Recent approaches leveraging Chain-of-Thought (CoT) prompting aim to enhance reasoning and interpretability; however, they only gain marginal improvement and often introduce inconsistencies across repeated responses. We observe that such inconsistency arises from incomplete reasoning chains that fail to include all relevant contradictory sentences consistently. To address this, we propose a two-stage method that combines supervised fine-tuning (SFT) and reinforcement learning (RL) to enhance DSCD performance. In the SFT phase, a teacher model helps the model learn reasoning patterns, while RL further refines its reasoning ability. Our method incorporates a task-specific reward function to expand the model's reasoning scope, boosting both accuracy and consistency. On the Con-traDoc benchmark, our approach significantly boosts Llama 3.1-8B-Instruct's accuracy from 38.5% to 51.1%, and consistency from 59.6% to 76.2%. 1 * Corresponding author. 1 Data and Code: https://github.com/isyuhaochen/RRC-DSCD.

For agents

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

get_harvested_code_for_paper("2025.emnlp-main.67")
get_code_for_paper("2025.emnlp-main.67")
have("2025.emnlp-main.67")

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

curl https://syntology.ai/api/ran/2025.emnlp-main.67.json

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

[![Syntology run record](https://syntology.ai/api/ran/2025.emnlp-main.67.svg)](https://syntology.ai/paper/2025.emnlp-main.67)

Connect an agent — have() is free.