Skip to main content
QUICK REVIEW

[Paper Review] Towards Understanding the Generalization of Medical Text-to-SQL Models and Datasets

Richard Tarbell, Kim‐Kwang Raymond Choo|PubMed|Mar 22, 2023
Machine Learning in HealthcareComputer Science7 references3 citations
TL;DR

This paper introduces MIMICSQL 2.0, a revised split of the MIMICSQL dataset designed to better evaluate the generalization of medical text-to-SQL models. By re-splitting the data to isolate distributional shift and applying back-translation and Spider dataset augmentation, the authors show that state-of-the-art models drop from 92% to 28% accuracy, revealing significant room for improvement in real-world deployment scenarios.

ABSTRACT

Electronic medical records (EMRs) are stored in relational databases. It can be challenging to access the required information if the user is unfamiliar with the database schema or general database fundamentals. Hence, researchers have explored text-to-SQL generation methods that provide healthcare professionals direct access to EMR data without needing a database expert. However, currently available datasets have been essentially "solved" with state-of-the-art models achieving accuracy greater than or near 90%. In this paper, we show that there is still a long way to go before solving text-to-SQL generation in the medical domain. To show this, we create new splits of the existing medical text-to- SQL dataset MIMICSQL that better measure the generalizability of the resulting models. We evaluate state-of-the-art language models on our new split showing substantial drops in performance with accuracy dropping from up to 92% to 28%, thus showing substantial room for improvement. Moreover, we introduce a novel data augmentation approach to improve the generalizability of the language models. Overall, this paper is the first step towards developing more robust text-to-SQL models in the medical domain.

Motivation & Objective

  • To address the lack of generalization evaluation in existing medical text-to-SQL benchmarks, particularly under distributional shift.
  • To create a new dataset split (MIMICSQL 2.0) that better measures model robustness to unseen database schemas and query variations.
  • To evaluate whether data augmentation techniques like back-translation and external dataset integration (e.g., Spider) can improve model generalization.
  • To demonstrate that current models are overfit to training data patterns and fail under real-world distribution shifts.
  • To provide a stronger benchmark for future research in medical text-to-SQL, especially for cross-hospital deployment.

Proposed method

  • Re-split the original MIMICSQL dataset into new train/development/test sets to isolate distributional shift and measure generalization.
  • Train and evaluate state-of-the-art T5-based models on the new MIMICSQL 2.0 split, comparing performance across template-to-template (T→T), paraphrased-to-paraphrased (P→P), and template-to-paraphrased (T→P) settings.
  • Apply back-translation to generate synthetic paraphrased queries from template-based questions, increasing linguistic diversity.
  • Fine-tune models using the Spider dataset to improve zero-shot generalization to complex schema structures.
  • Combine back-translation with Spider fine-tuning to enhance model robustness across diverse query forms.
  • Measure performance using both logical form accuracy (ACC_LF) and execution accuracy (ACC_EX) to capture both syntactic correctness and result fidelity.
Figure 1: Model overview.
Figure 1: Model overview.

Experimental results

Research questions

  • RQ1Can a new data split of MIMICSQL better measure the generalization of text-to-SQL models in the medical domain?
  • RQ2How do state-of-the-art models perform when evaluated on a distributionally shifted split compared to the original split?
  • RQ3Can data augmentation via back-translation and external datasets (e.g., Spider) improve model generalization in medical text-to-SQL?
  • RQ4To what extent do models trained on templates generalize to paraphrased or unseen query forms?
  • RQ5How do performance metrics like ACC_LF and ACC_EX diverge under distributional shift, and what insights do they provide?

Key findings

  • Performance on the new MIMICSQL 2.0 split dropped significantly: base T5 model achieved only 14.9% logical form accuracy (ACC_LF) and 27.8% execution accuracy (ACC_EX) on the T→T split, compared to 92% in prior benchmarks.
  • The T5+Spider model achieved 77.7% ACC_LF and 83.9% ACC_EX on the T→T split, indicating that schema-specific pretraining helps but does not fully resolve generalization issues.
  • Models trained on templates (T→T) showed high overfitting, often making incorrect joins based on training pattern matching rather than schema understanding.
  • When fine-tuned with back-translation and Spider data, the T5 model achieved 51.9% ACC_EX on the T→P split, approaching the 48.7% ACC_EX of models trained directly on paraphrased data.
  • The performance gap between T→T and P→P splits was substantial, indicating that current models are not robust to distributional shifts in query form or schema structure.
  • The study reveals that existing MIMICSQL benchmarks are not sufficient for evaluating real-world generalization, especially under cross-hospital deployment conditions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.