---
base_model:
- Qwen/Qwen2.5-3B-Instruct
tags:
- text-generation-inference
- transformers
- alphaaico
- qwen
- reasoning
- thought
- lite
- GRPO
license: apache-2.0
language:
- zho
- eng
- fra
- spa
- por
- deu
- ita
- rus
- jpn
- kor
- vie
- tha
- ara
datasets:
- openai/gsm8k
---

<div align="center">
<img src="https://cdn-uploads.huggingface.co/production/uploads/669777597cb32718c20d97e9/4emWK_PB-RrifIbrCUjE8.png"
     alt="Title card" 
     style="width: 500px;
            height: auto;
            object-position: center top;">
</div>

**Website - https://www.alphaai.biz**

# Uploaded Model

- **Developed by:** alphaaico
- **License:** apache-2.0
- **Finetuned from model:** Qwen/Qwen2.5-3B-Instruct

This model, **qwen2.5-reason-thought-lite**, is a fine-tuned version of Qwen1.5 designed to not only reason through problems but also introspect on the reasoning process itself before delivering the final response. Its unique selling proposition (USP) is that it generates both a detailed reasoning and an internal thought on why that reasoning was made, all before presenting the final answer.

## Overview

**qwen2.5-reason-thought-lite** has been finetuned using GRPO and advanced reward modelling techniques—including custom functions such as `sequence_format_reward_func`—to enforce a strict response structure and encourage deep reasoning. While we won't divulge all the details, these techniques ensure that the model generates responses in a precise sequence that includes both a detailed reasoning process and a subsequent internal reflection before providing the final answer.

## Model Details

- **Base Model:** Qwen/Qwen2.5-3B-Instruct
- **Fine-tuned by:** alphaaico
- **Training Framework:** Unsloth and Hugging Face’s TRL library
- **Finetuning Techniques:** GRPO and additional reward modelling methods

## Prompt Structure

The model is designed to generate responses in the following exact format:
```python
Respond in the following exact format:
<reasoning>
[Your detailed reasoning here...]
</reasoning>
<thought>
[Your internal thought process about the reasoning...]
</thought>
<answer>
[Your final answer here...]
</answer>
```


## Key Features

- **Enhanced Reasoning & Introspection:** Produces detailed reasoning enclosed in `<reasoning>` tags and follows it with an internal thought process (the "why" behind the reasoning) enclosed in `<thought>` tags before giving the final answer in `<answer>` tags.
- **Structured Output:** The response format is strictly enforced, making it easy to parse and integrate into downstream applications.
- **Optimized Inference:** Fine-tuned using Unsloth and TRL for faster and more efficient performance on consumer hardware.
- **Versatile Deployment:** Supports multiple quantization formats, including GGUF and 16-bit, to accommodate various hardware configurations.

## Quantization Levels Available

- q4_k_m
- q5_k_m
- q8_0
- 16 Bit (This)
GGUF Models (https://huggingface.co/alpha-ai/qwen2.5-reason-thought-lite-GGUF)

## Ideal Configuration for Using the Model

- **Temperature:** 0.8
- **Top-p:** 0.95
- **Max Tokens:** 1024
- **Using Ollama or LMStudio** - To see the model thinking, Replace the &lt;reasoning&gt;...&lt;/reasoning&gt; tokens with &lt;think&gt;...&lt;/think&gt; tokens.

## Use Cases

**qwen1.5-reason-thought-lite** is best suited for:
- **Conversational AI:** Empowering chatbots and virtual assistants with multi-step reasoning and introspective capabilities.
- **AI Research:** Investigating advanced reasoning and decision-making processes.
- **Automated Decision Support:** Enhancing business intelligence, legal reasoning, and financial analysis systems with structured, step-by-step outputs.
- **Educational Tools:** Assisting students and professionals in structured learning and problem solving.
- **Creative Applications:** Generating reflective and detailed content for storytelling, content creation, and more.

## Limitations & Considerations

- **Domain Specificity:** May require additional fine-tuning for specialized domains.
- **Factual Accuracy:** Primarily focused on reasoning and introspection; not intended as a comprehensive factual knowledge base.
- **Inference Speed:** Enhanced reasoning capabilities may result in slightly longer inference times.
- **Potential Biases:** Output may reflect biases present in the training data.

## License

This model is released under the Apache-2.0 license.

## Acknowledgments

Special thanks to the Unsloth team for providing an optimized training pipeline and to Hugging Face’s TRL library for enabling advanced fine-tuning techniques.

## Disclaimer
This model has been saved in the .bin format because it was trained using Unsloth. The .bin format is the default PyTorch serialization method and functions as expected. However, .bin files use Python's pickle module, which can execute arbitrary code during loading.

If security is a concern, we strongly recommend loading the model in a sandboxed environment such as staging servers, Kaggle, or Google Colab before deploying in production. You can also convert the model to .safetensors, a more secure and optimized format, using the following approach:

```python
from transformers import AutoModel
from safetensors.torch import save_file

# Load model
model = AutoModel.from_pretrained("path/to/model")
state_dict = model.state_dict()

# Convert to safetensors
save_file(state_dict, "model.safetensors")

print("Model converted to safetensors successfully.")
```
Alternatively, you can use our GGUF models, which are optimized for inference with llama.cpp, exllama, and other efficient runtimes. GGUF provides better performance on CPU/GPU and is a more portable option for deployment.

Choose the format that best suits your security, performance, and deployment needs.
