Instructions to use alibidaran/Qwen_COG_Thinker_Merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alibidaran/Qwen_COG_Thinker_Merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alibidaran/Qwen_COG_Thinker_Merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alibidaran/Qwen_COG_Thinker_Merged") model = AutoModelForCausalLM.from_pretrained("alibidaran/Qwen_COG_Thinker_Merged") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use alibidaran/Qwen_COG_Thinker_Merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alibidaran/Qwen_COG_Thinker_Merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alibidaran/Qwen_COG_Thinker_Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/alibidaran/Qwen_COG_Thinker_Merged
- SGLang
How to use alibidaran/Qwen_COG_Thinker_Merged 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 "alibidaran/Qwen_COG_Thinker_Merged" \ --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": "alibidaran/Qwen_COG_Thinker_Merged", "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 "alibidaran/Qwen_COG_Thinker_Merged" \ --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": "alibidaran/Qwen_COG_Thinker_Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use alibidaran/Qwen_COG_Thinker_Merged with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for alibidaran/Qwen_COG_Thinker_Merged to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for alibidaran/Qwen_COG_Thinker_Merged to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for alibidaran/Qwen_COG_Thinker_Merged to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="alibidaran/Qwen_COG_Thinker_Merged", max_seq_length=2048, ) - Docker Model Runner
How to use alibidaran/Qwen_COG_Thinker_Merged with Docker Model Runner:
docker model run hf.co/alibidaran/Qwen_COG_Thinker_Merged
🧠 Qwen2.5 + GRPO — Structured Reasoning Model
A fine-tuned version of Qwen2.5 trained with GRPO (Group Relative Policy Optimization) to reason before it answers — not just pattern-match.
Overview
Most LLMs simulate reasoning by mimicking patterns seen during training. This model is different: it builds a real cognitive path on every response by following a strict, verifiable reasoning protocol enforced through reinforcement learning.
Every response goes through three mandatory stages:
| Stage | Tag | Purpose |
|---|---|---|
| 📌 Plan | <planning> |
Understand the task and define an approach |
| 🔍 Monitor | <monitoring> |
Reason step by step, show calculations and logic |
| ✅ Evaluate | <evaluation> |
Verify the answer before committing |
This isn't chain-of-thought bolted on top — the reasoning protocol is baked in via RL.
System Prompt
SYSTEM_PROMPT = """
You are an AI assistant that MUST produce structured reasoning.
Your response MUST EXACTLY follow this format:
<think>
<planning>
...
</planning>
<monitoring>
...
</monitoring>
<evaluation>
...
</evaluation>
</think>
<output>
...
</output>
FORMAT RULES:
1. The <think> block must contain exactly three sections in this order:
<planning>, <monitoring>, <evaluation>
2. Each section must contain detailed reasoning in full sentences.
3. Minimum reasoning length:
- <planning>: at least 40 tokens
- <monitoring>: at least 80 tokens
- <evaluation>: at least 40 tokens
4. The <monitoring> section MUST show explicit reasoning steps,
including calculations, derivations, or logical deductions.
5. Generic placeholder phrases are forbidden, including:
- "analyze the problem"
- "determine the strategy"
- "verify the solution"
- "check correctness"
6. The reasoning must explicitly reference values, equations,
or logical relationships from the problem.
7. The <output> section must contain ONLY the final answer.
INVALID RESPONSES:
Responses will be rejected if they contain:
- Empty sections
- Bullet point placeholders
- Generic reasoning
- Missing calculations when required
- Incorrect tag order
The format must always be strictly respected.
"""
Usage
from vllm import SamplingParams
def generate_response(question, choices):
messages = [
{
"role": "system",
"content": SYSTEM_PROMPT
},
{
"role": "user",
"content": (
f"Examine the following question and select the right answer from given options.\n"
f"The output must be only the number of the option.\n"
f"Question: {question}\n"
f"Provided options: {choices}\n"
)
}
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
return_tensors="pt",
)
sampling_params = SamplingParams(
temperature=0.8,
top_p=0.95,
max_tokens=1024,
)
output = model.fast_generate(
[inputs],
sampling_params=sampling_params,
lora_request=None,
)[0].outputs[0].text
return output
What Makes This Different
| Feature | Standard LLM | This Model |
|---|---|---|
| Reasoning method | Pattern matching | Structured cognitive protocol |
| Reasoning enforcement | None | RL-baked (GRPO) |
| Output format | Free-form | Strictly validated |
| Self-verification | No | Yes — invalid structure = rejected response |
| Final answer | Mixed with reasoning | Isolated in <output> |
MMLU Benchmark Results
We selected random 100 samples from each subsets of MMLU dataset. Performance across a range of MMLU subject categories:
🎓 College Courses
| Subject | Accuracy |
|---|---|
| College Mathematics | 50% |
| College Computer Science | 57% |
| Medicine | 67% |
🧑💼 Professional
| Subject | Accuracy |
|---|---|
| Professional Psychology | 63% |
🏫 High School Courses
| Subject | Accuracy |
|---|---|
| Psychology | 83% |
| Computer Science | 78% |
| Management | 70% |
| Mathematics | 68% |
| Statistics | 66% |
| Biology | 67% |
| Chemistry | 62% |
| European History | 64% |
Results reflect accuracy on MMLU multiple-choice questions using the structured reasoning protocol described above.
Training
- Base model: Qwen2.5
- Training method: GRPO (Group Relative Policy Optimization)
- Objective: Enforce structured reasoning as a non-negotiable output constraint, not a post-hoc addition
- Downloads last month
- 30
Model tree for alibidaran/Qwen_COG_Thinker_Merged
Base model
Qwen/Qwen2.5-3B