Mobile AI Factory: Qwen3.5-0.8B for biomedical entity extraction (BC5CDR)
A small language model fine-tuned and quantized by Mobile AI Factory for biomedical entity extraction (BC5CDR), ready to run on a phone with llama.cpp.
Paper: Mobile AI Factory: Building Specialized Language Models for Your Mobile Device (Hugging Face paper page) · Code: evanly-gh/SLM_Factory
Mobile AI Factory is an agentic system that takes a task specification and a target phone and builds a fine-tuned, quantized SLM for them: an orchestrator LLM chooses whether to tune hyperparameters, mine real data or generate synthetic examples, fixed rules roll back changes that hurt accuracy, and the search climbs from small to large models using real measurements of the phone.
Result
Span F1 0.830 on the run's frozen held-out evaluation set (1,000 rows), +0.125 over the first fine-tune. This is the BC5CDR row of the paper's main results table.
Model
- Base model:
Qwen/Qwen3.5-0.8B, LoRA fine-tuned and merged - Format: Q4_K_M GGUF (4-bit), 0.54 GB
- Engine: llama.cpp
Files:
mobile-ai-factory-bc5cdr-ner-qwen3.5-0.8b-q4_k_m.gguf
Prompt format
The model was trained and scored on one exact prompt: the task instruction in a ChatML user turn, then the assistant turn with an empty think block (thinking off). Decode greedily, stop at <|im_end|>, and allow up to 512 new tokens. An example from the evaluation set, fully rendered:
<|im_start|>user
Extract named entities from the text. Reply with a JSON list of objects with "text" and "type" keys. Reply with [] if there are no entities.
Text: 3 - 5 uIU / mL ) and free thyroxine ( FT4 ) was < 0 .<|im_end|>
<|im_start|>assistant
<think>
</think>
Expected output for this example:
[{"text": "thyroxine", "type": "Chemical"}]
Run it
from llama_cpp import Llama
prompt = open("prompt.txt").read() # the fully rendered prompt, as in Prompt format
llm = Llama(model_path="mobile-ai-factory-bc5cdr-ner-qwen3.5-0.8b-q4_k_m.gguf", n_ctx=4096, verbose=False)
out = llm.create_completion(prompt, max_tokens=512, temperature=0.0, stop=["<|im_end|>"])
print(out["choices"][0]["text"].strip())
On a phone, the same GGUF runs in any llama.cpp-based app; pass the rendered prompt as raw text (no extra chat template), with greedy decoding.
Training data
- BC5CDR (BioCreative V CDR corpus, chemical and disease spans), via
tner/bc5cdr. See the corpus's own terms of use. - Synthetic rows written and checked by a teacher LLM (Claude Sonnet 5) during the search.
License
Apache-2.0, as the base model.
Citation
@article{li2026mobileaifactory,
title = {Mobile AI Factory: Building Specialized Language Models for Your Mobile Device},
author = {Li, Evan and Deshpande, Krishna and Cheng, Wen and Gollakota, Shyamnath},
journal = {arXiv preprint arXiv:2611.13509},
year = {2026}
}