SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.25920 · 2026

Can LLMs Time Travel? Enhancing Temporal Consistency in Legal Agentic Search through Reinforcement Learning

Wei Fan, Yangqiu Song, Haoran Li, Chunyang Li, Tianshi Zheng, Baixuan Xu, Yiran Hu, Yining Zhou, Mufan Zhang, Yanbing Weng, Jianhui Yang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 16 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, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 7 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/2605.25920.json · badge: /api/ran/2605.25920.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
AlexFanw/LegalSearch-R1 canonical (classifier label)
classifier basis: census
9 ran · 7 no recorded run
FunctionStatusWhere it lives
build_reward_model Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/user/legalsearch_data_process.py
code served (permissive licence) · get_code("99a0d136268aa0e8")
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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'user_content': "What is the capital of France?",
    'answer': "Paris"
}
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
extract_answer Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/user/calculate_metrics.py
code served (permissive licence) · get_code("04f6d2711d4cd42e")
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

ANSWER_PATTERN = re.compile('<answer>\\s*(.*?)\\s*</answer>', re.IGNORECASE | re.DOTALL)

def extract_answer(text: str | None) -> str:
    if not text:
        return ''
    match = ANSWER_PATTERN.search(text)
    if not match:
        return text.strip()
    return match.group(1).strip()


