NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tool-wielding language-model-based agent offers conversational exploration of clinical tabular data

Andrew I. Yang, J. Woo, Ryan Zhang, Alan Mach, Prem N. Ramkumar, Ying MamedRxiv 2025

TL;DR

ChatDA is a new AI agent designed to help clinicians analyze tabular medical data through natural conversation. By using a specialized "tools-only" approach instead of raw code generation, it achieves higher accuracy than OpenAI’s Advanced Data Analysis while significantly reducing the risk of exposing sensitive patient information to the cloud.

What Problem Does This Paper Address?

Evidence-based medicine relies on data, but there is a persistent "last-mile" problem: clinicians have the essential domain knowledge to ask the right questions, but often lack the specialized programming or statistical training required to answer them using modern data science tools.

While Large Language Models (LLMs) like ChatGPT can write code to analyze data, they present two major hurdles in a clinical setting:

  1. Privacy Risks: Standard code-writing agents often process raw, patient-level data in the cloud. Even if de-identified, sharing detailed records increases the risk of re-identification.
  2. Stability and Continuity: LLMs are notorious for "hallucinating" code or forgetting data transformations (like scaling or filtering) between steps in a long conversation.

Methods

The researchers developed ChatDA (Chat Data Analyst), an agent built using the LlamaIndex framework. Unlike typical agents that write and execute free-form Python code, ChatDA primarily operates through a specialized toolkit called TableMage.

TableMage is a low-code Python package developed by the authors specifically for clinical data. It handles data transformation, statistical testing, and machine learning while enforcing strict "best practices," such as keeping test data isolated from training data to prevent leakage.

ChatDA offers two primary modes:

  • Normal Mode: Uses both custom tools and a Python interpreter.
  • Tools-only Mode: This is the "privacy-first" configuration. The LLM never sees raw patient data. Instead, the local tools perform the calculations and only send aggregated, population-level insights (like means, p-values, or variable names) back to the LLM to be interpreted.

Datasets

The authors evaluated ChatDA using three distinct approaches:

  1. DataAnalysisQA: A novel benchmark created for this study. It consists of 100 question-answer pairs across 10 public datasets. Unlike previous benchmarks that used code-heavy language, this one uses natural, non-technical queries and tests "persistence"—the ability to remember changes made to the data across multiple steps.
  2. Tabular ML Benchmark: 11 publicly available datasets from OpenML used to test machine learning capabilities (regression and classification).
  3. Clinical Case Study: A proprietary, de-identified dataset of 1,419 knee arthroplasty patients used to demonstrate real-world utility in predicting surgical procedures.

Key Insights and Ideas

  • Tool-Use vs. Code-Gen: The most significant "aha moment" is that restricting an LLM to a set of pre-validated tools actually makes it smarter and more reliable for data science. By removing the "blank canvas" of a Python interpreter, the researchers reduced the chance of the model making syntax errors or logical blunders.
  • The Persistence Advantage: One of the biggest frustrations with AI data analysts is that they often "forget" they normalized a column or filtered a dataset three prompts ago. Because ChatDA is integrated with the TableMage environment, these transformations are automatically tracked and preserved, leading to much higher consistency.
  • Privacy through Aggregation: The "Tools-only" mode provides a clever middle ground for using powerful cloud-based models (like GPT-4o) in healthcare. By ensuring only "population-level" summaries leave the local environment, the system aligns with standard clinical reporting practices while keeping individual records safe.

Key Results

ChatDA consistently outperformed state-of-the-art alternatives, including OpenAI’s Advanced Data Analysis (ADA), Open Interpreter, and LAMBDA.

  • Overall Accuracy: ChatDA achieved an accuracy of 0.951, significantly higher than OpenAI ADA (0.830) and Open Interpreter (0.803).
  • Stability: The model showed much lower variance across repeated trials, meaning it is less likely to give different answers to the same question.
  • Machine Learning: In the ML benchmark, ChatDA outperformed OpenAI ADA in 10 out of 11 tasks, achieving lower error rates in regression and higher AUC in classification.
  • Transformation Retention: ChatDA was nearly 20% better at retaining data transformations between analysis steps compared to the next-best agent.

Limitations and Future Work

While promising, the authors acknowledge several limitations:

  • Tabular Focus: Currently, ChatDA only handles tabular data (spreadsheets). It cannot yet analyze medical imaging or unstructured clinical notes.
  • Residual Privacy Risks: While "Tools-only" mode is safer, modern privacy research suggests that even aggregate statistics can sometimes be used for re-identification in very specific scenarios.
  • Tool Dependency: In its most private mode, the agent is strictly limited by the functions available in the TableMage library. If a specific statistical test isn't in the toolkit, the agent can't perform it.
  • Human Validation: The study used a single case study; the authors note that a formal user study with multiple clinicians is needed to fully validate its real-world usability.

Summary updated

BibTeX
@misc{yang2025tool,
  author = {Andrew I. Yang and J. Woo and Ryan Zhang and Alan Mach and Prem N. Ramkumar and Ying Ma},
  title = {{Tool-wielding language-model-based agent offers conversational exploration of clinical tabular data}},
  year = {2025},
  doi = {10.64898/2025.12.01.25341392},
  howpublished = {medRxiv},
}
Figure