ELAINE-medllm - Build with Llama3-8B

ELAINE (EngLish-jApanese-chINesE)-medLLM is a trilingual (English, Japanese, Chinese) large language mol adapted for the bio-medical domain based on Llama-3-8B. The training dataset was carefully curated in terms of volume and diversity to adapt to the biomedical domain and endow trilingual capability while preserving the knowledge and abilities of the base model. The training follows 2-stage paths: continued pre-training and supervised fine-tuning (SFT). ELAINE-medLLM exhibits superior trilingual capabilities compared to existing bilingual or multilingual medical LLMs without severely sacrificing the base model's capability.

Model Details

  • Model type: Please refer to Llama 3 Github for details on the model architecture.
  • Language(s): English, Japanese, Chinese
  • Library: DeepSpeed
  • Tokenizer: Please refer to Llama 3 blog for details on the tokenizer.

Model Performance

Evaluation Benchmarks

The evaluation behchmark dataset and evaluation code can be obtained from this Github site. The details of the bechmark are as follows.

English evaluation benchmarks

Japanese evaluation benchmarks

  • IgakuQA
    • We concatenate the original exam data from 2018 to 2022 into a single JSON file.
  • JJSIMQA
  • DenQA
    • It contains the exam problems from the Japan National Dentistry Examination and their answers in the past two years (from 2023 through 2024) extracted from the official website of the Ministry of Health, Labor and Welfare in Japan (https://www.mhlw.go.jp/stf/english/index.html).

Chinese evaluation benchmarks

Training Datasets

Continued pre-training

For continued pretraining, we collected English, Japanese, and Chinese text in the bio-medical domain. The domain text collected is classified into six categories: 1) scientific papers, 2) medical guidelines, 3) web text related to biomedical, 4) textbook of biomedical, 5) PubMed abstracts, and 6) PubMed Central (PMC) archives. For the Japanese PubMed abstract, we used the original English PubMed abstract translated in Japanese. We used only open-licensed text except for the Japanese biomedical papers from J-STAGE.

Instruction supervised fine-tuning

We collected various conversational QA datasets in the bio-medical domain from different data sources. For English, we used Medical Meadow in MedAlpca, HealthCareMagic, and iClilic dataset used in ChatDoctor. We adapted the augmented QA dataset from HuatuoGPT-2 for Chinese and English. For Japanese, we used existing alpaca datasets in the general domain translated in Japanese.

Results

English benchmark

model_name MMLU MedMCQA MedQA MedQA-4op PubMedQA Avg
google_gemma-7b-it 50.55 41.07 33.12 39.67 67.07 46.30
meta-llama_Llama-2-7b-chat-hf 48.71 35.97 30.99 38.09 63.64 43.48
meta-llama_Meta-Llama-3-8B-Instruct 72.79 60.89 57.65 61.28 78.99 66.32
tokyotech-llm_Llama-3-Swallow-8B-Instruct-v0.1 66.88 53.85 47.95 56.07 64.65 57.88
medalpaca_medalpaca-7b 51.48 36.02 31.15 39.35 55.15 42.63
epfl-llm_meditron-7b 47.32 34.35 29.18 32.26 39.19 36.46
aaditya_Llama3-OpenBioLLM-8B 73.43 55.03 50.00 56.78 65.86 60.22
FreedomIntelligence_Apollo-7B 68.17 53.85 45.98 53.86 75.35 59.44
Llama3-ELAINE-medLLM-instruct-8B 72.69 55.07 55.76 61.36 75.35 64.05

Japanese benchmark

model_name DenQA IgakuQA JJSIMQA Avg
google_gemma-7b-it 13.71 25.51 12.09 17.10
meta-llama_Llama-2-7b-chat-hf 12.03 20.80 10.55 14.46
meta-llama_Meta-Llama-3-8B-Instruct 19.72 40.45 25.93 28.70
tokyotech-llm_Llama-3-Swallow-8B-Instruct-v0.1 23.78 44.01 26.81 31.53
medalpaca_medalpaca-7b 10.91 17.74 10.77 13.14
epfl-llm_meditron-7b 9.79 18.20 8.35 12.11
aaditya_Llama3-OpenBioLLM-8B 18.18 33.03 21.98 24.40
FreedomIntelligence_Apollo-7B 17.90 32.28 20.66 23.61
Llama3-ELAINE-medLLM-instruct-8B 22.24 43.36 24.40 30.00

Chinese benchmark

model_name CMExam MedQA MedQA-4op Avg
google_gemma-7b-it 30.90 29.03 34.96 31.63
meta-llama_Llama-2-7b-chat-hf 25.43 25.37 32.30 27.70
meta-llama_Meta-Llama-3-8B-Instruct 52.01 62.99 68.40 61.13
tokyotech-llm_Llama-3-Swallow-8B-Instruct-v0.1 41.11 45.05 51.27 45.81
medalpaca_medalpaca-7b 23.58 24.99 30.11 26.23
epfl-llm_meditron-7b 23.85 25.46 29.82 26.38
aaditya_Llama3-OpenBioLLM-8B 39.07 42.59 48.73 43.46
FreedomIntelligence_Apollo-7B 49.99 58.29 62.99 57.09
Llama3-ELAINE-medLLM-instruct-8B 48.85 55.80 61.59 55.41

