SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.01301 · 2026

Med-HEAL: Analyzing and Mitigating Hallucinations in Medical LLMs with Hallucination-Aware In-Context Learning

Yiming Liao, Jose Lizarraga

arXiv · PDF

Code that ran

15 of 19 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 0 have no contract verdict; 13 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2606.01301.json · badge: /api/ran/2606.01301.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
yimingliao-blad/med-heal canonical (classifier label)
classifier basis: census
15 ran · 4 no recorded run
FunctionStatusWhere it lives
assemble_note_text Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py
code served (permissive licence) · get_code("70bb037a2b4cc449")
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

torch.manual_seed(0)

# Construct a notes_lookup dictionary that mimics a patient notes database
# The function expects str(patient_id) as keys and row dicts with 'note_1', 'note_2', 'note_3' fields
notes_lookup = {
    '1': {
        'note_1': 'Patient presented with fever and cough',
        'note_2': 'Lab results show elevated white blood cell count',
        'note_3': 'Prescribed antibiotics and rest'
    },
    '2': {
        'note_1': 'Routine checkup completed',
        'note_2': 'All vitals normal',
        'note_3': np.nan  # Test handling of NaN values
    },
    '3': {
        'note_1': 'Patient complained of headaches',
        'note_2': '   ',  # Test handling of whitespace
        'note_3': 'nan'  # Test handling of string 'nan'
    }
}

patient_id = 1

ARGS = {
    'patient_id': patient_id,
    'notes_lookup': notes_lookup
}
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
bootstrap_delta Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/stats.py
code served (permissive licence) · get_code("2416e8bb6e0a9f35")
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

# Create small numpy arrays for zs and final
# zs represents initial values, final represents final values
np.random.seed(42)
zs = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
final = np.array([1.5, 2.8, 3.2, 4.5, 5.9])

# Define ARGS with all parameters for bootstrap_delta
ARGS = {
    'zs': zs,
    'final': final,
    'n_boot': 10000,
    '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
build_judge_user Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/llm.py
code served (permissive licence) · get_code("a7b09b0a06d8ff5a")
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)

ARGS = {
    "note": "Patient presented with chest pain and shortness of breath. EKG showed normal sinus rhythm. Troponin levels were within normal limits. Patient discharged with outpatient cardiology follow-up.",
    "question": "What were the patient's troponin levels?",
    "ground_truth": "Within normal limits",
    "model_answer": "Within normal limits"
}
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
build_pool_embeddings Ran
ran, honoured the contract we drafted
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/build_note_embeddings.py
code served (permissive licence) · get_code("9fafe34c699ee2cb")
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 ndarray, ndim 2, dtype family float, shape (2, 384) 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 numpy as np
from pathlib import Path
from unittest.mock import Mock, MagicMock
import tempfile

# Create a minimal mock model that has an encode method
class MockEmbeddingModel:
    def encode(self, texts, batch_size=32, show_progress_bar=False):
        # Return embeddings with shape (num_texts, embedding_dim)
        return np.random.randn(len(texts), 384).astype(np.float32)

# Create a small pool of examples
pool = [
    {'patient_id': 101},
    {'patient_id': 102},
]

# Create notes_lookup dictionary
notes_lookup = {
    '101': {
        'note_1': 'Patient presents with fever',
        'note_2': 'Blood pressure elevated',
        'note_3': 'Recommend follow-up',
    },
    '102': {
        'note_1': 'Routine check-up',
        'note_2': 'nan',
        'note_3': 'Continue current medications',
    },
}

# Create a temporary directory for fold_dir
fold_dir = Path(tempfile.gettempdir()) / 'test_fold'
fold_dir.mkdir(exist_ok=True)

# Create model instance
model = MockEmbeddingModel()

# Define ARGS dictionary with all required parameters
ARGS = {
    'pool': pool,
    'pool_name': 'correct',
    'fold_dir': fold_dir,
    'model': model,
    'notes_lookup': notes_lookup,
}
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 ndarray, ndim 2, dtype family float, shape (2, 384) — shape (2, 384) 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
classify_question Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/analyze_fullscale_pilot12.py
code served (permissive licence) · get_code("60514da571582bde")
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 classify_question takes a single parameter: question (a string)
# It processes the string by converting to lowercase and checking for keywords
# It returns a classification string based on which keyword list matches first

ARGS = {
    'question': 'What was the dose prescribed before admission?'
}
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
copy_asset Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/data_assets.py
code served (permissive licence) · get_code("ae3a16d5b0034f27")
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 tempfile
from pathlib import Path

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir)

# Create a source file with some content
src_file = temp_path / "source.txt"
src_file.write_bytes(b"This is test content for the source file. " * 100)

