About OpenMed
OpenMed builds open models and open-source tools for clinical and biomedical text that run on your own hardware.
Results
Table with columns: MedQA-USMLE test, 1,273 questions, seed 0, Qwen3.5-0.8B as released, WSP Clinical Direct 0.8B, Paired difference (95% CI), McNemar p| MedQA-USMLE test, 1,273 questions, seed 0 | Qwen3.5-0.8B as released | WSP Clinical Direct 0.8B | Paired difference (95% CI) | McNemar p |
|---|
| Format-agnostic (any answer format) | 32.52% | 47.13% | +14.61 pts (+11.55 to +17.52) | 8.6e-21 |
Strict (last Answer: X line only) | 24.43% | 47.13% | +22.70 pts (+19.80 to +25.61) | 1.3e-47 |
Same model architecture, tokenizer, chat template and sampling for every row; only weight values differ. One sample per
question with seed 0 (MedQA also with seeds 1 and 2). Thinking on, temperature 0.6, top_p 0.95, top_k 20, presence
penalty 1.5, at most 32,768 new tokens (the paper's evaluation protocol). The prompt is OpenMed's fixed MedQA exam prompt
(below), and an answer is graded from the text after </think>: its last Answer: X line, X in A to D. Answers cut at the
token limit and answers with no gradable line count as wrong, as in the paper.
Table with columns: Checkpoint, MedQA (seed 0), MedQA, median of 3 seeds (range), MedMCQA, MMLU medical, MedQA answers cut at 32,768 tokens, MedQA answers with no gradable line| Checkpoint | MedQA (seed 0) | MedQA, median of 3 seeds (range) | MedMCQA | MMLU medical | MedQA answers cut at 32,768 tokens | MedQA answers with no gradable line |
|---|
| OpenMed WSP Clinical Direct 0.8B (this model) | 47.1% | 45.5% (44.1% to 47.1%) | 40.9% | 61.7% | 0.1% | 0.0% |
| Random patch, same size, random direction (seed 1) | 23.1% | n/a | 29.7% | not scored | 21.4% | 33.4% |
| Random patch, same size, random direction (seed 2) | 0.2% | n/a | 0.3% | 0.2% | 98.9% | 0.5% |
| Qwen3.5-0.8B as released | 24.4% | 23.1% (22.1% to 24.4%) | 30.6% | 43.4% | 18.3% | 32.9% |
Paired tests on the same questions (seed 0; exact McNemar on the questions only one checkpoint got right; bootstrap 95%
CI over questions, 10,000 resamples):
Table with columns: Comparison, Benchmark, n, Before, After, Difference (95% CI), Only before right / only after right, McNemar p| Comparison | Benchmark | n | Before | After | Difference (95% CI) | Only before right / only after right | McNemar p |
|---|
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 24.4% | 47.1% | +22.7 pts (+19.8 to +25.6) | 71 / 360 | 1.3e-47 |
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 30.6% | 40.9% | +10.3 pts (+7.1 to +13.5) | 88 / 191 | 6.6e-10 |
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MMLU | 1,089 | 43.4% | 61.7% | +18.3 pts (+15.3 to +21.2) | 56 / 255 | 1.7e-31 |
| random patch 1 -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 23.1% | 47.1% | +24.0 pts (+21.1 to +26.9) | 69 / 375 | 5.6e-52 |
| random patch 1 -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 29.7% | 40.9% | +11.2 pts (+8.2 to +14.2) | 70 / 182 | 1.1e-12 |
| random patch 2 -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 0.2% | 47.1% | +47.0 pts (+44.3 to +49.7) | 0 / 598 | 1.9e-180 |
| random patch 2 -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 0.3% | 40.9% | +40.6 pts (+37.5 to +43.7) | 0 / 406 | 1.2e-122 |
| random patch 2 -> WSP Clinical Direct 0.8B | MMLU | 1,089 | 0.2% | 61.7% | +61.5 pts (+58.7 to +64.5) | 0 / 670 | 4.1e-202 |
Random patch 1 is the control that counts. It changes the same rows and columns of the same four tensors by the same amount in random directions, and the model stays where it was: MedQA 23.1% strict and 32.0% format-agnostic, against 24.4% and 32.5% for the release. Its MMLU answers are in eval/per_question/ but have no score in the study's summary, and it was not run on the general benchmarks. Random patch 2 broke the model: it scores 0.2% on MedQA, with 98.9% of answers cut at the token limit, so it is a weak control and its rows are kept only for completeness.
Also accepting Answer: <B>, Answer: (b), Answer: <letter>B and \boxed{B} after </think>. The gap between this
and the strict score shows how much of a checkpoint's score is lost to the format of its final line rather than to the
choice itself.
Table with columns: Checkpoint, MedQA, MedMCQA, MMLU medical| Checkpoint | MedQA | MedMCQA | MMLU medical |
|---|
| OpenMed WSP Clinical Direct 0.8B (this model) | 47.1% | 40.9% | 61.7% |
| Random patch, same size, random direction (seed 1) | 32.0% | 33.5% | not scored |
| Random patch, same size, random direction (seed 2) | 0.2% | 0.3% | 0.3% |
| Qwen3.5-0.8B as released | 32.5% | 34.8% | 50.0% |
Paired tests on the format-agnostic score (same questions, seed 0, same tests as above):
Table with columns: Comparison, Benchmark, n, Before, After, Difference (95% CI), Only before right / only after right, McNemar p| Comparison | Benchmark | n | Before | After | Difference (95% CI) | Only before right / only after right | McNemar p |
|---|
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 32.5% | 47.1% | +14.6 pts (+11.6 to +17.5) | 110 / 296 | 8.6e-21 |
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 34.8% | 40.9% | +6.1 pts (+2.8 to +9.3) | 106 / 167 | 2.7e-04 |
| Qwen3.5-0.8B -> WSP Clinical Direct 0.8B | MMLU | 1,089 | 50.0% | 61.7% | +11.7 pts (+8.7 to +14.6) | 75 / 202 | 1.3e-14 |
| random patch 1 -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 32.0% | 47.1% | +15.1 pts (+12.2 to +18.0) | 100 / 292 | 6.6e-23 |
| random patch 1 -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 33.5% | 40.9% | +7.4 pts (+4.3 to +10.4) | 85 / 159 | 2.5e-06 |
| random patch 2 -> WSP Clinical Direct 0.8B | MedQA-USMLE (4 options) | 1,273 | 0.2% | 47.1% | +46.9 pts (+44.2 to +49.6) | 0 / 597 | 3.9e-180 |
| random patch 2 -> WSP Clinical Direct 0.8B | MedMCQA | 1,000 | 0.3% | 40.9% | +40.6 pts (+37.5 to +43.7) | 0 / 406 | 1.2e-122 |
| random patch 2 -> WSP Clinical Direct 0.8B | MMLU | 1,089 | 0.3% | 61.7% | +61.4 pts (+58.5 to +64.4) | 1 / 670 | 1.4e-199 |
Nothing else broke (general benchmarks, one sample, seed 0)
Table with columns: Checkpoint, MATH-500, MATH-500 cut at 32,768 tokens, IFEval (strict, prompt level)| Checkpoint | MATH-500 | MATH-500 cut at 32,768 tokens | IFEval (strict, prompt level) |
|---|
| OpenMed WSP Clinical Direct 0.8B (this model) | 49.2% | 8.6% | 57.3% |
| Qwen3.5-0.8B as released | 7.4% | 93.6% | 20.2% |
For reference, the paper reports 48.1% on MATH-500 and 62.3% on IFEval for its own math edit (4 and 2 samples per problem); this model contains no part of that edit.
What the edit does
Both edits sit in layer 23, the last layer, and each is a rank-one change: one singular value holds 99.9% of every edited tensor's change (eval/direction_check.json, our own check of the saved weights).
- The answer line (
self_attn.o_proj). OpenMed's fixed exam prompt ends with "finish with one last line exactly like: Answer: ". Under the evaluation's sampling, Qwen3.5-0.8B often copies the placeholder and ends with Answer: <B> or Answer: <letter>, which the strict grader does not read as a letter: 419 of the release's 1,273 MedQA answers end that way. The edit removes one direction from the attention output of layer 23 (W <- W - u u^T W), and that direction lines up with the output direction of the token < (cosine 0.96, against 0.003 or less for A to D). With the edit, 0 of 1,273 MedQA answers end with a placeholder. The editor's own summary called this a direction for copying earlier text; the measured direction is <, the same one OpenMed/Qwen3.5-0.8B-WSP-Clinical removes.
- The thinking loops (one MLP neuron). 233 of the release's 1,273 MedQA answers (18.3%) never close their thinking and are cut at 32,768 tokens. The edit rewrites neuron 2059 of the layer-23 MLP: its row of
gate_proj, its row of up_proj and its column of down_proj. The new down column writes along the output direction of </think> (cosine 0.63), so when the neuron fires it pushes the model to end its thinking. The editor built the gate to open on tokens inside a verbatim repetition; we checked the output side of the neuron, not that trigger. With the edit, 1 of 1,273 MedQA answers is cut at the limit.
Nothing else in the model changes.
Table with columns: Tensor, Shape, bfloat16 entries changed, Relative change, sha256 (edited, bfloat16 bytes)| Tensor | Shape | bfloat16 entries changed | Relative change | sha256 (edited, bfloat16 bytes) |
|---|
model.language_model.layers.23.mlp.down_proj.weight | 1024 x 3584 | 1,024 | 0.0150 | c76fdae774c9e7c3e0da5ba36934f6ec4cb26f7ea18d048bc81ae5f85ed53edb |
model.language_model.layers.23.mlp.gate_proj.weight | 3584 x 1024 | 1,023 | 0.2407 | 0979840b6e3a093e9b285c60fe5004e4ffdae67a09e4215182739df418fe491a |
model.language_model.layers.23.mlp.up_proj.weight | 3584 x 1024 | 1,024 | 0.0185 | 442ee04db5cd7101868a83c1fc036393a8b8da18caeb434c6621a4ef10d1eab5 |
model.language_model.layers.23.self_attn.o_proj.weight | 1024 x 2048 | 1,735,071 | 0.0436 | 3bf0485515737d103cd6d97a0270718291f9f69e25b15c8e6c941cea0d7acfa0 |
1,738,142 bfloat16 entries differ from the starting checkpoint (Qwen/Qwen3.5-0.8B @ 2fc06364, the plain release, with no math edit). edit/manifest.json and
edit/edit.npz hold the edit as an exact diff (indices and bfloat16 bits), with the sha256 of every tensor before and
after; rebuilding the tensors from the diff reproduces these hashes.
Quick start
from vllm import LLM, SamplingParamsfrom transformers import AutoTokenizer def main(): repo = "OpenMed/Qwen3.5-0.8B-WSP-Clinical-Direct" tok = AutoTokenizer.from_pretrained(repo) llm = LLM(model=repo, dtype="bfloat16", max_model_len=34816, language_model_only=True, generation_config="vllm") # a MedQA-USMLE practice question (train split, id medqa_train_4541; the key is B) question = ("A 23-year-old male with a homozygous CCR5 mutation is found to be immune to HIV infection. " "The patient's CCR5 mutation interferes with the function of which viral protein?") options = {"A": "Reverse transcriptase", "B": "gp120", "C": "gp41", "D": "pp17"} user = ("Which option is the best answer to this clinical question?\n\n" + question + "\n\n" + "\n".join(f"{k}. {v}" for k, v in options.items()) + "\n\nReason as much as you need, then finish with one last line exactly like: Answer: <letter>") prompt = tok.apply_chat_template([{"role": "user", "content": user}], tokenize=False, add_generation_prompt=True, enable_thinking=True) sp = SamplingParams(temperature=0.6, top_p=0.95, top_k=20, presence_penalty=1.5, max_tokens=32768, seed=0) text = llm.generate([prompt], sp)[0].outputs[0].text print(text.split("</think>")[-1].strip()) if __name__ == "__main__": # vLLM starts worker processes main()
Output of the code above, run once as printed on Hugging Face Jobs on 1 Dec 2026 (one sample, seed 0; sampled text can differ between machines and vLLM versions):
The patient has a homozygous CCR5 mutation. The CCR5 receptor is the primary entry receptor for HIV-1. HIV-1 enters host cells by binding to the CCR5 receptor. The CCR5 receptor interacts with the viral envelope glycoprotein gp120. When a patient has a homozygous CCR5 mutation, they are unable to bind the CCR5 receptor effectively, leading to an inability to establish an infectious cycle. Therefore, the mutation interferes with the function of the viral protein gp120, which is the critical envelope glycoprotein required for viral entry into host cells. Answer: B
How it was made
- The harness. We rebuilt the paper's setup, whose prompts and rules are published but whose code is not: a persistent Python kernel over the weights on CPU (no internet, no gradients;
save_edit refuses the final norm, the embeddings and whole-tensor rescaling) and a forward-pass tool (generations with the evaluation's sampling, paired original vs edited with fixed seeds, and teacher-forced reads of hidden states, MLP activations and attention). The task text is the paper's, with the target changed from math to clinical questions.
- The editor. A frontier model started from the plain Qwen/Qwen3.5-0.8B release, without the paper's math edit, with a budget of 50 forward passes. It could use only training-split practice questions; the MedQA, MedMCQA and MMLU test sets in the tables were never shown to it. The run was stopped after 19 of its 50 forward passes (176 Python runs, 217 turns). Its median of three MedQA seeds, 45.5%, is level with OpenMed/Qwen3.5-0.8B-WSP-Math-Clinical (45.4%), which carries the paper's math edit plus an OpenMed head edit; this one gets there from the plain release in one editor run.
- First kept private, now released. The study's release plan, written on 3 Nov 2026 before the last runs finished, set this edit aside as a reported second 0.8B data point: its numbers were reported, its weights were not released. It passed the same pre-registered release gate as its public siblings (on MedQA it beats the release and both random patches with exact McNemar p < 0.01 and a 95% CI above zero, and it is not worse on MedMCQA or MMLU medical), and OpenMed released it on 1 Dec 2026. The weights are the ones that were evaluated (
eval/env/).
- Evaluation and controls. Every checkpoint ran with the same vLLM 0.33.0 server and settings, loaded from its Hub repo. The random-patch controls change the same rows and columns of the same tensors by the same amount (the same singular values) in random directions; two seeds.
Files
- The weights, config, tokenizer and chat template: Qwen3.5-0.8B's release files with the edited tensors (every
other tensor is unchanged).
edit/: the clinical edit as an exact, hash-checked diff from the starting checkpoint.
eval/: per-question results of every checkpoint on every benchmark (id, finish reason, tokens, extracted answer,
grade) with no question text, the scores, the first 20 generated texts per benchmark for this model, and
receipt.json (forward passes, Python runs, turns and wall time of the edit run).
Limitations
- One 0.8B model and one sample per question (MedQA with three seeds). The gains are relative to the same model and sampling and say nothing about clinical safety.
- Part of the strict gain is format: the release loses answers to
Answer: <letter> lines that the format-agnostic grader still reads. The format-agnostic difference (+14.61 points on MedQA) is the fairer number.
- The edits change how the model finishes (its thinking loops and its answer line), not what it knows.
- The fixed prompt literally says
Answer: <letter>; with a prompt that shows no placeholder the attention edit has less to fix.
- The attention edit lowers the probability of
< everywhere layer 23 writes, not only in the answer line, and the stop neuron can close the thinking before the model has finished reasoning. MATH-500 and IFEval did not get worse (table above); other tasks were not tested.
- Random patch 2 broke the model, so the comparison against it says little; random patch 1 is the control that counts; it has no MMLU score in the study's summary and was not run on the general benchmarks.
- Research only. Not for clinical use, diagnosis or treatment.
Credits
- Method: "Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights" by Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab (MIT CSAIL, 2 Nov 2026), https://rikiyat.github.io/blog/weight-space-programming/; logs and diffs at https://github.com/RikiyaT/lm_understand-logs. OpenMed rebuilt their harness from the published prompts and rules and pointed it at clinical questions. This model contains no part of their math edit.
- Base model: Qwen/Qwen3.5-0.8B by the Qwen team, Apache-2.0.
- Data: MedQA-USMLE (GBaker/MedQA-USMLE-4-options, CC-BY-4.0), MedMCQA (openlifescienceai/medmcqa, Apache-2.0), MMLU (cais/mmlu, MIT), MATH-500 (HuggingFaceH4/MATH-500), IFEval (google/IFEval, Apache-2.0).
- Hugging Face's ML Intern reproduction of the paper's math edit showed the method reproduces; ML Intern did not take part in this model.
Citation
@misc{takehi2026weightspace, title = {Sparks of Weight-Space Programming: LLMs can natively read \& write neural network weights}, author = {Rikiya Takehi and Jayden Teoh and Alex Zhang and Omar Khattab}, year = {2026}, month = {nov}, url = {https://rikiyat.github.io/blog/weight-space-programming/}}