병리 보고서 구조화 추출을 위한 LLM 종합 테스트
Comprehensive testing of large language models for extraction of structured data in pathology
TL;DR Highlight
오픈소스 LLM으로 병리 보고서를 구조화했더니 GPT-4와 비슷한 정확도가 나왔다
Who Should Read
병원·헬스케어 환경에서 자유 텍스트 문서를 JSON 등 구조화 데이터로 바꾸는데 외부 API 비용과 개인정보가 걱정인 백엔드 개발자
Core Mechanics
- 오픈소스가 GPT-4만큼 뽑았다
- 병리 보고서에서 핵심 항목 11개를 추출하는 작업에서 오픈소스 모델이 GPT-4와 비슷한 정확도를 냈다.
- 비교한 오픈소스는 Llama2 13B·70B, Llama3 8B·70B, Qwen2.5 7B다.
- 비용과 개인정보 문제가 줄어든다
- 오픈소스 모델은 자체 환경에서 돌릴 수 있어 상용 API보다 싸고 개인정보 걱정이 적다고 한다.
- 병원처럼 민감한 문서를 다루는 곳에 맞는 선택지다.
- 모델·설정마다 정확도가 크게 갈린다
- 같은 작업이라도 모델과 구성에 따라 정밀도 차이가 컸다.
- 프롬프트 전략과 양자화(모델을 가볍게 줄이는 기법) 방식이 그 차이의 원인이었다.
- 영어·독일어 두 언어로 테스트했다
- 주석을 단 보고서 579건을 독일어판과 영어판으로 만들어 평가했다.
- 이 데이터셋은 공개되어 벤치마크로 쓸 수 있다.
Evidence
- 보고서 579건으로 평가
- 독일어·영어 두 버전으로 주석을 단 병리 보고서다.
- 보고서마다 핵심 파라미터 11개를 추출하게 했다.
- 모델 6종을 비교
- 상용은 GPT-4 하나다.
- 오픈소스는 Llama2 13B, Llama2 70B, Llama3 8B, Llama3 70B, Qwen2.5 7B다.
- GPT-4와 오픈소스의 정밀도가 비슷
- 원문은 오픈소스 모델이 높은 정밀도로 GPT-4의 정확도에 필적한다고 밝혔다.
- 원문 요약에는 구체적인 수치가 없다.
How to Apply
- 내 문서 20건으로 추출 정확도 비교하기
- 오늘 실제 문서 20건을 골라 정답 JSON을 직접 만들어라.
- 현재 쓰는 API 모델과 로컬 오픈소스 모델에 같은 프롬프트를 넣고 필드별로 맞는지 세어라.
- 민감 문서는 로컬 오픈소스 모델로 돌리기
- 개인정보 때문에 외부 API를 쓰기 어려운 문서 추출 파이프라인에 적용하라.
- 정확도가 GPT-4급인지 먼저 소규모로 확인하고 전환하라.
- 프롬프트와 양자화 조합을 표로 만들어 실험하기
- 프롬프트 전략 2~3종과 양자화 수준 2~3종을 곱해 조합별 정확도를 기록하라.
- 제일 가벼운 조합 중 목표 정확도를 넘는 것을 배포하라.
Try It
# Claude나 ChatGPT에 붙여넣기 (논문 방법의 간이 버전: 프롬프트로 필드 추출)
아래 보고서에서 다음 필드를 추출해 JSON으로만 답해줘.
필드: {{추출할 필드 목록}}
규칙:
- 원문에 없는 값은 null로 둔다.
- 추측해서 채우지 않는다.
- 값은 원문 표현 그대로 쓴다.
보고서:
{{문서}}Terminology
관련 논문
Gemini 4 Neon, Models Engineering Index 1위에 오르다
여러 벤치마크를 합친 MEI에서 Gemini 4 Neon이 68.0점으로 1위
LLM이 hex dump만 보고 실행 파일을 바이트 단위로 읽고 쓴다
도구 없이 hex dump만 줬더니 LLM이 바이너리를 분석·패치·작성했다
Claude는 대규모 단백질 서열로 학습됐다: next-amino-acid 테스트 결과
연구가 안 된 단백질의 다음 아미노산을 맞히자 최신 Claude만 통했다
짧게 기억됐다: 저장된 선호가 의사결정에 필수적인 정보를 조용히 지운다
메모리에 '짧게' 선호가 저장되면 경고가 조용히 빠지고, 2단계 답변이 내용을 되살렸다
AI가 생성한 코드는 전부 오픈소스여야 한다는 주장
AI가 쓴 코드는 오픈소스로 공개해야 한다는 주장에 HN 댓글은 대체로 반대했다
수천 개 대화가 LLM 내부에서 어떻게 보이는가: Qwen3-1.7B 상태 지도
Qwen3-1.7B 내부 상태를 시각화했더니 중국어만 영어와 확연히 떨어졌다
AI로 코드는 빨라졌는데 왜 배포는 안 빨라질까: 활동과 성과의 간극
AI가 코드 작성은 빠르게 했지만 배포 속도는 그만큼 오르지 않았다는 발표
LLM 16종이 TIS-100 퍼즐을 풀었다: 커뮤니티 기록을 깬 모델들
LLM 16종에 TIS-100을 풀게 했더니 18개 퍼즐에서 새 최적점 133개가 나왔다
Original Abstract (Expand)
Pathology departments generate large volumes of unstructured data as free-text diagnostic reports. Converting these reports into structured formats for analytics or artificial intelligence projects requires substantial manual effort by specialized personnel. While recent studies show promise in using advanced language models for structuring pathology data, they primarily rely on proprietary models, raising cost and privacy concerns. Additionally, important aspects such as prompt engineering and model quantization for deployment on consumer-grade hardware remain unaddressed. We created a dataset of 579 annotated pathology reports in German and English versions. Six language models (proprietary: GPT-4; open-source: Llama2 13B, Llama2 70B, Llama3 8B, Llama3 70B, and Qwen2.5 7B) were evaluated for their ability to extract eleven key parameters from these reports. Additionally, we investigated model performance across different prompt engineering strategies and model quantization techniques to assess practical deployment scenarios. Here we show that open-source language models extract structured data from pathology reports with high precision, matching the accuracy of proprietary GPT-4 model. The precision varies significantly across different models and configurations. These variations depend on specific prompt engineering strategies and quantization methods used during model deployment. Open-source language models demonstrate comparable performance to proprietary solutions in structuring pathology report data. This finding has significant implications for healthcare institutions seeking cost-effective, privacy-preserving data structuring solutions. The variations in model performance across different configurations provide valuable insights for practical deployment in pathology departments. Our publicly available bilingual dataset serves as both a benchmark and a resource for future research. Pathology departments produce many diagnostic reports as free text, which is hard to analyze or use in research and computer projects. Converting this free text into more standard organized information like test results or diagnoses, makes it easier to use. This task often requires human experts and takes time. Large language models (LLMs), which are advanced computer systems designed to understand and generate human-like text, might simplify this process. Here, we tested six LLMs, including freely available models and the commercial GPT-4 model, using 579 pathology reports in English and German. Our results show that freely available models can perform as well as commercial, providing a cheaper solution while avoiding privacy concerns. The shared dataset will support future research in pathology data processing. Grothey et al. examine the performance of large language models in structuring pathology reports. Findings demonstrate similar accuracy between commercial and open-source models providing a cost-effective, privacy-conscious solution to extract structured data with high precision from bilingual datasets.