# Define destination path
dst_file = temp_path / "subdir" / "destination.txt"

ARGS = {
    'src': src_file,
    'dst': dst_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
env_for_legacy Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/config.py
code served (permissive licence) · get_code("0de6339bc4fc5b3a")
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 os
from pathlib import Path
from tempfile import TemporaryDirectory

# Create a minimal config dict that matches what env_for_legacy expects
cfg = {
    'paths': {
        'source_repo_root': './source_repo'
    }
}

ARGS = {
    'cfg': cfg
}
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
evaluate_one Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/evaluate_fullscale_pilot12.py
code served (permissive licence) · get_code("b38b8b67b3db5da2")
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 re
import time
from unittest.mock import Mock, MagicMock

# Create a mock OpenAI client that simulates the chat.completions.create API
mock_client = Mock()

# Create a mock response object
mock_message = Mock()
mock_message.content = "CORRECT: yes\nREASON: The model correctly identified the primary diagnosis as pneumonia based on the clinical presentation."

mock_choice = Mock()
mock_choice.message = mock_message

mock_response = Mock()
mock_response.choices = [mock_choice]

# Set up the client to return the mock response
mock_client.chat.completions.create = Mock(return_value=mock_response)

# Define test data for medical evaluation
test_note = """
PATIENT: John Doe, 65-year-old male
ADMISSION: 2024-01-15
CHIEF COMPLAINT: Shortness of breath and cough
HISTORY OF PRESENT ILLNESS: Patient presented with 5-day history of productive cough, fever (101.5F), and dyspnea.
PHYSICAL EXAMINATION: Crackles noted in bilateral lower lung fields. SpO2 92% on room air.
DIAGNOSIS: Community-acquired pneumonia
TREATMENT: Azithromycin and ceftriaxone initiated
DISCHARGE: 2024-01-22
"""

test_question = "What is the primary diagnosis for this patient?"

test_ground_truth = "Community-acquired pneumonia (CAP) with bilateral lung involvement"

test_model_answer = "The patient has pneumonia affecting both lungs, treated with antibiotics"

ARGS = {
    'client': mock_client,
    'note': test_note,
    'question': test_question,
    'ground_truth': test_ground_truth,
    'model_answer': test_model_answer,
    'model': 'gpt-4o'
}
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
file_info Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/data_assets.py
code served (permissive licence) · get_code("f0ebc27fe5d62c02")
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 tempfile
from pathlib import Path

# Create a temporary file with some content
with tempfile.NamedTemporaryFile(mode='wb', delete=False, suffix='.txt') as tmp:
    tmp.write(b'Hello, World! This is test content for the file_info function.')
    tmp_path = tmp.name

temp_file_path = Path(tmp_path)

ARGS = {
    'path': temp_file_path,
}
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_pilot7_controls Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12.py
code served (permissive licence) · get_code("b9a261c5c75e6950")
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 tempfile
from pathlib import Path
import pandas as pd
import os

# Create temporary directory structure to mock PILOT7_DIR
temp_dir = tempfile.mkdtemp()
pilot7_dir = Path(temp_dir) / 'output' / 'pilot_7_fullscale' / 'fold_0'
pilot7_dir.mkdir(parents=True, exist_ok=True)

# Create mock CSV files for control methods
type_positive_data = pd.DataFrame({
    'openended_correct': ['yes', 'no', 'yes', 'yes', 'no'] * 10,
})
type_positive_data.to_csv(pilot7_dir / 'type_positive_evaluated.csv', index=False)

random_positive_data = pd.DataFrame({
    'openended_correct': ['yes', 'yes', 'no', 'yes', 'yes'] * 10,
})
random_positive_data.to_csv(pilot7_dir / 'random_positive_evaluated.csv', index=False)

# Patch the PROJECT_ROOT and PILOT7_DIR before importing
import sys
from unittest.mock import patch

# Mock the module-level constants
mock_project_root = Path(temp_dir)
mock_pilot7_dir = pilot7_dir.parent

# Arguments for load_pilot7_controls
ARGS = {
    'n_samples': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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_exact Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/stats.py
code served (permissive licence) · get_code("6f6260842721f3e9")
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 math

ARGS = {
    "breaks": 5,
    "fixes": 8,
}
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
paired_summary Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/stats.py
code served (permissive licence) · get_code("de3d34655b0969fb")
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 pandas as pd
import numpy as np

# Create a small DataFrame with the required columns
np.random.seed(42)
n_samples = 10

# Create zeroshot_correct and final_correct columns (binary values)
zeroshot_correct = np.random.randint(0, 2, size=n_samples)
final_correct = np.random.randint(0, 2, size=n_samples)

# Create a fold column to test the optional fold_col parameter
fold = np.repeat(np.arange(2), n_samples // 2)  # 2 folds

df = pd.DataFrame({
    'zeroshot_correct': zeroshot_correct,
    'final_correct': final_correct,
    'fold': fold
})

ARGS = {
    'df': df,
    'fold_col': 'fold'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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_binary Ran
ran, honoured the contract we drafted
yimingliao-blad/med-heal/src/pre_atom/llm.py
code served (permissive licence) · get_code("e125c6da102eac5a")
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 int, ndim 0, dtype family int, 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

def parse_binary(text: str | None) -> int | None:
    if text is None:
        return None
    if '1' in text and '0' not in text:
        return 1
    if '0' in text:
        return 0
    return None

ARGS = {
    "text": "101"
}
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 int, ndim 0, dtype family int, 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
resolve_path Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/config.py
code served (permissive licence) · get_code("1aea88fcb5ac567a")
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 PosixPath. 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 pathlib import Path
import tempfile
import os

# Create a temporary directory to serve as a safe base for testing
temp_dir = tempfile.mkdtemp()

# Define arguments for resolve_path function
ARGS = {
    "value": "subdir/file.txt",
    "base": Path(temp_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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
resolve_project_path Ran
ran; our contract draft was wrong, not the code
yimingliao-blad/med-heal/src/pre_atom/data_assets.py
code served (permissive licence) · get_code("ccfe2f5d5709a273")
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 PosixPath. 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 tempfile
from pathlib import Path

# Create a temporary directory to act as a mock PROJECT_ROOT for testing
with tempfile.TemporaryDirectory() as tmpdir:
    PROJECT_ROOT = Path(tmpdir)
    
    # Test with relative path
    relative_path = "some/relative/path.txt"
    
    ARGS = {
        "path": relative_path
    }
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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_config Not yet run
unverified (harvested, no recorded run)
yimingliao-blad/med-heal/src/pre_atom/config.py
code served (permissive licence) · get_code("438722c182de3c8c")
How it ran

no invocation recorded.

load_correct_pool Not yet run
unverified (harvested, no recorded run)
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/build_retrieval_indices.py
code served (permissive licence) · get_code("9670ba25faf901be")
How it ran

no invocation recorded.

load_pilot_baseline Not yet run
unverified (harvested, no recorded run)
yimingliao-blad/med-heal/src/pre_atom/legacy/pilot_12_ra_icl/analyze_pilot12_phase3.py
code served (permissive licence) · get_code("83941c06f092f61e")
How it ran

no invocation recorded.

write_matrix Not yet run
unverified (harvested, no recorded run)
yimingliao-blad/med-heal/src/pre_atom/registry.py
code served (permissive licence) · get_code("4e4f08fa346f0d9f")
How it ran

no invocation recorded.

Also present in other papers' code

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

Hallucinations in medical large language models (LLMs) pose serious risks for clinical decision support, particularly when models must reason over complex electronic health records (EHRs). However, existing benchmarks often lack a realistic clinical context and provide limited insight into how hallucinations can be mitigated in practice. We introduce Med-HEAL, a framework for systematically identifying, analyzing, and mitigating hallucinations in medical LLMs using clinically grounded data. Building on the EHRNoteQA benchmark derived from MIMIC-IV discharge summaries, we construct a hallucination dataset by evaluating BioMistral-7B on openended clinical question answering tasks. Model outputs are labeled through a dual evaluation pipeline that combines LLM-as-a-Judge assessment (GPT-4o) with human auditing by medical student reviewers, producing correctness judgments and annotations of reasoning errors via a custom web-based evaluation system. We then leverage this dataset to investigate mitigation strategies: a self-critique pipeline, in which the test model reviews its own answers to detect potential errors and regenerates responses for flagged cases, and retrieval-augmented in-context learning (RA-ICL), which exposes the model to hallucinated and corrected examples. Experiments across five open-source LLMs-BioMistral, Llama-3.1, DeepSeek, Qwen2.5, and Qwen3, show that the self-critique strategy improves accuracy for three of five models (𝑝 < 0.05) without requiring parameter updates. Med-HEAL provides both a reusable hallucination dataset and a practical framework for studying and mitigating hallucinations in medical LLMs, supporting safer deployment of AI systems in clinical environments. Our code and data are publicly available at https://github.com/yimingliao-blad/med-heal.git. • Computing methodologies → Few-shot learning; Natural language processing; • Applied computing → Bioinformatics.

For agents

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

get_harvested_code_for_paper("2606.01301")
get_code_for_paper("2606.01301")
have("2606.01301")

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

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

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

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

Connect an agent — have() is free.