TL;DR
While Large Language Models (LLMs) are increasingly capable of generating SQL, they often stumble in the "messy" reality of clinical data access. This paper introduces EHR-ChatQA, a new benchmark that uses simulated users to evaluate how well AI agents handle vague questions, resolve terminology mismatches, and maintain consistency across multi-turn conversations in the high-stakes world of Electronic Health Records (EHR).
The Problem: Static Benchmarks vs. Clinical Reality
Most existing text-to-SQL benchmarks treat database querying as a one-and-done translation task: a perfectly phrased question goes in, and a SQL query comes out. In a real clinical setting, this is rarely the case.
Clinicians often ask vague questions (e.g., "Show me recent labs") or use brand names and abbreviations (e.g., "Lopressor," "WBC") that do not match the formal terminology stored in a database (e.g., "metoprolol tartrate" or "white blood cell count"). To be genuinely useful, an AI agent must act as a proactive collaborator—clarifying ambiguity, using tools to find the right database values, and adapting when a search comes up empty. This paper addresses the lack of benchmarks that test this end-to-end "agentic" workflow.
Methods: The EHR-ChatQA Framework
To bridge this gap, the authors developed EHR-ChatQA, which places an AI agent in a simulated environment with an LLM-powered user and a suite of tools.
The benchmark evaluates agents through two distinct interaction flows:
- Incremental Query Refinement (IncreQA): The user starts with a broad goal and adds constraints turn-by-turn (e.g., "Find patients with diabetes," then "only those over 65," then "only those with a recent HbA1c test").
- Adaptive Query Refinement (AdaptQA): This flow is more complex. If an initial search fails (e.g., no records for a brand-name drug), the agent must "pivot" using clinical knowledge to search for a generic equivalent or an alternative lab test.
To ensure the agent isn't just guessing based on prior knowledge, the researchers provided a Tool Suite for schema exploration, fuzzy value matching, and web search. Crucially, they also implemented a Simulation Validator—an LLM-as-a-judge that monitors the conversation to ensure the simulated user follows the rules and doesn't accidentally leak the answer to the agent.
Datasets
The benchmark is grounded in two widely used, publicly available EHR databases: MIMIC-IV and eICU. To prevent models from simply memorizing the schemas of these famous datasets, the authors renamed all tables and columns (e.g., changing "patients" to "demographics"). This forces the agents to actively use the schema exploration tools to succeed across the benchmark's 366 unique task instances.
Key Insights and Results
The most striking finding from the evaluation is the massive difference between "optimistic" success and "consistent" success, termed the Robustness Gap.
The authors measured Pass@5 (did the agent succeed at least once in five independent trials?) and Pass^5 (did it succeed every single time?).
- The Consistency Crisis: Even top models like o4-mini showed a massive gap. For instance, on AdaptQA, o4-mini achieved a Pass@5 of 66.2%, but its Pass^5 (consistent success) was a dismal 7.5%. In medicine, getting it right occasionally isn't good enough; consistency is a fundamental safety requirement.
- Closed-source Dominance: Models like o4-mini and Gemini-2.5-Flash significantly outperformed open-source models (Llama 3.3-70B, Qwen3-32B).
- IncreQA vs. AdaptQA: Agents performed reasonably well on IncreQA (Pass@5 > 90% for top models), but struggled significantly with the non-linear logic and pivoting required in AdaptQA.
Common Failure Modes
- Value Linking is the Primary Bottleneck: Over 50% of consistent failures were due to "Value Linking Errors." Agents struggled to map common clinical terms to the specific strings stored in the database, even when given search tools.
- Context is Fragile: Many inconsistent failures occurred because a slight change in how the user phrased a follow-up question caused the agent to "forget" a constraint from a previous turn.
Limitations and Future Work
The authors acknowledge that LLM-based simulated users can still behave unpredictably, which might occasionally affect evaluation. Additionally, the benchmark currently focuses on structured SQL databases and does not yet incorporate unstructured clinical notes.
Future agent development should focus on better state-tracking to prevent losing context during multi-turn conversations and more comprehensive exploration strategies to resolve terminology mismatches reliably.
Summary updated