SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.13300 · ICLR · 2024

Adaptive Chameleon or Stubborn Sloth: REVEALING THE BEHAVIOR OF LARGE LANGUAGE MODELS IN KNOWLEDGE CONFLICTS

Kai Zhang, Jian Xie, Jiangjie Chen, Renze Lou, Yu Su

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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 2 have no contract verdict; 4 failures of our instrument; 2 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/2305.13300.json · badge: /api/ran/2305.13300.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
OSU-NLP-Group/LLM-Knowledge-Conflict canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
osu-nlp-group/llm-knowledge-conflict canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
copenlu/context-utilisation-for-rag community
Papers with Code archive
1 ran · 2 no recorded run
FunctionStatusWhere it lives
build_claim_popQA Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm-knowledge-conflict/code/prompt_preparation.py
code served (permissive licence) · get_code("367590f6d8914402")
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.

# Setup code for build_claim_popQA function

ARGS = {
    'relation': 'occupation',
    'subj': 'Albert Einstein',
    'obj': 'physicist'
}
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
build_zeroshot_prompt_popQA Ran
ran on a synthesized input
OSU-NLP-Group/LLM-Knowledge-Conflict/code/prompt_preparation.py
code served (permissive licence) · get_code("241d7275ea43ae59")
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 file with sample PopQA data in JSONL format
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False, encoding='utf-8')
temp_filename = temp_file.name

# Write sample data
sample_data = [
    {'question': 'What is the capital of France?'},
    {'question': 'Who wrote Romeo and Juliet?'},
    {'question': 'What is the largest planet in our solar system?'}
]

for item in sample_data:
    temp_file.write(json.dumps(item) + '\n')

temp_file.close()

ARGS = {
    'filename': temp_filename,
    'model_name': 'gpt-4'
}
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
build_zeroshot_prompt_popQA_with_singleSource_evidence Ran
ran; our contract draft was wrong, not the code
osu-nlp-group/llm-knowledge-conflict/code/prompt_preparation.py
code served (permissive licence) · get_code("db391e5200411c40")
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 random
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "sample_data.jsonl")

# Create sample data matching the expected structure
sample_data = [
    {
        "question": "What is the occupation of John?",
        "conflict_entailment": True,
        "parametric_entailment": True,
        "reGen_plus": False,
        "reGen_flag": False,
        "conflict_evidence": "John works as a software engineer.",
        "conflict_evidence_summarization": "John is a software engineer.",
        "parametric_memory": "John's occupation is software engineer.",
        "first_pred_ans": "software engineer",
        "contrary_claim": "John is a doctor.",
        "prop": "occupation",
        "subj": "John",
        "obj": "software engineer",
        "irrelevant_evidence_sentBERT": {
            "text": "The sky is blue.",
            "idx": 1
        }
    },
    {
        "question": "Where was Alice born?",
        "conflict_entailment": True,
        "parametric_entailment": True,
        "reGen_plus": False,
        "reGen_flag": False,
        "conflict_evidence": "Alice was born in Paris.",
        "conflict_evidence_summarization": "Alice's birthplace is Paris.",
        "parametric_memory": "Alice was born in Paris, France.",
        "first_pred_ans": "Paris",
        "contrary_claim": "Alice was born in London.",
        "prop": "place of birth",
        "subj": "Alice",
        "obj": "Paris",
        "irrelevant_evidence_sentBERT": {
            "text": "The weather is sunny.",
            "idx": 0
        }
    }
]

# Write sample data to file
with open(temp_file, 'w', encoding='utf-8') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

# Define ARGS with all parameters for build_zeroshot_prompt_popQA_with_singleSource_evidence
ARGS = {
    'filename': temp_file,
    'mode': 'explicit',
    'evidence_order': 'random',
    'option_order': 'conf_para',
    'parametric_filter': True,
    'conflict_type': 'all',
    'regenerate': False
}
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
calc_cost_w_tokens Ran
ran, honoured the contract we drafted
OSU-NLP-Group/LLM-Knowledge-Conflict/code/openai_request.py
code served (permissive licence) · get_code("3589cdef8c72142f")
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

# Set seed for reproducibility
torch.manual_seed(0)

