File size: 16,886 Bytes
971e74e
 
3d22f93
 
 
 
 
 
692a128
3d22f93
 
 
692a128
 
 
 
 
 
 
 
 
 
3d22f93
692a128
3d22f93
692a128
 
3d22f93
 
 
 
 
 
 
 
 
 
 
971e74e
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22f93
692a128
 
 
 
 
 
 
3d22f93
 
692a128
 
 
 
 
 
 
3d22f93
 
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22f93
 
 
692a128
 
3d22f93
 
 
692a128
 
 
 
 
 
 
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
 
 
 
 
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
 
 
3d22f93
692a128
3d22f93
692a128
3d22f93
692a128
 
 
 
 
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d22f93
692a128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
---
license: apache-2.0
language:
- en
- code
library_name: transformers
pipeline_tag: text-generation
tags:
- WIUAI
- WIUAI.Mini.Coder
- code-llm
- code-generation
- code-completion
- programming
- algorithmic-reasoning
- small-language-model
- compact-llm
- from-scratch
- causal-language-model
- llama
- starcoder-tokenizer
- supervised-fine-tuning
- pretraining
- multi-stage-training
- tpu
- google-tpu-research-cloud
- TRC
- 303m
datasets:
- HuggingFaceFW/fineweb-edu
- nvidia/Nemotron-Pretraining-SFT-v1
- bigcode/starcoderdata
- nvidia/Nemotron-Pretraining-Code-v1
- HuggingFaceFW/finewiki
- open-web-math/open-web-math
- nvidia/Nemotron-CC-Math-v1
- nvidia/OpenCodeInstruct
- nvidia/OpenMathInstruct-2
---

* WIUAI.Mini.Coder

A 303M Parameter Code Language Model Trained from Scratch

Developed by WithIn Us AI

A compact, code-specialized causal language model designed for programming, code generation, algorithmic problem solving, and instruction-driven software development.

303M parameters | 29.8B reported curriculum tokens | 1,024-token context

⸻

1. Introduction

WIUAI.Mini.Coder is a 303-million-parameter language model developed from scratch with a dedicated focus on programming and algorithmic reasoning.

The project explores how a relatively compact neural language model can develop useful code-generation capabilities through carefully structured multi-stage training.

Rather than relying on an existing pretrained foundation model, WIUAI.Mini.Coder uses a LLaMA-style causal decoder architecture initialized from scratch and trained through a four-stage curriculum covering general language understanding, programming, mathematics, knowledge acquisition, and supervised instruction tuning.

The final published Stage 4.1 checkpoint represents an EOS-corrected supervised fine-tuning run designed to address an End-of-Sequence token handling issue identified in earlier versions.

The reported training curriculum encompasses approximately 29.8 billion cumulative tokens, culminating in a 6-billion-token instruction-tuning stage.

The resulting model is specialized for code generation and programming-oriented tasks rather than unrestricted general-purpose intelligence.

Project Objectives

The development of WIUAI.Mini.Coder explores five central objectives:

1. Building a compact language model entirely from scratch.
2. Developing programming capabilities through dedicated code pretraining.
3. Combining general-language, code, and mathematical training.
4. Improving instruction-following behavior through supervised fine-tuning.
5. Investigating the relationship between training scale, model size, and coding performance.

2. Model Specifications

Specification	Configuration
Model name	WIUAI.Mini.Coder
Developer	WithIn Us AI
Model family	WIUAI Mini
Architecture	LLaMA-style causal decoder
Total parameters	Approximately 303M
Hidden dimension	768
Transformer layers	24
Attention heads	8
Key/value heads	8
Attention type	Standard MHA
Intermediate dimension	3,072
Vocabulary size	49,152
Tokenizer	BigCode StarCoder
Maximum context	1,024 tokens
Training initialization	From scratch
Final training stage	Stage 4.1 EOS-corrected SFT
Reported cumulative tokens	Approximately 29.8B
Final SFT token budget	Approximately 6B
Training precision	bfloat16
Optimizer	AdamW XLA
Training hardware	TPU v4-32
Training program	Google TPU Research Cloud
License	Apache 2.0

3. Architecture

WIUAI.Mini.Coder uses a LLaMA-style autoregressive decoder with standard Multi-Head Attention (MHA).

