Question Answering
Safetensors
upcycling-qwen2-moe
biology
medical
custom_code
Apollo-MoE-1.5B / README.md
BossRui's picture
Update README.md
2395b4e verified
|
raw
history blame
7.89 kB
metadata
license: apache-2.0
datasets:
  - FreedomIntelligence/ApolloMoEDataset
language:
  - ar
  - en
  - zh
  - ko
  - ja
  - mn
  - th
  - vi
  - lo
  - mg
  - de
  - pt
  - es
  - fr
  - ru
  - it
  - hr
  - gl
  - cs
  - co
  - la
  - uk
  - bs
  - bg
  - eo
  - sq
  - da
  - sa
  - 'no'
  - gn
  - sr
  - sk
  - gd
  - lb
  - hi
  - ku
  - mt
  - he
  - ln
  - bm
  - sw
  - ig
  - rw
  - ha
metrics:
  - accuracy
base_model:
  - microsoft/Phi-3-mini-4k-instruct
pipeline_tag: question-answering
tags:
  - biology
  - medical

Covering 12 Major Languages including English, Chinese, French, Hindi, Spanish, Arabic, Russian, Japanese, Korean, German, Italian, Portuguese and 38 Minor Languages So far.

๐Ÿ“ƒ Paper โ€ข ๐ŸŒ Demo โ€ข ๐Ÿค— ApolloMoEDataset โ€ข ๐Ÿค— ApolloMoEBench โ€ข ๐Ÿค— Models โ€ข ๐ŸŒ Apollo โ€ข ๐ŸŒ ApolloMoE

Apollo

๐ŸŒˆ Update

  • [2024.10.15] ApolloMoE repo is published๏ผ๐ŸŽ‰

Architecture

Click to view the MoE routing image

ApolloMoE

Results

Dense

๐Ÿค— Apollo2-0.5B โ€ข ๐Ÿค— Apollo2-1.5B โ€ข ๐Ÿค— Apollo2-2B โ€ข ๐Ÿค— Apollo2-3.8B โ€ข ๐Ÿค— Apollo2-7B โ€ข ๐Ÿค— Apollo2-9B

Click to view the Dense Models Results

ApolloMoE

Post-MoE

๐Ÿค— Apollo-MoE-0.5B โ€ข ๐Ÿค— Apollo-MoE-1.5B โ€ข ๐Ÿค— Apollo-MoE-7B

Click to view the Post-MoE Models Results

ApolloMoE

โ€‹

Usage Format

Apollo2

  • 0.5B, 1.5B, 7B: User:{query}\nAssistant:{response}<|endoftext|>
  • 2B, 9B: User:{query}\nAssistant:{response}<eos>
  • 3.8B: <|user|>\n{query}<|end|><|assisitant|>\n{response}<|end|>

Apollo-MoE

  • 0.5B, 1.5B, 7B: User:{query}\nAssistant:{response}<|endoftext|>

Dataset & Evaluation

  • Dataset ๐Ÿค— ApolloMoEDataset

    Click to expand

    ApolloMoE

  • Evaluation ๐Ÿค— ApolloMoEBench

    Click to expand
    • EN:

      • MedQA-USMLE
      • MedMCQA
      • PubMedQA: Because the results fluctuated too much, they were not used in the paper.
      • MMLU-Medical
        • Clinical knowledge, Medical genetics, Anatomy, Professional medicine, College biology, College medicine
    • ZH:

      • MedQA-MCMLE
      • CMB-single: Not used in the paper
        • Randomly sample 2,000 multiple-choice questions with single answer.
      • CMMLU-Medical
        • Anatomy, Clinical_knowledge, College_medicine, Genetics, Nutrition, Traditional_chinese_medicine, Virology
      • CExam: Not used in the paper
        • Randomly sample 2,000 multiple-choice questions
    • ES: Head_qa

    • FR:

      • Frenchmedmcqa
      • [MMLU_FR]
        • Clinical knowledge, Medical genetics, Anatomy, Professional medicine, College biology, College medicine
    • HI: MMLU_HI

      • Clinical knowledge, Medical genetics, Anatomy, Professional medicine, College biology, College medicine
    • AR: MMLU_AR

      • Clinical knowledge, Medical genetics, Anatomy, Professional medicine, College biology, College medicine
    • JA: IgakuQA

    • KO: KorMedMCQA

    • IT:

      • MedExpQA
      • [MMLU_IT]
        • Clinical knowledge, Medical genetics, Anatomy, Professional medicine, College biology, College medicine
    • DE: BioInstructQA: German part

    • PT: BioInstructQA: Portuguese part

    • RU: RuMedBench

โ€‹
โ€‹

Results reproduction

Click to expand

We take Gemma-2b as example

  1. Download Dataset for project:

    bash 0.download_data.sh
    
  2. Prepare test and dev for specific model:

    • Create test data for with special token, you can use ./util/check.ipynb to check models' special tokens
    bash 1.data_process_test&dev.sh
    
  3. Prepare train data for specific model (Create tokenized data in advance):

    • You can adjust data Training order and Training Epoch in this step
    bash 2.data_process_train.sh
    
  4. Train the model

    • If you want to train in Multi Nodes please refer to ./scripts/multi_node_train_*.sh
    bash 3.single_node_train_gemma.sh
    
  5. Evaluate your model: Generate score for benchmark

    bash 4.eval.sh
    
  6. Evaluate your model: Play with your ckpts in bash

    python ./src/evaluate/cli_demo.py --model_name='./ckpts/your/path/tfmr'
    

Citation

Please use the following citation if you intend to use our dataset for training or evaluation:

@misc{zheng2024efficientlydemocratizingmedicalllms,
      title={Efficiently Democratizing Medical LLMs for 50 Languages via a Mixture of Language Family Experts}, 
      author={Guorui Zheng and Xidong Wang and Juhao Liang and Nuo Chen and Yuping Zheng and Benyou Wang},
      year={2024},
      eprint={2410.10626},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2410.10626}, 
}