Text Generation
Transformers
Safetensors
qwen2
control-foundation-model
scientific-ai
methodology-review
peer-review
rlvr
morphmind
conversational
text-generation-inference
Instructions to use MorphMind-AI/CFM-Methods-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MorphMind-AI/CFM-Methods-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MorphMind-AI/CFM-Methods-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MorphMind-AI/CFM-Methods-3B") model = AutoModelForCausalLM.from_pretrained("MorphMind-AI/CFM-Methods-3B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MorphMind-AI/CFM-Methods-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MorphMind-AI/CFM-Methods-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MorphMind-AI/CFM-Methods-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MorphMind-AI/CFM-Methods-3B
- SGLang
How to use MorphMind-AI/CFM-Methods-3B 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 "MorphMind-AI/CFM-Methods-3B" \ --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": "MorphMind-AI/CFM-Methods-3B", "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 "MorphMind-AI/CFM-Methods-3B" \ --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": "MorphMind-AI/CFM-Methods-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MorphMind-AI/CFM-Methods-3B with Docker Model Runner:
docker model run hf.co/MorphMind-AI/CFM-Methods-3B
CFM-Proof-3B research preview: adapter + model card
Browse files- README.md +85 -0
- adapter_config.json +48 -0
- adapter_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: qwen-research-license
|
| 4 |
+
license_link: https://huggingface.co/Qwen/Qwen2.5-3B/blob/main/LICENSE
|
| 5 |
+
base_model: Qwen/Qwen2.5-3B-Instruct
|
| 6 |
+
library_name: peft
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- control-foundation-model
|
| 10 |
+
- scientific-ai
|
| 11 |
+
- proof-verification
|
| 12 |
+
- rlvr
|
| 13 |
+
- lora
|
| 14 |
+
- morphmind
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# CFM-Proof-3B · MorphMind
|
| 18 |
+
|
| 19 |
+
**A Control Foundation Model (CFM) that screens mathematical proofs for errors.** Give it a
|
| 20 |
+
theorem and its proof; it returns a structured verdict — **support** or **refute** — localizes
|
| 21 |
+
the flawed step, and explains it. It is tuned as a **high-recall screening layer** for human
|
| 22 |
+
review: it surfaces nearly every suspicious step and leaves the final call to the reviewer.
|
| 23 |
+
|
| 24 |
+
*Built by [MorphMind](https://morphmind.ai) · research preview.*
|
| 25 |
+
|
| 26 |
+
## What it is
|
| 27 |
+
- **Base:** `Qwen/Qwen2.5-3B-Instruct` (Qwen Research License — see below). Distributed here as a **LoRA adapter**.
|
| 28 |
+
- **Method:** light SFT warm-start → **RLVR** (Reinforcement Learning from *Verifiable* Rewards): the
|
| 29 |
+
model proposes a verdict, an automatic checker validates it against ground-truth errors, and only
|
| 30 |
+
verifiably-correct answers are reinforced. No model-as-judge.
|
| 31 |
+
- **Output (JSON contract):** `{"analysis": ..., "verdict": "support|refute", "error_spans": [...], "action": ...}`.
|
| 32 |
+
|
| 33 |
+
## Results
|
| 34 |
+
Frozen, by-paper held-out test of arXiv proofs (with injected errors) + an out-of-distribution domain never trained on.
|
| 35 |
+
|
| 36 |
+
| Set | Recall (catch rate) | Precision | Localization | detF1 |
|
| 37 |
+
|---|---|---|---|---|
|
| 38 |
+
| **Test** (1,977 · 5 domains) | **0.83** | 0.50 | 0.30 | 0.62 |
|
| 39 |
+
| **OOD** (math.PR, held out) | **0.82** | 0.47 | 0.28 | 0.60 |
|
| 40 |
+
|
| 41 |
+
Per-domain recall — cs.CC 0.87 · cs.IT 0.84 · cs.LG 0.84 · math.OC 0.84 · math.ST 0.80.
|
| 42 |
+
Base Qwen2.5-3B zero-shot recall ≈ 0.10.
|
| 43 |
+
|
| 44 |
+
**Operating point:** optimized for **recall** — a missed error costs more than a false alarm a
|
| 45 |
+
reviewer dismisses in seconds. Precision ≈ 0.5 means it **over-flags by design**.
|
| 46 |
+
|
| 47 |
+
## Intended use
|
| 48 |
+
A **screening assistant** for reviewing mathematical / statistical / CS-theory proofs: it flags
|
| 49 |
+
suspect steps for a human to verify. Tested on statistics & methodology, probability, optimization,
|
| 50 |
+
CS-theory, and ML theory.
|
| 51 |
+
|
| 52 |
+
## Limitations (honest)
|
| 53 |
+
- **Research preview.** Recall ≈ 0.83 → still misses ~1 in 6 injected errors.
|
| 54 |
+
- **Over-flags** (precision ≈ 0.5). It is a screen, not an oracle — always human-in-the-loop.
|
| 55 |
+
- **Localization ≈ 0.30** — names the exact wrong step ~30% of the time.
|
| 56 |
+
- Trained on **injected** errors (reversed inequalities, sign flips, altered constants); real-world
|
| 57 |
+
error coverage may differ.
|
| 58 |
+
- Confidence is not yet calibrated.
|
| 59 |
+
|
| 60 |
+
## Provenance
|
| 61 |
+
Warm-start critiques were generated with a frontier model; the reinforcement stage used **only
|
| 62 |
+
automatic verifiable rewards**. Training proofs are public **arXiv LaTeX** source.
|
| 63 |
+
|
| 64 |
+
## Usage
|
| 65 |
+
```python
|
| 66 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 67 |
+
from peft import PeftModel
|
| 68 |
+
|
| 69 |
+
base = "Qwen/Qwen2.5-3B-Instruct"
|
| 70 |
+
tok = AutoTokenizer.from_pretrained(base)
|
| 71 |
+
model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="bfloat16", device_map="auto")
|
| 72 |
+
model = PeftModel.from_pretrained(model, "morphmind/CFM-Proof-3B")
|
| 73 |
+
|
| 74 |
+
system = ("You are a scientific correctness reviewer. Review the theorem and proof and respond "
|
| 75 |
+
"ONLY with JSON: {\"analysis\":...,\"verdict\":\"support|refute\","
|
| 76 |
+
"\"error_spans\":[{\"text\":...,\"why\":...}],\"action\":\"accept|suggest_edit\"}")
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
Released under the **Qwen Research License**, inherited from the `Qwen2.5-3B` base, with attribution
|
| 81 |
+
to Qwen. **Research / non-commercial** use. A permissively-licensed (Apache-2.0) commercial version,
|
| 82 |
+
**CFM-Proof-7B**, is planned.
|
| 83 |
+
|
| 84 |
+
## Citation
|
| 85 |
+
> MorphMind. *CFM-Proof-3B: a control foundation model for scientific-proof correctness.* 2026.
|
adapter_config.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "Qwen/Qwen2.5-3B-Instruct",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 64,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.05,
|
| 22 |
+
"lora_ga_config": null,
|
| 23 |
+
"megatron_config": null,
|
| 24 |
+
"megatron_core": "megatron.core",
|
| 25 |
+
"modules_to_save": null,
|
| 26 |
+
"peft_type": "LORA",
|
| 27 |
+
"peft_version": "0.19.1",
|
| 28 |
+
"qalora_group_size": 16,
|
| 29 |
+
"r": 32,
|
| 30 |
+
"rank_pattern": {},
|
| 31 |
+
"revision": null,
|
| 32 |
+
"target_modules": [
|
| 33 |
+
"q_proj",
|
| 34 |
+
"k_proj",
|
| 35 |
+
"o_proj",
|
| 36 |
+
"v_proj",
|
| 37 |
+
"up_proj",
|
| 38 |
+
"gate_proj",
|
| 39 |
+
"down_proj"
|
| 40 |
+
],
|
| 41 |
+
"target_parameters": null,
|
| 42 |
+
"task_type": "CAUSAL_LM",
|
| 43 |
+
"trainable_token_indices": null,
|
| 44 |
+
"use_bdlora": null,
|
| 45 |
+
"use_dora": false,
|
| 46 |
+
"use_qalora": false,
|
| 47 |
+
"use_rslora": false
|
| 48 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2229da6a1e61ec16964f44ff04adcf28949b719946db2387e46d33c58ec13ae5
|
| 3 |
+
size 239536272
|