Instructions to use jeffchanpm/Qwen3.5-27B-SGR-LCL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jeffchanpm/Qwen3.5-27B-SGR-LCL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jeffchanpm/Qwen3.5-27B-SGR-LCL") 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("jeffchanpm/Qwen3.5-27B-SGR-LCL") model = AutoModelForMultimodalLM.from_pretrained("jeffchanpm/Qwen3.5-27B-SGR-LCL", 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 jeffchanpm/Qwen3.5-27B-SGR-LCL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jeffchanpm/Qwen3.5-27B-SGR-LCL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jeffchanpm/Qwen3.5-27B-SGR-LCL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jeffchanpm/Qwen3.5-27B-SGR-LCL
- SGLang
How to use jeffchanpm/Qwen3.5-27B-SGR-LCL 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 "jeffchanpm/Qwen3.5-27B-SGR-LCL" \ --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": "jeffchanpm/Qwen3.5-27B-SGR-LCL", "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 "jeffchanpm/Qwen3.5-27B-SGR-LCL" \ --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": "jeffchanpm/Qwen3.5-27B-SGR-LCL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jeffchanpm/Qwen3.5-27B-SGR-LCL with Docker Model Runner:
docker model run hf.co/jeffchanpm/Qwen3.5-27B-SGR-LCL
Qwen3.5-27B-SGR-LCL
Fine-tuned from Qwen3.5-27B using Self-Graph Reasoning (SGR) + Logical Curriculum Learning (LCL) — a 4-phase progressive training approach based on LoCM (Logical Complexity Metric).
Highlights
- Thinking mode: +6.5% overall improvement over Qwen3.5-27B baseline (78.0% → 84.5%)
- ProverQA Hard: +12.0% in thinking mode (62.0% → 74.0%)
- Near-zero skip-think degradation: only -1.2% (improved from -5.7% of naive LoRA)
Method
Self-Graph Reasoning (SGR)
SGR is a graph-structured reasoning framework that enables LLMs to explicitly represent their reasoning processes as structured graphs prior to producing final answers. See arXiv:2601.03597.
Logical Curriculum Learning (LCL)
Standard SGR training data has a mean LoCM of 23.33 with zero samples below LoCM 6, causing the model to skip foundational logic. LCL addresses this with 4-phase progressive training:
| Phase | LoCM Range | Data Source | Samples |
|---|---|---|---|
| 1 | 0-6 | ProntoQA + ProofWriter | 360 |
| 2 | 6-10 | ProntoQA + ProofWriter + SFT | 724 (cumulative) |
| 3 | 10-15 | Original SFT | 996 (cumulative) |
| 4 | 15-30 | Original SFT | 9,536 (cumulative) |
Each phase warm-starts from the previous phase's best LoRA checkpoint. LoCM (Logical Complexity Metric) is from arXiv:2601.02902.
Training Details
- Hardware: NVIDIA DGX Spark (Grace Blackwell GB10, 128 GB unified memory)
- Framework: Unsloth + PEFT (BF16, LoRA r=16, alpha=32)
- LoRA targets: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj (256 pairs across 64 layers)
- Optimizer: AdamW 8-bit, lr=2e-5, cosine schedule
- Batch: effective batch size 8 (bs=1 × grad_accum=8)
- Total training: ~24 hours across 4 phases
Merge
LoRA merged into base weights via manual matrix multiplication (W_merged = W_base + B @ A * scaling), bypassing PEFT merge_and_unload() which has a key mapping issue with Qwen3.5's language_model prefix.
Results (LPT Benchmark)
Thinking Mode (200 questions, 50 per dataset)
| Dataset | Qwen3.5-27B | SGR-LCL | Delta |
|---|---|---|---|
| ProverQA Easy | 92.0% | 96.0% | +4.0% |
| ProverQA Medium | 76.0% | 82.0% | +6.0% |
| ProverQA Hard | 62.0% | 74.0% | +12.0% |
| NSA-LR | 82.0% | 86.0% | +4.0% |
| Overall | 78.0% | 84.5% | +6.5% |
Skip-think Mode (3,000 questions)
| Dataset | N | Qwen3.5-27B | SGR-LCL | Delta |
|---|---|---|---|---|
| NSA-LR | 1500 | 76.5% | 75.2% | -1.3% |
| ProverQA Easy | 500 | 85.0% | 86.0% | +1.0% |
| ProverQA Medium | 500 | 74.8% | 74.6% | -0.2% |
| ProverQA Hard | 500 | 68.0% | 64.0% | -4.0% |
| Overall | 3000 | 76.2% | 75.0% | -1.2% |
Data Contamination
ProverQA and NSA-LR evaluation datasets have zero overlap with training data. Full audit available in the project repository.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"jeffchanpm/Qwen3.5-27B-SGR-LCL",
torch_dtype="auto",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("jeffchanpm/Qwen3.5-27B-SGR-LCL")
prompt = "If all dogs are animals and all animals are living things, are all dogs living things? Think step by step."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=2048)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))
GGUF Quantized Version
For GGUF quantized versions (Q4_K_M), see jeffchanpm/Qwen3.5-27B-SGR-LCL-GGUF.
Citation
@article{chen2026chains,
title={From Chains to Graphs: Self-Structured Reasoning for General-Domain LLMs},
author={Chen, Yingjian and Liu, Haoran and Liu, Yinhong and Tong, Sherry T and Feng, Aosong and Lu, Jinghui and Zhang, Juntao and Iwasawa, Yusuke and Matsuo, Yutaka and Li, Irene},
journal={arXiv preprint arXiv:2601.03597},
year={2026}
}
Acknowledgments
- Qwen Team for Qwen3.5-27B
- Unsloth for efficient fine-tuning on DGX Spark
- Logical Phase Transitions for the LoCM complexity metric
- Downloads last month
- 5
Model tree for jeffchanpm/Qwen3.5-27B-SGR-LCL
Dataset used to train jeffchanpm/Qwen3.5-27B-SGR-LCL
Papers for jeffchanpm/Qwen3.5-27B-SGR-LCL
From Chains to Graphs: Self-Structured Reasoning for General-Domain LLMs
Logical Phase Transitions: Understanding Collapse in LLM Logical Reasoning
Evaluation results
- Overall Accuracy on LPT Benchmark (Thinking)self-reported84.500
- ProverQA Hard Accuracy on LPT Benchmark (Thinking)self-reported74.000
- Overall Accuracy on LPT Benchmark (Skip-think)self-reported75.000