# Setup code to construct valid arguments
ARGS = {
    'text': '<answer>  The correct answer is 42  </answer>'
}
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
generate_config_from_args Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/verl/model_merger/base_model_merger.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from LeapLabTHU/OPDVR, is pointer only (licence: NONE) · get_code("8896f4e2bafe8abc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from LeapLabTHU/OPDVR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_dynamic_pipeline_shards Ran
ran, honoured the contract we drafted
AlexFanw/LegalSearch-R1/verl/model_merger/megatron_model_merger.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from LeapLabTHU/OPDVR, is pointer only (licence: NONE) · get_code("94209884dcb2308e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from LeapLabTHU/OPDVR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_ipv4 Ran
ran, violated the contract we drafted
AlexFanw/LegalSearch-R1/verl/utils/net_utils.py
code served (permissive licence) · get_code("735e93af30b15fa9")
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 bool, 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 ipaddress

ARGS = {
    "ip_str": "192.168.1.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 bool, 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
load_jsonl Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/user/legalsearch_data_process.py
code served (permissive licence) · get_code("0eed8cf50397ec71")
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 tempfile
from pathlib import Path
from typing import Any, Dict, List

# Create a temporary JSONL file with sample data
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "test.jsonl"

# Write sample JSONL data
sample_data = [
    {"id": 1, "name": "Alice", "value": 42},
    {"id": 2, "name": "Bob", "value": 100},
    {"id": 3, "name": "Charlie", "value": 75},
]

with temp_path.open('w', encoding='utf-8') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "path": temp_path,
}
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_for_metrics Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/user/calculate_metrics.py
code served (permissive licence) · get_code("3d10a418d728ed47")
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_metrics(text: str | None) -> str:
    if not text:
        return ''
    return re.sub('\\s+', '', text)

# Test with various text inputs
ARGS = {
    'text': 'hello  world   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
read_jsonl Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/user/calculate_metrics.py
code served (permissive licence) · get_code("27498a27e49ed413")
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
from pathlib import Path
import tempfile

# Create a temporary directory and a test JSONL file
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "test.jsonl"

# Write some test JSONL data
with temp_path.open('w', encoding='utf-8') as f:
    f.write(json.dumps({"key1": "value1", "num": 42}) + "\n")
    f.write(json.dumps({"key2": "value2", "nested": {"inner": "data"}}) + "\n")
    f.write(json.dumps({"key3": [1, 2, 3]}) + "\n")

ARGS = {
    "path": temp_path
}
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
unpad_dataproto Ran
ran; our contract draft was wrong, not the code
AlexFanw/LegalSearch-R1/verl/protocol.py
code served (permissive licence) · get_code("83b1686d7ac03c21")
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 DataProto. 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)

# DataProto is a custom class that needs to support slicing with [:-pad_size]
class DataProto:
    def __init__(self, data):
        self.data = data
    
    def __getitem__(self, key):
        # Support slicing like [:-pad_size]
        sliced_data = self.data[key]
        return DataProto(sliced_data)
    
    def __repr__(self):
        return f"DataProto({self.data})"

# Create sample data
sample_data = torch.randn(2, 4)
data_proto = DataProto(sample_data)

ARGS = {
    'data': data_proto,
    'pad_size': 0
}
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 DataProto — a DataProto output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataProto 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
build_prompt Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/user/legalsearch_data_process.py
code served (permissive licence) · get_code("d6beb2151fab8888")
How it ran

no invocation recorded.

get_generation_config Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/utils/model.py
code served (permissive licence) · get_code("d3eec2b92fdb53f7")
How it ran

no invocation recorded.

get_huggingface_actor_config Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/utils/model.py
code served (permissive licence) · get_code("7b27e6b612de6077")
How it ran

no invocation recorded.

get_weight_loader Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/models/weight_loader_registry.py
code served (permissive licence) · get_code("acf240079d434746")
How it ran

no invocation recorded.

get_weight_saver Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/models/weight_loader_registry.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Hesse73/ARMOR, is pointer only (licence: NONE) · get_code("cd6b1e0d6afb2762")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Hesse73/ARMOR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

is_ipv6 Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/utils/net_utils.py
code served (permissive licence) · get_code("705afe175ad8e404")
How it ran

no invocation recorded.

squeeze Not yet run
unverified (harvested, no recorded run)
AlexFanw/LegalSearch-R1/verl/utils/model.py
code served (permissive licence) · get_code("3b15e2ac7497c441")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 10 the same month, 10 later) and 6 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
unpad_dataproto 89 other papers
63 dated earlier, 7 the same month, 16 later, 3 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
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
and 86 more not named here
squeeze 82 other papers
59 dated earlier, 6 the same month, 14 later, 3 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
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
and 79 more not named here
get_generation_config 63 other papers
43 dated earlier, 6 the same month, 12 later, 2 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
2410.21236 (2024-10)
Flaming-hot Initiation with Regular Execution Sampling for Large Language Models
2502.19613 (2025-02)
Self-rewarding correction for mathematical reasoning
and 60 more not named here
get_weight_loader 58 other papers
34 dated earlier, 7 the same month, 15 later, 2 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
2505.14362 (2025-05)
DeepEyes: Incentivizing "Thinking with Images" via Reinforcement Learning
2505.20046 (2025-05)
REARANK: Reasoning Re-ranking Agent via Reinforcement Learning
and 55 more not named here
generate_config_from_args 57 other papers
28 dated earlier, 7 the same month, 19 later, 3 undated
2410.02992 (2024-10)
Learning to Better Search with Language Models via Guided Reinforced Self-Training
2509.25787 (2025-09)
Self-Evolving Vision-Language Models for Image Quality Assessment via Voting and Ranking
2510.08630 (2025-10)
ExPO-HM: Learning to Explain-then-Detect for Hateful Meme Detection
and 54 more not named here
get_dynamic_pipeline_shards 52 other papers
25 dated earlier, 7 the same month, 18 later, 2 undated
2410.02992 (2024-10)
Learning to Better Search with Language Models via Guided Reinforced Self-Training
2509.25787 (2025-09)
Self-Evolving Vision-Language Models for Image Quality Assessment via Voting and Ranking
2510.08630 (2025-10)
ExPO-HM: Learning to Explain-then-Detect for Hateful Meme Detection
and 49 more not named here
is_ipv4 41 other papers
22 dated earlier, 6 the same month, 11 later, 2 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
2506.08672 (2025-06)
RuleReasoner: Reinforced Rule-based Reasoning via Domain-aware Dynamic Sampling
2506.12935 (2025-06)
SoundMind: RL-Incentivized Logic Reasoning for Audio-Language Models
and 38 more not named here
is_ipv6 41 other papers
22 dated earlier, 6 the same month, 11 later, 2 undated
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
2506.08672 (2025-06)
RuleReasoner: Reinforced Rule-based Reasoning via Domain-aware Dynamic Sampling
2506.12935 (2025-06)
SoundMind: RL-Incentivized Logic Reasoning for Audio-Language Models
and 38 more not named here
get_huggingface_actor_config 28 other papers
13 dated earlier, 5 the same month, 9 later, 1 undated
2509.25787 (2025-09)
Self-Evolving Vision-Language Models for Image Quality Assessment via Voting and Ranking
2601.02648 (2026-01)
Prioritized Replay for RL Post-training
2602.02518 (2026-02)
GRAPHDANCER: Training LLMs to Explore and Reason over Graphs via Two-Stage Curriculum Post-Training
and 25 more not named here
get_weight_saver 12 other papers
8 dated earlier, 2 the same month, 2 later
2409.19256 (2024-09)
HybridFlow: A Flexible and Efficient RLHF Framework
2510.04678 (2025-10)
Multi-Agent Tool-Integrated Policy Optimization
2602.12036 (2026-02)
Composition-RL: Compose Your Verifiable Prompts for Reinforcement Learning of Large Language Models
and 9 more not named here

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

While large language models (LLMs) augmented with agentic search capabilities show promise for legal reasoning, they overlook a fundamental constraint that applicable law must match the temporal context of each case, as retroactive application of statutes violates core legal principles and leads to erroneous conclusions. Our observations reveal that current legal LLMs suffer from temporal bias anchored to their training cutoff, while search agents rarely incorporate temporal constraints into queries, and that web search alone cannot provide the precise statute and precedent citations that legal reasoning demands. To address these challenges, we propose LegalSearch-R1, an end-to-end reinforcement learning framework that pairs local statute RAG for precise article matching with online web search for broader legal knowledge, trained on temporallyindexed data spanning multiple amendment periods to enforce temporal consistency. Extensive experiments on our benchmark covering 13 legal tasks demonstrate that our 7Bparameter agent outperforms state-of-the-art deep research frameworks and specialized legal LLMs by 12.9% to 29.8%, surpasses baselines by 57.7% to 80.3% on temporal consistency, and exhibits robust out-of-domain generalization. The code and data are available at https: //github.com/AlexFanw/LegalSearch-R1. "A retroactive law is truly a monstrosity." (Lex retro non agit) -Lon L. Fuller, The Morality of Law (1969) * Corresponding Authors Background: In May 2010, YAO was the ringleader of a criminal group involved in non-violent fraud. He voluntarily confessed, returned all illegal proceeds, compensated victims, and had no prior convictions. Question: Given these mitigating circumstances, is YAO eligible for probation? Search: "The criminal code articles on probation." Final Answer: Yao is NOT eligible for probation. Art. 74 (2023 Amendment) " Probation shall NOT apply to recidivists AND ringleaders of criminal groups." " Probation shall NOT apply to recidivists.

For agents

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

get_harvested_code_for_paper("2605.25920")
get_code_for_paper("2605.25920")
have("2605.25920")

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

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

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

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

Connect an agent — have() is free.