--- license: apache-2.0 language: - en tags: - reasoning - chain-of-thought - qwen - tiny - whirlwindai pipeline_tag: text-generation datasets: - WhirlwindAI/Soft-CoT-1K library_name: transformers base_model: - Qwen/Qwen2.5-0.5B-Instruct ---
--- # ๐Ÿ’ก The Idea
> **Good answers come from good thinking.** Qwen-R1-0.5B is a fine-tuned version of Qwen2.5-0.5B-Instruct trained to **reason before it answers** using explicit `` tags.
Instead of jumping straight to the answer, this model generates its reasoning first โ€” making it more transparent, more reliable, and easier to debug. --- # ๐Ÿง  How It Works Every response is structured as: ``` User: {question} Assistant: {reasoning} {answer} ``` The model learns to: 1. **Think** โ€“ generate step-by-step reasoning 2. **Answer** โ€“ provide the final response --- # ๐Ÿ“Š Training Details | Property | Value | |----------|-------| | Base Model | Qwen2.5-0.5B-Instruct | | Dataset | WhirlwindAI/Soft-CoT-1K | | Examples | 1,355 | | Method | QLoRA (4-bit) | | Epochs | 3 | | Learning Rate | 2e-4 | | LoRA Rank | 16 | | LoRA Alpha | 32 | --- # ๐Ÿš€ Quick Start ```python from transformers import AutoTokenizer, AutoModelForCausalLM model_name = "WhirlwindAI/Qwen-R1-0.5B" tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True) prompt = "User: What is 2+2?\nAssistant: " inputs = tokenizer(prompt, return_tensors="pt") outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, temperature=0.7) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` --- # ๐Ÿ“‹ Sample Output ``` User: What is the capital of France? Assistant: Paris is the capital of France. Paris ``` --- # ๐Ÿ“ˆ Performance The model was evaluated on 10 out-of-distribution questions: | Category | Performance | |----------|-------------| | Format (thinking tags) | โœ… Excellent | | General Knowledge | โœ… Good | | Creative Reasoning | โœ… Good | | Math/Logic | โš ๏ธ Needs improvement | | Physics/Science | โš ๏ธ Needs improvement | --- # ๐Ÿ”ฌ What It Learned | Strength | Weakness | |----------|----------| | โœ… Consistent `` format | โŒ Sometimes hallucinates facts | | โœ… Generates reasoning before answering | โŒ Struggles with multi-step math | | โœ… Retains general knowledge | โŒ Physics reasoning needs more data | --- # ๐Ÿงช Test It Yourself ```python questions = [ "What is the capital of France?", "Explain entropy like I'm 5.", "Write a short poem about a robot.", ] for q in questions: prompt = f"User: {q}\nAssistant: " inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=80) print(tokenizer.decode(outputs[0], skip_special_tokens=True)) ``` --- # ๐Ÿ“œ Citation ```bibtex @model{qwenr1_2026, title={Qwen-R1-0.5B}, author={WhirlwindAI}, year={2026}, publisher={Hugging Face} } ``` ---
### ๐ŸŒช๏ธ WhirlwindAI **Efficient Models โ€ข Practical Research โ€ข Open AI**