SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.00223 · 2025

DeepRetrieval: Hacking Real Search Engines and Retrievers with Large Language Models via Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

24 of 25 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 23 have no contract verdict; 1 failure of our instrument; 1 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/2503.00223.json · badge: /api/ran/2503.00223.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
pat-jj/deepretrieval canonical (classifier label)
classifier basis not recorded on the link
24 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_dict_to_str Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/ctgov.py
code served (permissive licence) · get_code("6e8ab81618f0098c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function expects a dictionary with keys 'P', 'I', 'C', 'O'
# Each value will be converted to a string using f-string formatting
pico_dict = {
    'P': 'Population',
    'I': 'Intervention',
    'C': 'Comparison',
    'O': 'Outcome'
}

ARGS = {
    'pico_dict': pico_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_dict_to_str Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/ctgov_32.py
code served (permissive licence) · get_code("faed77b9c35affca")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def convert_dict_to_str(pico_dict):
    """
    Converts a PICO dictionary to a formatted string.
    No changes needed for this function.
    """
    pico_str = ''
    pico_str += f"P: {pico_dict['P']}\n"
    pico_str += f"I: {pico_dict['I']}\n"
    pico_str += f"C: {pico_dict['C']}\n"
    pico_str += f"O: {pico_dict['O']}\n"
    return pico_str

pico_dict = {
    'P': 'Population: Adults with Type 2 Diabetes',
    'I': 'Intervention: Metformin treatment',
    'C': 'Comparison: Placebo control',
    'O': 'Outcome: HbA1c reduction'
}

ARGS = {
    'pico_dict': pico_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_huggingface_repo Ran
ran on a synthesized input
pat-jj/deepretrieval/code/upload_datasets.py
code served (permissive licence) · get_code("bc5d24e0433026c0")
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 logging
from unittest.mock import MagicMock, patch

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Create mock token and repo_id
mock_token = "hf_test_token_12345"
mock_repo_id = "test_user/test_dataset"

# Mock the HfApi and related functions to avoid actual network calls
mock_api = MagicMock()

ARGS = {
    "repo_id": mock_repo_id,
    "token": mock_token,
    "repo_type": "dataset"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
huggingface_hub — 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
extract_query Ran
ran on a synthesized input
pat-jj/deepretrieval/query_rewrite.py
code served (permissive licence) · get_code("b2c496f92d26455f")
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 json
import re

def extract_query(response_text: str) -> str:
    """Extract the rewritten query from the model's response."""
    try:
        if '<answer>' not in response_text:
            response_text = '<answer>' + response_text
        if '</answer>' not in response_text:
            response_text = response_text + '</answer>'
        answer_pattern = '<answer>(.*?)</answer>'
        matches = re.findall(answer_pattern, response_text, re.DOTALL)
        if matches:
            answer_json = json.loads(matches[-1].strip())
            return answer_json['query']
        else:
            raise ValueError('No answer tags found in response')
    except Exception as e:
        raise ValueError(f'Failed to extract query from response: {e}')


# Test case 1: Valid response with answer tags and JSON
response_text_valid = '<answer>{"query": "rewritten search query"}</answer>'

# Test case 2: Response without answer tags (will be added by function)
response_text_without_tags = '{"query": "another query"}'

# Test case 3: Response with multiline JSON in answer tags
response_text_multiline = '''<answer>{
    "query": "multiline query"
}</answer>'''

ARGS = {
    'response_text': response_text_valid
}
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_query Ran
ran on a synthesized input
pat-jj/deepretrieval/code/src/query_rewrite.py
code served (permissive licence) · get_code("b83cfc67f1280b1b")
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 json
import re

def extract_query(response_text: str) -> str:
    """Extract the rewritten query from the model's response."""
    try:
        answer_pattern = '<answer>(.*?)</answer>'
        matches = re.findall(answer_pattern, response_text, re.DOTALL)
        if matches:
            answer_json = json.loads(matches[-1].strip())
            return answer_json['query']
        else:
            raise ValueError('No answer tags found in response')
    except Exception as e:
        raise ValueError(f'Failed to extract query from response: {e}')


# Setup: Create a valid response_text with proper XML tags and JSON content
response_text = '<answer>{"query": "what is machine learning"}</answer>'

ARGS = {
    'response_text': response_text
}
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
format_prompt Ran
ran on a synthesized input
pat-jj/deepretrieval/query_rewrite.py
code served (permissive licence) · get_code("f4549a2164452ce1")
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

torch.manual_seed(0)

ARGS = {
    'user_query': 'machine learning algorithms for natural language processing'
}
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 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
format_prompt Ran
ran on a synthesized input
pat-jj/deepretrieval/code/src/query_rewrite.py
code served (permissive licence) · get_code("dbf81b46206bc092")
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

torch.manual_seed(0)

ARGS = {
    'user_query': 'machine learning optimization algorithms'
}
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 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
generate_schema_prompt Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/bird.py
code served (permissive licence) · get_code("a59933530f0ecb8e")
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 sqlite3
import tempfile
import os

# Create a temporary SQLite database for testing
temp_dir = tempfile.mkdtemp()
db_id = "test_db"
os.makedirs(f"{temp_dir}/data/raw_data/bird/train/train_databases/{db_id}", exist_ok=True)
os.makedirs(f"{temp_dir}/data/raw_data/bird/dev/dev_databases/{db_id}", exist_ok=True)

db_path_train = f"{temp_dir}/data/raw_data/bird/train/train_databases/{db_id}/{db_id}.sqlite"
db_path_dev = f"{temp_dir}/data/raw_data/bird/dev/dev_databases/{db_id}/{db_id}.sqlite"

# Create a test database with sample schema and data
conn = sqlite3.connect(db_path_train)
cursor = conn.cursor()

# Create a sample table
cursor.execute('''
    CREATE TABLE users (
        id INTEGER PRIMARY KEY,
        name TEXT NOT NULL,
        age INTEGER
    )
''')

cursor.execute("INSERT INTO users (id, name, age) VALUES (1, 'Alice', 30)")
cursor.execute("INSERT INTO users (id, name, age) VALUES (2, 'Bob', 25)")

conn.commit()
conn.close()

# Also create dev database
conn_dev = sqlite3.connect(db_path_dev)
cursor_dev = conn_dev.cursor()
cursor_dev.execute('''
    CREATE TABLE users (
        id INTEGER PRIMARY KEY,
        name TEXT NOT NULL,
        age INTEGER
    )
''')
cursor_dev.execute("INSERT INTO users (id, name, age) VALUES (1, 'Charlie', 35)")
cursor_dev.execute("INSERT INTO users (id, name, age) VALUES (2, 'Diana', 28)")
conn_dev.commit()
conn_dev.close()

# Change working directory to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    "db_id": "test_db",
    "split": "train",
    "num_rows": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_upload_paths Ran
ran on a synthesized input
pat-jj/deepretrieval/code/upload_datasets.py
code served (permissive licence) · get_code("c6cc8b394729c034")
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 os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create some category directories
categories_to_create = ['category1', 'category2', 'category3']
for category in categories_to_create:
    cat_path = os.path.join(temp_dir, category)
    os.makedirs(cat_path, exist_ok=True)
    # Create a dummy file in each category
    with open(os.path.join(cat_path, 'file.txt'), 'w') as f:
        f.write('test')

# Define the arguments
ARGS = {
    'input_dir': temp_dir,
    'categories': ['category1', 'category2', 'nonexistent_category'],
    'skip_patterns': ['skip_this', 'avoid_pattern'],
    'verbose': True
}
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
group_files_by_category Ran
ran on a synthesized input
pat-jj/deepretrieval/code/download_datasets.py
code served (permissive licence) · get_code("1f087e4914635b4b")
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 numpy as np

# Analyze the function:
# - It takes a list of files (strings with '/' separators)
# - It splits each file path by '/' and uses the first part as category
# - It groups files by their first path component
# - No model, tensor, or complex objects needed

ARGS = {
    "files": [
        "documents/file1.txt",
        "documents/file2.txt",
        "images/photo1.jpg",
        "images/photo2.jpg",
        "videos/movie1.mp4",
        "data/dataset.csv"
    ]
}
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 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
group_files_by_dataset Ran
ran on a synthesized input
pat-jj/deepretrieval/code/download_datasets.py
code served (permissive licence) · get_code("4db3d8f4262c757d")
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 numpy as np

ARGS = {
    "files": [
        "category_a/dataset_1/file1.txt",
        "category_a/dataset_1/file2.txt",
        "category_a/dataset_2/file3.txt",
        "category_b/dataset_3/file4.txt",
        "other/path/file5.txt",
        "category_a/dataset_2/file6.txt",
    ],
    "category": "category_a",
}
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 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
list_available_files Ran
ran on a synthesized input
pat-jj/deepretrieval/code/download_datasets.py
code served (permissive licence) · get_code("6f9a9a9fcea51423")
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 logging
from unittest.mock import Mock, patch

logger = logging.getLogger(__name__)

# Mock the huggingface_hub functions to avoid actual network calls
def mock_list_repo_files(repo_id, token=None, repo_type='dataset'):
    """Mock function that returns a list of files."""
    return ['file1.txt', 'file2.csv', 'metadata.json']

# Patch the actual function import
with patch('huggingface_hub.list_repo_files', side_effect=mock_list_repo_files):
    pass

ARGS = {
    'repo_id': 'username/dataset-name',
    'token': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
huggingface_hub — 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
load_matching_dataset Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/msmarco_sub.py
code served (permissive licence) · get_code("9d324a33882b374b")
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 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import os
import tempfile
from pathlib import Path

# Create temporary directory structure and mock data files
temp_dir = tempfile.mkdtemp()
data_dir = Path(temp_dir) / 'data' / 'raw_data' / 'msmarco' / 'msmarco_passage'
data_dir.mkdir(parents=True, exist_ok=True)

# Create mock training data
train_data = [
    {'question': 'What is machine learning?', 'docs_id': [1, 2, 3]},
    {'question': 'How does neural network work?', 'docs_id': [4, 5]},
    {'question': 'What is deep learning?', 'docs_id': [6, 7, 8, 9]},
]

test_data = [
    {'question': 'Explain reinforcement learning', 'docs_id': [10, 11]},
    {'question': 'What is NLP?', 'docs_id': [12, 13, 14]},
]

val_data = [
    {'question': 'Define supervised learning', 'docs_id': [15, 16]},
]

# Write mock JSONL files
train_file = data_dir / 'train.jsonl'
with open(train_file, 'w') as f:
    for item in train_data:
        f.write(json.dumps(item) + '\n')

dev_file = data_dir / 'dev.jsonl'
with open(dev_file, 'w') as f:
    for item in test_data + val_data:
        f.write(json.dumps(item) + '\n')

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'domain': 'passage'
}
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 2, 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
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/ctgov.py
code served (permissive licence) · get_code("bd162b7f6f193c7b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

ARGS = {
    'dp': {
        'input': 'P: Adult patients with type 2 diabetes mellitus\nI: Metformin monotherapy\nC: Placebo or standard care\nO: HbA1c reduction, weight loss, adverse events'
    },
    'dataset': 'pubmed_literature'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/fever.py
code served (permissive licence) · get_code("bc592fb448c2d78d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'dp': {
        'query': 'Climate change is caused by human activities'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/fiqa.py
code served (permissive licence) · get_code("606ffeb10da3d22e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

INSTRUCTION = '\nYou are an expert in query generation. Given a financial question, your task is to create query terms to retrieve user replies that best answer the question.'

def make_prefix(dp):
    input_str = '<|im_start|>system\nYou are a helpful assistant. You first thinks about the reasoning process in the mind and then provides the user with the answer.<|im_end|>\n<|im_start|>user\n' + INSTRUCTION
    input_str += '\nShow your work in <think> </think> tags. Your final response must be in JSON format within <answer> </answer> tags. For example,\n<answer>\n{\n    "query": "...."\n} \n</answer>. \nNote: The query should use Boolean operators (AND, OR) and parentheses for grouping terms appropriately.\n\nHere\'s the financial question:\n'
    input_str += dp['query'] + '\nAssistant: Let me think step by step. \n<think>\n'
    return input_str

torch.manual_seed(0)

ARGS = {
    'dp': {
        'query': 'What is the impact of Federal Reserve interest rate changes on technology stock valuations?'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/hotpotqa.py
code served (permissive licence) · get_code("545e19c701f43c85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'dp': {
        'query': 'What are the benefits of machine learning in healthcare and how does it compare to traditional methods?'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/msmarco_beir.py
code served (permissive licence) · get_code("1c8330e765ddfad8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'dp': {
        'query': 'What are the benefits of machine learning in healthcare?'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/msmarco_sub.py
code served (permissive licence) · get_code("f87645303568f144")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Define a minimal data point dict that the function expects
dp = {
    'input': 'What are the latest advances in machine learning?'
}

# Define ARGS mapping all parameters of make_prefix to values
ARGS = {
    'dp': dp,
    'retrieval_mode': 'sparse'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_prefix_llama_32_3b Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/ctgov_32.py
code served (permissive licence) · get_code("a949969186799c79")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Build a minimal dp dict with 'input' key
dp = {
    'input': 'P: Patients with type 2 diabetes\nI: Metformin therapy\nC: Placebo\nO: Glycemic control and HbA1c reduction'
}

# Build a minimal dataset - can be a list, dict, or simple object
dataset = {
    'name': 'medical_research_dataset',
    'size': 100
}

ARGS = {
    'dp': dp,
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
nice_look_table Ran
ran; our contract draft was wrong, not the code
pat-jj/deepretrieval/code/data_preprocess/bird.py
code served (permissive licence) · get_code("08dfd0c28c8d8777")
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

torch.manual_seed(0)

# Analyze the function:
# - column_names: list of strings (column headers)
# - values: list of lists/tuples where each inner list has len(column_names) elements
# The function creates a formatted table with right-justified columns

ARGS = {
    "column_names": ["Name", "Age", "Score"],
    "values": [
        ["Alice", 25, 95.5],
        ["Bob", 30, 87.2],
        ["Charlie", 22, 92.1]
    ]
}
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
parse_qrel Ran
ran on a synthesized input
pat-jj/deepretrieval/code/data_preprocess/fever.py
code served (permissive licence) · get_code("ca7c915d51ff8962")
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

# The function expects qrel to be an iterable of lines
# Each line should be a tuple/list of (query_id, corpus_id, score)
qrel_data = [
    ("q1", "doc1", "2"),
    ("q1", "doc2", "1"),
    ("q2", "doc3", "2"),
    ("q2", "doc1", "0"),
    ("q3", "doc2", "1"),
]

ARGS = {
    "qrel": qrel_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
rewrite_query Ran
ran on a synthesized input
pat-jj/deepretrieval/query_rewrite.py
code served (permissive licence) · get_code("95a95645e65bef95")
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 requests
import json

# Mock the requests.post to avoid actual network calls
class MockResponse:
    def __init__(self):
        self.status_code = 200
        
    def raise_for_status(self):
        pass
    
    def json(self):
        return {
            'choices': [
                {
                    'message': {
                        'content': '<think>\nThe user is asking about literature related to machine learning and neural networks. I should create a BM25 query with relevant terms combined using Boolean operators.\n</think>\n<answer>\n{"query": "(machine learning OR neural networks) AND (deep learning OR AI)"}\n</answer>'
                    }
                }
            ]
        }

# Patch requests.post
original_post = requests.post
def mock_post(url, headers=None, json=None):
    return MockResponse()

requests.post = mock_post

# Define the arguments for rewrite_query function
ARGS = {
    'query': 'What are the latest advances in machine learning and neural networks?',
    'api_url': 'http://localhost:8000/v1/chat/completions'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests — 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
should_skip_path Ran
ran on a synthesized input
pat-jj/deepretrieval/code/upload_datasets.py
code served (permissive licence) · get_code("8579366f86217f73")
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 torch
import numpy as np

def should_skip_path(path, skip_patterns):
    """Check if a path should be skipped based on patterns."""
    for pattern in skip_patterns:
        if pattern in path:
            return True
    return False


# Setup code
path = "/home/user/project/src/utils.py"
skip_patterns = [".git", "__pycache__", ".pyc", "node_modules"]

ARGS = {
    "path": path,
    "skip_patterns": skip_patterns
}
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 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
make_prefix Not yet run
unverified (harvested, no recorded run)
pat-jj/deepretrieval/code/data_preprocess/bird.py
code served (permissive licence) · get_code("49231bf0422fb2d5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 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 (1 with at least one paper dated earlier, 0 the same month, 0 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
nice_look_table 2 other papers
2 dated earlier
2402.11517 (2024-02)
Knowledge-to-SQL: Enhancing SQL Generation with Data Expert LLM
2408.14717 (2024-08)
Text2SQL is Not Enough: Unifying AI and Databases with TAG

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

Information retrieval systems are crucial for enabling effective access to large document collections. Recent approaches have leveraged Large Language Models (LLMs) to enhance retrieval performance through query augmentation, but often rely on expensive supervised learning or distillation techniques that require significant computational resources and hand-labeled data. We introduce DeepRetrieval, a reinforcement learning (RL) approach that trains LLMs for query generation through trial and error without supervised data (reference query). Using retrieval metrics as rewards, our system generates queries that maximize retrieval performance. DeepRetrieval outperforms leading methods on literature search with 65.07% (vs. previous SOTA 24.68%) recall for publication search and 63.18% (vs. previous SOTA 32.11%) recall for trial search using real-world search engines. DeepRetrieval also dominates in evidence-seeking retrieval, classic information retrieval and SQL database search. With only 3B parameters, it outperforms industry-leading models like GPT-4o and Claude-3.5-Sonnet on 11/13 datasets. These results demonstrate that our RL approach offers a more efficient and effective paradigm for information retrieval. Our data and code are available at: https://github.com/pat-jj/DeepRetrieval.

For agents

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

get_harvested_code_for_paper("2503.00223")
get_code_for_paper("2503.00223")
have("2503.00223")

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

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

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

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

Connect an agent — have() is free.