EHRStruct: A Comprehensive Benchmark Framework for Evaluating Large Language Models on Structured Electronic Health Record Tasks

Xiao Yang, Xuejiao Zhao, Zhiqi Shen · DOI

Abstract

While Large Language Models (LLMs) have demonstrated significant potential in medical text processing, their performance on structured Electronic Health Records (EHR)—the core of modern clinical data—remains under-explored and inconsistently evaluated. We introduce EHRStruct, a comprehensive benchmark featuring 11 diverse tasks designed to assess LLMs across data-driven and knowledge-driven dimensions. Alongside this, we propose EHRMaster, a code-augmented framework that translates clinical queries into executable logic. Our benchmarking of 20 representative LLMs reveals that general-purpose models currently surpass medical-specific variants in structured data reasoning, and that adaptive code execution significantly enhances performance on complex arithmetic tasks.

Introduction

Structured EHR data, consisting of relational tables with lab results, medications, and vitals, is fundamental to clinical decision support. However, evaluating LLMs on this data has historically been fragmented, focusing on narrow tasks like mortality prediction with inconsistent datasets. This lack of standardization hinders fair model comparison and diagnostic analysis of model failures. Structured EHR tasks present a "dual-challenge": they require Data-Driven capabilities (filtering, aggregation, and arithmetic) and Knowledge-Driven capabilities (interpreting data through external medical expertise).

The EHRStruct Benchmark and EHRMaster Framework

To address these challenges, we developed EHRStruct, which categorizes 11 representative tasks into a taxonomy based on clinical scenarios and cognitive levels (Understanding vs. Reasoning).

Overview of the EHRStruct benchmarking pipeline and the EHRMaster framework.

The EHRMaster framework was designed to tackle these tasks through a three-stage pipeline:

  1. Solution Planning: Generating a high-level natural language plan.
  2. Concept Alignment: Mapping plan elements to specific database schema fields (e.g., mapping "admission time" to ADMITTIME).
  3. Adaptive Execution: Choosing between direct reasoning or generating Python code (e.g., using pandas) to compute final answers.

Experimental Setup

EHRStruct utilizes 2,200 evaluation samples from two sources: Synthea (synthetic records) and the eICU Collaborative Research Database (real-world multi-center ICU data). This combination tests models against both clean synthetic logic and the complexities of real-world clinical data. We evaluated 20 LLMs, including generalist models (GPT, Gemini) and medical-specific models (Meditron, Apollo).

Key Insights and Results

Our evaluation yielded several critical findings regarding the current state of LLMs in structured health data:

  • Generalist Superiority: General-purpose LLMs consistently outperformed medical-specific models. This suggests that the broad reasoning and tabular understanding developed during general pre-training are currently more effective for structured data than specialized medical knowledge.
  • The Power of Code Augmentation: Models often struggle with multi-step arithmetic. By enabling Python code execution via EHRMaster, performance on data-heavy tasks (e.g., calculating total hospital costs) reached near-perfection.
  • Performance Across Task Categories: As shown in the comparative analysis, the proposed multi-stage approach (EHRMaster) significantly improves performance across both data-driven and knowledge-driven tasks compared to standard baselines.
Performance comparison of baseline models versus the proposed single-stage and multi-stage (EHRMaster) frameworks across Data-Driven and Knowledge-Driven tasks.
  • Knowledge-Driven Gaps: Despite improvements, models still struggle with tasks requiring deep clinical alignment, such as "Clinical Code Identification" (K-U1), where AUC scores remained moderate (50-60%).
  • Few-Shot Dynamics: While few-shot prompting (1-3 examples) generally helps, increasing to 5 examples often led to performance degradation due to context-window interference or overfitting.

Conclusion

EHRStruct provides a much-needed standardized lens for evaluating LLMs on structured clinical data. While generalist models and code-augmented frameworks like EHRMaster show great promise, the "knowledge gap" in mapping raw data to formal medical ontologies remains a significant hurdle. Future work will focus on extending the benchmark to dynamic, iterative treatment planning to better simulate real-time clinical care.

Summary updated

BibTeX
@inproceedings{yang2026ehrstruct,
  author = {Xiao Yang and Xuejiao Zhao and Zhiqi Shen},
  title = {{EHRStruct: A Comprehensive Benchmark Framework for Evaluating Large Language Models on Structured Electronic Health Record Tasks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i40.40731},
}
Figure