Instructions to use starttoshow/medix-qwen3.5-2b-cpt-sft-gspo-20260908 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use starttoshow/medix-qwen3.5-2b-cpt-sft-gspo-20260908 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
MediX Qwen3.5-2B CPT β SFT β GSPO (2026-09-08)
Four research adapters from the expanded-candidate experiment, including the matched SFT-only control. This repository updates the model artifacts accompanying Medical Agent Assistant. It does not claim a general improvement over the earlier AβF or VQA-GSPO releases.
What is included
| Folder | Training stage | Required loading order |
|---|---|---|
cpt/ |
Rank 32 medical continued pretraining, 1,252 steps, 8,081,502 training tokens | Base β attach CPT |
sft/ |
Rank 8 Attention SFT, 1,355 steps | Base β merge CPT β attach SFT |
sft_only/ |
Matched direct SFT control | Base β attach SFT-only |
rl/ |
Rank 8 Attention+FFN GSPO, 320 updates | Base β merge CPT β merge SFT β attach RL |
These are dependent stage increments. SFT and RL cannot be loaded directly on the original base. Reproduce sequential BF16 merging: changing dtype or comparing unmerged SFT against a merged RL backbone introduces a numerical confound. release_manifest.json records base revision, dependencies and exact weight/configuration hashes. Adapter tensor bytes match the frozen experiment; only public base-path metadata was normalized.
Evaluation
| Protocol | Before β after | Interpretation |
|---|---|---|
| 150 knowledge questions, SFT-only β CPT+SFT, strict answer | 88/150 β 89/150 | +0.67 pp, nominal paired 95% CI [β5.33, +6.67]; 10 wins / 9 losses |
| 91 fact families, two phrasings both correct, CPT β CPT+SFT | 38/91 β 48/91 | 45 training and 46 project-validation families; prompted recall diagnostic |
| 312 knowledge/case questions, same merged backbone, RL off β on | 134/312 β 132/312 | β0.64 pp, 95% CI [β2.56, +1.28]; 4 wins / 6 losses |
| Frozen 128 RL training questions, greedy round 0 β 5 | 79/128 β 84/128 | 5 wins / 0 losses; exact McNemar p=0.0625 |
| Same training questions, at least one correct answer in 8 draws | 109/128 β 108/128 | Candidate availability, not single-answer accuracy |
The 150-question comparison uses 2,048 tokens; the 312-question mechanism comparison uses 512 total / 384 thinking tokens. Scores are not directly interchangeable across these protocols. The project knowledge questions informed CPT source selection, so the 150/312 set measures controlled acquisition/retrieval, not unseen-knowledge generalization. There is one training seed, proxy model judging and no full multiple-comparison correction. RL has not demonstrated reliable net gains on the complete knowledge/case set. Full metrics and paired intervals are in evaluation.json and the public report.
GSPO revisits 128 unique training questions (96 knowledge / 32 cases), five rounds with four fresh candidates: 2,560 rollouts. Reward is 0.9 Γ minimum(answer score, reasoning score)/2 + 0.1 Γ native-format score, using Gemini 3.5 Flash. Learning rate 1e-6, KL coefficient 0.02, asymmetric clipping 0.0003/0.0004. Reward flaws, knowledge instability and application errors remain.
Loading
Clone the code repository, install MediX-R1/requirements.txt and compatible PyTorch, then run from MediX-R1/:
python -m examples.inference_chain --stage rl --question "What is the purpose of a randomized control group?" --device cuda
The code registry pins this repository revision. Use --stage cpt, sft or sft_only for controls, and --verify-only to check artifact hashes without loading weights. --package supports a local download and --base-model a local base directory. inference_chain.py here is a copy of the repository example and imports its shared prompt; run the documented module from the code repository. This simple demo uses greedy native thinking with a total token cap, not the full mechanism evaluation protocol.
Data and scope
CPT uses selected public medical background material; the complete selected CPT corpus is not distributed here. SFT uses the project's VQA, knowledge, case and context recipe; the original SFT dataset has source and license information. The release supplies frozen weights and loading dependencies; retraining CPT additionally requires preparing the source corpus. It is not an end-to-end training reproduction from this package alone.
Research and engineering demonstration only. No clinical validation or patient-facing deployment certification. These models were not connected to the Agent end-to-end evaluations. Synthetic/reference-assisted explanations are not clinician-reviewed ground truth. The newer 600-question old-model MCQ diagnostic belongs to different checkpoints and is not this model's score.
Release verification
All four adapter tensor hashes match the frozen experiment and remote LFS metadata. The full baseβCPT mergeβSFT mergeβRL attach chain completed a Windows CPU 2-token generation smoke test. The example disables asynchronous weight loading before importing Hub/Transformers to avoid the observed Windows native access violation; for an existing Python environment, set HF_DEACTIVATE_ASYNC_LOAD=1 before starting Python. This is a loading smoke test, not a new quality evaluation or GPU training run.
- Downloads last month
- -