⚠️ Experimental

medgemma-4b-decision

Non-autoregressive clinical decision encoder built on google/medgemma-4b-it.

Instead of generating text, the model runs one forward pass and reads hidden states at [DECISION] marker token positions. Lightweight classification heads (ChoiceHead, ScoreHead, NoulHead) decode structured answers directly β€” no sampling, no generation loop.

Architecture

State: {state}
Q[q1] {instructions} Options: {opt1} | {opt2} [DECISION]
Q[q2] {instructions} [DECISION]
         ↓ single forward pass
         ↓ hidden state at each [DECISION]
         ↓ per-question head
         β†’ choice (softmax over options)
         β†’ score (expected value over ordinal levels)
         β†’ noul (sigmoid probability)

Decision primitives (compatible with OpenRouter /api/alpha/decisions schema):

Type Head Output
choice ChoiceHead (linear β†’ softmax) top option + probabilities dict
score ScoreHead (linear β†’ ordinal EV) float in [0, n_levels)
noul NoulHead (linear β†’ sigmoid) probability float in [0, 1]

Latency on Apple M-series MPS: ~74ms per call (all questions in one pass).

Usage

Requires access to google/medgemma-4b-it (accept Google HAI-DEF terms at that page first).

from medgemma_decision import MedGemmaDecision

model = MedGemmaDecision(device="mps")  # or "cuda" / "cpu"

result = model.predict(
    state="54yo male. Chest tightness x2h. BP 158/96. ECG: ST elevation II/III/aVF.",
    questions={
        "triage": {
            "type": "choice",
            "instructions": "Triage priority?",
            "criteria": {
                "emergent": "life-threatening, immediate intervention required",
                "urgent":   "serious but stable, seen within 30 min",
                "semi":     "non-urgent, can wait",
            },
        },
        "admit": {
            "type": "noul",
            "instructions": "Does this patient require hospital admission?",
        },
    },
)
# result["answers"]["triage"]["choice"] β†’ "emergent"
# result["answers"]["admit"]["noul"]    β†’ 0.73

Status

noul_head.pt is a trained checkpoint (60-epoch Brier-loss fine-tune on the prior auth benchmark set, head-only β€” backbone frozen). Choice and score heads remain randomly initialized.

Performance

Model Accuracy (83 Qs) Notes
laya (ModernBERT-large, zero-shot) 75% noul biased toward 0
medgemma-4b-decision (untrained) 75% noul stuck at 0.5
medgemma-4b-decision (noul_head.pt) 90% 60 epochs, Brier loss; in-sample

Synthetic prior auth charts (rheumatology + dermatology), criterion-level and overall approval questions (tests/eval_2_prior_auth.py). 83 questions across 16 cases.
Training: head-only, backbone frozen, Adam lr=1e-3, loss 0.21 β†’ 0.10.

Intended Use

Research and development tooling for clinical decision-support systems. Not intended for clinical deployment or use in diagnosis, treatment decisions, or patient care without appropriate validation, regulatory review, and Health Regulatory Authorization.

This is a modified architecture (not a fine-tune or weights release). Users must load google/medgemma-4b-it weights themselves under the HAI-DEF Terms of Use.

License and Terms

This repository is distributed under the Health AI Developer Foundations (HAI-DEF) Terms of Use: https://developers.google.com/health-ai-developer-foundations/tos

By using this repository, you agree to the HAI-DEF Terms of Use, which are incorporated by reference and apply to all downstream uses. Key requirements for downstream users:

  • Include the attribution notice from the NOTICE file
  • Mark any further modified files as modified
  • Pass through these terms to your own downstream users
  • If your use could trigger medical device classification, obtain Health Regulatory Authorization before deployment
  • Comply with Google's Prohibited Use Policy

You may not use this model in a way that would cause a Health Regulatory Authority to classify Google as the medical device manufacturer.

See the NOTICE file for the full attribution notice and list of modified files.

Citation

If you use this architecture in research, please cite the base model:

@misc{medgemma2025,
  title={MedGemma},
  author={Google},
  year={2025},
  url={https://huggingface.co/google/medgemma-4b-it}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rreinold/medgemma-4b-decision

Finetuned
(630)
this model