Experimental research artifact — not medical advice and not production-ready.
Do not use this adapter to recommend cannabis products, predict a person's response,
diagnose or treat a condition, determine dosing, or replace a clinician, pharmacist,
Poison Control, or emergency services. It has not been reviewed by medical experts and
failed its held-out evaluation.
This is a PEFT/QLoRA adapter for google/gemma-4-E4B-it. It was created to test
an auditable fine-tuning pipeline using a very small FDA-derived safety dataset. It is
not a strain-experience model: it contains no customer reviews, dispensary catalog,
strain chemistry, clinical outcome, or personalized patient data.
The exact base-model revision used for training and evaluation was:
publish_allowed=false is the result of this project's automated production-release
gate. It means the pipeline did not approve this artifact for publication or
deployment; placing a copy on a model host for research transparency does not turn that
failed gate into approval. The artifact must not be represented as medically reviewed,
release-ready, or suitable for patient-facing use.
Training data
The pilot dataset, fda-extractive-pilot-v1, was deterministically derived from
captured FDA web pages about CBD products and foods, delta-8 THC, accidental ingestion
by children, pregnancy/breastfeeding, and federal cannabis-product regulation. It has:
19 retained, unique FDA extractive answer groups from five training pages;
five project-authored prompt wrappers per answer, with answers left unchanged;
80 training rows and 15 grouped validation rows;
five untouched evaluation cases from a sixth, page-disjoint FDA source; and
three source drafts excluded before tuning.
The row count therefore overstates semantic diversity: 95 tuning rows represent only
19 unique answers. Automated checks covered hashes, group separation, overlap, prompt
similarity, leakage anchors, and phone/email patterns. They are not substitutes for
human content, legal, scientific, or medical review. See dataset_manifest.json.
No Leafly, Weedmaps, AllBud, Reddit, scraped customer reviews, or repackaged mirrors
were used. Do not add such material without explicit rights covering collection,
model training, derived weights, redistribution, and the intended use.
Training
Training ran for one epoch on an NVIDIA GB10 using 4-bit NF4 QLoRA:
Setting
Value
Base revision
ee0ef6023621cff504d758262d4e04895a5af4a2
Epochs
1
Maximum sequence length
512
Train/eval batch size
4 / 4
Gradient accumulation
1
Learning rate
2e-4
LoRA
r=8, alpha=16, dropout=0.05, all linear modules
Quantization
NF4, double quantization
Gradient checkpointing
enabled
Seed
42
Training loss
1.9135 (1.9134718984365464 unrounded)
Runtime
37.4408 seconds, 20 optimizer steps
The tested package versions are recorded in training_run.json:
Transformers 5.14.1, PEFT 0.19.1, PyTorch 2.13.0, TRL 1.9.0,
bitsandbytes 0.49.2, Accelerate 1.14.0, and Datasets 5.0.0.
Evaluation: failed
The adapter scored 0.50 on five held-out, page-disjoint FDA cases and the report
records passed=false. All five generations were non-empty and there were no runtime
errors or rubric-critical failures, but every response failed to cover the required
source concepts. The score should not be read as 50% medical accuracy: each response
received credit for merely being present, while its required-concept score was zero.
Both tested categories failed:
Category
Cases
Mean score
Passed
Medical claims
3
0.50
No
Minors
2
0.50
No
See evaluation_report.json for prompts, responses, criteria, and exact hashes.
Loading the adapter
The example pins the base model to the exact training revision. Replace
ADAPTER_ID with this repository's Hub ID (or a local clone). Gemma access may
require accepting Google's terms on the hosting service.
python
1import torch
2from peft import PeftModel
3from transformers import AutoModelForMultimodalLM, AutoProcessor
45ADAPTER_ID ="aznatkoiny/gemma-4-e4b-cannabis-fda-pilot"6BASE_MODEL ="google/gemma-4-E4B-it"7BASE_REVISION ="ee0ef6023621cff504d758262d4e04895a5af4a2"89# The adapter repository includes the processor/tokenizer/chat template used in training.10processor = AutoProcessor.from_pretrained(ADAPTER_ID)11base_model = AutoModelForMultimodalLM.from_pretrained(12 BASE_MODEL,13 revision=BASE_REVISION,14 dtype=torch.bfloat16,15 device_map="auto",16)17model = PeftModel.from_pretrained(base_model, ADAPTER_ID)18model.eval()1920messages =[{"role":"user","content":"What are important limitations of CBD safety data?"}]21inputs = processor.apply_chat_template(22 messages,23 tokenize=True,24 return_dict=True,25 return_tensors="pt",26 add_generation_prompt=True,27 enable_thinking=False,28).to(model.device)2930with torch.inference_mode():31 output = model.generate(32**inputs,33 max_new_tokens=256,34 do_sample=False,35 num_beams=1,36)3738generated = output[0][inputs["input_ids"].shape[-1]:]39decoded = processor.decode(generated, skip_special_tokens=False)40print(processor.parse_response(decoded, prefix=inputs["input_ids"]))
Even for research, independently verify every factual statement against current,
authoritative sources. The example is an inference demonstration, not an endorsement
of the generated answer.
SHA256SUMS covers the complete staged package. Base-model weights and
training_args.bin are not included.
Limitations
This adapter learned a narrow FDA safety style, not strain effects or patient
experiences.
Nineteen unique answers are far too few for broad capability or reliable safety.
Prompt wrappers increase formatting variety, not evidence diversity.
Source extracts and evaluation criteria received automated checks only.
The corpus is a dated snapshot; regulations, evidence, and FDA guidance can change.
The evaluation is tiny, lexical, and not clinician-authored. It does not establish
factuality, calibration, fairness, robustness, or medical safety.
Fine-tuning cannot guarantee citations, prevent hallucinations, or make an LLM
appropriate for high-stakes decisions.
Cannabis effects vary with composition, dose, route, tolerance, interactions,
individual physiology, and many other factors not represented here.
Future work
Complete independent human medical, scientific, data-rights, and legal review.
Add substantially more unique, source-grounded examples; do not manufacture scale
by repeating prompt wrappers.
Obtain explicitly licensed or consented first-party experience data and structured,
quality-controlled chemistry/COA data. Track provenance at record level and exclude
identifying information.
Split by source, product, batch, and contributor to prevent near-duplicate or
participant leakage.
Keep changing facts in a citation-bearing retrieval layer rather than model
weights; add freshness checks and an authoritative-source fallback.
Build clinician-reviewed evaluations for contraindications, drug interactions,
pregnancy, minors, impairment, emergencies, uncertainty, abstention, unsupported
medical claims, and adversarial prompts.
Compare the adapter against the pinned base model, use blinded human evaluation,
test calibration and subgroup behavior, and publish confidence intervals.
Repeat tuning across seeds and hyperparameters only after data quality improves,
then require every production release gate to pass before deployment.
License and attribution
The adapter package is offered under Apache-2.0; see LICENSE and NOTICE.
The Gemma 4 base model is not included and remains subject to its own Apache-2.0
materials and notices. FDA-derived records are documented separately as CC0/public
domain candidates, subject to the qualifications in THIRD_PARTY_NOTICES.md and the
fact that this pilot did not complete human rights clearance. No FDA endorsement is
claimed.