SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.25960 · 2026

When Chain-of-Thought Backfires: Evaluating Prompt Sensitivity in Medical Language Models

Vahid Behzadan, Binesh Sadanandan

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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; 9 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2603.25960.json · badge: /api/ran/2603.25960.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
UNHSAILLab/MedMCQA-Robustness-Study canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
bonferroni_correction Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/significance.py
code served (permissive licence) · get_code("f1904564c5ce1da4")
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

# Set random seed for reproducibility
torch.manual_seed(0)

# Construct valid arguments for bonferroni_correction
p_values = [0.001, 0.01, 0.05, 0.1, 0.5, 0.9]
alpha = 0.05

ARGS = {
    'p_values': p_values,
    'alpha': alpha
}
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
bootstrap_ci Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/significance.py
code served (permissive licence) · get_code("3d7619274b44eb70")
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 numpy as np
from typing import List

# Define a simple metric function for accuracy
def accuracy_metric(predictions: List[str], labels: List[str]) -> float:
    """Compute accuracy as fraction of correct predictions."""
    if len(predictions) == 0:
        return 0.0
    correct = sum(1 for p, l in zip(predictions, labels) if p == l)
    return correct / len(predictions)

# Create sample predictions and labels
predictions = ["cat", "dog", "cat", "bird", "dog", "cat"]
labels = ["cat", "dog", "dog", "bird", "dog", "cat"]

