Qwen2.5-3B-Reasoning-v1

This is a fine-tuned version of Qwen2.5-3B-Instruct, specialized in Chain-of-Thought (CoT) reasoning.

The model was trained to "think before it speaks" by generating internal reasoning traces enclosed in <reasoning> tags before providing the final <answer>. This process allows the model to self-correct and handle logic puzzles that the base model frequently fails at.

🚀 Model Description

  • Developed by: [Yakuraku]
  • Base Model: Qwen2.5-3B-Instruct
  • Fine-tuning Framework: Unsloth (LoRA)
  • Objective: To enable robust logical reasoning in small language models (SLMs) by mimicking the thinking patterns of larger reasoning models.

🛠️ Data Pipeline & Training

The core strength of this model lies in the data engineering pipeline. It was not merely trained on raw datasets but on a rigorously curated corpus.

  1. Source: Synthetically generated data using SOTA models.
  2. Cleaning & Augmentation: Applied strict filters for token size, context window usage, and prompt difficulty.
  3. Validation (The "Human-in-the-Loop" Layer): - Over 75,000 prompts were validated.
    • Used a hybrid validation system involving human review and LLM-based verification (via Async API batch processing).
    • Categories include: Coding, Math, General Reasoning, and Summarization.

📊 Performance Example

Logical Fallacy Test: "The Chocolate Problem"

Prompt:

"I have 3 chocolates, I eat 2, then i buy 3 more chocolates, I buy 4 more. I eat 5. How many chocolates do i have now?"


Base Model (Before Fine-Tuning) - Failed

The base model makes a critical logical error:

"...Finally, you eat 5 chocolates. Since you only have 8 chocolates, you can't eat 5 of them. Therefore, you eat all 8 chocolates."

Final Answer: You have 0 chocolates now.

Issue: The model hallucinates that 8 chocolates is insufficient to eat 5, incorrectly concluding all chocolates must be eaten.


Fine-Tuned Model (After Training) - Success

Qwen2.5-3B-Reasoning-v1 produces correct step-by-step reasoning:

<reasoning>

Let's trace through the problem step by step:

  1. Start with 3 chocolates
  2. Eat 2 → Remaining: 3 - 2 = 1
  3. Buy 3 more → Total: 1 + 3 = 4
  4. Buy 4 more → Total: 4 + 4 = 8
  5. Eat 5 → Final: 8 - 5 = 3

</reasoning>

<answer>

You have 3 chocolates now.

</answer>

Result: The fine-tuned model correctly performs arithmetic operations and maintains logical consistency throughout the reasoning chain.

💻 How to Use

Using transformers

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_name = "yakuraku/Qwen2.5-3B-Reasoning-v1"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "A farmer has 17 sheep and all but 9 die. How many are left?"
messages = [
    {"role": "system", "content": "You are a logical reasoning assistant. Answer the question based on your reasoning."},
    {"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=512,
    temperature=0.1 # Low temperature for logic
)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Downloads last month
10
Safetensors
Model size
3B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for yakuraku/Qwen2.5-3B-Reasoning-v1

Base model

Qwen/Qwen2.5-3B
Finetuned
(175)
this model