groundnote-239m

A 239M-parameter Llama-style decoder that turns a doctor–patient conversation into a sectioned clinical note: Chief Complaint, HPI, Past Medical History, Allergies, Physical Exam, Assessment, Plan.

Intended use

Research and education on clinical-note generation and on checking notes against their transcripts.

Out of scope

  • Any clinical use: diagnosis, treatment, documentation of real care, or decision support.
  • Real patient data. Do not feed it transcripts of real patients.

Architecture:

  • 16 layers, d=1024, 32k byte-level BPE vocabulary, 3,072-token context.
  • The tokenizer and the weights were both trained from scratch, with no pretrained checkpoint. The tokenizer was trained on about 300 MB of FineWeb-Edu plus the fine-tuning train set.

Pretraining: 3.0B tokens of FineWeb-Edu sample/10BT, shards 000–003 (ODC-By 1.0), one epoch. That took 13.3 GPU-hours, mostly on H100.

Fine-tuning (28,454 examples, 4 epochs, best dev loss at epoch 3):

  • about 18k synthetic encounters written by Gemma 4 31B (Apache-2.0 per its model card);
  • ACI-Bench train notes, oversampled (ACI-Bench, Yim et al., 2023, CC BY 4.0);
  • MTS-Dialog train sections plus its back-translated augmentation (MTS-Dialog, Ben Abacha et al., 2023, CC BY 4.0).

"About 18k synthetic": about 20k encounters were generated, 5% were held out as dev/test, and notes with two or more contradicted clauses were dropped from train.

The weights are released under CC BY 4.0.

Use it with the groundnote code

The code forces the section headers and checks each clause against the transcript:

git clone https://github.com/hxlvvm/groundnote && cd groundnote
pip install torch==2.13.0 transformers==5.17.0
python -m groundnote.app Opflare1144/groundnote-239m     # web page at http://localhost:8000

In the browser

onnx/model_f16w.onnx runs the model in a web page with transformers.js (live demo: https://groundnote.vercel.app/demo.html).

  • The weights are stored as fp16 and cast back to fp32 when the session starts, so it is a 480 MB download that computes in full precision.
  • On three example visits its notes match the PyTorch model word for word.
  • Scored with the same script on the gate test sets: ACI-Bench test1 ROUGE-1 48.3, unsupported 73.1%; synthetic denied facts written as present 3.2%.
const model = await AutoModelForCausalLM.from_pretrained("Opflare1144/groundnote-239m", { dtype: "fp32", model_file_name: "model_f16w" });

The section-by-section decoding loop is docs/note.js in the GitHub repo.

Results

Greedy decoding on held-out test splits, compared with the earlier 97.5M model, which was trained without pretraining:

Test set 239M 97.5M
ACI-Bench test1 (40 real visits): ROUGE-1 48.4 44.0
ACI-Bench test1: clauses not found in transcript (gold note 37%) 71% 84%
Synthetic (200): denied facts written as present 3.2% 7.6%
Synthetic: fact recall 83.5% 60.4%

The repo's GATE.md fixed these comparisons before the 239M model was trained.

Limits

  • It still hallucinates on real conversations. 71% of its clauses on real visits cannot be found in the transcript, against 37% for doctors' notes. Most of the gap is domain shift: 63% of the fine-tuning examples are synthetic.
  • Use it with the clause checker, and read every note against its transcript.
  • Research prototype. Not for clinical use. Not a medical device.
Downloads last month
29
Safetensors
Model size
0.2B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Opflare1144/groundnote-239m