gyung's picture
Upload README.md with huggingface_hub
8d53e5c verified
|
Raw
History Blame Contribute Delete
4.39 kB
---
license: apache-2.0
base_model: principled-intelligence/Qwen3.5-9B-text-only
tags:
- graph-preflexor
- orpo
- reasoning
- graph-reasoning
language:
- en
pipeline_tag: text-generation
library_name: transformers
---
# LLM-OS-Models/Qwen3.5-9B-Graph-Preflexor-ORPO
Merged full model from ORPO cold-start stage of the Graph-PRefLexOR
reproduction fork `gyunggyng/lfm-graph-preflexor` (fork of
`lamm-mit/graph-preflexor-grpo`, arXiv 2607.00924v1).
- **Base model:** `principled-intelligence/Qwen3.5-9B-text-only`
(`Qwen3_5TextForCausalLM`, `model_type: qwen3_5_text`, hybrid
linear + full attention)
- **Stage:** ORPO cold-start (step 1 of 2; Graph-GRPO refinement pending)
- **Architecture:** text-only Qwen3.5 — 32 layers, 4 full-attention layers
(every 4th), 28 linear-attention layers, hidden 4096, vocab 248087.
- **Checkpoint:** `checkpoint-250` merged into the base.
## Training
- **Framework:** TRL 0.24 `ORPOTrainer`, PEFT LoRA (r=32, alpha=64,
dropout=0.05, targets = q/k/v/o/gate/up/down).
- **Data:** `lamm-mit/graph_reasoning_10K` filtered for graph-reasoning
items with structured `<brainstorm>...<synthesis>` reasoning targets.
- **Hardware:** 4× H200 (CUDA 12.8), `torch 2.12.0.dev20260407+cu128`,
`transformers 5.5.4`, bfloat16.
- **Hparams:** LR 5e-6, effective batch 8 (per_device 1 × accum 2 ×
world 4), max_prompt 1536, max_completion 4096, eval disabled to fit VRAM
(ORPO's `concatenated_forward` OOMs at 9B + seq 5632).
## Results (checkpoint-250)
| Metric | Value |
|---|---|
| ORPO loss | 1.413 → 0.98 (step 295, crashed at final eval) |
| ORPO accuracy | 1.0 (from step 55) |
| Eval score (rq,depth,trace,overall, /10) | 5.42 / 6.60 / 6.38 / **6.13** |
| Sentinel hit-rate (100 q) | brainstorm 99, graph 94, graph_json 79, patterns 85, synthesis 84 |
Eval was run with `scripts/05c_eval_transformers.py` (4-GPU shard-parallel
transformers, eager attention, thinking enabled) because vLLM 0.19 / 0.20
do not register `Qwen3_5TextForCausalLM` — see "Known limitations" below.
## Output format
The model emits a structured reasoning trace inside `<think>`:
```
<think>
<brainstorm>... free-form exploration ...</brainstorm>
<graph>... concept graph (natural language) ...</graph>
<graph_json>{"nodes": [...], "edges": [...]}</graph_json>
<patterns>... reusable abstractions ...</patterns>
<synthesis>... integrated reasoning ...</synthesis>
</think>
final answer
```
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"LLM-OS-Models/Qwen3.5-9B-Graph-Preflexor-ORPO",
dtype="bfloat16", device_map="auto", trust_remote_code=True,
)
tok = AutoTokenizer.from_pretrained(
"LLM-OS-Models/Qwen3.5-9B-Graph-Preflexor-ORPO",
trust_remote_code=True,
)
prompt = tok.apply_chat_template(
[{"role": "user", "content": "Your graph-reasoning question here"}],
tokenize=False, add_generation_prompt=True,
)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=3500, do_sample=True, temperature=0.2)
print(tok.decode(out[0, inputs.input_ids.shape[1]:], skip_special_tokens=False))
```
`attn_implementation="eager"` is required if `flash-linear-attention` is
not installed; SDPA silently returns empty tokens otherwise.
## Known limitations
- **vLLM:** `Qwen3_5TextForCausalLM` is not in vLLM's registered
architectures as of vLLM 0.20.2 (only `Qwen3_5ForConditionalGeneration`
/ `Qwen3_5MoeForConditionalGeneration` / `Qwen3_5MTP` are). vLLM's
generic `TransformersForCausalLM` wrapper also fails because it expects
the multimodal prefix `model.language_model.*`, while text-only weights
are flat at `model.layers.*`. Use transformers for inference until vLLM
adds native text-only Qwen3.5 support.
- **Final eval OOM:** `ORPOTrainer` forces a final `evaluate()` after
training, which OOMs on 9B + seq 5632 in `concatenated_forward`.
Checkpoint-250 (saved before the crash) is what's merged here.
- **GRPO stage:** not yet completed. The Qwen3.5 text-only arch blocks the
vLLM-based rollout server the GRPO config assumes, so the GRPO
refinement run was abandoned at the import step.
## Citation
```bibtex
@article{graphpreflexor2025,
title={Graph-PRefLexOR: Graph-based Preference-based Reasoning via Learning},
doi={10.48550/arXiv.2607.00924}
}
```