Instructions to use wanglab/sft_gene_pathway_v7_6_100k_relabel_4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wanglab/sft_gene_pathway_v7_6_100k_relabel_4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wanglab/sft_gene_pathway_v7_6_100k_relabel_4b") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("wanglab/sft_gene_pathway_v7_6_100k_relabel_4b") model = AutoModelForMultimodalLM.from_pretrained("wanglab/sft_gene_pathway_v7_6_100k_relabel_4b", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wanglab/sft_gene_pathway_v7_6_100k_relabel_4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wanglab/sft_gene_pathway_v7_6_100k_relabel_4b
- SGLang
How to use wanglab/sft_gene_pathway_v7_6_100k_relabel_4b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wanglab/sft_gene_pathway_v7_6_100k_relabel_4b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wanglab/sft_gene_pathway_v7_6_100k_relabel_4b with Docker Model Runner:
docker model run hf.co/wanglab/sft_gene_pathway_v7_6_100k_relabel_4b
You need to agree to share your contact information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
Access to these weights is reviewed manually. Please state your name, affiliation, and how you intend to use the model.
Log in or Sign Up to review the conditions and access this model content.
sft_gene_pathway_v7_6_100k_relabel_4b
Qwen3.5-4B fine-tuned to reason mechanistically about genetic (CRISPR) perturbations and predict how a queried pathway responds — upregulated, downregulated, or unchanged — conditioned on a single-cell expression profile.
This is the 4B arm of the BioReasonCell genetic family, trained on exactly the same corpus as
sft_gene_pathway_v7_6_100k_relabel_9b,
which makes the pair a clean read on what the base model size buys. It is not a plain text model:
it consumes a 2058-d STATE cell embedding alongside the prompt (see Loading).
Where this sits in the project
The repo name is the run name, so it maps 1:1 onto the source tree:
| experiment leaf | experiments/sft_gene_pathway_v7_6_100k/4b_full_relabel/ |
| family | sft_gene_pathway_v7_6_100k — v7.6 pooled with v7.5, scale arm + row-composition A/Bs + the relabel repair |
| training run | sft_gene_pathway_v7_6_100k_relabel_4b_stage2 (stage 2; stage 1 is ..._4b_stage1) |
| checkpoint | sft_gene_pathway_v7_6_100k_relabel_4b_converted — these weights, stage 2 last at step 14,480 (epoch 10/10) |
| dataset config | sft_gene_pathway_v7_6_full100k_relabel |
| scoring sets | benchmark_genetic_v1, and a leave-perturbation-out clean split |
Results
The metric is committed accuracy — accuracy on the rows where the model commits to a direction — reported as the per-perturbation macro-average, never row-pooled.
benchmark_genetic_v1, pooled over 1,317 perturbations
| greedy | maj@10 | |
|---|---|---|
| 4B (this model) | 60.9 | 63.9 |
| 9B, same corpus | 63.4 | 66.6 |
| constant-direction control | 58.6 | 58.6 |
The constant-direction control is the score from always answering the majority direction for that dataset. It is the number any model on this task has to clear, and it is high, so read every result against 58.6 rather than against 50.
Doubling the base model is worth about as much as voting. 9B over 4B is +2.5 greedy and +2.7 maj@10 on identical perturbations; self-consistency over ten samples is worth +3.0 to this model on the same rows. The two stack, and neither is large next to the control.
Leave-perturbation-out clean split, 20,000 rows
The pre-registered primary here is committed-directional accuracy on the dir_strong stratum — the
rows whose label is most reproducible. The family README explains why reading the aggregate inverts
the conclusion.
| view | n | greedy | maj@10 | Δ |
|---|---|---|---|---|
dir_strong (primary) |
3,103 | 57.8 | 60.3 | +2.4 |
dir_weak |
— | 52.0 | 48.3 | −3.8 |
| aggregate, all rows | 4,508 directional | 56.0 | 56.5 | +0.5 |
Self-consistency is +2.4 where the label is trustworthy and −3.8 where it is not, and those cancel to a +0.5 in the aggregate that reads as noise. Quoting the aggregate alone would retire voting as useless on this split; it is not.
Per dataset, directional rows only — kaufman, xu2026 and papalexi carry 0–21 directional rows
each on this split and are shown for completeness, not for reading:
| dataset | n | 3-class greedy | 3-class maj@10 | directional n | dir greedy | dir maj@10 |
|---|---|---|---|---|---|---|
| nadig | 3,398 | 31.2 | 31.8 | 1,273 | 57.6 | 55.4 |
| marson | 8,753 | 31.7 | 31.8 | 2,065 | 49.4 | 50.7 |
| xaira_orion | 4,463 | 65.5 | 63.3 | 984 | 64.9 | 68.3 |
| xaira_pisces | 504 | 59.3 | 61.9 | 163 | 70.1 | 68.1 |
| kaufman | 2,607 | 84.0 | 86.4 | 21 | — | — |
| xu2026 | 255 | 87.5 | 83.1 | 0 | — | — |
| papalexi | 20 | 50.0 | 45.0 | 2 | — | — |
| pooled | 20,000 | 47.4 | 47.4 | 4,508 | 56.0 | 56.5 |
In-distribution test split, 10,296 rows
| metric | value |
|---|---|
| greedy, 3-class | 62.9 |
| maj@10, 3-class | 68.1 |
| best-of-10 | 94.9 |
| parse rate | 100.0 |
best-of-10 at 94.9 against a 68.1 majority vote says the correct label is present in the sample set for nearly every trace, and plurality voting is what fails to surface it — the gap is selection, not knowledge. Sample entropy tracks it: 0.388 when the vote is right, 0.683 when it is wrong, so disagreement across draws is a usable confidence signal.
Things worth knowing before you quote a number
- Self-consistency is worth +5.2 in-distribution against +2.4 on the primary out-of-distribution stratum. The benefit is real in both places but roughly halves out of distribution.
- Recovering the last 1.37 epochs of training moved nothing (+0.3 on the primary). At this scale the last epoch is not where the accuracy is.
- This arm has no size-matched partner on an unrepaired corpus, so its score is not a measurement of what the trace repair bought. Quote it as a standalone number.
Loading
The checkpoint carries a cell_projection.pt alongside the transformer weights. The model expects a
STATE 2058-d per-perturbation cell embedding projected into the token stream between
<|CELL_START|> and <|CELL_END|>; loading the weights with AutoModel.from_pretrained alone will
run, but will not reproduce the results above, because the cell channel will be empty.
from huggingface_hub import snapshot_download
path = snapshot_download("wanglab/sft_gene_pathway_v7_6_100k_relabel_4b")
# path/model.safetensors transformer weights
# path/cell_projection.pt the cell-embedding projector (required)
The full inference path — embedding construction, projection, prompt rendering and scoring — lives in the BioReasonCell repository. Rendering matters: a prompt belongs to a corpus version, and scoring this model under a different template measures something else.
Training
| base model | Qwen3.5-4B |
| method | two-stage SFT, LoRA r128 / α128 |
| stage 1 | cell-projector alignment, 1 epoch |
| stage 2 | full reasoning SFT, 10 epochs, warm-started from stage 1's projector |
| corpus | sft_gene_pathway_v7_6_full100k_relabel — 102,957 rows |
| context | max_length_text 16384 |
| hardware | 1 node × 4 GPUs, accumulation 16, effective batch 64 |
Training traces were generated by Claude Opus 5 at effort: medium over CRISPR perturbation
data, then repaired: a 2026-08-24 effect-size relabel (directional iff padj < 0.05 and
|pathway_score| > 0.05) invalidated 25,531 of the 102,961 rows, each of which still carried a trace
arguing a direction its own label no longer supported. All of them were regenerated on the same
setup. This checkpoint is trained on the repaired corpus.
Intended use and limitations
Research use. This model predicts a direction of pathway response, not an effect size, and its outputs are hypotheses to be tested — not experimental evidence.
- The constant-direction control is 58.6 pooled. A model at 60.9 is above "always say up," but not by much; on the clean split's weaker strata it does not clear its control at all.
- Performance is not uniform across datasets; quote the per-dataset row, not just the pooled number.
- The model was trained and scored on one template. Scoring under a different prompt measures a different thing.
- Reasoning traces are model-generated and can be fluent while wrong. Do not treat a trace's intermediate claims about individual genes as validated.
Related
- 9B sibling on the same corpus:
wanglab/sft_gene_pathway_v7_6_100k_relabel_9b - Reasoning corpus:
wanglab/BioReasonCell-ReasoningData
License
Inherits the license of the Qwen3.5-4B base model. Training data derives from Claude Opus 5 generations; downstream use is subject to the terms governing those outputs.
- Downloads last month
- -