The architecture is designed around a relatively deep but compact transformer configuration.

3.1 Transformer Configuration

LlamaConfig(
    vocab_size=49152,
    hidden_size=768,
    num_hidden_layers=24,
    num_attention_heads=8,
    num_key_value_heads=8,
    intermediate_size=3072,
    max_position_embeddings=1024,
)

3.2 Architectural Components

Causal Self-Attention

The model uses standard multi-head causal attention to process contextual information while respecting autoregressive generation constraints.

Feed-Forward Networks

Each transformer layer incorporates feed-forward processing with a configured intermediate dimension of 3,072.

Token Embeddings

The model uses a 49,152-token vocabulary based on the BigCode StarCoder tokenizer.

Autoregressive Generation

The decoder predicts subsequent tokens based on previously processed context, enabling code completion and natural-language generation.

3.3 Architecture Design

The architectural configuration prioritizes:

* Compact parameter allocation.
* Deep transformer processing.
* Code-oriented tokenization.
* Autoregressive language modeling.
* Efficient accelerator-based training.

4. Tokenizer

WIUAI.Mini.Coder uses the bigcode/starcoder tokenizer.

The vocabulary contains 49,152 tokens.

The tokenizer was selected for its suitability for programming languages and source-code representation.

This design supports the model’s code-specialization objectives by using a vocabulary developed for code-oriented language modeling.

The tokenizer is an important part of the model architecture and should remain consistent between training, evaluation, and inference.

5. Four-Stage Training Curriculum

WIUAI.Mini.Coder was developed through a four-stage training curriculum.

The curriculum gradually introduces general language knowledge, programming, mathematical material, and instruction-oriented supervision.

The reported cumulative training budget is approximately 29.8 billion tokens.

Stage 1 — Linguistic Foundation

6.3 billion tokens

Dataset: HuggingFaceFW/fineweb-edu

Objective: General English grounding.

This stage establishes the initial language-modeling foundation.

The objective is to develop basic linguistic representations and general text-prediction capabilities before introducing specialized programming data.

Measurement	Loss
Initial loss	10.87
Final loss	2.58

Stage 2 — Code Specialization

7.5 billion tokens

Datasets:

* nvidia/Nemotron-Pretraining-Code-v1
* bigcode/starcoderdata

Reported mixture:

* 60% Nemotron synthetic code.
* 40% StarCoderData.

Objective: Code syntax, programming patterns, and algorithmic reasoning.

This stage introduces dedicated programming knowledge and source-code prediction.

The combination of synthetic programming material and real-world code data provides two complementary training sources.

Measurement	Loss
Initial loss	5.00
Final loss	1.25

Stage 3 — Mathematics and Knowledge

10 billion tokens

Datasets:

* nvidia/Nemotron-CC-Math-v1
* HuggingFaceFW/finewiki
* open-web-math/open-web-math

Objective: Mathematical reasoning, factual knowledge, and broader problem-solving foundations.

This stage expands the training distribution beyond programming syntax.

The intention is to improve the mathematical and informational foundations that support algorithmic problem solving.

Measurement	Loss
Initial loss	2.77
Final loss	1.55

Stage 4.1 — EOS-Corrected Supervised Fine-Tuning

Final checkpoint

6 billion tokens

Datasets:

* nvidia/Nemotron-Pretraining-SFT-v1
* nvidia/OpenCodeInstruct
* nvidia/OpenMathInstruct-2

Objective: Instruction following, code generation, mathematical instructions, and assistant-response alignment.

This stage represents the final instruction-tuning phase of the reported training curriculum.

A critical EOS token handling issue identified in earlier versions was corrected.

The corrected checkpoint is intended to improve generation termination behavior and instruction-oriented output handling.

Measurement	Loss
Initial loss	1.73
Final loss	Approximately 0.70

Training Curriculum Summary

Stage	Training tokens	Primary focus
Stage 1	6.3B	Language foundation
Stage 2	7.5B	Code specialization
Stage 3	10.0B	Mathematics and knowledge
Stage 4.1	6.0B	Instruction fine-tuning
Total	29.8B	Complete curriculum

The stage token budgets represent cumulative training exposure as reported in the original project documentation, not unique dataset token counts.