# Define the arguments dictionary
ARGS = {
    'predictions': predictions,
    'labels': labels,
    'metric_fn': accuracy_metric,
    'n_bootstrap': 100,
    'confidence': 0.95,
    'seed': 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
mcnemar_test Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/significance.py
code served (permissive licence) · get_code("290dc837db95a164")
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 numpy as np

ARGS = {
    'preds1': ['cat', 'dog', 'cat', 'bird', 'dog'],
    'preds2': ['cat', 'cat', 'cat', 'bird', 'cat'],
    'labels': ['cat', 'dog', 'dog', 'bird', 'dog'],
    'alpha': 0.05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
parse_mcq_answer Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/metrics.py
code served (permissive licence) · get_code("f9ff2509e4bdcaeb")
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

# Analyze the function: parse_mcq_answer takes a single string parameter 'output'
# and processes it to extract an answer letter (A, B, C, or D).
# The function:
# 1. Strips and uppercases the output
# 2. Looks for 'ANSWER:' in the output and extracts text after it
# 3. Searches for the first character in 'ABCD' and returns it
# 4. Returns 'UNKNOWN' if no answer letter is found

# Test cases for the output parameter:
output_examples = [
    "The answer is ANSWER: B",
    "ANSWER: C please",
    "Model output with A in it",
    "No answer here at all",
    "answer: d lowercase",
    "   A   ",
]

# We'll use one of these as the test argument
ARGS = {
    "output": "The correct answer is ANSWER: B, which is the best choice."
}
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
parse_pubmedqa_answer Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/metrics.py
code served (permissive licence) · get_code("0efda3c23d604b19")
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.

# Construct valid arguments for parse_pubmedqa_answer

# The function takes a single parameter: output (a string)
# It processes the string to extract yes/no/maybe answers

# Test with a simple model output string
output = "The answer is yes, based on the evidence provided."

ARGS = {
    "output": output
}
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 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
plot_accuracy_comparison Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/visualization.py
code served (permissive licence) · get_code("112204efe8deb0e0")
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 Figure. 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 matplotlib.pyplot as plt
import numpy as np
from typing import Dict, List, Any, Optional

# Create sample results dictionary with accuracy values
results = {
    'Model A': 0.92,
    'Model B': 0.87,
    'Model C': 0.95,
    'Model D': 0.81,
    'Model E': 0.89
}

title = 'Accuracy Comparison'
ylabel = 'Accuracy'
output_path = None

ARGS = {
    'results': results,
    'title': title,
    'ylabel': ylabel,
    'output_path': output_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
plot_reliability_diagram Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/visualization.py
code served (permissive licence) · get_code("4c38c1dba8b131e8")
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 Figure. 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 matplotlib.pyplot as plt
import numpy as np
from typing import Dict, List, Any, Optional

# Construct calibration_data dict that matches the structure expected by plot_reliability_diagram
calibration_data = {
    'bins': [
        {
            'bin_start': 0.0,
            'bin_end': 0.25,
            'accuracy': 0.15,
            'size': 8,
            'gap': 0.10
        },
        {
            'bin_start': 0.25,
            'bin_end': 0.5,
            'accuracy': 0.35,
            'size': 12,
            'gap': 0.15
        },
        {
            'bin_start': 0.5,
            'bin_end': 0.75,
            'accuracy': 0.62,
            'size': 15,
            'gap': 0.13
        },
        {
            'bin_start': 0.75,
            'bin_end': 1.0,
            'accuracy': 0.88,
            'size': 10,
            'gap': 0.12
        }
    ],
    'n_samples': 45
}

ARGS = {
    'calibration_data': calibration_data,
    'title': 'Reliability Diagram',
    'output_path': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
plot_subject_heatmap Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/visualization.py
code served (permissive licence) · get_code("5ede6d75b429e9b5")
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 Figure. 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 numpy as np
import matplotlib.pyplot as plt

# Create sample subject_results data structure
# This is a nested dict: model_name -> subject_name -> {accuracy, n}
subject_results = {
    "model_a": {
        "subject_1": {"accuracy": 0.85, "n": 100},
        "subject_2": {"accuracy": 0.92, "n": 100},
        "subject_3": {"accuracy": 0.78, "n": 100},
    },
    "model_b": {
        "subject_1": {"accuracy": 0.88, "n": 100},
        "subject_2": {"accuracy": 0.95, "n": 100},
        "subject_3": {"accuracy": 0.81, "n": 100},
    },
    "model_c": {
        "subject_1": {"accuracy": 0.90, "n": 100},
        "subject_2": {"accuracy": 0.89, "n": 100},
        "subject_3": {"accuracy": 0.87, "n": 100},
    },
}

models = ["model_a", "model_b", "model_c"]
title = "Accuracy by Subject and Model"
output_path = None

ARGS = {
    "subject_results": subject_results,
    "models": models,
    "title": title,
    "output_path": output_path,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
reliability_diagram_data Ran
ran; our contract draft was wrong, not the code
UNHSAILLab/MedMCQA-Robustness-Study/src/evaluation/calibration.py
code served (permissive licence) · get_code("8dd6584d4fdbeb18")
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

torch.manual_seed(0)

# The function expects calibration_data to be a dict with a 'bins' key
# Each bin is a dict with 'bin_start', 'bin_end', 'accuracy', 'confidence', 'size', 'gap'
# This is the output structure from compute_ece

calibration_data = {
    'bins': [
        {
            'bin_start': 0.0,
            'bin_end': 0.25,
            'accuracy': 0.85,
            'confidence': 0.15,
            'size': 10,
            'gap': 0.7
        },
        {
            'bin_start': 0.25,
            'bin_end': 0.5,
            'accuracy': 0.92,
            'confidence': 0.38,
            'size': 15,
            'gap': 0.54
        },
        {
            'bin_start': 0.5,
            'bin_end': 0.75,
            'accuracy': 0.95,
            'confidence': 0.62,
            'size': 20,
            'gap': 0.33
        },
        {
            'bin_start': 0.75,
            'bin_end': 1.0,
            'accuracy': 0.98,
            'confidence': 0.88,
            'size': 25,
            'gap': 0.1
        }
    ]
}

ARGS = {
    'calibration_data': calibration_data
}
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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-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

Large Language Models (LLMs) are increasingly deployed in medical settings, yet their sensitivity to prompt formatting remains poorly characterized. We evaluate MedGemma (4B and 27B parameters) on MedMCQA (4,183 questions) and PubMedQA (1,000 questions) across a broad suite of robustness tests. Our experiments reveal several concerning findings. Chain-of-Thought (CoT) prompting decreases accuracy by 5.7% compared to direct answering. Few-shot examples degrade performance by 11.9% while increasing position bias from 0.14 to 0.47. Shuffling answer options causes the model to change predictions 59.1% of the time, with accuracy dropping up to 27.4 percentage points. Front-truncating context to 50% causes accuracy to plummet below the no-context baseline, yet back-truncation preserves 97% of full-context accuracy. We further show that cloze scoring (selecting the highest logprobability option token) achieves 51.8% (4B) and 64.5% (27B), surpassing all prompting strategies and revealing that models "know" more than their generated text shows. Permutation voting recovers 4 percentage points over single-ordering inference. These results demonstrate that prompt engineering techniques validated on general-purpose models do not transfer to domain-specific medical LLMs, and that reliable alternatives exist.

For agents

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

get_harvested_code_for_paper("2603.25960")
get_code_for_paper("2603.25960")
have("2603.25960")

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

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

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

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

Connect an agent — have() is free.