File size: 13,265 Bytes
8a50b6c
 
d9c0f19
f9b273d
8a50b6c
f9b273d
 
 
 
 
 
 
 
 
 
 
 
d9c0f19
8a50b6c
d9c0f19
 
f9b273d
 
8a50b6c
f9b273d
 
d9c0f19
 
 
 
 
 
c85ee2c
 
 
 
700b725
04a0575
700b725
d9c0f19
 
 
 
 
b2abf68
d9c0f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a50b6c
 
d9c0f19
 
d430eee
 
 
8a50b6c
d430eee
d9c0f19
 
8a50b6c
fa5e3ef
2f58766
 
 
fa5e3ef
295768b
 
 
 
d9c0f19
8a50b6c
d9c0f19
 
 
 
 
 
 
 
 
 
ce138ef
d9c0f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ce138ef
d9c0f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a50b6c
d9c0f19
8a50b6c
d9c0f19
8a50b6c
d9c0f19
 
 
8a50b6c
d9c0f19
 
 
 
 
 
8a50b6c
d9c0f19
 
 
 
 
 
 
 
 
 
8a50b6c
d9c0f19
 
 
 
8a50b6c
d9c0f19
 
 
 
 
 
 
 
 
8a50b6c
d9c0f19
 
 
 
 
 
8a50b6c
d9c0f19
8a50b6c
d9c0f19
 
 
8a50b6c
d9c0f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa5747d
d9c0f19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a50b6c
d9c0f19
8a50b6c
d9c0f19
 
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
---
license: apache-2.0
language:
- en
tags:
- atlas-coder
- atlas-coder-2
- qwen2.5-coder
- sub-1b
- qlora
- code-generation
- code-completion
- code-debugging
- coding
- fine-tuned
- text-generation-inference
- flagship
base_model: Qwen/Qwen2.5-Coder-0.5B-Instruct
pipeline_tag: text-generation
library_name: transformers
datasets:
- bigcode/self-oss-instruct-sc2-exec-filter-50k
- Siddh07ETH/Atlas-Coder-50K-ChatML
model-index:
- name: Atlas-Coder-2-0.5B
  results: []
---

<div align="center">

# ⚑ Atlas-Coder-2-0.5B

<p align="center">
  <img src="./banner.png" width="100%">
</p>

**πŸ› οΈ Atlas-Coder-2-0.5B: The Top Sub-1B Coding Model**

**Ranked #Top 5 globally for strictly sub-1B parameter models on the EvalPlus (HumanEval+) strict benchmark.**

