SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.10633 · EMNLP · 2023

RALLE: A Framework for Developing and Evaluating Retrieval-Augmented Large Language Models

Yasuto Hoshi, Daisuke Miyashita, Youyang Ng, Kento Tatsuno, Yasuhiro Morioka, Osamu Torii, Jun Deguchi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 15 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 0 have no contract verdict; 7 failures of our instrument; 8 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/2308.10633.json · badge: /api/ran/2308.10633.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
yhoshi3/ralle canonical (classifier label)
classifier basis: census
5 ran · 5 no recorded run
yhoshi3/RaLLe community
Papers with Code archive
2 ran · 3 no recorded run
FunctionStatusWhere it lives
average_pool Ran
ran; our contract draft was wrong, not the code
yhoshi3/ralle/ralle/retrievers/embeddings/encode_functions/e5.py
code served (permissive licence) · get_code("e4462ed511216842")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# Construct valid arguments for average_pool function
# The function expects:
# - last_hidden_states: Tensor of shape (batch_size, seq_length, hidden_dim)
# - attention_mask: Tensor of shape (batch_size, seq_length) with binary values

batch_size = 2
seq_length = 3
hidden_dim = 4

# Create last_hidden_states tensor
last_hidden_states = torch.randn(batch_size, seq_length, hidden_dim)

# Create attention_mask tensor with binary values (1 for attended, 0 for masked)
attention_mask = torch.tensor([
    [1, 1, 1],
    [1, 1, 0]
], dtype=torch.long)

ARGS = {
    "last_hidden_states": last_hidden_states,
    "attention_mask": attention_mask
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
flex_format Ran
ran; our contract draft was wrong, not the code
yhoshi3/ralle/ralle/utils.py
code served (permissive licence) · get_code("f06db4cb088e9ddf")
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)

text = "Hello {name}, you have {count} messages and {status} status"
history = {
    "name": "Alice",
    "count": 42,
    "status": "active",
    "unused_key": "this won't be used"
}

ARGS = {
    "text": text,
    "history": history
}
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
flex_format_batch Ran
ran; our contract draft was wrong, not the code
yhoshi3/ralle/ralle/evaluation/evaluate.py
code served (permissive licence) · get_code("5fa53ca5d798ad2d")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - template: a string used with eval() or .format()
# - history_org: a dict with keys like 'question', 'prompt', 'response', 'wiki_id_title'
# - eval_mode: either 'eval' or 'f-strings'
# 
# The function expects:
# - history_org['question'] to exist and have a length
# - Other keys in history_org may or may not be present
# - If eval_mode == 'eval', template is evaluated as Python code with local vars
# - If eval_mode == 'f-strings', template is formatted with .format(**dict)

# Create a valid history_org dict
history_org = {
    'question': ['What is AI?', 'What is ML?'],
    'prompt': [['prompt1_part1', 'prompt1_part2'], ['prompt2_part1', 'prompt2_part2']],
    'response': [['resp1_part1', 'resp1_part2'], ['resp2_part1', 'resp2_part2']],
    'wiki_id_title': [['wiki1_id', 'wiki1_title'], ['wiki2_id', 'wiki2_title']],
}

# Template for f-strings mode: uses .format() with keys from used_history_mod
template_fstring = "Question: {question}, Prompt: {prompt}"

# Template for eval mode: uses eval() with local variables question, prompt, response, wiki_id_title
template_eval = "f'Q: {question} P: {prompt}'"