samples

import torch
from transformers import pipeline

pipe = pipeline("text-generation", 
                model="kenyano/Llama3-ELAINE-medLLM-instruct-8B",
                torch_dtype=torch.float16,
                device_map="auto", 
                trust_remote_code=True)



messages_ja = [
            {"role": "system", "content": "あなたはAIヘルスアシスタントです" },
            {"role": "user", "content": "高血圧とはどれくらいの血圧でしょうか?"},
            {"role": "user", "content": "うつ病はどのようにすれば治りますか?"},
            {"role": "user", "content": "自閉症はどんな原因が考えられますか?"},
            {"role": "user", "content": "アレルギー性鼻炎がありますが、いい薬はありますか?"},
            {"role": "user", "content": "脳梗塞とはどんな病気で、治療法はあるでしょうか?"},
            {"role": "user", "content": "突発性難聴とはどんな病気ですか?治療法はありますか?"},
            {"role": "user", "content": "緑内障と白内障の違いを教えて"},
          ]

messages_ch = [
            {"role": "system", "content": "你是一名人工智能健康助理。" },
            {"role": "user", "content": "高血压有多高?"},
            {"role": "user", "content": "如何治愈抑郁症?"},
            {"role": "user", "content": "自闭症的可能病因是什么?"},
            {"role": "user", "content": "我有过敏性鼻炎,有什么好药吗?"},
            {"role": "user", "content": "什么是中风,有治疗方法吗?"},
            {"role": "user", "content": "什么是突发性听力损失? 有治疗方法吗?"},
            {"role": "user", "content": "青光眼和白内障有什么区别?"},
          ]

messages_en = [
            {"role": "system", "content": "You are an AI Health Assistant"},
            {"role": "user", "content": "How high is hypertension?"},
            {"role": "user", "content": "How can depression be cured?"},
            {"role": "user", "content": "What are the possible causes of autism?"},
            {"role": "user", "content": "I have allergic rhinitis, are there any good medications?"},
            {"role": "user", "content": "What is a stroke and is there a treatment for it?"},
            {"role": "user", "content": "What is sudden hearing loss? Is there a treatment?"},
            {"role": "user", "content": "Tell me the difference between glaucoma and cataract."},
          ]


messages = messages_ja

for i in range(len(messages)-1):

    inputs = [messages[0], messages[i+1]]
    prompt = pipe.tokenizer.apply_chat_template(inputs, tokenize=False, add_generation_prompt=True)

    outputs = pipe(prompt, max_new_tokens=256, do_sample=True, temperature=0.01)

    print("-"*10)
    print(f"{messages[i+1]['role']}: {messages[i+1]['content']}")
    print(outputs[0]["generated_text"][len(prompt):])
    

Risks and Limitations

The models released here are still in the early stages of our research and development and have not been tuned to ensure outputs align with human intent and safety considerations.

Known issues

The current model has some issues continuing to generate text when it should stop. We plan to fix this issue in the coming months.

Acknowledgements

We thank Meta Research for releasing Llama 3 under a generous open license.

Authors

  • Ken Yano
  • Zheheng Luo
  • Jimin Huang
  • Qianqian Xie
  • Masaki Asada
  • Chenhan Yuan
  • Kailai Yang
  • Makoto Miwa
  • Sophia Ananiadou
  • Jun'ichi Tsujii

Contact

How to cite

If you find our work helpful, please feel free to cite these papers.

@inproceedings{yano-etal-2025-elaine,
    title = "{ELAINE}-med{LLM}: Lightweight {E}nglish {J}apanese {C}hinese Trilingual Large Language Model for Bio-medical Domain",
    author = "Yano, Ken  and
      Luo, Zheheng  and
      Huang, Jimin  and
      Xie, Qianqian  and
      Asada, Masaki  and
      Yuan, Chenhan  and
      Yang, Kailai  and
      Miwa, Makoto  and
      Ananiadou, Sophia  and
      Tsujii, Jun{'}ichi",
    editor = "Rambow, Owen  and
      Wanner, Leo  and
      Apidianaki, Marianna  and
      Al-Khalifa, Hend  and
      Eugenio, Barbara Di  and
      Schockaert, Steven",
    booktitle = "Proceedings of the 31st International Conference on Computational Linguistics",
    month = jan,
    year = "2025",
    address = "Abu Dhabi, UAE",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.coling-main.313/",
    pages = "4670--4688",
 }
Downloads last month
64
Safetensors
Model size
8.03B params
Tensor type
FP16
·
Inference Providers NEW
This model is not currently available via any of the supported third-party Inference Providers, and the model is not deployed on the HF Inference API.

Model tree for kenyano/Llama3-ELAINE-medLLM-instruct-8B

Finetuned
(393)
this model