Loss values are stage-specific training measurements and should not be directly interpreted as comparable measures of capability across different data distributions.

6. Coding Performance

WIUAI.Mini.Coder Stage 4.1 was evaluated on HumanEval and MBPP.

The reported results are:

<grid columns={2} gap={3}>
  <grid-item>
    <box border radius="lg" padding={3} gap={1}>
      <title size="2xl" color="success" tabularNums>27.4%</title>
      **HumanEval pass@1**
      <text color="secondary" size="xs">Zero-shot</text>
    </box>
  </grid-item>
  <grid-item>
    <box border radius="lg" padding={3} gap={1}>
      <title size="2xl" color="success" tabularNums>31.0%</title>
      **MBPP pass@1**
      <text color="secondary" size="xs">Three-shot</text>
    </box>
  </grid-item>
</grid>

6.1 Comparative Results

Model	Parameters	HumanEval	MBPP
WIUAI.Mini.Coder Stage 4.1	303M	27.4%	31.0%
TinyLlama-1.1B	1.1B	~26.4%	~27.6%
MPT-1B-Instruct	1.0B	~22.0%	~25.0%
Zephyr-1.3B-SFT	1.3B	31.0%	34.0%
Mistral-7B-Base	7B	30.5%	47.5%

Comparison values are those reported in the original project documentation. They should be treated as indicative comparisons, not controlled head-to-head results. Evaluation prompts, decoding parameters, model revisions, and benchmark implementations may differ.

6.2 Parameter Efficiency

At approximately 303 million parameters, WIUAI.Mini.Coder is substantially smaller than the larger models in the comparison.

Its reported HumanEval result is particularly interesting when considered against the TinyLlama-1.1B and MPT-1B-Instruct results.

The model demonstrates that meaningful code-generation performance can be explored within a sub-500M parameter budget.

It does not establish universal superiority over larger models.

7. Broader Evaluation

In addition to code-generation benchmarks, the model was evaluated on mathematical, knowledge, and reasoning tasks.

Domain	Benchmark	Evaluation	Score
Coding	HumanEval	pass@1, zero-shot	27.4%
Coding	MBPP	pass@1, three-shot	31.0%
Mathematics	GSM8K	Exact match, zero-shot	4.55%
Language modeling	WikiText-2	Perplexity	167.6
Reasoning	ARC-Easy	Accuracy normalized	34.6%
Reasoning	ARC-Challenge	Accuracy normalized	22.8%
Commonsense	HellaSwag	Accuracy normalized	28.3%

Evaluation Methodology

HumanEval and MBPP were evaluated using manual generation and evaluation procedures.

Reported generation configuration:

* Maximum new tokens: 512.
* Temperature: 0.2.
* HumanEval: zero-shot.
* MBPP: three-shot.

The original project documentation identifies SFT formatting and truncation issues in the lm-eval evaluation pathway, which motivated the alternative evaluation procedure.

Consequently, these results should not be assumed to be directly interchangeable with results from standardized evaluation harnesses.

8. Known Limitations

WIUAI.Mini.Coder is a specialized compact model, and its limitations are important when selecting deployment scenarios.

8.1 General-Purpose Language Understanding

The model prioritizes programming and code-related tasks.

Its performance on general conversation, broad factual reasoning, and unrestricted language tasks may be limited.

8.2 Mathematical Reasoning

The reported GSM8K result is 4.55%.

This indicates substantial limitations in complex mathematical reasoning despite the inclusion of mathematical training data.

8.3 Context Length

The model was trained using a maximum sequence length of 1,024 tokens.

Long source files, extensive instructions, and large contextual inputs may exceed its effective training regime.

8.4 Tokenizer Specialization

The StarCoder tokenizer is optimized for code-oriented language modeling.

Its tokenization behavior may be less efficient for general prose and other text distributions.

8.5 Generation Reliability

Generated code may contain:

* Syntax errors.
* Incorrect assumptions.
* Logical mistakes.
* Missing edge-case handling.
* Incomplete implementations.

All generated code should be executed and tested before use in production systems.

9. Recommended Applications

WIUAI.Mini.Coder is particularly suited to experimentation with compact programming models.

Potential applications include:

