Tala (Tagalog for "note" or "record") reads a short Philippine clinical note, written in English, Tagalog, Taglish, Cebuano or another Philippine language, and suggests WHO ICD-10 codes for its findings as JSON.
Modified model notice. Tala is a fine-tuned (modified) version of Google's Gemma 3 4B PT. It is not made, endorsed or reviewed by Google. Gemma is provided under and subject to the Gemma Terms of Use found at gemma.ai/resources/terms.
Decision support only. Tala suggests codes for a trained coder, nurse or physician to check. It does not diagnose, it is not a medical device, and it has not been validated on real patient records. Do not use its output for automated clinical, billing or insurance decisions.
Input: a clinical note, for example
45 y/o M. CC: may lagnat x 3 days, masakit ang ulo. Walang ubo.
Imp: Dengue fever w/o warning signs. HPN, maintained on amlodipine.
Output (JSON only):
{"findings": [
{"mention": "Dengue fever w/o warning signs", "icd10": "A97.0"},
{"mention": "HPN", "icd10": "I10"}
]}
It follows the rules it was trained on:
UNMAPPABLE and code its real symptoms.Codes are WHO ICD-10, including the Philippine 2016 updates used by PhilHealth (e.g. dengue A97.x). The model outputs codes only, without WHO titles.
Send the coding instruction and the note as one user turn (<instruction>\n\n<note>), using the chat template shipped with the model (<bos>[INST] … [/INST], the format Adaption trained with). The exact instruction text ships with the model as tala_prompt.txt (prompt version v1; skip its first line, which is a comment). Use greedy decoding (temperature 0).
import torch
from huggingface_hub import hf_hub_download
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "xenix278/Tala-ICD10-gemma-3-4b-pt"
instruction = open(hf_hub_download(repo, "tala_prompt.txt"), encoding="utf-8").read().split("\n", 1)[1].strip()
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
note = "45 y/o M. CC: may lagnat x 3 days, masakit ang ulo. Walang ubo.\nImp: Dengue fever w/o warning signs. HPN, maintained on amlodipine."
messages = [{"role": "user", "content": f"{instruction}\n\n{note}"}]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", return_dict=True).to(model.device)
output = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The weights are a text-only Gemma3ForCausalLM (the LoRA from Adaption merged into Gemma 3 4B PT; vision tower removed). Its config.json uses the newer per-layer rope format: tested with transformers 5.13.0 (older 4.x versions may not read it) and served with vLLM 0.10.1.1. About 8 GB in bfloat16; runs on one 16 GB GPU.
Always validate the output: parse the JSON, and check every code against an ICD-10 list.
google/gemma-3-4b-pt, fine-tuned with supervised fine-tuning on Adaption AutoScientist. Settings chosen by AutoScientist: LoRA r=32, alpha=64, dropout 0.05 on all attention and MLP projections; 5 epochs; learning rate 5e-5 (cosine); weight decay 0.01; loss on completions only. The run stopped after 2 of 3 iterations once its internal judge's win rate reached 0.87 (target 0.70). The LoRA was then merged into Google's public Gemma 3 4B PT language weights; the vision tower is not included.Test set: 83 notes, 125 coded findings, never used in training.
Metric: per-finding F1 at the ICD-10 category level (first 3 characters), plus exact-code F1 and the share of codes that don't exist. Same prompt, temperature 0, same scorer for every model.
| Model | Category F1 (all) | Slice A (EN) | Slice B (PH) | Exact-code F1 | Invalid codes |
|---|---|---|---|---|---|
| Gemma 3 4B PT (base, untrained) | 0.00 | 0.00 | 0.00 | 0.00 | 100% |
| Gemma 3 4B IT (Google's instruction-tuned, reference) | 0.33 | 0.42 | 0.27 | 0.23 | 21% |
| Tala (pilot: 1,200 rows, 1 epoch) | 0.58 | 0.60 | 0.56 | 0.30 | 14% |
| Tala (full run: 6,864 rows, 5 epochs) | 0.66 | 0.64 | 0.67 | 0.52 | 8% |
The untrained PT model only repeats the instruction, so the IT model is the meaningful bar.
Tala is a research prototype for decision support only. It must not assign codes without a person checking them, and it must not be used for diagnosis, billing or claims.
The biggest limits come from the data, not the model. No open Philippine clinical notes exist, and no clinical data could be obtained before the deadline.
UNMAPPABLE by design, because their meaning varies by region and they have no ICD-10 code.De-identified real notes for testing (under ethics approval and RA 10173), a clinician or certified coder reviewing the test answers, native speakers checking the regional terms, and blank local forms (ITR, FHSIS, iClinicSys) to make the training notes look real.
GEMMA_TERMS.md) and the Gemma Prohibited Use Policy. By using Tala you agree to these terms. The use restrictions in the Prohibited Use Policy apply to Tala and are an enforceable part of its licence, including the bans on unlicensed medical practice, misleading health claims and automated decisions affecting healthcare. Pass these terms on to anyone you share Tala with. See NOTICE.Built for the Adaptive Intelligence Challenge (Adaption × HackCulture). Thanks to AI Singapore (SEA-LION), the ACI-Bench authors, TICO-19, PhilHealth and DOH for public documents, and WHO for ICD-10.
@misc{oblimar2026tala,
title = {Tala-ICD10-gemma-3-4b-pt: ICD-10 coding of Philippine clinical notes},
author = {Oblimar, Mac Xenix},
year = {2026},
note = {Fine-tuned from Gemma 3 4B PT on Adaption. Adaptive Intelligence Challenge.}
}
有文件?提交种子。
发布种子model-00001-of-00002.safetensors 4.0 GiBmodel-00002-of-00002.safetensors 3.2 GiB