Multi-Agent Conversation(MAC) 프레임워크로 의료 진단 능력 강화하기
Enhancing diagnostic capability with multi-agents conversational large language models
TL;DR Highlight
여러 AI 의사 에이전트가 MDT 회의처럼 협업하여 희귀 질환 진단 정확도를 GPT-4 단독보다 높인다.
Who Should Read
의료 AI 솔루션을 개발하는 백엔드 개발자 또는 멀티 에이전트 시스템을 설계 중인 AI 엔지니어. 특히 LLM 단독 추론의 한계를 느끼고 에이전트 협업 구조를 고민하는 분들.
Core Mechanics
- 임상 다학제팀(MDT, 여러 전문의가 모여 논의하는 방식)을 모방한 MAC 프레임워크 설계 — 여러 Doctor 에이전트가 토론하고 Supervisor 에이전트가 최종 판단
- 302개 희귀 질환 케이스로 GPT-3.5, GPT-4, MAC 세 가지 비교 — 초진과 추가 상담 모두에서 MAC이 단독 모델 대비 진단 정확도와 검사 제안 정확도 모두 우세
- 최적 구성은 Doctor 에이전트 4명 + Supervisor 에이전트 1명, 베이스 모델은 GPT-4
- CoT(Chain of Thought, 단계별 추론), Self-Refine(스스로 답 수정), Self-Consistency(여러 번 답하고 다수결) 등 기존 프롬프트 기법들과 비교했을 때 MAC이 정확도와 출력 토큰 수 모두에서 앞섬
- 반복 실행 시 결과 일관성이 높아 실제 임상 적용 가능성 있음
Evidence
- MAC은 GPT-4 단독 대비 초진 및 추가 상담 진단 정확도 모두에서 더 높은 수치 달성 (논문 내 희귀질환 302케이스 기준)
- CoT, Self-Refine, Self-Consistency 대비 MAC이 더 높은 진단 정확도 + 더 많은 출력 토큰(근거 서술 풍부) 기록
- Doctor 에이전트 수를 1→4명으로 늘릴수록 성능 향상, 4명에서 최적점 도달
How to Apply
- 복잡한 분류/판단 태스크에서 단일 LLM 호출 대신, 역할이 다른 에이전트(예: 전문가 A, 전문가 B, 검토자)를 병렬로 돌리고 Supervisor 에이전트가 최종 결론 내리는 구조로 바꿔보면 정확도 향상 기대 가능
- GPT-4 기반으로 에이전트를 구성할 때 4~5개 에이전트가 최적 — 에이전트가 너무 많으면 비용과 지연이 증가하고 성능 향상이 둔화되므로 이 범위 참고
- 의료 외에도 법률 검토, 코드 리뷰, 요구사항 분석처럼 여러 관점이 필요한 도메인에 동일한 MDT 패턴 적용 가능 — 각 에이전트에 다른 전문 역할 페르소나를 부여하면 됨
Code Example
# OpenAI API를 활용한 간단한 MAC 패턴 예시
import openai
client = openai.OpenAI()
def doctor_agent(case: str, specialty: str) -> str:
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": f"You are an experienced {specialty} physician. Analyze the case and suggest a diagnosis with reasoning."},
{"role": "user", "content": case}
]
)
return response.choices[0].message.content
def supervisor_agent(case: str, doctor_opinions: list[str]) -> str:
opinions_text = "\n\n".join([f"Doctor {i+1}: {op}" for i, op in enumerate(doctor_opinions)])
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a senior supervising physician. Review all doctor opinions and provide a final integrated diagnosis."},
{"role": "user", "content": f"Case:\n{case}\n\nDoctor Opinions:\n{opinions_text}\n\nProvide the final diagnosis."},
]
)
return response.choices[0].message.content
# 사용 예시
case = "28-year-old patient with progressive muscle weakness, fatigue, and elevated CK levels..."
specialties = ["neurologist", "rheumatologist", "internal medicine specialist", "geneticist"]
# 4명의 Doctor 에이전트 실행
opinions = [doctor_agent(case, s) for s in specialties]
# Supervisor가 최종 진단
final_diagnosis = supervisor_agent(case, opinions)
print(final_diagnosis)Terminology
관련 논문
OpenKnowledge – Obsidian/Notion의 오픈소스 AI-first 대안
Git 기반 동기화와 Claude/Codex/Cursor 연동을 내장한 로컬 우선 마크다운 에디터로, AI 에이전트의 두 번째 뇌(LLM Wiki)로 활용할 수 있는 오픈소스 도구다.
Unfireable Safety Kernel: AI 에이전트를 위한 Execution-Time AI Alignment
AI 에이전트가 자신의 안전장치를 우회할 수 없도록, 에이전트 프로세스 바깥에 수학적으로 증명된 강제 통제 게이트를 배치하는 아키텍처
RubyLLM: 주요 AI 프로바이더를 모두 지원하는 Ruby 프레임워크
OpenAI, Claude, Gemini 등 주요 AI 프로바이더를 단일 인터페이스로 통합한 Ruby 프레임워크로, Rails 통합과 에이전트 기능까지 지원해 Ruby 개발자가 AI 기능을 빠르게 붙일 수 있다.
Qwen-AgentWorld: 범용 에이전트를 위한 Language World Model
Alibaba Qwen 팀이 AI 에이전트가 행동 결과를 미리 시뮬레이션할 수 있는 'Language World Model'을 공개했다. 에이전트 훈련과 실행 경로 검증에 새로운 패러다임을 제시하는 연구다.
SHERLOC: Code Repair Agent를 위한 구조화된 Diagnostic Localization 프레임워크
버그 위치만 알려주는 게 아니라 '왜, 어떻게 고쳐야 하는지'까지 진단 리포트를 생성해서 코드 수정 에이전트의 성능을 높이는 training-free 프레임워크
peerd – 브라우저에서 완전히 실행되는 AI Agent Harness
백엔드 서버 없이 Chrome/Firefox 확장 프로그램으로만 동작하는 AI 에이전트 실행 환경으로, 브라우저 탭을 직접 조작하고 WASM Linux VM까지 구동할 수 있어 프라이버시와 보안을 동시에 챙길 수 있다.
Original Abstract (Expand)
Large Language Models (LLMs) show promise in healthcare tasks but face challenges in complex medical scenarios. We developed a Multi-Agent Conversation (MAC) framework for disease diagnosis, inspired by clinical Multi-Disciplinary Team discussions. Using 302 rare disease cases, we evaluated GPT-3.5, GPT-4, and MAC on medical knowledge and clinical reasoning. MAC outperformed single models in both primary and follow-up consultations, achieving higher accuracy in diagnoses and suggested tests. Optimal performance was achieved with four doctor agents and a supervisor agent, using GPT-4 as the base model. MAC demonstrated high consistency across repeated runs. Further comparative analysis showed MAC also outperformed other methods including Chain of Thoughts (CoT), Self-Refine, and Self-Consistency with higher performance and more output tokens. This framework significantly enhanced LLMs’ diagnostic capabilities, effectively bridging theoretical knowledge and practical clinical application. Our findings highlight the potential of multi-agent LLMs in healthcare and suggest further research into their clinical implementation.