# Define arguments for calc_cost_w_tokens
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
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
get_prompt Ran
ran; our contract draft was wrong, not the code
copenlu/context-utilisation-for-rag/src/get_model_predictions/get_model_predictions.py
pointer only (licence: GPL-3.0) · get_code("525dbdd48bc6f54c")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, copenlu/context-utilisation-for-rag, 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.

limited_execution_time Ran
ran on a synthesized input
OSU-NLP-Group/LLM-Knowledge-Conflict/code/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
OSU-NLP-Group/LLM-Knowledge-Conflict/code/prompt_preparation.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
OSU-NLP-Group/LLM-Knowledge-Conflict/code/openai_request.py
code served (permissive licence) · get_code("db2cf6f145458dbc")
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 torch.nn as nn

# Set seed for reproducibility
torch.manual_seed(0)

# Define ARGS dictionary with valid arguments for openai_unit_price
ARGS = {
    'model_name': 'gpt-4-turbo',
    'token_type': 'prompt'
}
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 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
TextWithLogitsGenerationPipeline Not yet run
unverified (harvested, no recorded run)
copenlu/context-utilisation-for-rag/src/get_model_predictions/get_model_predictions.py
pointer only (licence: GPL-3.0) · get_code("56a4bdd3f8d69984")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, copenlu/context-utilisation-for-rag, 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. No invocation recorded.

predict_veracity Not yet run
unverified (harvested, no recorded run)
copenlu/context-utilisation-for-rag/src/get_model_predictions/get_model_predictions.py
pointer only (licence: GPL-3.0) · get_code("56c7a4ff3e95f3a9")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, copenlu/context-utilisation-for-rag, 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. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 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
calc_cost_w_tokens 3 other papers
3 later
2402.01622 (2024-02)
TravelPlanner: A Benchmark for Real-World Planning with Language Agents
2404.03302 (2024-04)
How Easily do Irrelevant Inputs Skew the Responses of Large Language Models?
2410.08414 (2024-10)
Understanding the Interplay between Parametric and Contextual Knowledge for Large Language Models
load_line_json_data
brick of this paper's assembly: helper
3 other papers
3 later
2402.01622 (2024-02)
TravelPlanner: A Benchmark for Real-World Planning with Language Agents
2404.03302 (2024-04)
How Easily do Irrelevant Inputs Skew the Responses of Large Language Models?
2410.12409 (2024-10)
Revealing the Barriers of Language Agents in Planning
limited_execution_time 1 other paper
1 later
2404.03302 (2024-04)
How Easily do Irrelevant Inputs Skew the Responses of Large Language Models?
openai_unit_price 1 other paper
1 later
2402.01622 (2024-02)
TravelPlanner: A Benchmark for Real-World Planning with Language Agents

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

By providing external information to large language models (LLMs), tool augmentation (including retrieval augmentation) has emerged as a promising solution for addressing the limitations of LLMs' static parametric memory. However, how receptive are LLMs to such external evidence, especially when the evidence conflicts with their parametric memory? We present the first comprehensive and controlled investigation into the behavior of LLMs when encountering knowledge conflicts. We propose a systematic framework to elicit high-quality parametric memory from LLMs and construct the corresponding counter-memory, which enables us to conduct a series of controlled experiments. Our investigation reveals seemingly contradicting behaviors of LLMs. On the one hand, different from prior wisdom, we find that LLMs can be highly receptive to external evidence even when that conflicts with their parametric memory, given that the external evidence is coherent and convincing. On the other hand, LLMs also demonstrate a strong confirmation bias when the external evidence contains some information that is consistent with their parametric memory, despite being presented with conflicting evidence at the same time. These results pose important implications that are worth careful consideration for the further development and deployment of tool-and retrieval-augmented LLMs. Resources are available at https://github.com/OSU-NLP-Group/LLM-Knowledge-Conflict. * The first two authors contributed equally. Work done during Jian Xie's internship at OSU NLP Group. 1 In the rest of the paper we use "tool-augmented LLMs" because retrievers are one type of tools, but tools are not limited to retrievers (consider, e.g., a question answering tool).

For agents

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

get_harvested_code_for_paper("2305.13300")
get_code_for_paper("2305.13300")
have("2305.13300")

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

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

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

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

Connect an agent — have() is free.