SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.21943 · 2024

Beyond Text: Optimizing RAG with Multimodal Inputs for Industrial Applications

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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; 4 failures of our instrument; 0 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/2410.21943.json · badge: /api/ran/2410.21943.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
riedlerm/multimodal_rag_for_industry canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
evaluate_dataframe Ran
ran; our contract draft was wrong, not the code
riedlerm/multimodal_rag_for_industry/src/evaluation/evaluate_rag_pipeline.py
code served (permissive licence) · get_code("8eb1895c330bb497")
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 DataFrame. 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 pandas as pd
import base64
from io import BytesIO
from PIL import Image

class MockEvaluator:
    """Mock evaluator that simulates gpt4_vision or llava behavior"""
    def evaluate(self, metrics, query, context, image, generated_answer, reference_answer):
        results = {}
        for metric in metrics:
            results[metric] = {
                'grade': 0.85,
                'reason': f'Evaluation of {metric} completed successfully'
            }
        return results

# Create a small base64 encoded image
def create_mock_image_base64():
    img = Image.new('RGB', (10, 10), color='red')
    buffer = BytesIO()
    img.save(buffer, format='PNG')
    img_str = base64.b64encode(buffer.getvalue()).decode()
    return img_str

# Create input dataframe with sample data
input_data = {
    'user_query': [
        'What is machine learning?',
        'Explain neural networks'
    ],
    'reference_answer': [
        'Machine learning is a subset of AI',
        'Neural networks are computational models'
    ],
    'generated_answer': [
        'Machine learning enables computers to learn from data',
        'Neural networks are inspired by biological neurons'
    ],
    'context': [
        'Machine learning is a field of artificial intelligence that focuses on learning from data.',
        'Neural networks are computing systems inspired by biological neural networks.'
    ],
    'image': [
        [create_mock_image_base64()],
        [create_mock_image_base64()]
    ]
}

input_df = pd.DataFrame(input_data)

# Create mock evaluator
evaluator = MockEvaluator()

# Output file path (won't actually write due to sandbox restrictions, but parameter is required)
output_file = '/tmp/evaluation_results.json'

ARGS = {
    'input_df': input_df,
    'evaluator': evaluator,
    'output_file': output_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
evaluate_row Ran
ran; our contract draft was wrong, not the code
riedlerm/multimodal_rag_for_industry/src/evaluation/evaluate_rag_pipeline.py
code served (permissive licence) · get_code("0adbc3bf317a6afa")
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 DataFrame. 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 pandas as pd
import numpy as np

class MockEvaluator:
    """Mock evaluator that simulates gpt4_vision or llava behavior."""
    
    def evaluate(self, metrics, query, context, image, generated_answer, reference_answer):
        """
        Simulates evaluation by returning scores for each metric.
        Returns a dict with metric names as keys and dicts with 'grade' and 'reason' as values.
        """
        results = {}
        for metric in metrics:
            results[metric] = {
                'grade': np.random.uniform(0, 1),
                'reason': f"Evaluation reason for {metric}"
            }
        return results

# Create a mock scores dataframe with appropriate columns
metrics_list = ['relevance', 'accuracy', 'completeness']
columns = []
for metric in metrics_list:
    columns.append(f'{metric} grade')
    columns.append(f'{metric} reason')

scores_df = pd.DataFrame(columns=columns)
# Add a few empty rows
for i in range(5):
    scores_df.loc[i] = [None] * len(columns)

# Create mock evaluator
evaluator = MockEvaluator()

# Define all arguments
ARGS = {
    'metrics': ['relevance', 'accuracy', 'completeness'],
    'index': 0,
    'context': 'The context retrieved by the retrieval system contains relevant information about the topic.',
    'image': 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==',
    'user_query': 'What is the main topic discussed in this document?',
    'generated_answer': 'The main topic is about machine learning and its applications.',
    'reference_answer': 'The document discusses machine learning, deep learning, and their practical applications in industry.',
    'evaluator': evaluator,
    'scores_df': scores_df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
handle_no_data Ran
ran; our contract draft was wrong, not the code
riedlerm/multimodal_rag_for_industry/src/evaluation/evaluate_rag_pipeline.py
code served (permissive licence) · get_code("05b52fb3ee5443e7")
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 DataFrame. 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 pandas as pd

# Create a small DataFrame with the expected columns
scores_df = pd.DataFrame({
    'text Faithfulness grade': [None],
    'text Faithfulness reason': [None],
    'text Context Relevancy grade': [None],
    'text Context Relevancy reason': [None],
    'image Faithfulness grade': [None],
    'image Faithfulness reason': [None],
    'image Context Relevancy grade': [None],
    'image Context Relevancy reason': [None],
})

ARGS = {
    'index': 0,
    'data_type': 'text',
    'scores_df': scores_df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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_dataframe Ran
ran; our contract draft was wrong, not the code
riedlerm/multimodal_rag_for_industry/src/question_answering/rag/run_multimodal_rag.py
code served (permissive licence) · get_code("8fad12c807b0493a")
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 DataFrame. 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 pandas as pd
import torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a minimal input dataframe with required columns
input_df = pd.DataFrame({
    'question': ['What is the capital of France?', 'What is 2+2?'],
    'reference_answer': ['Paris', '4']
})

# Create a minimal RAG chain mock
rag_chain = Mock()
rag_chain.retrieved_images = ['image1.jpg', 'image2.jpg']
rag_chain.retrieved_texts = ['Paris is the capital of France.', 'It is located in northern France.']

# Create a minimal pipeline mock
pipeline = Mock()
pipeline.rag_chain = rag_chain
pipeline.answer_question = Mock(side_effect=['Paris is the capital of France.', 'The answer is 4.'])

# Create output dataframe (None will trigger creation in function)
output_df = None

# Create a temporary output file path (won't actually write in test)
output_file = '/tmp/output.json'

ARGS = {
    'input_df': input_df,
    'pipeline': pipeline,
    'output_file': output_file,
    'output_df': output_df
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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.

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

Large Language Models (LLMs) have demonstrated impressive capabilities in answering questions, but they lack domain-specific knowledge and are prone to hallucinations. Retrieval Augmented Generation (RAG) is one approach to address these challenges, while multimodal models are emerging as promising AI assistants for processing both text and images. In this paper we describe a series of experiments aimed at determining how to best integrate multimodal models into RAG systems for the industrial domain. The purpose of the experiments is to determine whether including images alongside text from documents within the industrial domain increases RAG performance and to find the optimal configuration for such a multimodal RAG system. Our experiments include two approaches for image processing and retrieval, as well as two LLMs (GPT4-Vision and LLaVA) for answer synthesis. These image processing strategies involve the use of multimodal embeddings and the generation of textual summaries from images. We evaluate our experiments with an LLM-as-a-Judge approach. Our results reveal that multimodal RAG can outperform single-modality RAG settings, although image retrieval poses a greater challenge than text retrieval. Additionally, leveraging textual summaries from images presents a more promising approach compared to the use of multimodal embeddings, providing more opportunities for future advancements.

For agents

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

get_harvested_code_for_paper("2410.21943")
get_code_for_paper("2410.21943")
have("2410.21943")

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

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

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

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

Connect an agent — have() is free.