SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.04039 · 2026

Safety and accuracy follow different scaling laws in clinical large language models

Andreas Maier, Daniel Truhn, Mahshad Lotfinia, Sven Nebelung, Soroosh Tayebi Arasteh, Harald Köstler, Gerhard Wellein, Sebastian Wind, Tri-Thien Nguyen, Jeta Sopa, Sebastian Bickelhaupt, Michael Uder

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2605.04039.json · badge: /api/ran/2605.04039.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
langchain-ai/langgraph canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
compose_as_dict Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/docker.py
code served (permissive licence) · get_code("92b539d170b715ac")
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.

from typing import Literal

# Define Version and DockerCapabilities classes
class Version:
    def __init__(self, major: int, minor: int, patch: int):
        self.major = major
        self.minor = minor
        self.patch = patch

class DockerCapabilities:
    def __init__(self, version_docker: Version, version_compose: Version, healthcheck_start_interval: bool, compose_type: Literal['plugin', 'standalone'] = 'plugin'):
        self.version_docker = version_docker
        self.version_compose = version_compose
        self.healthcheck_start_interval = healthcheck_start_interval
        self.compose_type = compose_type

# Create the capabilities object
docker_version = Version(major=20, minor=10, patch=5)
compose_version = Version(major=2, minor=5, patch=0)
capabilities = DockerCapabilities(
    version_docker=docker_version,
    version_compose=compose_version,
    healthcheck_start_interval=True,
    compose_type='plugin'
)

# Build ARGS dictionary with all parameters
ARGS = {
    'capabilities': capabilities,
    'port': 8000,
    'debugger_port': None,
    'debugger_base_url': None,
    'postgres_uri': None,
    'image': None,
    'base_image': None,
    'api_version': None,
    'engine_runtime_mode': 'combined_queue_worker'
}
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
dict_to_yaml Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/docker.py
code served (permissive licence) · get_code("34998b09d306c99b")
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 numpy as np

# Construct a test dictionary with various value types
test_dict = {
    'model': {
        'name': 'resnet50',
        'layers': 50,
        'pretrained': True
    },
    'training': {
        'batch_size': 32,
        'epochs': 100,
        'learning_rate': 0.001
    },
    'augmentation': ['random_crop', 'random_flip', 'color_jitter'],
    'seed': 42,
    'debug': False
}

ARGS = {
    'd': test_dict,
    'indent': 0
}
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 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
get_unknown_keys Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/config.py
code served (permissive licence) · get_code("34d113e6281f1afb")
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 difflib

# The function get_unknown_keys takes a raw_config dictionary as input
# and returns a list of warning strings for unknown keys.
# It uses difflib.get_close_matches to find similar keys.

# Create a test raw_config dict with both known and unknown keys
raw_config = {
    # Known keys
    'python_version': '3.10',
    'node_version': '16',
    'api_version': '1.0',
    'base_image': 'ubuntu:20.04',
    'image_distro': 'ubuntu',
    'pip_config_file': '/etc/pip.conf',
    'pip_installer': 'pip',
    'source': 'github',
    'dependencies': ['requests', 'numpy'],
    'dockerfile_lines': ['RUN apt-get update'],
    'graphs': {},
    'env': {'VAR': 'value'},
    'store': 's3',
    'auth': {'type': 'oauth'},
    'encryption': {'enabled': True},
    'http': {'port': 8080},
    'webhooks': [],
    'checkpointer': {'interval': 100},
    'ui': True,
    'ui_config': {},
    'keep_pkg_tools': False,
    '_INTERNAL_docker_tag': 'latest',
    'project_root': '/home/project',
    'package': 'mypackage',
    # Unknown keys to test the function
    'pyton_version': '3.10',  # typo - should suggest 'python_version'
    'random_unknown_key': 'value',  # completely unknown
    'dependancies': ['pkg'],  # typo - should suggest 'dependencies'
}

ARGS = {
    'raw_config': raw_config
}
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
has_disallowed_build_command_content Ran
ran, violated the contract we drafted
langchain-ai/langgraph/libs/cli/langgraph_cli/config.py
code served (permissive licence) · get_code("a13996604909f26f")
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 bool, 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 re

DISALLOWED_BUILD_COMMAND_CHARS = ['"', '`', '\\', '\n', '\r', '\x00', '\t', '|', ';', '$', '>', '<']

_SINGLE_AMPERSAND_RE = re.compile('(?<!&)&(?:&&)*(?!&)')

def has_disallowed_build_command_content(command: str) -> bool:
    """Check if a command string contains disallowed characters or patterns."""
    if any((char in command for char in DISALLOWED_BUILD_COMMAND_CHARS)):
        return True
    if _SINGLE_AMPERSAND_RE.search(command):
        return True
    return False

# Test case 1: Valid command with no disallowed content
valid_command = "echo hello world"

