用本地大模型自动提取病历信息并转为诊断编码,保护隐私且无需云端服务。
Leveraging Large Language Models to Extract and Translate Medical Information in Doctors' Notes for Health Records and Diagnostic Billing Codes
- 在本地设备上用开源大模型提取医生笔记中的临床信息
- 小模型(7B-20B参数)生成特定诊断码准确率仍不理想
- 建议采用人机协作方式,更适合当前技术条件
美国医生职业倦怠已达到危机水平,部分原因在于电子健康记录(EHR)文档和复杂诊断代码的行政负担。为缓解压力并严格保障患者隐私,本文探索一种基于本地设备、离线运行的自动医疗编码系统。研究聚焦于使用开源权重的大语言模型(LLMs),从医生笔记中提取临床信息,并将其转化为ICD-10-CM诊断编码,无需依赖云服务。通过Ollama、LangChain与容器化环境构建隐私优先的处理流程,评估了Llama 3.2、Mistral、Phi和DeepSeek等多款开源模型在消费级硬件上的表现。采用新型合成病历基准测试零样本、少样本及检索增强生成(RAG)提示策略。结果表明,严格JSON格式约束实现近100%合规性,但小规模本地模型(7B–20B参数)生成特定诊断码仍具挑战。与常见提示工程建议相反,少样本提示导致过拟合与幻觉,性能下降。尽管RAG可发现部分未见编码,但常因上下文窗口饱和而降低整体准确率。研究认为,当前完全自动化无监督编码尚不可靠,人机协同辅助编码是更可行路径。本文贡献了一个可复现的本地LLM架构与用于隐私保护医疗信息提取与编码的基准数据集。
原文摘要 · Abstract (English)
Physician burnout in the United States has reached critical levels, driven in part by the administrative burden of Electronic Health Record (EHR) documentation and complex diagnostic codes. To relieve this strain and maintain strict patient privacy, this thesis explores an on-device, offline automatic medical coding system. The work focuses on using open-weight Large Language Models (LLMs) to extract clinical information from physician notes and translate it into ICD-10-CM diagnostic codes without reliance on cloud-based services. A privacy-focused pipeline was developed using Ollama, LangChain, and containerized environments to evaluate multiple open-weight models, including Llama 3.2, Mistral, Phi, and DeepSeek, on consumer-grade hardware. Model performance was assessed for zero-shot, few-shot, and retrieval-augmented generation (RAG) prompting strategies using a novel benchmark of synthetic medical notes. Results show that strict JSON schema enforcement achieved near 100% formatting compliance, but accurate generation of specific diagnostic codes remains challenging for smaller local models (7B-20B parameters). Contrary to common prompt-engineering guidance, few-shot prompting degraded performance through overfitting and hallucinations. While RAG enabled limited discovery of unseen codes, it frequently saturated context windows, reducing overall accuracy. The findings suggest that fully automated unsupervised coding with local open-source models is not yet reliable; instead, a human-in-the-loop assisted coding approach is currently the most practical path forward. This work contributes a reproducible local LLM architecture and benchmark dataset for privacy-preserving medical information extraction and coding.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。