Text Generation
Transformers
Safetensors
English
qwen3
medical
clinical
biomedical
radiology
from-scratch
base-model
university-of-kentucky
university-of-louisville
ccts
text-generation-inference
Instructions to use Kentucky-Open-Science/KOS-V5-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kentucky-Open-Science/KOS-V5-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kentucky-Open-Science/KOS-V5-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kentucky-Open-Science/KOS-V5-Base") model = AutoModelForCausalLM.from_pretrained("Kentucky-Open-Science/KOS-V5-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kentucky-Open-Science/KOS-V5-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kentucky-Open-Science/KOS-V5-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
- SGLang
How to use Kentucky-Open-Science/KOS-V5-Base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kentucky-Open-Science/KOS-V5-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kentucky-Open-Science/KOS-V5-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kentucky-Open-Science/KOS-V5-Base with Docker Model Runner:
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
KOS-V5-Base (Catbird): final pretrain ckpt 49835 - 235.2B tokens, 100% of the single-epoch run
Browse filesFinal checkpoint of the completed run (step 49,835/49,835, epoch 1.000, loss ~1.16).
Card carries the full external evaluation (12 rank-1 of 17), the KOS-V5-vs-KOS-V4 comparison
(17-15), the convergence result (the 190B ckpt is knowledge-best, NOT this one), and the known
issues -- including that the tokenizer does not split numbers.
- .gitattributes +2 -0
- README.md +258 -0
- catbird_llm_logo.png +3 -0
- config.json +71 -0
- generation_config.json +12 -0
- kos_v5_brief.pdf +3 -0
- model.safetensors +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +12 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
catbird_llm_logo.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
kos_v5_brief.pdf filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- medical
|
| 9 |
+
- clinical
|
| 10 |
+
- biomedical
|
| 11 |
+
- radiology
|
| 12 |
+
- from-scratch
|
| 13 |
+
- base-model
|
| 14 |
+
- qwen3
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<img src="catbird_llm_logo.png" alt="Catbird" width="320"/>
|
| 19 |
+
</p>
|
| 20 |
+
|
| 21 |
+
# KOS-V5-Base · *"Catbird"*
|
| 22 |
+
|
| 23 |
+
**A 3.72B-parameter medical language model trained from scratch — not distilled, not pruned, not
|
| 24 |
+
continued-pretrained from a general base.** KOS-V5 (codename **Catbird**) is the fifth-generation
|
| 25 |
+
Kentucky Open Science base model. This repository holds the **final pretraining checkpoint**: the
|
| 26 |
+
complete single-epoch run, **235.2B tokens, step 49,835 of 49,835**.
|
| 27 |
+
|
| 28 |
+
This is a **base model**. It has had no instruction tuning, no RLHF, and no chat post-training. It
|
| 29 |
+
completes text; it does not follow instructions. It is the initialisation for a downstream SFT/RL
|
| 30 |
+
line, and it is released as a research artifact.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## At a glance
|
| 35 |
+
|
| 36 |
+
| | |
|
| 37 |
+
|---|---|
|
| 38 |
+
| **Parameters** | 3.72B (36 layers × 2560 hidden, 32/8 GQA, head_dim 128, SwiGLU, **tied** embeddings) |
|
| 39 |
+
| **Training tokens** | **235.2B** — one epoch over a 54-source medical/biomedical corpus, complete |
|
| 40 |
+
| **Final train loss** | ≈1.16 |
|
| 41 |
+
| **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** |
|
| 42 |
+
| **RoPE** | standard 1D, **θ = 25,000** (pin this — see *Serving notes*) |
|
| 43 |
+
| **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) |
|
| 44 |
+
| **Objective** | **pure cross-entropy** — no auxiliary/geometric losses (no SigReg, no STP, no MTP) |
|
| 45 |
+
| **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 |
|
| 46 |
+
| **Architecture class** | `Qwen3ForCausalLM` (stock — exports with no custom modelling code) |
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Headline evaluation
|
| 51 |
+
|
| 52 |
+
Benchmarked against **16 external models** (a 17-model pool; KOS-V4 is held out as our own internal
|
| 53 |
+
comparison). Every comparator was trained on **1.3–153× more data** (0.3–36T tokens vs our 0.235T).
|
| 54 |
+
96 metrics across 19 tests; 93 ranked.
|
| 55 |
+
|
| 56 |
+
**KOS-V5 is rank-1 of 17 on 12 metrics**, best-tied on 4, top-3 on 9, and trails on 68.
|
| 57 |
+
|
| 58 |
+
**Where it wins** — and the wins are concentrated, not scattered:
|
| 59 |
+
|
| 60 |
+
| Axis | Result |
|
| 61 |
+
|---|---|
|
| 62 |
+
| **Held-out medical BPB** (the headline) | **rank 1 / 17**, 5-corpus mean **0.4635** — plus rank-1 on radiology (0.5132), chest-xray (0.6688) and clinical narratives (0.4179) |
|
| 63 |
+
| **Attention health** (T2) | rank-1 on 3 of 4 measures (bos-sink mass, collapsed-head fraction, min-entropy); rank 2 on the fourth |
|
| 64 |
+
| **Representation geometry** (T4) | rank-1 on RankMe (220.0) |
|
| 65 |
+
| **Long-context BPB** | rank-1 at the 1,024- and 2,048-token buckets; bucket-BPB falls monotonically out to the full 32,768 |
|
| 66 |
+
| **Semantic similarity** | rank-1 on BIOSSES (Pearson 0.7097 / Spearman 0.7014) |
|
| 67 |
+
|
| 68 |
+
Bits-per-byte is tokenizer-agnostic, so it is a fair cross-model number — and the distillation
|
| 69 |
+
confound in the pool *flatters the trillion-token externals, not a from-scratch model*. These BPB
|
| 70 |
+
placements are therefore conservative.
|
| 71 |
+
|
| 72 |
+
**Where it does not win — stated plainly, because earlier drafts of our own report got this wrong:**
|
| 73 |
+
|
| 74 |
+
| Axis | Result |
|
| 75 |
+
|---|---|
|
| 76 |
+
| BLURB probe mean | **rank 2 / 17** (0.7268) — *not* rank-1; only BIOSSES is |
|
| 77 |
+
| Calibration (mean ECE) | **rank 9 / 17** (0.1209) — mid-pool, not a strength |
|
| 78 |
+
| RadGraph entity/relation F1 | **rank 7–10 / 17** — high absolute scores (micro-F1 0.90–0.91), mid-pool rank |
|
| 79 |
+
| Long-context needle | **rank 11 / 17** (0.9333) |
|
| 80 |
+
| MedHALT-FCT (false-confidence) | **rank 16 / 17** (0.0280) — **our single worst placement**, and we call it out rather than bury it |
|
| 81 |
+
| Tokenizer single-token rate (STRR) | rank 15 / 17 — a deliberate BBPE trade-off (see *Known issues*) |
|
| 82 |
+
| Closed-book medical MCQ | mean 0.4352 — below the frontier fleet; a post-training problem, not a token-budget one |
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## KOS-V5 vs KOS-V4 — a corpus trade-off, now settled
|
| 87 |
+
|
| 88 |
+
Both models are ours, both are finished, and both were run on the identical harness. **KOS-V5 is
|
| 89 |
+
better on 17 of 32 compared metrics, KOS-V4 on 15.**
|
| 90 |
+
|
| 91 |
+
The token-budget alibi is dead: KOS-V5 finished on **235.2B tokens vs KOS-V4's 180.3B** (1.30×) at a
|
| 92 |
+
larger parameter count. **Every remaining KOS-V4 win is a win on the merits.**
|
| 93 |
+
|
| 94 |
+
| | KOS-V5 (final, 235B) | KOS-V4 (final, 180B) | Winner |
|
| 95 |
+
|---|---|---|---|
|
| 96 |
+
| **Medical MCQ mean** (16 tasks) | **0.4352** | 0.3319 | **V5** (+0.103; 12 of 16 tasks) |
|
| 97 |
+
| MMLU clinical knowledge | **0.5057** | 0.3094 | **V5** (+0.196) |
|
| 98 |
+
| MMLU college medicine | **0.4335** | 0.2312 | **V5** (+0.202) |
|
| 99 |
+
| BPB 5-corpus mean | 0.4635 | **0.4309** | **V4** |
|
| 100 |
+
| BPB radiology / chest-xray / clinical | 0.5132 / 0.6688 / 0.4179 | **0.4761 / 0.5887 / 0.3221** | **V4** |
|
| 101 |
+
| BPB biomedical-lit / textbooks | **0.1108 / 0.6066** | 0.1243 / 0.6432 | **V5** |
|
| 102 |
+
| RankMe (mean) | **220.0** | 170.8 | **V5** |
|
| 103 |
+
| Long-context BPB @ 4k→32k | **wins every window** | — | **V5** |
|
| 104 |
+
| Needle 3-depth mean | **0.9333** | 0.8667 | **V5** |
|
| 105 |
+
| BLURB mean / RadGraph | 0.7268 / 0.75–0.77 | **0.7465 / 0.77–0.82** | **V4** |
|
| 106 |
+
| PubMedQA / MedThink | 0.6680 / 0.9200 | **0.6980 / 0.9450** | **V4** |
|
| 107 |
+
|
| 108 |
+
**The honest reading.** KOS-V4's narrow radiology/clinical-dominant corpus still produces the better
|
| 109 |
+
**text model of radiology and clinical notes**. KOS-V5's broader 54-source corpus produces the better
|
| 110 |
+
**medical reasoner** — on the recall-heavy MCQ tasks V4 sat close to chance and V5 does not. This is a
|
| 111 |
+
**corpus-composition difference, not a maturity gradient**, and no amount of further pretraining was
|
| 112 |
+
going to close it: V5 would have needed to recover 0.0326 BPB, and its entire final leg moved it by
|
| 113 |
+
0.0001. Which model is "better" depends on the deployment.
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## The run converged before it finished — read this before choosing a checkpoint
|
| 118 |
+
|
| 119 |
+
The identical 16-tier battery was run at **six** checkpoints (90B / 120B / 150B / 190B / 220B / 235B).
|
| 120 |
+
|
| 121 |
+
| axis | 90B | 120B | 150B | **190B** | 220B | **235B (final)** |
|
| 122 |
+
|---|---|---|---|---|---|---|
|
| 123 |
+
| BPB (5-corpus, lower better) | .4890 | .4781 | .4740 | .4647 | .4636 | **.4635** |
|
| 124 |
+
| MCQ (16 tasks, higher better) | .3478 | .3737 | .4071 | **.4449** | .4332 | **.4352** |
|
| 125 |
+
| Needle (higher better) | .9333 | .9000 | .9500 | .9167 | .9000 | **.9333** |
|
| 126 |
+
| ECE (lower better) | .1847 | **.1135** | .1181 | .1378 | .1183 | **.1209** |
|
| 127 |
+
|
| 128 |
+
**On the final leg, not one headline axis improved.** BPB moved **+0.0001** (zero to three decimals).
|
| 129 |
+
MCQ **peaked at 190B and never recovered** — the final model ends **0.0097 below its own peak**, with
|
| 130 |
+
12 of 16 tasks below their peak-checkpoint value. Needle ended **exactly** where it began at 90B.
|
| 131 |
+
Calibration ended *worse* than the checkpoint before it. The learning-rate integral is 100% spent.
|
| 132 |
+
|
| 133 |
+
> **⚠️ The newest checkpoint is NOT the knowledge-best checkpoint.**
|
| 134 |
+
> The **190B** checkpoint is KOS-V5's knowledge-best, permanently. **Choose your fine-tuning
|
| 135 |
+
> initialisation by axis:** the 190B checkpoint for medical knowledge/MCQ; **this final checkpoint for
|
| 136 |
+
> BPB, long-context and general LM health.** Do not assume "newest = best."
|
| 137 |
+
|
| 138 |
+
Both MCQ moves (the 220B drop and the 235B bounce) sit inside MMLU-subset sampling noise. What
|
| 139 |
+
survives noise is the **plateau**: knowledge accuracy stopped improving 45B tokens before the end.
|
| 140 |
+
|
| 141 |
+
---
|
| 142 |
+
|
| 143 |
+
## Known issues
|
| 144 |
+
|
| 145 |
+
**1. The tokenizer does not split numbers — and this cannot be fixed in V5.**
|
| 146 |
+
|
| 147 |
+
The v5-32k BBPE has **no digit rule**: its pre-tokenizer is plain byte-level, so digit runs merge into
|
| 148 |
+
single tokens by BPE frequency.
|
| 149 |
+
|
| 150 |
+
| tokenizer | digit rule | multi-digit tokens | max digit-run | `10` / `100` / `1000` | tokens/number |
|
| 151 |
+
|---|---|---|---|---|---|
|
| 152 |
+
| **KOS-V5** | **none** | **963** | **5** | one token each | **1.80** |
|
| 153 |
+
| Qwen3-4B-Base | yes — **every digit split** | 0 | 1 | `1`·`0` / `1`·`0`·`0` / … | 4.20 |
|
| 154 |
+
| Llama-3.2-3B | yes — ≤3-digit groups | 1100 | 3 | `10` / `100` / `100`+`0` | 2.90 |
|
| 155 |
+
|
| 156 |
+
**The consequence is compositional:** `10`, `100` and `1000` are three *unrelated atomic symbols* that
|
| 157 |
+
share no substructure. The model cannot see that they differ by a factor of ten; it must learn each
|
| 158 |
+
magnitude as a separate lexical item, and rare numbers fragment on arbitrary BPE boundaries while
|
| 159 |
+
common ones do not. In medicine — doses, lab values, vitals — this is exactly the regime where
|
| 160 |
+
digit-level arithmetic and magnitude comparison are known to degrade.
|
| 161 |
+
|
| 162 |
+
**Stated with its limit:** this is a **measured property of the frozen tokenizer, not a measured
|
| 163 |
+
downstream failure.** Our evaluation suite contains **no arithmetic or numeric-reasoning tier**, so we
|
| 164 |
+
neither quantify the cost nor claim there is none. The tokenizer is baked into the trained (tied)
|
| 165 |
+
embedding table, so it is unfixable in V5 — **it is a KOS-V6 decision** (add a digit-splitting
|
| 166 |
+
pre-tokenizer), and V6 must ship the missing tier to measure it.
|
| 167 |
+
|
| 168 |
+
**2. Low medical single-token rate (STRR, rank 15/17).** Deliberate: BBPE spends its 32k vocabulary on
|
| 169 |
+
byte-level compression rather than memorising whole medical terms. It single-tokens only ~19% of
|
| 170 |
+
radiology and ~23% of chest-xray terms. The trade appears sound — tokens-per-byte is rank 4/17 and BPB
|
| 171 |
+
is rank 1/17 — but it is a trade, and it is the same trade as the digit issue above.
|
| 172 |
+
|
| 173 |
+
**3. Long-context needle retrieval never improved** across the entire run (rank 11/17). More
|
| 174 |
+
pretraining will not fix it; it is a post-training problem.
|
| 175 |
+
|
| 176 |
+
**4. MedHALT-FCT rank 16/17.** A base model with no refusal prior has essentially no mechanism for
|
| 177 |
+
declining a question with a false premise, and KOS-V5 answers anyway. This is the axis a grounded
|
| 178 |
+
medical executor most needs to improve, and it is a target for the instruction/RL stage.
|
| 179 |
+
|
| 180 |
+
**5. Attention health is leading but degrading.** KOS-V5 still leads the pool on T2, but bos-sink mass
|
| 181 |
+
rose 0.1619 → 0.2541 and layers-carrying-a-sink rose 0.0830 → 0.3330 across training. The lead is real
|
| 182 |
+
but it shrank; it did not consolidate.
|
| 183 |
+
|
| 184 |
+
---
|
| 185 |
+
|
| 186 |
+
## Usage
|
| 187 |
+
|
| 188 |
+
```python
|
| 189 |
+
import torch
|
| 190 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 191 |
+
|
| 192 |
+
model_id = "Kentucky-Open-Science/KOS-V5-Base"
|
| 193 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 194 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
|
| 195 |
+
|
| 196 |
+
prompt = "IMPRESSION: The chest radiograph demonstrates"
|
| 197 |
+
ids = tok(prompt, return_tensors="pt").to(model.device) # add_bos_token=False by design
|
| 198 |
+
out = model.generate(**ids, max_new_tokens=128, do_sample=False)
|
| 199 |
+
print(tok.decode(out[0], skip_special_tokens=True))
|
| 200 |
+
```
|
| 201 |
+
|
| 202 |
+
### Serving notes (please read — these bite)
|
| 203 |
+
|
| 204 |
+
- **`rope_theta = 25000`, not 10000.** Some conversion paths (notably GGUF) silently fall back to
|
| 205 |
+
10,000 and quietly damage long-context behaviour. **Pin it explicitly** when converting.
|
| 206 |
+
- **`add_bos_token=False`.** Setting it true double-prepends BOS and breaks generation.
|
| 207 |
+
- **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.
|
| 208 |
+
- **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.
|
| 209 |
+
- Requires `transformers` with the nested `rope_parameters` config schema (≥5.x), or convert the config.
|
| 210 |
+
|
| 211 |
+
---
|
| 212 |
+
|
| 213 |
+
## Intended use
|
| 214 |
+
|
| 215 |
+
A **research base model** for medical/biomedical NLP: the initialisation for domain SFT/RL, a subject
|
| 216 |
+
for interpretability and tokenizer/corpus research, and a from-scratch reference point against
|
| 217 |
+
distilled and continued-pretrained medical models. It is not instruction-tuned and is not a
|
| 218 |
+
question-answering system. Its closed-book medical MCQ accuracy is well below the frontier fleet, and
|
| 219 |
+
the known issues above (especially the number tokenization) bear directly on any numeric medical task.
|
| 220 |
+
|
| 221 |
+
---
|
| 222 |
+
|
| 223 |
+
## Reproducibility
|
| 224 |
+
|
| 225 |
+
| artifact | value |
|
| 226 |
+
|---|---|
|
| 227 |
+
| checkpoint | step **49,835** of 49,835 (epoch 1.000) |
|
| 228 |
+
| tokens/step | 1 × 8 × 24 × 24,576 = 4,718,592 |
|
| 229 |
+
| `tokenizer.json` md5 | `9c9df0404f6aae96dba5f3785e8b4c9d` |
|
| 230 |
+
| optimizer | AdamW β=(0.9, 0.95), grad-clip 1.0 |
|
| 231 |
+
| LR schedule | cosine → 0, peak 3.0e-4, 1% warmup (integral 100% spent) |
|
| 232 |
+
| batch | micro_batch 1 × grad_accum 8 × 24 GPUs, seq 24,576 (≈4.72M tokens/step) |
|
| 233 |
+
| corpus | 54 sources, English-only, deduped → decontaminated, whole documents (>24,576 tokens dropped, never split), neat-packed with 4-D block-diagonal segment mask (no cross-document attention; position ids reset per document) |
|
| 234 |
+
|
| 235 |
+
Full 22-page evaluation report — all 96 metrics, all 17 models, every rank re-derived from source:
|
| 236 |
+
`kos_v5_brief.pdf` (in this repository).
|
| 237 |
+
|
| 238 |
+
---
|
| 239 |
+
|
| 240 |
+
## Attribution
|
| 241 |
+
|
| 242 |
+
Developed at the **University of Kentucky College of Medicine**, **Center for Clinical and
|
| 243 |
+
Translational Science (CCTS)**.
|
| 244 |
+
|
| 245 |
+
*Additional collaborator attribution to be added.*
|
| 246 |
+
|
| 247 |
+
## Citation
|
| 248 |
+
|
| 249 |
+
```bibtex
|
| 250 |
+
@misc{kos_v5_base_2026,
|
| 251 |
+
title = {KOS-V5-Base (Catbird): a from-scratch 3.72B medical language model},
|
| 252 |
+
author = {Kentucky Open Science},
|
| 253 |
+
year = {2026},
|
| 254 |
+
note = {University of Kentucky College of Medicine,
|
| 255 |
+
Center for Clinical and Translational Science (CCTS)},
|
| 256 |
+
url = {https://huggingface.co/Kentucky-Open-Science/KOS-V5-Base}
|
| 257 |
+
}
|
| 258 |
+
```
|
catbird_llm_logo.png
ADDED
|
Git LFS Details
|
config.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 0,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 2560,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 9728,
|
| 15 |
+
"layer_types": [
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
+
"full_attention",
|
| 51 |
+
"full_attention"
|
| 52 |
+
],
|
| 53 |
+
"max_position_embeddings": 32768,
|
| 54 |
+
"max_window_layers": 36,
|
| 55 |
+
"model_type": "qwen3",
|
| 56 |
+
"num_attention_heads": 32,
|
| 57 |
+
"num_hidden_layers": 36,
|
| 58 |
+
"num_key_value_heads": 8,
|
| 59 |
+
"pad_token_id": 0,
|
| 60 |
+
"rms_norm_eps": 1e-06,
|
| 61 |
+
"rope_parameters": {
|
| 62 |
+
"rope_theta": 25000.0,
|
| 63 |
+
"rope_type": "default"
|
| 64 |
+
},
|
| 65 |
+
"sliding_window": null,
|
| 66 |
+
"tie_word_embeddings": true,
|
| 67 |
+
"transformers_version": "5.2.0",
|
| 68 |
+
"use_cache": true,
|
| 69 |
+
"use_sliding_window": false,
|
| 70 |
+
"vocab_size": 32000
|
| 71 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 0,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
0
|
| 6 |
+
],
|
| 7 |
+
"output_attentions": false,
|
| 8 |
+
"output_hidden_states": false,
|
| 9 |
+
"pad_token_id": 0,
|
| 10 |
+
"transformers_version": "5.2.0",
|
| 11 |
+
"use_cache": false
|
| 12 |
+
}
|
kos_v5_brief.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b5a2d204a16ebe03b738649b3f1261d1144011bdb7a0bc28ae08f0e1812be6c2
|
| 3 |
+
size 355280
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02790fecbb3aaedbc43dea9fd12ea7619af7ee822d33bc634ce1ff4b82cf1dda
|
| 3 |
+
size 7594749808
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<|endoftext|>",
|
| 3 |
+
"eos_token": "<|endoftext|>",
|
| 4 |
+
"model_max_length": 32768,
|
| 5 |
+
"pad_token": "<|endoftext|>",
|
| 6 |
+
"padding_side": "right",
|
| 7 |
+
"split_special_tokens": false,
|
| 8 |
+
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 9 |
+
"unk_token": "<|endoftext|>",
|
| 10 |
+
"add_bos_token": false,
|
| 11 |
+
"add_eos_token": false
|
| 12 |
+
}
|