You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

loop-qwen35-4b — Qwen3.5-4B closed-loop insulin controller (Gemini-distilled)

A Qwen3.5-4B model LoRA-distilled from a gemini-3-flash-preview insulin-control policy for closed-loop type-1-diabetes control in the simglucose simulator. It emits the next basal/bolus action chunk (with a short clinical rationale) from a rolling CGM/insulin/carb history + a deterministically-computed insulin-on-board.

Result (held-out 9 patients, 48 h, seed 42)

meals model TIR (70–180) TBR (<70) survived
announced v15 (Qwen3-4B) 68.8 13.2 7/9
announced this (Qwen3.5-4B) 80.8 2.1 9/9
unannounced v15 68.9 10.3 8/9
unannounced this 73.8 2.2 9/9
unannounced Gemini teacher 73.9 3.0 9/9
  • 9/9 survival in both conditions — matches the Gemini teacher; unannounced TIR ≈ teacher parity. The base-model upgrade from Qwen3-4B (v15) collapsed the pediatric over-dosing (TBR 13/10 → ~2 %) and saved the hardest patient (child#008).
  • Eval is bf16 on A100 (single seed); Q4_K_M deployment verified surviving on the decisive hard case.

Files

  • adapter_model.safetensors — LoRA adapter (rank 32, all-linear targets; the hybrid linear-attention layers need all-linear). Merge onto Qwen/Qwen3.5-4B.
  • *-f16.gguf — merged f16 GGUF, already patched for llama.cpp/Ollama (Qwen3.5's phantom MTP block removed: block_count −1, nextn_predict_layers=0). Quantize + serve: ollama create loop-qwen35 --quantize q4_K_M -f Modelfile (needs Ollama ≥ 0.32). Modelfile: FROM *-f16.gguf / TEMPLATE {{ .Prompt }} / PARAMETER num_ctx 4096 / PARAMETER temperature 0.

Training

transformers 5.x + torch 2.6 (matched torchvision/torchaudio), LoRA r32 target_modules=all-linear, 2 epochs, eff. batch 32, lr 2e-4, max-seq 4096. Data: jxx123/loop-qwen-v8-sft (distill_sft_v16.jsonl). Reason-before-act (concise clinical rationale) output format. Trained on 21 non-held-out patients only.

⚠️ Research / simulation only — not a medical device.

Downloads last month
2
GGUF
Model size
4B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for jxx123/loop-qwen35-4b

Finetuned
Qwen/Qwen3.5-4B
Adapter
(509)
this model