Skip to content
sczzz3Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

RaDaR: Rare Disease navigatoR

RaDaR (Rare Disease navigatoR) is a 32B-parameter reasoning language model for rare-disease differential diagnosis from free-text clinical narratives. It was initialized from DeepSeek-R1-Distill-Qwen-32B and trained through supervised fine-tuning (SFT) and direct preference optimization (DPO). The training corpus contains 49,170 publicly available rare-disease cases and 104,666 phenotype-anchored synthetic cases.

Model weights · Data · Paper · Web application


This repository provides:

  • phenotype-set sampling based on Orphanet and the Human Phenotype Ontology (HPO);
  • prompt templates used for synthetic-case and reasoning-data construction;
  • example SFT and DPO datasets in the expected training format;
  • the LLaMA-Factory training code bundled and reference configurations for SFT and DPO.

Repository structure

RaDaR/
├── data/
│   ├── HPO/
│   │   └── HPO_meta.json
│   ├── Orphanet/
│   │   ├── disease2phenotype.json
│   │   └── orphanet_hypernym.json
│   ├── dataset_info.json
│   ├── sample_sft_data.json
│   └── sample_dpo_data.json
├── sample/
│   ├── phenotype_sampling.py
│   ├── prompt_case_syn.txt
│   ├── prompt_case_modify.txt
│   └── cot_modify.txt
├── src/                         # LLaMA-Factory training code
├── sft.yaml                     # SFT configuration
├── dpo.yaml                     # DPO configuration
├── ds_z3_config.json            # DeepSpeed configuration used by the YAML files
├── requirements.txt
├── pyproject.toml
├── setup.py
├── LICENSE
└── README.md

Installation

git clone https://github.com/sczzz3/RaDaR.git
cd RaDaR

conda create -n radar python=3.11 -y
conda activate radar

pip install -e ".[torch,metrics]" --no-build-isolation
pip install ninja
MAX_JOBS=4 pip install flash-attn --no-build-isolation --use-pep517
pip install liger-kernel deepspeed

FlashAttention, Liger Kernel, and DeepSpeed are enabled by the provided training configurations. Adjust the YAML files if you do not plan to use them.

Phenotype-set sampling

Run the sampling script from the repository root:

python sample/phenotype_sampling.py \
    --orpha data/Orphanet/disease2phenotype.json \
    --hpo-meta data/HPO/HPO_meta.json \
    --out sampled_phenotypes.json \
    --gen-num 3 \
    --max-key 3 \
    --seed 42

The output contains sampled phenotype sets for each disease, including age of onset, key phenotypes, remaining phenotypes, dropout variants, and confusion/obfuscation phenotypes.

The script stops at structured phenotype-set construction. The accompanying templates describe the subsequent LLM-based steps:

  • sample/prompt_case_syn.txt: phenotype-conditioned free-text case generation without providing the disease label;
  • sample/prompt_case_modify.txt: disease-aware review and correction of a generated case; and
  • sample/cot_modify.txt: modification of teacher-generated diagnostic reasoning traces.

See the paper for the complete data-construction protocol and generation settings.

Model training

The included example datasets are registered in data/dataset_info.json:

  • SFT data use ShareGPT-style conversations;
  • DPO data use conversations, chosen, and rejected.

Before training, update the model, dataset, and output paths in sft.yaml and dpo.yaml as needed. In particular, sft.yaml contains a placeholder base-model path, while dpo.yaml expects the SFT checkpoint at saves/SFT_32b.

Run SFT first:

llamafactory-cli train sft.yaml

Then run DPO:

llamafactory-cli train dpo.yaml

The provided configurations perform full-parameter training of a 32B model and therefore require suitable distributed GPU resources.

Inference

Training is not required to use RaDaR. The released checkpoint and local inference instructions are available on the huggingface.

Clinical-use notice

RaDaR is intended for research and clinical decision support, not autonomous diagnosis or treatment. Its outputs may be incorrect, incomplete, or overconfident and should be independently reviewed by qualified clinicians under appropriate institutional governance.

Citation

@article{chen2026radar,
  title   = {A specialized reasoning large language model for accelerating rare disease diagnosis: a randomized AI physician assistance trial},
  author  = {Chen, Haichao and
             Zhou, Songchi and
             Zhao, Zhengyun and
             Hu, Shikai and
             Jin, Xianghong and
             Ji, Hongwei and
             He, Li and
             Li, Shuli and
             Qin, Yiming and
             Tan, Xin and
             Shi, Runfeng and
             Tham, Yih Chung and
             Zhu, Jiaye and
             Li, Ye and
             Jin, Ye and
             Cao, Longhao and
             Li, Dawei and
             Wu, Honghan and
             Gu, Hongqiu and
             Li, Guanqiao and
             Groza, Tudor and
             Li, Chunying and
             Zeng, Dian and
             Yu, Weihong and
             Baynam, Gareth and
             Jamuar, Saumya Shekhar and
             Shen, Min and
             Zhang, Shuyang and
             Sheng, Bin and
             Yu, Sheng and
             Wong, Tien Yin},
  journal = {arXiv preprint arXiv:2606.24510},
  year    = {2026},
  url     = {https://arxiv.org/abs/2606.24510}
}

Acknowledgements

This repository builds on LLaMA-Factory, DeepSeek-R1, the Human Phenotype Ontology, and Orphanet.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages