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

RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions

Benyou Wang, Wenyu Chen, Li Zhou, Wanlong Liu, Junying Chen, Ji Ke

Open in the Atlas

Code that ran

20 of 21 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; 5 honoured the contract we drafted, 2 violated it and 6 have no contract verdict; 7 failures of our instrument; 1 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.192.json · badge: /api/ran/2025.emnlp-main.192.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
FreedomIntelligence/RAG-Instruct canonical (classifier label)
classifier basis: census
20 ran · 1 no recorded run
FunctionStatusWhere it lives
call_gpt4_with_retry Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/data_gen/generate_data.py
code served (permissive licence) · get_code("277423b157f6182a")
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 json
import re

class MockGPTInstance:
    """Mock GPT instance that returns valid JSON responses"""
    def __init__(self, response_type='normal'):
        self.response_type = response_type
    
    def call(self, content):
        if self.response_type == 'normal':
            return json.dumps({"result": "success", "data": "test_output"})
        elif self.response_type == 'arc':
            return json.dumps({"Options": ["A", "B", "C"], "result": "success"})
        elif self.response_type == 'with_brackets':
            return "Some text before\n" + json.dumps({"result": "success"}) + "\nSome text after"
        else:
            return json.dumps({"result": "success"})

ARGS = {
    "task": "normal_task",
    "gpt_instance": MockGPTInstance(response_type='normal'),
    "content": "What is the answer to this question?",
    "args": {"param1": "value1", "param2": 42},
    "showkeys": False,
    "max_retries": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
check_answer Ran
ran, violated the contract we drafted
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/evaluation.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("637b51b8df78832a")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

find_most_similar_index Ran
ran, honoured the contract we drafted
FreedomIntelligence/RAG-Instruct/eval/scorer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from RXH04-USTC/Medical-Reasoning-Survey, is pointer only (licence: NOASSERTION) · get_code("10f0fc9fecb6a8d7")
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 RXH04-USTC/Medical-Reasoning-Survey, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

gather Ran
ran, honoured the contract we drafted
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/dist_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("9fb6e57668661c38")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

gather_nograd Ran
ran, honoured the contract we drafted
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/dist_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from agwaBom/TPOUR, is pointer only (licence: NONE) · get_code("01971cc37e6fe583")
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 agwaBom/TPOUR, 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.

has_answer Ran
ran, violated the contract we drafted
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/evaluation.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("fa4ecbff4b9a354b")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_data Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/retrieval_lm/passage_retrieval.py
code served (permissive licence) · get_code("0c3de3890cd0b382")
How it ran

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

import json
import tempfile
import os

# Create temporary JSON file
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test_data.json")

# Write test data to JSON file
test_data = [
    {"id": 1, "text": "hello"},
    {"id": 2, "text": "world"}
]
with open(json_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "data_path": json_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_file Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/eval_sglang.py
code served (permissive licence) · get_code("cc9d641ec0d314e8")
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
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
input_file = os.path.join(temp_dir, "test_data.json")

test_data = {
    "source1": [
        {"id": 1, "text": "hello"},
        {"id": 2, "text": "world"}
    ],
    "source2": [
        {"id": 3, "text": "foo"},
        {"id": 4, "text": "bar"}
    ]
}

with open(input_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "input_fp": input_file
}
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
load_items Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/retrieval_lm/passage_retrieval.py
code served (permissive licence) · get_code("c3045447a535da01")
How it ran

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

import json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_file = os.path.join(temp_dir, "test_data.json")

test_data = {
    "source1": [
        {"id": 1, "name": "item1"},
        {"id": 2, "name": "item2"}
    ],
    "source2": [
        {"id": 3, "name": "item3"}
    ]
}

with open(test_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "file_path": test_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
match_choice3 Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/scorer.py
code served (permissive licence) · get_code("3717839193060552")
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
import difflib

def str_similarity(str1, str2):
    seq = difflib.SequenceMatcher(None, str1, str2)
    return seq.ratio()

def find_most_similar_index(str_list, target_str):
    """
    Given a list of strings and a target string, returns the index of the most similar string in the list.
    """
    most_similar_str = None
    most_similar_index = None
    highest_similarity = 0
    for i, str in enumerate(str_list):
        similarity = str_similarity(str, target_str)
        if similarity >= highest_similarity:
            most_similar_str = str
            most_similar_index = i
            highest_similarity = similarity
    return most_similar_index

def match_choice3(text, options):
    matches = list(re.finditer('(is |是|\\*|\\W|\\ |\\(|为|^|\'|\\"|#)(?![aA] )([abcdefghijklmnABCDEFGHIJKLMN])(\\W|$)', text, re.S))
    if matches:
        ans = matches[0].group(2)
        return (ans, 1)
    text = text.lower()
    opsindex = [(opt, text.rindex(options[opt].lower())) for opt in options if options[opt].lower() in text]
    if len(opsindex) > 0:
        return (sorted(opsindex, key=lambda x: x[1], reverse=True)[0][0], 2)
    oplabels = [x for x in options]
    opans = [options[x].lower() for x in options]
    ansindex = find_most_similar_index(opans, text.lower())
    return (oplabels[ansindex], 3)

ARGS = {
    "text": "The answer is B for this question",
    "options": {
        "A": "incorrect option",
        "B": "correct option",
        "C": "another option",
        "D": "last option"
    }
}
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
postprocess_answers_closed Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/utils.py
code served (permissive licence) · get_code("bb4cf433dbb2d408")
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 torch.nn as nn

torch.manual_seed(0)

# Analyze the function:
# - output: string that may contain choice characters
# - task: string compared to 'fever'
# - choices: optional string of space-separated choices

ARGS = {
    "output": "The answer is A",
    "task": "fever",
    "choices": "A B C"
}
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
postprocess_output Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/eval_sglang.py
code served (permissive licence) · get_code("a1dc14848b585cfd")
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 takes a string 'pred' and performs string operations on it
# It removes '</s>' tokens, strips leading spaces, and returns the result

ARGS = {
    'pred': 'hello world</s>'
}
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
postprocess_output Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/utils.py
code served (permissive licence) · get_code("6929958a65fe8565")
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

def postprocess(text):
    """Stand-in postprocess function that cleans text."""
    return text.strip() + '.'

def postprocess_output(input_instance, prediction, task, intermediate_results=None):
    if task == 'factscore':
        return {'input': input_instance['input'], 'output': prediction, 'topic': input_instance['topic'], 'cat': input_instance['cat']}
    elif task == 'qa':
        input_instance['pred'] = prediction
        return input_instance
    elif task in ['asqa', 'eli5']:
        final_output = ''
        docs = []
        if 'splitted_sentences' not in intermediate_results:
            input_instance['output'] = postprocess(prediction)
        else:
            for idx, (sent, doc) in enumerate(zip(intermediate_results['splitted_sentences'][0], intermediate_results['ctxs'][0])):
                if len(sent) == 0:
                    continue
                postprocessed_result = postprocess(sent)
                final_output += postprocessed_result[:-1] + ' [{}]'.format(idx) + '. '
                docs.append(doc)
            if final_output[-1] == ' ':
                final_output = final_output[:-1]
            input_instance['output'] = final_output
        input_instance['docs'] = docs
        return input_instance

torch.manual_seed(0)

# Construct arguments for factscore task
factscore_input = {
    'input': 'What is the capital of France?',
    'topic': 'Geography',
    'cat': 'capitals'
}
factscore_prediction = 'Paris'

# Construct arguments for qa task
qa_input = {
    'question': 'What is 2+2?',
    'context': 'Math problem'
}
qa_prediction = '4'

# Construct arguments for asqa task with intermediate results
asqa_input = {
    'question': 'Tell me about cats',
    'id': '123'
}
asqa_prediction = 'Cats are animals'
asqa_intermediate = {
    'splitted_sentences': [['Cats are feline', 'They have whiskers', '']],
    'ctxs': [[
        {'text': 'doc1', 'title': 'Feline facts'},
        {'text': 'doc2', 'title': 'Cat anatomy'},
        {'text': 'doc3', 'title': 'Extra'}
    ]]
}

# Construct arguments for eli5 task without intermediate results
eli5_input = {
    'question': 'Why is the sky blue?',
    'id': '456'
}
eli5_prediction = 'Because of light scattering'

ARGS = {
    'input_instance': factscore_input,
    'prediction': factscore_prediction,
    'task': 'factscore',
    'intermediate_results': None
}
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
process_arc_instruction Ran
ran on a synthesized input
FreedomIntelligence/RAG-Instruct/eval/utils.py
code served (permissive licence) · get_code("b2e8c217afa12b4d")
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

ARGS = {
    'item': {
        'choices': {
            'label': ['1', '2', '3', '4'],
            'text': ['Paris', 'London', 'Berlin', 'Madrid']
        },
        'instruction': 'What is the capital of France?'
    },
    'instruction': 'Answer the following multiple choice question:'
}
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
process_item Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/retrieval_lm/passage_retrieval.py
code served (permissive licence) · get_code("0a08200e3e35e3bc")
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 numpy as np

class MockRetriever:
    def search_document(self, query, n_docs):
        """Mock retriever that returns dummy documents"""
        docs = []
        for i in range(n_docs):
            docs.append({
                'text': f'Document {i} for query: {query}',
                'score': 0.9 - i * 0.1
            })
        return docs

# Create a mock retriever instance
retriever = MockRetriever()

# Create a sample item with various fields
item = {
    'question': 'What is the capital of France?',
    'answer': 'Paris',
    'Options': ['Paris', 'London', 'Berlin', 'Madrid']
}

n_docs = 3

ARGS = {
    'item': item,
    'retriever': retriever,
    'n_docs': n_docs
}
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 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
randomcrop Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/data.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("e037474365501512")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

select_from_data Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/data_gen/generate_data.py
code served (permissive licence) · get_code("4dda4d8bdfbbf323")
How it ran

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

import random
import json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
file_path = os.path.join(temp_dir, "test_data.json")

# Create sample data with different task types
sample_data = [
    {
        "task": "normal1_2_v1",
        "context": ["context1", "context2", "context3"]
    },
    {
        "task": "normal1_2_v1",
        "context": ["context4"]
    },
    {
        "task": "normal1_3_v1",
        "context": ["context5", "context6"]
    },
    {
        "task": "normal1_3_v1",
        "context": ["context7"]
    },
    {
        "task": "other_task",
        "context": ["context8"]
    },
    {
        "task": "other_task",
        "context": ["context9"]
    },
    {
        "task": "another_task",
        "context": ["context10"]
    },
]

# Add more items to ensure we have enough for sampling
for i in range(11, 4300):
    sample_data.append({
        "task": "other_task",
        "context": [f"context{i}"]
    })

# Write the sample data to the temporary file
with open(file_path, 'w', encoding='utf-8') as f:
    json.dump(sample_data, f)

ARGS = {
    "file_path": file_path,
    "sample_size": 4200
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
str_similarity Ran
ran, honoured the contract we drafted
FreedomIntelligence/RAG-Instruct/eval/scorer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from richard-peng-xia/CARES, is pointer only (licence: CC-BY-4.0) · get_code("2f7829f62b92f768")
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 richard-peng-xia/CARES, and CC-BY-4.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

table_to_csv_string Ran
ran; our contract draft was wrong, not the code
FreedomIntelligence/RAG-Instruct/train_rag_sft.py
code served (permissive licence) · get_code("4b9933d832571ead")
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.

class Table:
    def __init__(self, columns, data):
        self.columns = columns
        self.data = data

ARGS = {
    'table': Table(
        columns=['name', 'age', 'score'],
        data=[
            [1, 2, 3],
            [4, 5, 6]
        ]
    )
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
varsize_gather_nograd Ran
ran, honoured the contract we drafted
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/dist_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("b1ad8cd3a7168b7f")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

calculate_matches Not yet run
unverified (harvested, no recorded run)
FreedomIntelligence/RAG-Instruct/retrieval_lm/src/evaluation.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/contriever, is pointer only (licence: NOASSERTION) · get_code("7a4988952dd3a127")
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 facebookresearch/contriever, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 15 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 9 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
calculate_matches 13 other papers
11 dated earlier, 1 later, 1 same year, order not determinable
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 10 more not named here
check_answer 13 other papers
11 dated earlier, 1 later, 1 same year, order not determinable
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 10 more not named here
has_answer 11 other papers
9 dated earlier, 1 later, 1 same year, order not determinable
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2401.03568 (2024-01)
Agent AI: Surveying the Horizons of Multimodal Interaction
2401.16979 (2024-01)
Re3val: Reinforced and Reranked Generative Retrieval
and 8 more not named here
varsize_gather_nograd 10 other papers
5 dated earlier, 2 later, 3 same year, order not determinable
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 7 more not named here
gather_nograd 9 other papers
5 dated earlier, 2 later, 2 same year, order not determinable
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 6 more not named here
gather 8 other papers
5 dated earlier, 1 later, 2 same year, order not determinable
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
2403.06840 (2024-03)
RA-ISF: Learning to Answer and Understand from Retrieval Augmentation via Iterative Self-Feedback
and 5 more not named here
randomcrop 7 other papers
5 dated earlier, 1 later, 1 same year, order not determinable
2310.11511 (2023-10)
Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection
2402.03216 (2024-02)
M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation
2402.07867 (2024-02)
PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
and 4 more not named here
load_data 3 other papers
1 dated earlier, 2 same year, order not determinable
2310.11511 (2023-10)
Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions
2506.21215 (2025-06)
Unveiling Causal Reasoning in Large Language Models: Reality or Mirage?
str_similarity 2 other papers
1 dated earlier, 1 later
2406.06007 (2024-06)
CARES: A Comprehensive Benchmark of Trustworthiness in Medical Vision Language Models
2604.08559 (2026-04)
Medical Reasoning with Large Language Models: A Survey and MR-Bench
table_to_csv_string 2 other papers
1 dated earlier, 1 same year, order not determinable
2311.09774 (2023-11)
HuatuoGPT-II, One-stage Training for Medical Adaption of LLMs
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions
call_gpt4_with_retry 1 other paper
1 same year, order not determinable
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions
find_most_similar_index 1 other paper
1 later
2604.08559 (2026-04)
Medical Reasoning with Large Language Models: A Survey and MR-Bench
load_items 1 other paper
1 same year, order not determinable
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions
process_item 1 other paper
1 same year, order not determinable
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions
select_from_data 1 other paper
1 same year, order not determinable
2501.00353 (2025-01)
RAG-Instruct: Boosting LLMs with Diverse Retrieval-Augmented Instructions

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

Retrieval-Augmented Generation (RAG) has emerged as a key paradigm for enhancing large language models by incorporating external knowledge. However, current RAG methods exhibit limited capabilities in complex RAG scenarios and suffer from limited task diversity. To address these limitations, we propose RAG-Instruct, a general method for synthesizing diverse and high-quality RAG instruction data based on any source corpus. Our approach leverages (1) five RAG paradigms, which encompass diverse query-document relationships, and (2) instruction simulation, which enhances instruction diversity and quality by utilizing the strengths of existing instruction datasets. Using this method, we construct a 40K instruction dataset from Wikipedia, comprehensively covering diverse RAG scenarios and tasks. Experiments demonstrate that RAG-Instruct effectively enhances LLMs' RAG capabilities, achieving strong zero-shot performance and outperforming various RAG baselines. The code is publicly available at https://github.com/FreedomIntelligence/RAG-Instruct.

For agents

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

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

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

curl https://syntology.ai/api/ran/2025.emnlp-main.192.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.192.svg)](https://syntology.ai/paper/2025.emnlp-main.192)

Connect an agent — have() is free.