Code Generation

* Python functions.
* Algorithm implementation.
* Small programming tasks.
* Code completion.

Programming Education

* Basic programming explanations.
* Example generation.
* Programming exercises.
* Algorithm demonstrations.

Compact AI Systems

* Lightweight coding components.
* Local model experiments.
* Specialized coding agents.
* Research into small-model efficiency.

Multi-Agent Architectures

The model may be used as a specialized coding component within a larger agent system, where other models provide planning, verification, research, or tool execution.

Its limitations should be accounted for when assigning responsibilities within an agent architecture.

10. Usage

The model uses a User: / Assistant: dialogue format.

Transformers Inference

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_ID = "YOUR_HF_USERNAME/WIUAI.Mini.Coder"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.bfloat16
).to(device)
model.eval()
prompt = """User: Write a Python function that
checks whether a number is prime.
Assistant:"""
inputs = tokenizer(
    prompt,
    return_tensors="pt"
).to(device)
with torch.inference_mode():
    outputs = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.2,
        do_sample=True,
        eos_token_id=tokenizer.eos_token_id,
        pad_token_id=tokenizer.eos_token_id,
    )
generated = outputs[0][inputs["input_ids"].shape[-1]:]
print(
    tokenizer.decode(
        generated,
        skip_special_tokens=True
    )
)

Replace YOUR_HF_USERNAME/WIUAI.Mini.Coder with the actual published repository ID.

For CPU inference, use an appropriate supported precision rather than assuming bfloat16 is supported by the hardware.

11. Training Infrastructure

The reported training configuration used:

Component	Configuration
Accelerator	Google TPU v4-32
Training program	TPU Research Cloud
Precision	bfloat16
Optimizer	AdamW XLA
Model initialization	Random initialization
Training architecture	LLaMA-style decoder
Tokenizer	StarCoder
Total parameters	303M

The project acknowledges support from Google’s TPU Research Cloud program.

12. Research Significance

WIUAI.Mini.Coder explores an important direction in compact language-model research: developing specialized models through deliberate training curricula rather than relying exclusively on model size.

Its development combines:

* From-scratch initialization.
* General-language pretraining.
* Dedicated code specialization.
* Mathematical and knowledge training.
* Large-scale supervised fine-tuning.
* EOS token correction.
* Code-generation evaluation.

The reported results provide a useful experimental reference for investigating how smaller models can allocate their training budget toward specialized capabilities.

The project also highlights the importance of training methodology and data composition when developing models with limited parameter capacity.

13. Acknowledgements

WIUAI.Mini.Coder was developed with reported support from the Google TPU Research Cloud (TRC) program.

The project acknowledges the researchers and organizations responsible for the datasets used throughout the training curriculum, including:

* Hugging Face.
* NVIDIA.
* BigCode.
* Open Web Math.

Their open research contributions provide valuable resources for language-model development.

14. License

WIUAI.Mini.Coder is released under the Apache License 2.0, as specified by its model repository metadata.

Users should independently review upstream dataset licenses and applicable redistribution requirements.

15. Citation

@misc{WIUAI_Mini_Coder,
  title = {
    WIUAI.Mini.Coder:
    A 303M-Parameter Code Language Model
    Trained from Scratch
  },
  author = {Da Silva, Ilan},
  year = {2025},
  url = {
    https://huggingface.co/WIUAI.Mini.Coder
  },
  note = {
    Trained with Google TPU Research Cloud support
  }
}

16. Model Summary

Category	Description
Model	WIUAI.Mini.Coder
Model category	Code-specialized LLM
Parameters	303M
Architecture	LLaMA-style causal decoder
Layers	24
Hidden dimension	768
Attention	8-head MHA
Vocabulary	49,152
Tokenizer	StarCoder
Context length	1,024
Training initialization	From scratch
Training curriculum	Four stages
Total reported tokens	29.8B
Final SFT	6B tokens
HumanEval	27.4%
MBPP	31.0%
Training hardware	TPU v4-32
License	Apache 2.0

⸻

WIUAI.Mini.Coder — 303M

Purpose-built. Trained from scratch. Specialized for code.

WithIn Us AI

Exploring the potential of compact, specialized artificial intelligence through architecture, training, and research.