--- license: apache-2.0 language: - en base_model: meta-llama/Llama-3.1-8B-Instruct library_name: transformers pipeline_tag: text-generation datasets: - HiTZ/Magpie-Llama-3.1-70B-Instruct-Filtered tags: - biomedical - medical - clinical - english - llama-3.1 - continual-pretraining - merge widget: - messages: - role: user content: >- A 55-year-old man presents with crushing substernal chest pain radiating to the left arm. Which is the most appropriate initial diagnostic test? A) Chest X-ray B) 12-lead ECG C) Abdominal ultrasound D) Spirometry Answer with only the letter of the correct option. - messages: - role: user content: Explain the mechanism of action of metformin in type 2 diabetes. - messages: - role: user content: What are the most common adverse effects of ACE inhibitors? ---

Marmoka-en
A Lightweight English Clinical Large Language Model
Built on Llama 3.1


Marmoka is a family of lightweight 8B-parameter clinical LLMs for English and Spanish. Marmoka-en is the English member of the family. It was developed through continual domain-adaptive pretraining (DAPT) of Llama-3.1-8B-Instruct on English medical corpora, mixed with general-domain instructions to preserve its instruction-following ability. Under a perturbation-based evaluation on English clinical multiple-choice QA, Marmoka-en matches or slightly improves on its general-purpose counterpart.

- 📖 Paper: [To Adapt or not to Adapt, Rethinking the Value of Medical Knowledge-Aware Large Language Models](https://arxiv.org/abs/2604.06854) ## How to Get Started with the Model You can use the model with the `transformers` pipeline (it uses the Llama 3.1 chat template): ```python import torch from transformers import pipeline pipe = pipeline( "text-generation", model="HiTZ/Marmoka-en-Llama-3.1-8B-Instruct", torch_dtype=torch.bfloat16, device_map="auto", ) messages = [ {"role": "system", "content": "You are a medical expert. Answer the multiple-choice question with only the letter of the correct option."}, {"role": "user", "content": "Which vitamin deficiency causes scurvy?\nA) Vitamin A\nB) Vitamin B12\nC) Vitamin C\nD) Vitamin D"}, ] outputs = pipe(messages, max_new_tokens=256) print(outputs[0]["generated_text"][-1]["content"]) ``` # Model Description - **Developed by**: Ane G. Domingo-Aldama, Iker De La Iglesia, Maitane Urruela, Aitziber Atutxa, and Ander Barrena - **Contact**: [Ane G. Domingo-Aldama](mailto:ane.garciad@ehu.eus) and [Iker De La Iglesia](mailto:iker.delaiglesia@ehu.eus) - **Language(s) (NLP)**: English - **License**: apache-2.0 - **Funding**: - The Spanish Ministry of Science, Innovation and Universities, MCIN/AEI/10.13039/501100011033 projects: - EDHIA PID2022-136522OB-C22 (also supported by FEDER, UE). - TRUST-MED PID2025-174880OB-I00 (also supported by FEDER, UE). - DeepR3 TED2021-130295B-C31 (also supported by the European Union NextGenerationEU/PRTR). - Basque Government: - Research group funding IT1570-22. - HiTZ Center. - Predoctoral grants: FPU23/03347 (I. De La Iglesia, Spanish Ministry of Science, Innovation and Universities), PRE_2024_1_0224 (A. G. Domingo-Aldama) and PRE_2025_1_0177 (M. Urruela), Basque Government. ## Model Details
Training settings for Marmoka-en.
Param. no. ~8B
Architecture Llama 3.1 (decoder-only)
Base model Llama-3.1-8B-Instruct
Adaptation DAPT on medical corpora + general-domain instructions
Medical corpus ~26B words (English)
General instructions 1.4M (English, Magpie)
Marmoka-en training 4 models trained with different hyperparameters (6.5B unique words each), merged
Training framework Axolotl
Merging tool MergeKit
Model selection Casimedicos validation set (EN & ES)
## Training Data

Marmoka-en was trained with the hybrid strategy of Sainz et al. (2025), which combines continual domain-adaptive pretraining on medical corpora with general-domain instructions to avoid catastrophic forgetting. Unlike traditional DAPT setups, an instruction-tuned model (Llama-3.1-8B-Instruct), rather than a base model, was used as the starting point. Note that this setup includes medical corpora but no dedicated medical instructions; the amount of medical content in the Magpie instructions is minimal. The medical corpora are an updated version of those gathered in De la Iglesia et al. (2025), and were processed and deduplicated using standard approaches (deduplication code).

Data sources and sizes used to train Marmoka-en.
Type Source Size
Medical corpora (English) WikiMed 54.4M words
PubMed Central (PMC) 25.9B words
EMEA 12.9M words
General-domain instructions Magpie (Llama-3.1-70B-Instruct) 1.4M instructions
# Limitation and Bias

Marmoka-en is intended for research purposes. Its evaluation is based on short-form multiple-choice question answering with automated accuracy metrics and without expert clinical adjudication, so the validity of the model's underlying reasoning has not been verified, and these benchmarks may not fully capture genuine medical expertise. It is recommended to validate and test the model for specific applications before using it.

Instruction following and strict output formatting remain a limitation, especially in multi-step tasks such as summarization, where formatting failures were observed. Outputs should be checked whenever a strict format is required.

## Biases ## Disclaimer

Marmoka-en is intended for research purposes and is not approved for clinical use. It must not be used as a medical device or relied upon for diagnostic or therapeutic decision-making, and its outputs should not be interpreted as medical advice. Using the model without rigorous validation poses significant risks, including misinformation, misclassification, and potential harm.

When employed in actual clinical scenarios, all outputs must be independently reviewed and validated by qualified healthcare professionals. We do not take any liability for the use of this model.

# Citing information ```bibtex @article{domingo2026adapt, title={To Adapt or not to Adapt, Rethinking the Value of Medical Knowledge-Aware Large Language Models}, author={Domingo-Aldama, Ane G and De La Iglesia, Iker and Urruela, Maitane and Atutxa, Aitziber and Barrena, Ander}, journal={arXiv preprint arXiv:2604.06854}, year={2026} } ```