[![HuggingFace](https://img.shields.io/badge/πŸ€—-HuggingFace-yellow)](https://huggingface.co/Siddh07ETH/Atlas-Coder-2-0.5B)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](https://opensource.org/licenses/Apache-2.0)
[![Model Size](https://img.shields.io/badge/Parameters-494M-green)]()
[![Base Model](https://img.shields.io/badge/Base-Qwen2.5--Coder--0.5B--Instruct-orange)](https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct)
[![GGUF](https://img.shields.io/badge/GGUF-Available-purple)](https://huggingface.co/Siddh07ETH/Atlas-Coder-2-0.5B-GGUF)
[![Version](https://img.shields.io/badge/Version-2.0-red)]()

</div>

---

## Model Description

**Atlas-Coder-2-0.5B** is the flagship model of the **Pluto AI** research project by Siddharth N.R. β€” the second generation of the Atlas-Coder series and the most focused coding model released under the Pluto AI brand to date.

Built on top of [Qwen2.5-Coder-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct), Atlas-Coder-2 is trained exclusively on **50K execution-verified OSS-Instruct samples** β€” real open-source Python functions that have been independently verified to execute correctly. This single-source, high-purity data strategy maximizes alignment with HumanEval+ and MBPP+ benchmark formats while keeping the training signal clean and consistent.

Unlike V1 which trained from the base model and used a 4-source mixture, Atlas-Coder-2 starts from an instruction-tuned foundation and specializes it further on execution-verified code. The result is a sharper, more reliable code generator with a lower hallucination rate on self-contained Python tasks.

> **Research Goal:** Demonstrate that a sub-500M parameter model, fine-tuned exclusively on execution-verified code in a single Kaggle session, can match or exceed the coding performance of officially released instruct variants and outperform models up to 3Γ— its parameter count.

---

## πŸ“Š Benchmarks

<p align="center">
  <img src="./benchmark_atlas.png" width="100%">
</p>

*Competitor scores from official technical reports.*

---

>**⚑ Edge Performance:**
>Tested locally on an M2 MacBook Air (8GB RAM) using LM Studio with the **F16 GGUF**. Achieved 75 tokens/second generation speed. Because the model uses native **FP16** precision, it bypasses quantization overhead and fully utilizes Apple Silicon's Metal FP16 vector cores. Zero GPU required.



**GGUF Quantizations**

>https://huggingface.co/Siddh07ETH/Atlas-Coder-2-0.5B-GGUF

## What Changed from V1

| Property | Atlas-Coder-0.5B (V1) | Atlas-Coder-2-0.5B (V2) |
|----------|-----------------------|--------------------------|
| Base model | Qwen2.5-Coder-0.5B **Base** | Qwen2.5-Coder-0.5B **Instruct** |
| Data sources | 4 (Magicoder + OSS + CodeFeedback + TACO) | 1 (OSS-Instruct exec-verified only) |
| Training samples | ~80K (mixed quality) | 50K (100% exec-verified) |
| LoRA rank | r=64 | r=32 (faster, leaner) |
| Epochs | 3 | 1 (instruct base needs less) |
| Sequence length | 1024 | 1024 |
| Response masking | βœ… | Standard LM loss |
| Final loss | 0.0294 | **0.0596** (healthy β€” not overfit) |
| Training time | ~42h 44m | ~9.5h |
| Fits in 1 Kaggle session | ❌ (needed resume) | βœ… |

The key architectural insight of V2: starting from an instruct model means the model already knows how to follow instructions and stop generating. V2 doesn't need to re-learn conversation structure β€” it only needs to deepen its Python code generation capability. This allows a single clean epoch on a smaller, higher-quality dataset to outperform a longer multi-epoch run on a noisier mixture.

---

## Training Details

| Property | Value |
|----------|-------|
| **Base Model** | Qwen/Qwen2.5-Coder-0.5B-Instruct |
| **Parameters** | ~494 Million |
| **Method** | QLoRA (4-bit NF4 + LoRA) |
| **LoRA Rank** | r=32, Ξ±=64 |
| **LoRA Dropout** | 0.05 |
| **LoRA Target Modules** | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| **Trainable Parameters** | 17,596,416 |
| **Training Epochs** | 1 |
| **Training Steps** | ~1,568 (resumed from checkpoint 250) |
| **Final Training Loss** | 0.0596 |
| **Precision** | FP16 (forced β€” T4 sm_75 does not support BF16) |
| **Optimizer** | AdamW 8-bit (Paged) |
| **Learning Rate** | 1e-4 (cosine schedule) |
| **Warmup Steps** | 100 |
| **Effective Batch Size** | 32 (2 Γ— 16 grad accum) |
| **Sequence Length** | 1024 tokens |
| **Hardware** | Tesla T4 (16 GB VRAM) β€” Kaggle free tier |
| **Training Time** | ~9.5 hours (single session) |
| **Framework** | Transformers 4.52.4 + PEFT 0.17.0 + TRL 0.19.1 |
| **Chat Template** | ChatML (inherited from base instruct model) |

---

## Training Data

| Dataset | Samples | Why This Dataset |
|---------|---------|-----------------|
| [bigcode/self-oss-instruct-sc2-exec-filter-50k](https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k) | **50,154** (train) + 508 (eval) | 100% execution-verified. Generated from real open-source Python. Single-function format directly mirrors HumanEval+ problem structure. No hallucinated solutions β€” every completion has been independently run and confirmed correct. |

**Why single-source?** The V1 multi-dataset mixture introduced noise from TACO (competitive programming verbosity) and CodeFeedback (multi-turn debug style), both of which poorly align with HumanEval+ single-function completion format. V2 eliminates this noise entirely. The OSS-Instruct exec-filtered dataset is already the highest-ROI data source for HumanEval+ performance β€” using 50K samples of it exclusively produces a cleaner gradient signal than mixing 80K samples of heterogeneous quality.

---

## Key Design Decisions

**1. Instruct base = faster convergence**
Starting from `Qwen2.5-Coder-0.5B-Instruct` means the ChatML format, stop-token behavior, and instruction-following discipline are already in place. The model only needs to deepen code generation quality β€” not learn conversation structure from scratch. This makes 1 epoch sufficient where V1 needed 3.

**2. Execution-verified data only**
Every training sample in OSS-Instruct exec-filter-50k has been independently run and verified to produce correct output. This eliminates a significant noise source that affects most open-source fine-tuning datasets: plausible-looking but incorrect code completions that silently degrade model performance on pass@1 metrics.

**3. r=32 LoRA for speed without sacrificing quality**
At the 0.5B parameter scale, r=64 provides diminishing returns over r=32 while doubling the LoRA parameter count and training time. The r=32 configuration trains ~40% faster on the T4, allowing full training within a single Kaggle 9-hour session without checkpoint recovery.

**4. Single Kaggle session design**
The entire pipeline β€” install β†’ load β†’ data β†’ train β†’ merge β†’ upload β†’ GGUF β€” is designed to complete within a single 9-hour Kaggle session. The 3-layer checkpoint recovery system (local β†’ HuggingFace Hub β†’ fresh start) handles session interruptions automatically when they occur.

---

## Usage

### Basic Inference

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Siddh07ETH/Atlas-Coder-2-0.5B",
    torch_dtype=torch.float16,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("Siddh07ETH/Atlas-Coder-2-0.5B")

messages = [
    {
        "role": "system",
        "content": "You are a helpful coding assistant."
    },
    {
        "role": "user",
        "content": "Write a Python function to find all prime numbers up to n using the Sieve of Eratosthenes."
    }
]

text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt").to(model.device)

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.2,
        do_sample=True,
        top_p=0.9,
        repetition_penalty=1.1,
    )

response = tokenizer.decode(
    output[0][inputs.input_ids.shape[1]:],
    skip_special_tokens=True
)
print(response)
```

### Low Memory Inference (4-bit)

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch

quant_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.float16,
)
model = AutoModelForCausalLM.from_pretrained(
    "Siddh07ETH/Atlas-Coder-2-0.5B",
    quantization_config=quant_config,
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("Siddh07ETH/Atlas-Coder-2-0.5B")
```

### GGUF (Ollama / LM Studio / llama.cpp)

GGUF quantizations for CPU inference are available at:

> **[Siddh07ETH/Atlas-Coder-2-0.5B-GGUF](https://huggingface.co/Siddh07ETH/Atlas-Coder-2-0.5B-GGUF)**

Runs at 40+ tokens/second on a laptop CPU. No GPU required.

---

## Recommended Generation Settings

| Setting | Value | Reason |
|---------|-------|--------|
| `temperature` | 0.1–0.3 | Low temperature for precise code generation |
| `top_p` | 0.9 | Focused vocabulary sampling |
| `repetition_penalty` | 1.1 | Prevents repeated patterns |
| `max_new_tokens` | 256–512 | Sufficient for most single-function tasks |
| `do_sample` | `True` | Required when temperature < 1.0 |

---

## Important: Benchmark Evaluation Setup

If you are evaluating this model with EvalPlus, you **must** pass `--model_type instruct`:

```bash
python -m evalplus.evaluate   --model Siddh07ETH/Atlas-Coder-2-0.5B   --dataset humaneval   --backend hf   --model_type instruct   --greedy
```

Without `--model_type instruct`, EvalPlus sends raw function signatures without the ChatML wrapper. This causes the model to score near 0% β€” which is an evaluation configuration error, not a reflection of model quality. The model was trained exclusively on ChatML-formatted prompts and will not respond meaningfully to bare code signatures.

---

## Model Lineage

Atlas-Coder-2 is the second release in the Atlas-Coder series under Pluto AI. Each version refines the strategy based on lessons from the previous run.

| Version | Base | Strategy | Status |
|---------|------|----------|--------|
| [Atlas-Coder-0.5B (V1)](https://huggingface.co/Siddh07ETH/Atlas-Coder-0.5B) | Qwen2.5-Coder-0.5B Base | 4-source 80K mixture, 3 epochs, r=64 | Published |
| **Atlas-Coder-2-0.5B (V2)** | Qwen2.5-Coder-0.5B-Instruct | 50K exec-verified, 1 epoch, r=32 | **Flagship β€” this model** |

---

## Related Models

| Model | Parameters | Description |
|-------|-----------|-------------|
| **Atlas-Coder-2-0.5B (this)** | 494M | Flagship β€” exec-verified, instruct base |
| [Atlas-Coder-0.5B (V1)](https://huggingface.co/Siddh07ETH/Atlas-Coder-0.5B) | 494M | First generation, base model fine-tune |
| [Pluto-Genesis-0.6B](https://huggingface.co/Siddh07ETH/Pluto-Genesis-0.6B) | 596M | General reasoning, math, and code |

---

## Limitations

- **Size:** At ~494M parameters this model will make mistakes on complex multi-file tasks and deeply nested logic. Always verify generated code before running it in production.
- **Context length:** Trained on sequences up to 1024 tokens. Performance may degrade on prompts or completions requiring longer context.
- **Language bias:** Optimized primarily for Python. Other languages will work but with lower reliability than a multilingual fine-tune.
- **Single-domain training:** Trained entirely on OSS-Instruct data. May underperform on highly domain-specific code (e.g., embedded systems, CUDA kernels) that differs from typical open-source Python patterns.
- **Research only:** Not intended for production deployment without further evaluation and safety testing.

---

## Author

**Siddharth N.R**
Graduated B.Tech β€” AI & Data Science
Pluto AI Research

[![HuggingFace](https://img.shields.io/badge/πŸ€—-Siddh07ETH-yellow)](https://huggingface.co/Siddh07ETH)

---

## Citation

```bibtex
@misc{atlascoder2_2026,
  author    = {Siddharth N.R.},
  title     = {Atlas-Coder-2-0.5B: Execution-Verified QLoRA Fine-Tuning from an Instruct Base for Sub-1B Code Generation},
  year      = {2026},
  publisher = {HuggingFace},
  url       = {https://huggingface.co/Siddh07ETH/Atlas-Coder-2-0.5B}
}
```

---

## License

Apache 2.0 β€” see [LICENSE](https://opensource.org/licenses/Apache-2.0).
Base model [Qwen2.5-Coder-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct) is also Apache 2.0.