ECG-LLM -- training and evaluation of domain-specific large language models for electrocardiography
Lara Ahrens, Wilhelm Haverkamp, Nils Strodthoff
TL;DR
This work investigates domain adaptation of open-weight LLMs for electrocardiography, comparing finetuning and retrieval-augmented generation against a representative proprietary model. Using a multi-layered evaluation framework that includes MCQ, text similarity, LLM-as-a-judge, and human expert assessments, the study shows that finetuned Llama 3.1 70B excels on in-distribution tasks and approaches the performance of Claude Sonnet 3.7 and RAG in other settings. The results reveal substantial heterogeneity across evaluation modalities, underscoring the need for diverse, statistically robust assessments in domain-specific LLMs. Overall, domain adaptation through finetuning and RAG yields competitive performance with proprietary models, supporting privacy-preserving, locally deployable clinical AI solutions for ECG interpretation and analysis.
Abstract
Domain-adapted open-weight large language models (LLMs) offer promising healthcare applications, from queryable knowledge bases to multimodal assistants, with the crucial advantage of local deployment for privacy preservation. However, optimal adaptation strategies, evaluation methodologies, and performance relative to general-purpose LLMs remain poorly characterized. We investigated these questions in electrocardiography, an important area of cardiovascular medicine, by finetuning open-weight models on domain-specific literature and implementing a multi-layered evaluation framework comparing finetuned models, retrieval-augmented generation (RAG), and Claude Sonnet 3.7 as a representative general-purpose model. Finetuned Llama 3.1 70B achieved superior performance on multiple-choice evaluations and automatic text metrics, ranking second to Claude 3.7 in LLM-as-a-judge assessments. Human expert evaluation favored Claude 3.7 and RAG approaches for complex queries. Finetuned models significantly outperformed their base counterparts across nearly all evaluation modes. Our findings reveal substantial performance heterogeneity across evaluation methodologies, underscoring assessment complexity. Nevertheless, domain-specific adaptation through finetuning and RAG achieves competitive performance with proprietary models, supporting the viability of privacy-preserving, locally deployable clinical solutions.
