File size: 5,717 Bytes
75b0ac8
 
 
 
 
9694ce5
 
d77ae15
75b0ac8
 
f81f042
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
75b0ac8
f81f042
 
 
 
 
75b0ac8
 
 
f81f042
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
 
75b0ac8
f81f042
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
75b0ac8
f81f042
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
75b0ac8
 
f81f042
75b0ac8
f81f042
 
 
 
75b0ac8
f81f042
 
 
 
 
75b0ac8
f81f042
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
75b0ac8
f81f042
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75b0ac8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f81f042
75b0ac8
 
 
 
 
f81f042
75b0ac8
f81f042
 
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
 
 
75b0ac8
f81f042
 
 
 
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
 
 
75b0ac8
f81f042
75b0ac8
f81f042
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75b0ac8
f81f042
 
 
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
---
license: mit
language:
- pt
pipeline_tag: text-generation
base_model:
- AxionLab-official/MiniBot-0.9M-Base
library_name: transformers
---

# ๐Ÿง  MiniBot-0.9M-Instruct

> **Instruction-tuned GPT-2 style language model (~900K parameters) optimized for Portuguese conversational tasks.**

[![Model](https://img.shields.io/badge/๐Ÿค—%20Hugging%20Face-MiniBot--0.9M--Instruct-yellow)](https://huggingface.co/AxionLab-official/MiniBot-0.9M-Instruct)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
[![Language](https://img.shields.io/badge/Language-Portuguese-blue)](https://huggingface.co/AxionLab-official/MiniBot-0.9M-Instruct)
[![Parameters](https://img.shields.io/badge/Parameters-~900K-orange)](https://huggingface.co/AxionLab-official/MiniBot-0.9M-Instruct)

---

## ๐Ÿ“Œ Overview

**MiniBot-0.9M-Instruct** is the instruction-tuned version of [MiniBot-0.9M-Base](https://huggingface.co/AxionLab-official/MiniBot-0.9M-Base), designed to follow prompts more accurately, respond to user inputs, and generate more coherent conversational outputs in **Portuguese**.

Built on a GPT-2 architecture (~0.9M parameters), this model was fine-tuned on conversational and instruction-style data to improve usability in real-world interactions.

---

## ๐ŸŽฏ Key Characteristics

| Attribute | Detail |
|---|---|
| ๐Ÿ‡ง๐Ÿ‡ท **Language** | Portuguese (primary) |
| ๐Ÿง  **Architecture** | GPT-2 style (Transformer decoder-only) |
| ๐Ÿ”ค **Embeddings** | GPT-2 compatible |
| ๐Ÿ“‰ **Parameters** | ~900K |
| โš™๏ธ **Base Model** | MiniBot-0.9M-Base |
| ๐ŸŽฏ **Fine-tuning** | Instruction tuning (supervised) |
| โœ… **Alignment** | Basic prompt-following behavior |

---

## ๐Ÿง  What Changed from Base?

Instruction tuning introduced significant behavioral improvements with no architectural changes:

| Feature | Base | Instruct |
|---|---|---|
| Prompt understanding | โŒ | โœ… |
| Conversational flow | โš ๏ธ Partial | โœ… |
| Instruction following | โŒ | โœ… |
| Overall coherence | Low | Improved |
| Practical usability | Experimental | Functional |

> ๐Ÿ’ก The model is now significantly more usable in chat scenarios.

---

## ๐Ÿ—๏ธ Architecture

The core architecture remains identical to the base model:

- **Decoder-only Transformer** (GPT-2 style)
- Token embeddings + positional embeddings
- Self-attention + MLP blocks
- Autoregressive generation

No structural changes were made โ€” only behavioral improvement through fine-tuning.

---

## ๐Ÿ“š Fine-Tuning Dataset

The model was fine-tuned on a Portuguese instruction-style conversational dataset composed of:

- ๐Ÿ’ฌ Questions and answers
- ๐Ÿ“‹ Simple instructions
- ๐Ÿค– Assistant-style chat
- ๐ŸŽญ Basic roleplay
- ๐Ÿ—ฃ๏ธ Natural conversations

**Expected format:**

```
User: Me explique o que รฉ gravidade
Bot: A gravidade รฉ a forรงa que atrai objetos com massa...
```

**Training strategy:**
- Supervised Fine-Tuning (SFT)
- Pattern learning for instruction-following
- No RLHF or preference optimization

---

## ๐Ÿ’ก Capabilities

### โœ… Strengths

- Following simple instructions
- Answering basic questions
- Conversing more naturally
- Higher coherence in short responses
- More consistent dialogue structure

### โŒ Limitations

- Reasoning is still limited
- May generate incorrect facts
- Does not retain long context
- Sensitive to poorly structured prompts

> โš ๏ธ Even with instruction tuning, this remains an extremely small model. Adjust expectations accordingly.

---

## ๐Ÿš€ Getting Started

### Installation

```bash
pip install transformers torch
```

### Usage with Hugging Face Transformers

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "AxionLab-official/MiniBot-0.9M-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

prompt = "User: Me diga uma curiosidade sobre o espaรงo\nBot:"
inputs = tokenizer(prompt, return_tensors="pt")

outputs = model.generate(
    **inputs,
    max_new_tokens=80,
    temperature=0.7,
    top_p=0.9,
    do_sample=True,
)

print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```

### โš™๏ธ Recommended Settings

| Parameter | Recommended Value | Description |
|---|---|---|
| `temperature` | `0.6 โ€“ 0.8` | Controls randomness |
| `top_p` | `0.85 โ€“ 0.95` | Nucleus sampling |
| `do_sample` | `True` | Enable sampling |
| `max_new_tokens` | `40 โ€“ 100` | Response length |

> ๐Ÿ’ก Instruct models tend to perform better at lower temperatures. Try values around `0.65` for more accurate and focused responses.

---

## ๐Ÿงช Intended Use Cases

| Use Case | Suitability |
|---|---|
| ๐Ÿ’ฌ Lightweight Portuguese chatbots | โœ… Ideal |
| ๐ŸŽฎ NPCs and games | โœ… Ideal |
| ๐Ÿง  Fine-tuning experiments | โœ… Ideal |
| ๐Ÿ“š NLP education | โœ… Ideal |
| โšก Local / CPU-only applications | โœ… Ideal |
| ๐Ÿญ Critical production environments | โŒ Not recommended |

---

## โš ๏ธ Disclaimer

- Extremely small model (~900K parameters)
- No robust alignment (no RLHF)
- May generate incorrect or nonsensical responses
- **Not suitable for critical production environments**

---

## ๐Ÿ”ฎ Future Work

- [ ] ๐Ÿง  Reasoning-tuned version (`MiniBot-Reason`)
- [ ] ๐Ÿ“ˆ Scaling to 1Mโ€“10M parameters
- [ ] ๐Ÿ“š Larger and more diverse dataset
- [ ] ๐Ÿค– Improved response alignment
- [ ] ๐Ÿงฉ Tool-use experiments

---

## ๐Ÿ“œ License

Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for more details.

---

## ๐Ÿ‘ค Author

Developed by **[AxionLab](https://huggingface.co/AxionLab-official)** ๐Ÿ”ฌ

---

<div align="center">
  <sub>MiniBot-0.9M-Instruct ยท AxionLab ยท MIT License</sub>
</div>