SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.07459 · 2025

MedicalAgentsBench for Complex Medical Reasoning: Comparing Internalized Reasoning Models versus Externalized Agent-based Frameworks

arXiv · PDF · Open in the Atlas

Code that ran

18 of 23 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 15 have no contract verdict; 3 failures of our instrument; 5 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/2503.07459.json · badge: /api/ran/2503.07459.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
gersteinlab/medagents-benchmark canonical (classifier label)
classifier basis not recorded on the link
18 ran · 5 no recorded run
FunctionStatusWhere it lives
cleansing_syn_report Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedAgents/data_utils.py
code served (permissive licence) · get_code("f9e040ec376c111d")
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

ARGS = {
    'question': 'What is the capital of France?',
    'options': ['Paris', 'London', 'Berlin', 'Madrid'],
    'raw_synthesized_report': 'Key Knowledge: France is located in Western Europe and has been a major European power. Total Analysis: Paris is the capital of France and serves as the country\'s political, cultural, and economic center.'
}
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
deduplicate_data Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/output/utils.py
code served (permissive licence) · get_code("cf49648832dde99a")
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 torch
import numpy as np

torch.manual_seed(0)

# The function expects a list of dictionaries, where each dict has a 'realidx' key
# It deduplicates based on this 'realidx' value
data = [
    {'realidx': 0, 'value': 'first'},
    {'realidx': 1, 'value': 'second'},
    {'realidx': 0, 'value': 'duplicate_first'},
    {'realidx': 2, 'value': 'third'},
    {'realidx': 1, 'value': 'duplicate_second'},
]

ARGS = {
    'data': 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 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
ensemble_solutions Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedPrompt/cot_sc.py
code served (permissive licence) · get_code("d6c6a70501e69e49")
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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock client that works with both Anthropic and OpenAI patterns
mock_client = Mock()

# Mock Anthropic-style response
anthropic_completion = Mock()
anthropic_message = Mock()
anthropic_message.text = "The most consistent answer is B"
anthropic_completion.content = [anthropic_message]

# Mock OpenAI-style response
openai_completion = Mock()
openai_choice = Mock()
openai_choice.message = Mock()
openai_choice.message.content = "The most consistent answer is B"
openai_completion.choices = [openai_choice]

# Configure client methods
mock_client.messages = Mock()
mock_client.messages.create = Mock(return_value=anthropic_completion)
mock_client.chat = Mock()
mock_client.chat.completions = Mock()
mock_client.chat.completions.create = Mock(return_value=openai_completion)

# Create problem dict with medical question
problem = {
    'question': 'What is the primary treatment for hypertension?',
    'options': {
        'A': 'Lifestyle modifications',
        'B': 'Antihypertensive medications',
        'C': 'Surgery',
        'D': 'Observation only'
    }
}

# Create multiple solutions (chain-of-thought responses)
solutions = [
    'The question asks about primary treatment for hypertension. Considering the options, antihypertensive medications are the most common and effective primary treatment. Answer: B',
    'Hypertension treatment typically starts with lifestyle modifications, but for clinical management, antihypertensive medications are the standard primary approach. Answer: B',
    'Primary treatment of hypertension involves pharmacological intervention with antihypertensive drugs. Answer: B'
]

# Model can be one of the supported types
model = 'claude-3-5-sonnet'

ARGS = {
    'problem': problem,
    'solutions': solutions,
    'client': mock_client,
    'model': model
}
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
format_question Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/plots/annotate_reasoning_depth.py
code served (permissive licence) · get_code("4eb21a43f63b6a84")
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
import numpy as np
from typing import Dict, List, Tuple

torch.manual_seed(0)

# Construct test data for format_question function
item_basic = {
    'question': 'What is the capital of France?',
    'options': {
        'A': 'Paris',
        'B': 'London',
        'C': 'Berlin'
    }
}

item_with_choices_list = {
    'input': 'What is 2+2?',
    'choices': ['3', '4', '5', '6']
}

item_pubmedqa = {
    'QUESTION': 'Is this a medical question?',
    'options': ['yes', 'no', 'maybe'],
    'CONTEXTS': ['This is a context about medical research. It contains important information about the study.']
}

item_minimal = {
    'question': 'Simple question?'
}

# ARGS dict with all parameters for format_question
ARGS = {
    'item': item_pubmedqa,
    'dataset_name': 'pubmedqa'
}
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 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
get_options_domains_prompt Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedAgents/prompt_utils.py
code served (permissive licence) · get_code("78c3e21f9fd4a462")
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
import numpy as np

# Define the arguments for get_options_domains_prompt
ARGS = {
    'question': 'A 45-year-old patient presents with chest pain and shortness of breath. What is the most likely diagnosis?',
    'options': 'A) Myocardial infarction | B) Pneumonia | C) Pulmonary embolism | D) Anxiety disorder'
}
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 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
get_question_analysis_prompt Ran
ran; our contract draft was wrong, not the code
gersteinlab/medagents-benchmark/baselines/MedAgents/prompt_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from gersteinlab/medagents, is pointer only (licence: NONE) · get_code("b6cc2818fab31c22")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gersteinlab/medagents, 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.

get_question_domains_prompt Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedAgents/prompt_utils.py
code served (permissive licence) · get_code("87b3972971fb1c2f")
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
import numpy as np

torch.manual_seed(0)

ARGS = {
    "question": "A 45-year-old patient presents with persistent headaches and visual disturbances. What could be the underlying cause?"
}
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 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
load_dataset Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/plots/annotate_reasoning_depth.py
code served (permissive licence) · get_code("e282598f1bcc9567")
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 json
import tempfile
from pathlib import Path

# Create a temporary directory structure with test data
temp_dir = tempfile.mkdtemp()
data_dir = Path(temp_dir)

# Create a dataset subdirectory
dataset_name = "test_dataset"
dataset_path = data_dir / dataset_name
dataset_path.mkdir(parents=True, exist_ok=True)

# Create test.jsonl file
test_questions_data = [
    {"id": 1, "question": "What is 2+2?", "answer": 4},
    {"id": 2, "question": "What is 3+3?", "answer": 6}
]
with open(dataset_path / "test.jsonl", 'w') as f:
    for item in test_questions_data:
        f.write(json.dumps(item) + '\n')

# Create test_hard.jsonl file
test_hard_questions_data = [
    {"id": 10, "question": "Hard question 1", "answer": "complex"},
    {"id": 11, "question": "Hard question 2", "answer": "harder"}
]
with open(dataset_path / "test_hard.jsonl", 'w') as f:
    for item in test_hard_questions_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "dataset_name": dataset_name,
    "data_dir": data_dir
}
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
load_json Ran
ran; our contract draft was wrong, not the code
gersteinlab/medagents-benchmark/output/utils.py
code served (permissive licence) · get_code("2fbbe01c3721715d")
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 json
import tempfile
import os

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

sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w', encoding='utf-8') as f:
    json.dump(sample_data, f)

ARGS = {
    "file_path": temp_file
}
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 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_jsonl Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/output/utils.py
code served (permissive licence) · get_code("b07109264c29d074")
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 JSONL file with valid JSON data
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, "test_data.jsonl")

# Write sample JSONL data
with open(temp_file, 'w', encoding='utf-8') as f:
    f.write(json.dumps({"id": 1, "text": "hello"}) + "\n")
    f.write(json.dumps({"id": 2, "text": "world"}) + "\n")
    f.write(json.dumps({"id": 3, "value": 42}) + "\n")

ARGS = {
    "file_path": temp_file
}
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
parse_answer Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedPrompt/cot.py
code served (permissive licence) · get_code("22aed9a263e00947")
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
import numpy as np
from typing import Dict, Any, List
from unittest.mock import Mock, MagicMock
from pydantic import BaseModel

class AnswerResponse(BaseModel):
    thinking: str
    answer_idx: str

# Create a mock client that simulates OpenAI's API response
mock_client = Mock()

# Mock the chat.completions.create method to return a structured response
mock_response = Mock()
mock_choice = Mock()
mock_message = Mock()

# The function will extract JSON from this content
mock_message.content = '{"thinking": "The answer is option A because...", "answer_idx": "A"}'
mock_choice.message = mock_message
mock_response.choices = [mock_choice]

mock_client.chat.completions.create = Mock(return_value=mock_response)

# Define options dict with string keys
options = {
    "A": "First option description",
    "B": "Second option description", 
    "C": "Third option description"
}

# Raw response text that would come from an LLM
raw_response = "The answer is clearly option A because it aligns with the requirements."

