SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2512.05119 · NeurIPS · 2025

RAG-IGBench: Innovative Evaluation for RAG-based Interleaved Generation in Open-domain Question Answering

Wei Wang, Enhong Chen, Hao Wang, Yi Wu, Chengqiang Lu, Yao Hu, Qimeng Wang, Rongyang Zhang, Yuqing Huang, Yao Gao, Yin Xu

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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, 2 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2512.05119.json · badge: /api/ran/2512.05119.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
USTC-StarTeam/RAG-IGBench canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_prompt Ran
ran; our contract draft was wrong, not the code
USTC-StarTeam/RAG-IGBench/model_generation/claude.py
code served (permissive licence) · get_code("7c3de639a96dcf10")
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 re
import base64
from unittest.mock import Mock, patch

def convert_prompt(prompt):
    img_pattern = re.compile('<img>(.*?)</img>', re.DOTALL)
    parts = img_pattern.split(prompt)
    content = []
    for index, part in enumerate(parts):
        if index % 2 == 0:
            if part.strip():
                content.append({'type': 'text', 'text': part.strip()})
        else:
            img_url = part.strip()
            retry = 5
            while retry >= 0:
                try:
                    img_data = url_to_base64(img_url)
                    break
                except:
                    retry -= 1
            if retry < 0:
                return False
            content.append({'type': 'image', 'source': {'type': 'base64', 'media_type': 'image/jpeg', 'data': img_data}})
    return content

def url_to_base64(url):
    try:
        response = Mock()
        response.content = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'
        response.raise_for_status = Mock()
        image_data = response.content
        base64_data = base64.b64encode(image_data).decode('utf-8')
        return base64_data
    except:
        return False

prompt_text = "Hello world <img>https://example.com/image.jpg</img> some more text"

ARGS = {
    'prompt': prompt_text
}
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 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
convert_prompt Ran
ran; our contract draft was wrong, not the code
USTC-StarTeam/RAG-IGBench/model_generation/gemini.py
code served (permissive licence) · get_code("84245264a71f79ac")
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 re
import base64
from unittest.mock import Mock, patch

def convert_prompt(prompt):
    img_pattern = re.compile('<img>(.*?)</img>', re.DOTALL)
    parts = img_pattern.split(prompt)
    content = []
    for index, part in enumerate(parts):
        if index % 2 == 0:
            if part.strip():
                content.append({'type': 'text', 'text': part.strip()})
        else:
            img_url = part.strip()
            retry = 5
            while retry >= 0:
                try:
                    img_data = url_to_base64(img_url)
                    break
                except:
                    retry -= 1
            if retry < 0:
                return False
            content.append({'mime_type': 'image/jpeg', 'data': img_data})
    return content

def url_to_base64(url):
    try:
        response = Mock()
        response.content = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR'
        response.raise_for_status = Mock()
        image_data = response.content
        base64_data = base64.b64encode(image_data).decode('utf-8')
        return base64_data
    except:
        return False

prompt_simple = "Hello world"

prompt_with_img = "Here is an image: <img>https://example.com/image.jpg</img> and some text after"

prompt_text_and_img = "Start text <img>https://example.com/img1.jpg</img> middle <img>https://example.com/img2.jpg</img> end"

ARGS = {
    "prompt": prompt_with_img
}
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 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
convert_prompt Ran
ran; our contract draft was wrong, not the code
USTC-StarTeam/RAG-IGBench/model_generation/gpt4o.py
code served (permissive licence) · get_code("68380f6694c4d9ae")
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 re

def convert_prompt(prompt):
    img_pattern = re.compile('<img>(.*?)</img>', re.DOTALL)
    parts = img_pattern.split(prompt)
    content = []
    for index, part in enumerate(parts):
        if index % 2 == 0:
            if part.strip():
                content.append({'type': 'text', 'text': part.strip()})
        else:
            content.append({'type': 'image_url', 'image_url': {'url': part.strip()}})
    return content

