SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.16040 · NeurIPS · 2024

EHRNoteQA: An LLM Benchmark for Real-World Clinical Practice Using Discharge Summaries

Edward Choi, Seunghyun Won, Sunjun Kweon, Jiyoun Kim, Heeyoung Kwak, Dongchul Cha, Hangyul Yoon, Kwanghyun Kim, Jeewon Yang, Naver Digital, Healthcare Lab, Naver Healthcare

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2402.16040.json · badge: /api/ran/2402.16040.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
ji-youn-kim/ehrnoteqa canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
ji-youn-kim/EHRNoteQA canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
generate_prompt Ran
ran; our contract draft was wrong, not the code
ji-youn-kim/ehrnoteqa/src/gpt/gpt_setup.py
code served (permissive licence) · get_code("5652ec21392352cc")
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

torch.manual_seed(0)

# The function takes a single parameter 'sample' and wraps it in a list of dicts
# with role and content keys. The sample appears to be a string or text content.

sample = "This is a test sample for the prompt generation function."

ARGS = {
    'sample': sample
}
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 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
get_prompt Ran
ran; our contract draft was wrong, not the code
ji-youn-kim/ehrnoteqa/src/evaluation/utils.py
code served (permissive licence) · get_code("e80d57247e8567c0")
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

torch.manual_seed(0)

PROMPT_DICT = {'openended': 'Your task is to evaluate the provided model output in response to a specific question associated with the given discharge summaries. By using the correct answer also provided, you must score the answer as 0 or 1, based on the following scoring instructions.\nScoring Instructions:\n1. Assign 1 point if the answer is correct.\n2. Assign 0 points if the answer is either incorrect, or if it falsely claims there is no answer when one exists according to the discharge summaries.\n\n- Discharge Summaries:\n{note}\n\n- Question: {question}\n\n- Correct Answer: {correct_answer}\n\n- Model Output:\n\n{output}\n\nOutput format:\nScore: {{score}}\nReasoning: {{explanation}}\n(Note: In your response please replace {{score}} with the numerical score of 0 or 1, and provide a brief reasoning for the assigned score based on the evaluation criteria.)', 'multichoice': 'Your task is to evaluate the provided model output by determining whether it matches the correct answer from the multiple-choice options provided. The model output is correct and should be met with a "yes" if it accurately reflects the content of the correct answer choice, not necessarily its exact wording. If the content of the model output aligns with the correct answer choice, despite any additional details or varied phrasing, you are to respond "yes". Should the model output diverge in meaning or substance from the correct answer—whether by selecting an alternative choice or providing a response not aligning with any provided options—a response of "no" is necessary.\n\nModel Output:\n{output}\n\nAnswer Choices:\n{choices}\n\nCorrect Answer:\n{answer}\n\nWith the given information, do you conclude that the model output substantively matches the correct answer provided? Respond solely with "yes" or "no".'}

def get_prompt(eval_method):
    print(eval_method)
    return PROMPT_DICT[eval_method]

ARGS = {
    'eval_method': 'openended'
}
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
get_prompt Ran
ran; our contract draft was wrong, not the code
ji-youn-kim/ehrnoteqa/src/generation/utils.py
code served (permissive licence) · get_code("574a354a5ba5d4c1")
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

# Define PROMPT_DICT as shown in the function
PROMPT_DICT = {'openended': {'gpt': 'Discharge Summary :\n{note}\n\nQuestion : {question}\n\nAnswer :', 'llama-2-chat': '[INST] <<SYS>>\nYou are a helpful, respectful and honest assistant.\n<</SYS>>\n\nDischarge Summary :\n{note}\n\nQuestion : {question}\n\nAnswer : [/INST]'}, 'multichoice': {'gpt': 'Discharge Summary :\n{note}\n\nQuestion : {question}\nChoices :\nA. {choice_a}\nB. {choice_b}\nC. {choice_c}\nD. {choice_d}\nE. {choice_e}\n\nAnswer :', 'llama-2-chat': '[INST] <<SYS>>\nYou are a helpful, respectful and honest assistant.\n<</SYS>>\n\nDischarge Summary :\n{note}\n\nQuestion : {question}\nChoices :\nA. {choice_a}\nB. {choice_b}\nC. {choice_c}\nD. {choice_d}\nE. {choice_e}\n\nAnswer : [/INST]'}}

def get_prompt(eval_method, model_name):
    print(eval_method, model_name)
    if 'gpt' in model_name:
        return PROMPT_DICT[eval_method]['gpt']
    elif model_name in ['Llama-2-70b-chat-hf', 'Llama-2-13b-chat-hf', 'Llama-2-7b-chat-hf']:
        return PROMPT_DICT[eval_method]['llama-2-chat']

# Test case 1: GPT model with openended evaluation
eval_method_1 = 'openended'
model_name_1 = 'gpt-3.5-turbo'

# Test case 2: Llama-2 model with multichoice evaluation
eval_method_2 = 'multichoice'
model_name_2 = 'Llama-2-7b-chat-hf'

ARGS = {
    'eval_method': eval_method_1,
    'model_name': model_name_1
}
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
transform_string Ran
ran; our contract draft was wrong, not the code
ji-youn-kim/EHRNoteQA/src/preprocessing/preprocess.py
code served (permissive licence) · get_code("81d9be5791e0c528")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

ARGS = {
    's': """
    This is   a test string
    with multiple    spaces
    
    and newlines with    spaces
    
    """
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

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

Discharge summaries in Electronic Health Records (EHRs) are crucial for clinical decision-making, but their length and complexity make information extraction challenging, especially when dealing with accumulated summaries across multiple patient admissions. Large Language Models (LLMs) show promise in addressing this challenge by efficiently analyzing vast and complex data. Existing benchmarks, however, fall short in properly evaluating LLMs' capabilities in this context, as they typically focus on single-note information or limited topics, failing to reflect the real-world inquiries required by clinicians. To bridge this gap, we introduce EHRNoteQA, a novel benchmark built on the MIMIC-IV EHR, comprising 962 different QA pairs each linked to distinct patients' discharge summaries. Every QA pair is initially generated using GPT-4 and then manually reviewed and refined by three clinicians to ensure clinical relevance. EHRNoteQA includes questions that require information across multiple discharge summaries and covers ten diverse topics, mirroring the complexity and diversity of real clinical inquiries. We offer EHRNoteQA in two formats: open-ended and multi-choice question answering, and propose a reliable evaluation method for each. We evaluate 27 LLMs using EHRNoteQA and examine various factors affecting the model performance (e.g., the length and number of discharge summaries). Furthermore, to validate EHRNoteQA as a reliable proxy for expert evaluations in clinical practice, we measure the correlation between the LLM performance on EHRNoteQA, and the LLM performance manually evaluated by clinicians. Results show that LLM performance on EHRNoteQA have higher correlation with clinician-evaluated performance (Spearman(ρ): 0.78, Kendall(τ ): 0.62) compared to other benchmarks, demonstrating its practical relevance in evaluating LLMs in clinical settings. EHRNoteQA is publicly available under PhysioNet credential access at https://doi.org/10.13026/acga-ht95, and the code is available at https://github.com/ji-youn-kim/EHRNoteQA.

For agents

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

get_harvested_code_for_paper("2402.16040")
get_code_for_paper("2402.16040")
have("2402.16040")

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

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

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

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

Connect an agent — have() is free.