# Build ARGS dictionary
ARGS = {
    "raw_response": raw_response,
    "options": options,
    "client_old": mock_client
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pydantic, 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
parse_answer Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedPrompt/cot_sc.py
code served (permissive licence) · get_code("cb99011218fa888b")
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.

from unittest.mock import MagicMock
from typing import Dict, Any

# Create a mock client that simulates OpenAI's API behavior
mock_client = MagicMock()

# Create a mock response structure
mock_message = MagicMock()
mock_message.content = '{"answer_idx": "option_a"}'

mock_choice = MagicMock()
mock_choice.message = mock_message

mock_completion = MagicMock()
mock_completion.choices = [mock_choice]

# Set up the client to return our mock completion
mock_client.chat.completions.create.return_value = mock_completion

# Define the arguments
ARGS = {
    'raw_response': 'The answer is definitely option A because it provides the best explanation.',
    'options': {
        'option_a': 'First choice',
        'option_b': 'Second choice',
        'option_c': 'Third choice'
    },
    'client_old': mock_client
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — 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_filename Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/output/make_table.py
code served (permissive licence) · get_code("45ae3f57f1a0b42e")
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

# The function parse_filename takes a single parameter: filename (a string)
# It processes the string to extract model, dataset, split, and method information
# No other objects or complex structures are needed

ARGS = {
    'filename': 'gpt-4o-mmlu-test_hard-cot.json'
}
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
parse_group_info Ran
ran; our contract draft was wrong, not the code
gersteinlab/medagents-benchmark/baselines/MDAgents/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mitmedialab/mdagents, is pointer only (licence: NONE) · get_code("3a882e208639f562")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mitmedialab/mdagents, 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.

parse_method Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/output/make_table.py
code served (permissive licence) · get_code("582447d427269990")
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
import torch.nn as nn

torch.manual_seed(0)

# The function parse_method takes a single parameter 'method' which is a string
# It simply matches against various method names and returns a standardized display name
# No complex objects or attributes are accessed

ARGS = {
    'method': 'zero_shot'
}
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
run_cot Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedPrompt/cot.py
code served (permissive licence) · get_code("ff7fb56aafb0581a")
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
from unittest.mock import Mock, MagicMock

# Mock client for Anthropic (claude models)
anthropic_client = Mock()
anthropic_completion = Mock()
anthropic_completion.content = [Mock(text="Let me think through this step-by-step...\n\nBased on the medical knowledge, the answer is B")]
anthropic_client.messages.create.return_value = anthropic_completion

# Mock client for OpenAI (o1-mini, o3-mini, and other models)
openai_client = Mock()
openai_completion = Mock()
openai_message = Mock()
openai_message.content = "Let me analyze this question carefully...\n\nThe answer is A"
openai_completion.choices = [Mock(message=openai_message)]
openai_client.chat.completions.create.return_value = openai_completion

# Example medical question and options
question_text = "Which of the following is the primary treatment for acute myocardial infarction?"
options_text = "A) Aspirin and anticoagulation\nB) Percutaneous coronary intervention\nC) Lifestyle modification\nD) Physical therapy"

ARGS = {
    "question_text": question_text,
    "options_text": options_text,
    "client": anthropic_client,
    "model": "claude-3-5-sonnet"
}
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
run_few_shot Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MedPrompt/few_shot.py
code served (permissive licence) · get_code("8c33e08fea3477be")
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
import numpy as np
from typing import Dict, Any, List
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock client for Anthropic
mock_anthropic_client = Mock()
mock_completion = Mock()
mock_completion.content = [Mock()]
mock_completion.content[0].text = "The answer is A"
mock_anthropic_client.messages.create = Mock(return_value=mock_completion)

# Create few-shot examples
few_shot_examples = [
    {
        'question': 'What is the primary function of mitochondria?',
        'options': 'A) Energy production\nB) Protein synthesis\nC) DNA replication\nD) Photosynthesis',
        'answer': 'A'
    },
    {
        'question': 'Which hormone regulates blood glucose levels?',
        'options': 'A) Testosterone\nB) Insulin\nC) Cortisol\nD) Adrenaline',
        'answer': 'B'
    }
]

ARGS = {
    'question_text': 'What is the structure of a typical neuron?',
    'options_text': 'A) Cell body, dendrites, and axon\nB) Nucleus and cytoplasm\nC) Ribosome and mitochondria\nD) Membrane and organelles',
    'client': mock_anthropic_client,
    'model': 'claude-3-5-sonnet',
    'few_shot_examples': few_shot_examples
}
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 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
setup_model Ran
ran on a synthesized input
gersteinlab/medagents-benchmark/baselines/MDAgents/utils.py
code served (permissive licence) · get_code("524c7f26e71adef4")
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 os
from unittest.mock import MagicMock, patch

# Mock environment variables
os.environ['GEMINI_API_KEY'] = 'mock_gemini_key'
os.environ['AZURE_ENDPOINT'] = 'https://mock.openai.azure.com/'
os.environ['AZURE_API_KEY'] = 'mock_azure_key'
os.environ['AZURE_API_VERSION'] = '2024-02-01'
os.environ['AZURE_ENDPOINT_2'] = 'https://mock2.openai.azure.com/'
os.environ['AZURE_API_KEY_2'] = 'mock_azure_key_2'
os.environ['AZURE_API_VERSION_2'] = '2024-02-01'
os.environ['TOGETHER_API_KEY'] = 'mock_together_key'

# Mock genai module to avoid import errors
genai_mock = MagicMock()
import sys
sys.modules['google'] = MagicMock()
sys.modules['google.generativeai'] = genai_mock

ARGS = {
    'model_name': 'gpt-4'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
cleansing_analysis Not yet run
unverified (harvested, no recorded run)
gersteinlab/medagents-benchmark/baselines/MedAgents/data_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from gersteinlab/medagents, is pointer only (licence: NONE) · get_code("67d650ff65c4f541")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gersteinlab/medagents, 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. No invocation recorded.

fully_decode Not yet run
unverified (harvested, no recorded run)
gersteinlab/medagents-benchmark/baselines/MedAgents/utils.py
code served (permissive licence) · get_code("204419ab8fed348d")
How it ran

no invocation recorded.

remove_incomplete_sentence Not yet run
unverified (harvested, no recorded run)
gersteinlab/medagents-benchmark/baselines/MedAgents/data_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from gersteinlab/medagents, is pointer only (licence: NONE) · get_code("ed3609987f2d268f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gersteinlab/medagents, 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. No invocation recorded.

run Not yet run
unverified (harvested, no recorded run)
gersteinlab/medagents-benchmark/baselines/MedPrompt/cot.py
code served (permissive licence) · get_code("02116b249bf9b562")
How it ran

no invocation recorded.

run Not yet run
unverified (harvested, no recorded run)
gersteinlab/medagents-benchmark/baselines/MedPrompt/few_shot.py
code served (permissive licence) · get_code("4fbcebde16190dea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 1 later) and 18 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
cleansing_analysis 1 other paper
1 dated earlier
2311.10537 (2023-11)
MedAgents: Large Language Models as Collaborators for Zero-shot Medical Reasoning
get_question_analysis_prompt 1 other paper
1 dated earlier
2311.10537 (2023-11)
MedAgents: Large Language Models as Collaborators for Zero-shot Medical Reasoning
load_json 1 other paper
1 later
2609.00177 (2026-09)
Do General NLP Embeddings Capture Ontological Reasoning?
parse_group_info 1 other paper
1 dated earlier
2404.15155 (2024-04)
MDAgents: An Adaptive Collaboration of LLMs for Medical Decision-Making
remove_incomplete_sentence 1 other paper
1 dated earlier
2311.10537 (2023-11)
MedAgents: Large Language Models as Collaborators for Zero-shot Medical Reasoning

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

Complex medical reasoning requires integrating heterogeneous clinical evidence across multiple inference steps. Large language models (LLMs) now approach this through two routes: internalized reasoning and externalized agent scaffolding (frameworks that decompose problems collaboratively amongst multiple LLMs). To determine whether these routes are exclusive or complementary, we introduce MedicalAgentsBench, a filtered benchmark of 862 complex clinical questions drawn from the union of eight medical datasets via difficulty-aware curation and contamination screening. Evaluating three internalized reasoning models (DeepSeek-R1, o1-mini, and o3-mini), seven base models, and nine externalized agent-based methods, we find that internalized and externalized approaches each independently improve performance, and that their benefits compound: the highest accuracy is achieved by layering agent workflows onto an internalized reasoning model (i.e., o3-mini + MDAgents with 35.1%). Pareto analysis shows this combination dominates the cost-performance frontier; moreover, lightweight optimization on inexpensive models offers an entry point for resource-constrained settings. Our benchmark is at https://github.com/gersteinlab/MedicalAgentsBench.

For agents

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

get_harvested_code_for_paper("2503.07459")
get_code_for_paper("2503.07459")
have("2503.07459")

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

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

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

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

Connect an agent — have() is free.