# Test case 2: Command with disallowed character (quote)
invalid_command_quote = 'echo "hello"'

# Test case 3: Command with single ampersand
invalid_command_ampersand = "command1 & command2"

ARGS = {
    "command": valid_command
}
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 bool, 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
monitor_stream Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/exec.py
code served (permissive licence) · get_code("33cf3ec51efe6fc4")
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 coroutine. 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 asyncio
import sys

async def dummy_stream_reader():
    """Create a mock StreamReader with test data"""
    reader = asyncio.StreamReader()
    # Add some test lines
    reader.feed_data(b'line 1\n')
    reader.feed_data(b'line 2\n')
    reader.feed_data(b'line 3\n')
    reader.feed_eof()
    return reader

def callback_func(line: str) -> bool | None:
    """Sample callback that processes lines"""
    # Return True to stop processing and enable display
    if "line 2" in line:
        return True
    return None

# Create a valid StreamReader
stream = asyncio.StreamReader()
stream.feed_data(b'test line 1\n')
stream.feed_data(b'test line 2\n')
stream.feed_eof()

ARGS = {
    'stream': stream,
    'collect': True,
    'display': False,
    'on_line': callback_func
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
normalize_image_tag Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/deploy.py
code served (permissive licence) · get_code("6b40926400bab63a")
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 re
import click.exceptions

def normalize_image_tag(value: str) -> str:
    """Validate and return a Docker image tag.

    Tags may only contain [A-Za-z0-9_.-].  Defaults to "latest" when empty.
    """
    if not value:
        value = 'latest'
    if not re.fullmatch('[A-Za-z0-9_.-]+', value):
        raise click.UsageError("Image tag may only contain characters A-Z, a-z, 0-9, '_', '-', '.'")
    return value


ARGS = {
    'value': 'v1.0.0-latest'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
click — 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
normalize_name Ran
ran; our contract draft was wrong, not the code
langchain-ai/langgraph/libs/cli/langgraph_cli/deploy.py
code served (permissive licence) · get_code("825e5384f2f85cdf")
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 re

def normalize_name(value: str | None) -> str:
    """Sanitize a deployment/directory name into a valid deployment name.

    LangSmith Deployment names only allow lowercase
    alphanumeric characters and hyphens ([a-z0-9-]).
    Invalid characters are replaced with hyphens.
    """
    if not value:
        return 'app'
    slug = re.sub('[^a-z0-9-]+', '-', value.lower()).strip('-')
    return slug or 'app'


ARGS = {
    "value": "My-Deployment_Name_2024!"
}
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
subp_exec Not yet run
unverified (harvested, no recorded run)
langchain-ai/langgraph/libs/cli/langgraph_cli/exec.py
code served (permissive licence) · get_code("59a9dee6f90cc132")
How it ran

no invocation recorded.

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, 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 8 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

Clinical large language models (LLMs) are often scaled by increasing model size, context length, retrieval complexity, or inference-time compute, with the implicit expectation that higher accuracy implies safer behavior. This assumption is incomplete in medicine, where a few confident, high-risk, or evidence-contradicting errors can matter more than average benchmark performance. We introduce Safety-Focused Evaluation of Scaling (SaFE-Scale), a framework for measuring how clinical LLM safety changes across model scale, evidence quality, retrieval strategy, context exposure, and inference-time compute. To instantiate this framework, we introduce RadSaFE-200, a Radiology Safety-Focused Evaluation benchmark of 200 multiple-choice questions with clinician-defined clean evidence, conflict evidence, and option-level labels for high-risk error, unsafe answer, and evidence contradiction. We evaluated 34 locally deployed LLMs across six deployment conditions: closedbook prompting (zero-shot), clean evidence, conflict evidence, standard retrieval-augmented generation (RAG), agentic RAG, and max-context prompting. Clean evidence produced the strongest improvement, increasing mean accuracy from 73.5% to 94.1%, while reducing high-risk error from 12.0% to 2.6%, contradiction from 12.7% to 2.3%, and dangerous overconfidence from 8.0% to 1.6%. Standard RAG and agentic RAG did not reproduce this safety profile: agentic RAG improved accuracy over standard RAG (76.0% to 78.1%) and reduced contradiction (11.7% to 9.0%), but high-risk error and dangerous overconfidence remained elevated. Max-context prompting increased latency without closing the safety gap, and additional inference-time compute produced only limited gains. Worst-case analysis showed that clinically consequential errors concentrated in a small subset of questions. Clinical LLM safety is therefore not a passive consequence of scaling, but a deployment property shaped by evidence quality, retrieval design, context construction, and collective failure behavior.

For agents

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

get_harvested_code_for_paper("2605.04039")
get_code_for_paper("2605.04039")
have("2605.04039")

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

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

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

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

Connect an agent — have() is free.