https://pmc.ncbi.nlm.nih.gov/articles/PMC11851487/
A large language model framework for literature-based disease–gene association prediction - PMC
Abstract With the exponential growth of biomedical literature, leveraging Large Language Models (LLMs) for automated medical knowledge understanding has become increasingly critical for advancing precision medicine. However, current approaches face signifi
pmc.ncbi.nlm.nih.gov
논문을 번역 및 요약합니다.
LLM으로 얻은 임베딩 값이 생물학적 의미가 있는지 어떻게 확인하고 검증했는지 확인하기 위해 살펴본 논문입니다.
본 게시물은 논문 본문 외에도 개인적으로 공부한 내용 + 🔹 gpt를 사용한 내용이 있으므로 주의가 필요합니다.
Summary
- PubMed 논문으로부터 질병–유전자 관계를 자동으로 추출
- LLM을 활용해 신뢰 가능하고 확장 가능한 생의학 지식 그래프 생성
- 유전자 병인성(Pathogenicity)을 예측하는 embedding + ML 모델 개발
제안된 프레임워크: LORE
🔹 1단계: LLM-ORE (Open Relation Extraction)
- GPT-3.5 또는 Llama-8B를 사용해 논문 초록에서 DG 관계를 문장 단위로 추출
→ 예: ('BRCA1', 'mutation associated with', 'breast cancer') - 이 정보를 모아 지식그래프를 구축함
- 1.7백만 개의 PubMed abstract에서 GPT-3.5로 relation 추출 수행
- 총 11,285,095개의 relation 생성 (→ 평균적으로 abstract당 약 6.6개)
- ('BRCA1', 'mutations are frequently found in', 'breast cancer patients')
('Loss of BRCA1 function', 'can lead to', 'increased cancer risk')
이런식으로 주어 서술어 목적어로 구성 - Open Relation Extraction은 문장에서 사전 정의된 관계(label)가 없이
자유롭게(subject, predicate, object) 형태의 관계를 추출하는 방법을 사용
🔹 2단계: LLM-EMB (Embedding)
- 각 DG 쌍에 대한 관계 문장을 하나의 문서처럼 간주 → LLM으로 512차원 임베딩 생성
- 이 임베딩은 병인성(latent pathogenicity) 정보를 내포함
🔹 PMKB-CV 데이터셋 구축
- PubMed에서 2100여 개 질병과 관련된 DG 쌍 약 65만 개 수집
- ClinVar의 병인성 레이블을 활용해 감독 학습
🔹ML-Ranker 개발
- LLM-EMB 임베딩 기반의 gradient-boosting 랭킹 모델 사용
- 질병별로 병인성 흐름(pathogenic flow)을 따라 유전자 랭킹 수행
- LLM 직접 질의 (GPT-4o 등)보다 훨씬 높은 정확도 달성
🔹 새로운 개념: Pathogenic Flow
- DG embedding 공간에서 병인성 흐름이라는 방향성을 발견
- 비병인성 유전자 → 병인성 유전자 방향으로 임베딩이 정렬됨
- 이 흐름은 질병에 관계없이 일관적으로 나타남
- 질병마다 병인성 유전자(DG)(빨간점)와 비병인성 유전자(회색점)가 있습니다.
- LLM-EMB로 만들어진 embedding 공간 안에서,
병인성과 비병인성이 특정 방향으로 분리되는 구조를 가짐을 발견함
🔹 주요 기여
- LLM으로부터 문헌 기반 지식그래프 자동 구축 -> 학습 없이 그대로 사용해서 문장을 분석하게 한것이 신기
- DG 임베딩의 병인성 흐름 분석
- 기존 ClinVar보다 200배 확장된 관계 예측 범위
- 라이트한 모델(Llama-8B)로도 유사한 성능 가능
🔹 코드와 데이터
- GitHub: https://github.com/ailabstw/LORE
- 데이터: Zenodo 링크
예제
✅ 전체 코드 플로우 요약 (LORE 재현 simplified)
1. PubMed Abstract 수집
↓
2. ORE Prompting (LLM에 입력)
↓
3. DG 관계 추출 (subject, predicate, object)
↓
4. DG 관계를 문장으로 연결 → 임베딩 벡터 생성
↓
5. 모든 DG 쌍에 대해 벡터화
↓
6. ClinVar 병인성 라벨과 매핑 → ML-Ranker 학습
↓
7. UMAP / PCA로 시각화 및 병인성 흐름 파악
🧪 1. ORE 프롬프트 예제 만들기 (Prompting)
# 예제 abstract
abstract = """
Mutations in the TP53 gene are frequently observed in patients with lung cancer.
Loss of TP53 is associated with tumor progression and poor prognosis.
"""
# 대상 entity 쌍
entity1 = "TP53"
entity2 = "lung cancer"
# ORE prompt (문맥 포함)
prompt = f"""
Article: {abstract.strip()}
Entity 1: {entity1}
Entity 2: {entity2}
Relations:
-
"""
이 프롬프트를 OpenAI GPT API 또는 Llama API에 temperature=0으로 넣으면, 예를 들어 아래와 같은 결과를 얻을 수 있습니다:
- TP53, mutations are observed in, patients with lung cancer
- Loss of TP53, is associated with, tumor progression
- TP53, is associated with, poor prognosis in lung cancer
🧪 2. DG 관계 추출 (LLM 응답 → 관계 정제)
# 관계 리스트를 저장
relations = [
("TP53", "mutations are observed in", "patients with lung cancer"),
("Loss of TP53", "is associated with", "tumor progression"),
("TP53", "is associated with", "poor prognosis in lung cancer"),
]
이제 이 relations를 모두 하나의 텍스트로 연결해 "DG 문서"를 생성합니다.
dg_document = ". ".join([f"{s} {p} {o}" for s, p, o in relations]) + "."
🧪 3. 문서 임베딩 생성 (예: OpenAI API 사용)
from openai import OpenAI
import openai
openai.api_key = "your-api-key"
response = openai.Embedding.create(
input=dg_document,
model="text-embedding-3-large"
)
embedding_vector = response["data"][0]["embedding"]
(Llama를 쓰는 경우 InstructorEmbedding, HF Transformers 라이브러리로도 가능)