File size: 4,235 Bytes
e2d8213
 
 
 
 
 
 
 
 
 
 
7d49dc9
e2d8213
9024fe8
 
7d49dc9
e2d8213
7d49dc9
e2d8213
7d49dc9
e2d8213
7d49dc9
e2d8213
7d49dc9
e2d8213
7d49dc9
 
 
 
 
e2d8213
7d49dc9
e2d8213
7d49dc9
 
 
 
 
 
 
e2d8213
7d49dc9
 
 
 
 
 
 
 
e2d8213
 
 
 
 
 
 
 
 
 
 
 
 
7d49dc9
 
 
 
 
 
25531a8
7d49dc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e2d8213
7d49dc9
 
 
 
 
 
 
 
 
 
 
 
e2d8213
7d49dc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
base_model:
- Menlo/Jan-nano
- POLARIS-Project/Polaris-4B-Preview
- Qwen/Qwen3-4B
library_name: transformers
tags:
- mergekit
- merge

---
# Qwen3-4B-Agentic-Reasoner

  <img src="modelcard.png" widhth="400"/>

`yasserrmd/qwen3-4b-agentic-reasoner` is a merged model that combines the **agentic instruction-following strength** of [Menlo/Jan-nano](https://huggingface.co/Menlo/Jan-nano) with the **reasoning and structured thought capabilities** of [POLARIS-Project/Polaris-4B-Preview](https://huggingface.co/POLARIS-Project/Polaris-4B-Preview), using the [Qwen/Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B) architecture as the base.

This merge was performed using [mergekit](https://github.com/cg123/mergekit) and the [TIES](https://arxiv.org/abs/2306.01708) method for fine-grained parameter blending.

---

## 🧠 Intended Use

This model is intended for use in:

- Multi-step reasoning tasks  
- Agent-style instruction following (CLI assistants, web automation)  
- Educational assistance, planning, and explanation  
- Natural language code generation, JSON/schema design  
- Legal, productivity, and roleplay simulations

---

## πŸ§ͺ Merge Details

### πŸ”€ Merge Method

This model was merged using the [TIES](https://arxiv.org/abs/2306.01708) merge method with the [Qwen/Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B) as the base model.

### 🀝 Models Merged

| Model | Role |
|-------|------|
| [POLARIS-Project/Polaris-4B-Preview](https://huggingface.co/POLARIS-Project/Polaris-4B-Preview) | Deep reasoning & CoT |
| [Menlo/Jan-nano](https://huggingface.co/Menlo/Jan-nano) | Agentic & Instruction-following |

### βš™οΈ Configuration

```yaml
models:
  - model: POLARIS-Project/Polaris-4B-Preview
    parameters:
      weight: 0.5
  - model: Menlo/Jan-nano
    parameters:
      weight: 0.5
merge_method: ties
base_model: Qwen/Qwen3-4B
parameters:
  normalize: true
  int8_mask: true
dtype: float16
````

---

## πŸ“Š Prompt Evaluation

This model was evaluated on **handcrafted prompts** covering:

* Chain-of-thought reasoning
* Math and logic
* Code writing and CLI instructions
* JSON/schema generation
* Role-based planning and writing tasks
* Arabic translation
* Legal drafting

### βœ… Performance Highlights

| Criterion                  | Result                                  |
| -------------------------- | --------------------------------------- |
| CoT Reasoning              | Excellent (multi-step math, planning)   |
| Agentic Tasks              | Strong (shell scripts, terminal agents) |
| Code Output                | Clean formatting and logical structure  |
| Format Awareness           | Recognizes JSON, email, legal structure |
| Instruction Follow-through | Reliable and contextual                 |
| Language Tasks             | Accurate Arabic translation, paraphrase |

Average prompt score (0–3 scale): **2.15**
All outputs were logical, well-structured, and contextually accurate for the prompt types.

---

## πŸš€ Inference

To use the model:

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "yasserrmd/qwen3-4b-agentic-reasoner"

tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto", trust_remote_code=True)

prompt = "Plan the first 3 steps for launching a nonprofit AI education platform."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

---

## ⚠️ License & Use

Respect the licenses of the original merged models. This model is released for **research and personal experimentation** purposes.

* [POLARIS-Project/Polaris-4B-Preview License](https://huggingface.co/POLARIS-Project/Polaris-4B-Preview)
* [Menlo/Jan-nano License](https://huggingface.co/Menlo/Jan-nano)
* [Qwen3-4B License](https://huggingface.co/Qwen/Qwen3-4B)

---

## πŸ™ Acknowledgments

Thanks to the teams behind:

* Alibaba's Qwen3 series
* Menlo/Jan-nano project
* POLARIS RL framework
* MergeKit by [@cg123](https://github.com/cg123)

---

Model by [@yasserrmd](https://huggingface.co/yasserrmd)