SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.03302 · 2024

How Easily do Irrelevant Inputs Skew the Responses of Large Language Models?

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2404.03302.json · badge: /api/ran/2404.03302.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
di-viner/llm-robustness-to-irrelevant-information canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
build_multiple_choice_quantity_prompt Ran
ran; our contract draft was wrong, not the code
di-viner/llm-robustness-to-irrelevant-information/prompt_preparation.py
code served (permissive licence) · get_code("90477c43da0ab5d1")
How it ran

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

import random
import string

# Set seed for reproducibility
random.seed(0)

# Create sample data structure matching what the function expects
data = [
    {
        'question': 'What is the capital of France?',
        'related_info_cc': 'Paris is located in northern France.',
        'related_info_ml': 'France is a country in Western Europe.',
        'related_info_fa': 'The Eiffel Tower is in Paris.',
        'related_info_contriever_highest': 'Paris serves as the capital city.',
        'parametric_memory': 'The capital of France is Paris.',
        'memory_answer': 'Paris',
        'related_template': 'The capital is a major European city.',
    },
    {
        'question': 'What is 2 + 2?',
        'related_info_cc': 'Addition is a basic arithmetic operation.',
        'related_info_ml': 'Mathematics involves numbers and operations.',
        'related_info_fa': 'Arithmetic is taught in schools.',
        'related_info_contriever_highest': 'Basic math problems are simple.',
        'parametric_memory': 'Two plus two equals four.',
        'memory_answer': '4',
        'related_template': 'This is a basic arithmetic fact.',
    },
]