# Test with f-strings mode
ARGS = {
    'template': template_fstring,
    'history_org': history_org,
    'eval_mode': 'f-strings',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
initialize_faiss Ran
ran; our contract draft was wrong, not the code
yhoshi3/RaLLe/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("0f688c8a96ac6cce")
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 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 faiss
import numpy as np
import tempfile
import os

# Create a temporary directory for the index file
temp_dir = tempfile.mkdtemp()

# Create a small FAISS index and save it
dimension = 128
nb = 10
xb = np.random.random((nb, dimension)).astype('float32')
index = faiss.IndexFlatL2(dimension)
index.add(xb)

# Write the index to a temporary file
index_path = os.path.join(temp_dir, 'test_index.faiss')
faiss.write_index(index, index_path)

# Define the kwargs dictionary with the index_path
ARGS = {
    'kwargs': {
        'index_path': index_path
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
faiss, numpy — 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
initialize_vector_index Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yhoshi3/RaLLe/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("e50cb67e7f317872")
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 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 tempfile
import os
import numpy as np
import faiss

# Create a temporary directory for test indices
temp_dir = tempfile.mkdtemp()

# Create a minimal FAISS index for testing
def create_test_faiss_index(path):
    """Create a small test FAISS index"""
    d = 128  # dimension
    nb = 10  # number of vectors
    xb = np.random.random((nb, d)).astype('float32')
    index = faiss.IndexFlatL2(d)
    index.add(xb)
    faiss.write_index(index, path)

# Create test FAISS index
faiss_index_path = os.path.join(temp_dir, 'test_faiss.index')
create_test_faiss_index(faiss_index_path)

# Define ARGS for initialize_vector_index function
ARGS = {
    'kwargs': {
        'type': 'faiss',
        'index_path': faiss_index_path
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
diskannpy, faiss, numpy, pyserini — 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
interpret_prompt Ran
ran; our contract draft was wrong, not the code
yhoshi3/ralle/ralle/utils.py
code served (permissive licence) · get_code("135db0e7ca9f6697")
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)

# Analyze the function:
# - format_prompt: str, either 'f-strings' or 'eval'
# - prompt_template: str, a template string
# - step: int, default 0
# - history: dict with keys 'question', 'prompt', 'response', 'wiki_id_title'
#   - 'prompt' must be indexable (list/dict) to support history['prompt'][step] = t_in
#   - other values are used in eval() or format()

# Build history dict for 'f-strings' case
history_fstrings = {
    'question': 'What is AI?',
    'prompt': ['initial_prompt'],  # list so we can assign to [step]
    'response': 'AI is artificial intelligence',
    'wiki_id_title': 'AI_001'
}

# Build prompt_template for f-strings (uses only keys present in template)
prompt_template_fstrings = 'Question: {question}, Response: {response}'

ARGS = {
    'format_prompt': 'f-strings',
    'prompt_template': prompt_template_fstrings,
    'step': 0,
    'history': history_fstrings
}
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
read_config Ran
ran; our contract draft was wrong, not the code
yhoshi3/ralle/ralle/utils.py
code served (permissive licence) · get_code("233f1c06801ce83f")
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 json
import tempfile
import os
from argparse import Namespace

# Create temporary JSON config files
temp_dir = tempfile.mkdtemp()

# Create experiment config file
config_exp_data = {
    "name": "test_experiment",
    "model": "test_model",
    "epochs": 10
}
config_exp_path = os.path.join(temp_dir, "config_exp.json")
with open(config_exp_path, 'w') as f:
    json.dump(config_exp_data, f)

# Create system config file
config_system_data = {
    "gpu": False,
    "seed": 42,
    "batch_size": 32
}
config_system_path = os.path.join(temp_dir, "config_system.json")
with open(config_system_path, 'w') as f:
    json.dump(config_system_data, f)

# Create LLM config file
config_llms_data = {
    "model_name": "gpt-2",
    "max_tokens": 512
}
config_llms_path = os.path.join(temp_dir, "config_llms.json")
with open(config_llms_path, 'w') as f:
    json.dump(config_llms_data, f)

# Create retrievers config file
config_retrievers_data = {
    "retriever_type": "dense",
    "top_k": 10
}
config_retrievers_path = os.path.join(temp_dir, "config_retrievers.json")
with open(config_retrievers_path, 'w') as f:
    json.dump(config_retrievers_data, f)

# Create query encoders config file
config_query_encoders_data = {
    "encoder_type": "bert",
    "hidden_dim": 768
}
config_query_encoders_path = os.path.join(temp_dir, "config_query_encoders.json")
with open(config_query_encoders_path, 'w') as f:
    json.dump(config_query_encoders_data, f)

# Create corpora config file
config_corpora_data = {
    "corpus_name": "wikipedia",
    "corpus_size": 1000000
}
config_corpora_path = os.path.join(temp_dir, "config_corpora.json")
with open(config_corpora_path, 'w') as f:
    json.dump(config_corpora_data, f)

# Create datasets config file
config_datasets_data = {
    "dataset_name": "test_dataset",
    "split": "train",
    "size": 5000
}
config_datasets_path = os.path.join(temp_dir, "config_datasets.json")
with open(config_datasets_path, 'w') as f:
    json.dump(config_datasets_data, f)

ARGS = {
    "args": Namespace(
        config=config_exp_path,
        config_system=config_system_path,
        config_llms=config_llms_path,
        config_retrievers=config_retrievers_path,
        config_query_encoders=config_query_encoders_path,
        config_corpora=config_corpora_path,
        config_datasets=config_datasets_path
    )
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
Retriever Not yet run
unverified (harvested, no recorded run)
yhoshi3/RaLLe/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("fae9ccd49478bc2c")
How it ran

no invocation recorded.

encode Not yet run
unverified (harvested, no recorded run)
yhoshi3/ralle/ralle/retrievers/embeddings/encode_functions/e5.py
code served (permissive licence) · get_code("24ced6d0e7e56049")
How it ran

no invocation recorded.

initialize_bm25 Not yet run
unverified (harvested, no recorded run)
yhoshi3/RaLLe/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("a1ffc0eab16b3711")
How it ran

no invocation recorded.

initialize_corpus Not yet run
unverified (harvested, no recorded run)
yhoshi3/ralle/ralle/retrievers/corpus/initialize.py
code served (permissive licence) · get_code("7cdfbd35dd4dd689")
How it ran

no invocation recorded.

initialize_diskann Not yet run
unverified (harvested, no recorded run)
yhoshi3/RaLLe/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("11aabe46259db0a9")
How it ran

no invocation recorded.

initialize_llm Not yet run
unverified (harvested, no recorded run)
yhoshi3/ralle/ralle/llms/initialize.py
code served (permissive licence) · get_code("10ce681141110591")
How it ran

no invocation recorded.

initialize_query_encoder Not yet run
unverified (harvested, no recorded run)
yhoshi3/ralle/ralle/retrievers/embeddings/initialize.py
code served (permissive licence) · get_code("2e70586c29bf1ca2")
How it ran

no invocation recorded.

initialize_retriever Not yet run
unverified (harvested, no recorded run)
yhoshi3/ralle/ralle/retrievers/initialize.py
code served (permissive licence) · get_code("e17d224b96a47657")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 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, 1 later) and 14 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
average_pool 5 other papers
1 dated earlier, 4 later
2306.03799 (2023-06)
Prompt Space Optimizing Few-shot Reasoning Success with Large Language Models
2310.04678 (2023-10)
DORIS-MAE: Scientific Document Retrieval using Multi-level Aspect-based Queries
2402.11626 (2024-02)
Metacognitive Retrieval-Augmented Large Language Models
and 2 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

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

Abstract

Retrieval-augmented large language models (R-LLMs) combine pre-trained large language models (LLMs) with information retrieval systems to improve the accuracy of factual question-answering. However, current libraries for building R-LLMs provide high-level abstractions without sufficient transparency for evaluating and optimizing prompts within specific inference processes such as retrieval and generation. To address this gap, we present RALLE, an open-source framework designed to facilitate the development, evaluation, and optimization of R-LLMs for knowledgeintensive tasks. With RALLE, developers can easily develop and evaluate R-LLMs, improving hand-crafted prompts, assessing individual inference processes, and objectively measuring overall system performance quantitatively. By leveraging these features, developers can enhance the performance and accuracy of their R-LLMs in knowledge-intensive generation tasks. We open-source our code at https: //github.com/yhoshi3/RaLLe. Knowledge-source Documents Embedding Vectors Index Easy to test out the best practices. To track results, configs, and prompts on MLflow.

For agents

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

get_harvested_code_for_paper("2308.10633")
get_code_for_paper("2308.10633")
have("2308.10633")

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

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

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

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

Connect an agent — have() is free.