ARGS = {
    'prompt': 'Here is some text <img>https://example.com/image.jpg</img> and more text <img>https://example.com/image2.png</img> final 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 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
convert_prompt Ran
ran; our contract draft was wrong, not the code
USTC-StarTeam/RAG-IGBench/model_generation/qwen2vl.py
code served (permissive licence) · get_code("22707879c5a43031")
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 re

def convert_prompt(prompt):
    img_pattern = re.compile('<img>(.*?)</img>', re.DOTALL)
    parts = img_pattern.split(prompt)
    content = []
    for index, part in enumerate(parts):
        if index % 2 == 0:
            if part.strip():
                content.append({'type': 'text', 'text': part.strip()})
        else:
            content.append({'type': 'image', 'image': part.strip()})
    return content

# The function takes a single parameter: prompt (a string)
# It parses the string looking for <img>...</img> tags
# Let's create a test prompt with both text and image tags

ARGS = {
    'prompt': 'This is some text. <img>image_data_here</img> More text after. <img>another_image</img> Final 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 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
encode_image Ran
ran; our contract draft was wrong, not the code
USTC-StarTeam/RAG-IGBench/model_generation/claude.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from jongwoopark7978/LVNet, is pointer only (licence: NONE) · get_code("f41cb1a19b154297")
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 jongwoopark7978/LVNet, 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.

main Ran
ran, violated the contract we drafted
USTC-StarTeam/RAG-IGBench/download_images.py
code served (permissive licence) · get_code("422100d6c65e4729")
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 json
import os
import tempfile
from unittest.mock import Mock, patch, MagicMock

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

# Create a temporary input file with sample data
input_file = os.path.join(temp_dir, "input.jsonl")
with open(input_file, 'w') as f:
    # Write sample JSONL data with images structure
    sample_data_1 = {
        "images": [
            ["http://example.com/img1.jpg", "http://example.com/img2.jpg"],
            ["http://example.com/img3.jpg"]
        ]
    }
    sample_data_2 = {
        "images": [
            ["http://example.com/img4.jpg"]
        ]
    }
    f.write(json.dumps(sample_data_1) + "\n")
    f.write(json.dumps(sample_data_2) + "\n")

# Create images root path
images_root_path = os.path.join(temp_dir, "images")

# Mock the requests.get and open to avoid actual network calls and file I/O
def mock_requests_get(url):
    mock_response = Mock()
    mock_response.status_code = 200
    mock_response.content = b"fake_image_data"
    return mock_response

# Patch requests.get globally
import requests
original_get = requests.get
requests.get = mock_requests_get

# Create args object
class Args:
    def __init__(self, input_file, images_root_path):
        self.input_file = input_file
        self.images_root_path = images_root_path

ARGS = {
    "args": Args(input_file=input_file, images_root_path=images_root_path)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
requests, tqdm — 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
url_to_base64 Ran
ran, violated the contract we drafted
USTC-StarTeam/RAG-IGBench/model_generation/claude.py
code served (permissive licence) · get_code("95469ee3b1384512")
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 base64
import requests
from unittest.mock import Mock, patch

# Create a mock response that simulates a successful HTTP request
mock_response = Mock()
mock_response.content = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01'
mock_response.raise_for_status = Mock()

# Patch requests.get to return our mock response
with patch('requests.get', return_value=mock_response):
    pass

ARGS = {
    'url': 'https://example.com/image.png'
}
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 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
download_image Not yet run
unverified (harvested, no recorded run)
USTC-StarTeam/RAG-IGBench/download_images.py
code served (permissive licence) · get_code("6c277445442e0177")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 7 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
encode_image 76 other papers
68 dated earlier, 4 later, 4 same year, order not determinable
2309.05950 (2023-09)
Language Models as Black-Box Optimizers for Vision-Language Models
2311.15732 (2023-11)
GPT4Vis: What Can GPT-4 Do for Zero-shot Visual Recognition?
2312.14867 (2023-12)
VIEScore: Towards Explainable Metrics for Conditional Image Synthesis Evaluation
and 73 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

In real-world scenarios, providing user queries with visually enhanced responses can considerably benefit understanding and memory, underscoring the great value of interleaved image-text generation. Despite recent progress, like the visual autoregressive model that unifies text and image processing in a single transformer architecture, generating high-quality interleaved content remains challenging. Moreover, evaluations of these interleaved sequences largely remain underexplored, with existing benchmarks often limited by unimodal metrics that inadequately assess the intricacies of combined image-text outputs. To address these issues, we present RAG-IGBench, a thorough benchmark designed specifically to evaluate the task of Interleaved Generation based on Retrieval-Augmented Generation (RAG-IG) in open-domain question answering. RAG-IG integrates multimodal large language models (MLLMs) with retrieval mechanisms, enabling the models to access external image-text information for generating coherent multimodal content. Distinct from previous datasets, RAG-IGBench draws on the latest publicly available content from social platforms and introduces innovative evaluation metrics that measure the quality of text and images, as well as their consistency. Through extensive experiments with state-of-the-art MLLMs (both open-source and proprietary) on RAG-IGBench, we provide an in-depth analysis examining the capabilities and limitations of these models. Additionally, we validate our evaluation metrics by demonstrating their high correlation with human assessments. Models fine-tuned on RAG-IGBench's training set exhibit improved performance across multiple benchmarks, confirming both the quality and practical utility of our dataset. Our benchmark is available at https://github.com/USTC-StarTeam/RAG-IGBench. Recent research [1] has explored combining multimodal large language models (MLLMs) with diffusion models for coherent image-text generation. However, this approach suffers from semantic Preprint.

For agents

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

get_harvested_code_for_paper("2512.05119")
get_code_for_paper("2512.05119")
have("2512.05119")

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

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

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

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

Connect an agent — have() is free.