ARGS = {
    'data': data,
    'multi_irrelevant_info_flag': True,
    'relevant_info_flag': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_multiple_choice_semantic_relevance_prompt Ran
ran; our contract draft was wrong, not the code
di-viner/llm-robustness-to-irrelevant-information/prompt_preparation.py
code served (permissive licence) · get_code("84badbefbdc7ff60")
How it ran

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

import random
import string

# Set seed for reproducibility
random.seed(0)

# Create sample data with all required fields for each type
data = [
    {
        'question': 'What is the capital of France?',
        'memory_answer': 'Paris',
        'unrelated_info': 'The sky is blue.',
        'unrelated_template': 'Cats are animals.',
        'partially_related_info': 'France is in Europe.',
        'partially_related_template': 'European countries have capitals.',
        'related_info_contriever_highest': 'Paris is located in northern France and is the largest city in the country.',
        'related_template': 'Paris serves as the capital and cultural center of France.'
    },
    {
        'question': 'What is 2 + 2?',
        'memory_answer': '4',
        'unrelated_info': 'The moon orbits Earth.',
        'unrelated_template': 'Dogs are mammals.',
        'partially_related_info': 'Numbers can be added together.',
        'partially_related_template': 'Mathematics involves calculations.',
        'related_info_contriever_highest': 'Addition is a basic arithmetic operation where two numbers are combined.',
        'related_template': 'The sum of two and two equals four.'
    }
]

ARGS = {
    'data': data,
    '_type': 'related'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_cost_w_tokens Ran
ran, honoured the contract we drafted
di-viner/llm-robustness-to-irrelevant-information/openai_request.py
code served (permissive licence) · get_code("3d3918e09b5366dd")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function:
# calc_cost_w_tokens takes:
# - total_tokens: int
# - model_name: str
# 
# The function calls openai_unit_price with model_name and token_type='completion'
# openai_unit_price checks if model_name contains specific strings like 'gpt-4-1106-preview' or 'gpt-3.5-turbo'
# The function uses total_tokens as an int and multiplies it with unit price

torch.manual_seed(0)

ARGS = {
    'total_tokens': 1000,
    'model_name': 'gpt-3.5-turbo'
}
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 float, 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
create_dict_id_to_data Ran
ran; our contract draft was wrong, not the code
di-viner/llm-robustness-to-irrelevant-information/utils.py
code served (permissive licence) · get_code("287dc9d3368dc058")
How it ran

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

import torch
import numpy as np

# Analyze the function:
# - Takes 'data' and 'line_flag' (boolean)
# - If line_flag is True: iterates over data as a list, each item has 'id' key
# - If line_flag is False: iterates over data as a dict of properties, each property contains a list of units with 'id' key

# Case 1: line_flag=True
# data should be a list of dicts, each with an 'id' key
data_line_case = [
    {'id': 'unit_1', 'value': 10},
    {'id': 'unit_2', 'value': 20},
]

# Case 2: line_flag=False
# data should be a dict where values are lists of dicts, each with 'id' key
data_prop_case = {
    'property_1': [
        {'id': 'prop1_unit_1', 'value': 30},
        {'id': 'prop1_unit_2', 'value': 40},
    ],
    'property_2': [
        {'id': 'prop2_unit_1', 'value': 50},
    ],
}

# Choose one case for ARGS
ARGS = {
    'data': data_line_case,
    'line_flag': True,
}
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
get_dataset_prefix_and_path Ran
ran; our contract draft was wrong, not the code
di-viner/llm-robustness-to-irrelevant-information/utils.py
code served (permissive licence) · get_code("15be9688c6f6663f")
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 torch

ARGS = {
    'file_name': 'pqa'
}
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 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
limited_execution_time Ran
ran on a synthesized input
di-viner/llm-robustness-to-irrelevant-information/openai_request.py
code served (permissive licence) · get_code("f5009f2a6258e5e8")
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 torch.nn as nn

torch.manual_seed(0)

# Create a mock function that simulates an LLM API call
def mock_llm_func(model=None, messages=None, prompt=None, temperature=None, max_tokens=None, **kwargs):
    """Mock function that simulates LLM behavior"""
    return {"response": "mock response", "tokens": 42}

# Create a minimal model class (not used by the function, but included as parameter)
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

mock_model = MockModel()

# Define the ARGS dictionary with all required parameters
ARGS = {
    "func": mock_llm_func,
    "model": "gpt-3.5-turbo",
    "prompt": [{"role": "user", "content": "Hello"}],
    "temp": 0.7,
    "max_tokens": 128,
    "default": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
func_timeout, 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
load_line_json_data Ran
ran; our contract draft was wrong, not the code
di-viner/llm-robustness-to-irrelevant-information/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from llv22/travelplanner_forward, is pointer only (licence: NONE) · get_code("959eef29433a0a23")
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 llv22/travelplanner_forward, 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.

openai_unit_price Ran
ran, honoured the contract we drafted
di-viner/llm-robustness-to-irrelevant-information/openai_request.py
code served (permissive licence) · get_code("d3c8b3cc8cb6d337")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Construct valid arguments for openai_unit_price
ARGS = {
    'model_name': 'gpt-4-1106-preview',
    'token_type': 'prompt'
}
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 float, 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

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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 5 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
calc_cost_w_tokens 3 other papers
2 dated earlier, 1 later
2305.13300 (2023-05)
Adaptive Chameleon or Stubborn Sloth: REVEALING THE BEHAVIOR OF LARGE LANGUAGE MODELS IN KNOWLEDGE CONFLICTS
2402.01622 (2024-02)
TravelPlanner: A Benchmark for Real-World Planning with Language Agents
2410.08414 (2024-10)
Understanding the Interplay between Parametric and Contextual Knowledge for Large Language Models
load_line_json_data 3 other papers
2 dated earlier, 1 later
2305.13300 (2023-05)
Adaptive Chameleon or Stubborn Sloth: REVEALING THE BEHAVIOR OF LARGE LANGUAGE MODELS IN KNOWLEDGE CONFLICTS
2402.01622 (2024-02)
TravelPlanner: A Benchmark for Real-World Planning with Language Agents
2410.12409 (2024-10)
Revealing the Barriers of Language Agents in Planning
limited_execution_time 1 other paper
1 dated earlier
2305.13300 (2023-05)
Adaptive Chameleon or Stubborn Sloth: REVEALING THE BEHAVIOR OF LARGE LANGUAGE MODELS IN KNOWLEDGE CONFLICTS

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-22.

Repositories linked to this paper

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

Abstract

By leveraging the retrieval of information from external knowledge databases, Large Language Models (LLMs) exhibit enhanced capabilities for accomplishing many knowledge-intensive tasks. However, due to the inherent flaws of current retrieval systems, there might exist irrelevant information within those retrieving top-ranked passages. In this work, we present a comprehensive investigation into the robustness of LLMs to different types of irrelevant information under various conditions. We initially introduce a framework to construct high-quality irrelevant information that ranges from semantically unrelated, partially related, and related to questions. Furthermore, our analysis demonstrates that the constructed irrelevant information not only scores highly on similarity metrics, being highly retrieved by existing systems, but also bears semantic connections to the context. Our investigation reveals that current LLMs still face challenges in discriminating highly semantically related information and can be easily distracted by these irrelevant yet misleading content. Besides, we also find that current solutions for handling irrelevant information have limitations in improving the robustness of LLMs to such distractions. All the resources are available on GitHub at https://github.com/Di-viner/LLM-Robustness-to-Irrelevant-Information.

For agents

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

get_harvested_code_for_paper("2404.03302")
get_code_for_paper("2404.03302")
have("2404.03302")

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

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

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

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

Connect an agent — have() is free.