11-47 commited on
Commit
692a128
·
verified ·
1 Parent(s): a9414e1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +476 -115
README.md CHANGED
@@ -6,14 +6,26 @@ language:
6
  library_name: transformers
7
  pipeline_tag: text-generation
8
  tags:
 
9
  - WIUAI.Mini.Coder
10
  - code-llm
11
  - code-generation
12
- - sft
 
 
 
 
 
 
 
 
 
13
  - pretraining
 
14
  - tpu
 
 
15
  - 303m
16
- - trc
17
  datasets:
18
  - HuggingFaceFW/fineweb-edu
19
  - nvidia/Nemotron-Pretraining-SFT-v1
@@ -26,171 +38,520 @@ datasets:
26
  - nvidia/OpenMathInstruct-2
27
  ---
28
 
29
- # 🧠 WIUAI.Mini.Coder (303M)
30
 
31
- **WIUAI.Mini.Coder** is a **303M parameter** LLaMA-style language model trained **from scratch** for **code generation** and **algorithmic reasoning**.
32
 
33
- This checkpoint represents a **6B-token Supervised Fine-Tuning (SFT)** run that fixed a critical **End-of-Sequence (EOS) token bug** from earlier versions.
34
 
35
- Despite its compact size, WIUAI.Mini.Coder achieves **state-of-the-art (SOTA) coding performance for <500M models**, rivaling 1B–7B parameter LLMs.
36
 
37
- > Trained with support from **Google’s TPU Research Cloud (TRC)** program.
38
 
39
- ---
40
 
41
- ## 🚀 Key Results
42
 
43
- | Model | Size | HumanEval (pass@1) | MBPP (pass@1) |
44
- |:------|:----:|:------------------:|:--------------:|
45
- | **WIUAI.Mini.Coder (Stage 4.1)** | **303M** | **27.4 %** | **31.0 %** |
46
- | TinyLlama-1.1B | 1.1B | ~26.4 % | ~27.6 % |
47
- | MPT-1B-Instruct | 1.0B | ~22.0 % | ~25.0 % |
48
- | Zephyr-1.3B-SFT | 1.3B | 31.0 % | 34.0 % |
49
- | Mistral-7B-Base | 7B | 30.5 % | 47.5 % |
50
 
51
- > ⚖️ **WIUAI.Mini.Coder nearly matches Mistral 7B on HumanEval while being 23× smaller.**
52
 
53
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- ## 🧬 Model Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
- A **LLaMA-type causal decoder** with standard Multi-Head Attention (MHA).
 
 
 
 
 
 
58
 
59
- ```python
60
  LlamaConfig(
61
- vocab_size=49152, # StarCoder tokenizer
62
- hidden_size=768,
63
- num_hidden_layers=24,
64
- num_attention_heads=8,
65
- num_key_value_heads=8,
66
- intermediate_size=3072,
67
- max_position_embeddings=1024,
68
  )
69
- ````
70
-
71
- | Parameter | Value |
72
- | ----------------- | ------------------------------ |
73
- | Total parameters | ≈ 303 M |
74
- | Context length | 1 024 tokens |
75
- | Tokenizer | `bigcode/starcoder` |
76
- | Architecture type | LLaMA (MHA, non-GQA) |
77
- | Precision | bfloat16 |
78
- | Optimizer | AdamW XLA |
79
- | Hardware | TPU v4-32 (TRC) |
80
 
81
- ---
82
 
83
- ## 📚 Training Curriculum (4 Stages, 29.8B tokens)
84
 
85
- | Stage | Tokens (B) | Dataset | Objective | Loss ↓ |
86
- | :------------------------- | :--------: | :--------------------------------------------------- | :------------------------------- | :----------: |
87
- | **1. Linguistic Base** | 6.3 | FineWeb-Edu | General English grounding | 10.87 → 2.58 |
88
- | **2. Code Specialization** | 7.5 | 60 % Nemotron Synthetic Code / 40 % StarCoderData | Code syntax & reasoning | 5.00 → 1.25 |
89
- | **3. Math & Knowledge** | 10.0 | Nemotron CC-Math / FineWiki / OpenWebMath | Mathematical reasoning | 2.77 → 1.55 |
90
- | **4.1 SFT (EOS Fixed)** | 6.0 | Nemotron SFT / OpenCodeInstruct / OpenMathInstruct-2 | Instruction-tuned code alignment | 1.73 → ~0.70 |
91
 
92
- > 🧩 Total ≈ 29.8 B tokens of curated curriculum learning.
93
 
94
- ---
95
 
96
- ## 📊 Detailed Benchmarks (Stage 4.1 SFT)
97
 
98
- | Domain | Benchmark | Metric | Score |
99
- | :-------------- | :------------------- | :----------- | :-----------: |
100
- | **Code** | HumanEval (0-shot) | pass@1 | **27.4 %** |
101
- | **Code** | MBPP (3-shot) | pass@1 | **31.0 %** |
102
- | **Math** | GSM8k (0-shot) | exact match | **4.55 %** |
103
- | **Knowledge** | Wikitext-2 | perplexity ↓ | **167.6** |
104
- | **Reasoning** | ARC (Easy/Challenge) | acc norm | 34.6 / 22.8 % |
105
- | **Commonsense** | HellaSwag | acc norm | 28.3 % |
106
 
107
- > `humaneval`/`mbpp` were computed with manual evaluation (`max_new_tokens=512`, `temp=0.2`) due to SFT format truncation issues in `lm-eval`.
108
 
109
- ---
110
 
111
- ## ⚠️ Known Limitations
112
 
113
- 1. **Code-Specialized Model**
114
- Tuned for Python and algorithmic reasoning. Poor performance on general text, math, and commonsense tasks.
115
 
116
- 2. **Short Context**
117
- Trained on **1 024-token** sequences only. Performance degrades on longer inputs.
 
 
 
118
 
119
- 3. **Tokenizer Bias**
120
- Uses `bigcode/starcoder` BPE vocabulary — optimized for code, not prose.
121
 
122
- ---
123
 
124
- ## 💻 Usage Example
125
 
126
- ```python
127
- import torch
128
- from transformers import AutoTokenizer, AutoModelForCausalLM
129
 
130
- model_id = "WIUAI.Mini.Coder"
131
- device = "cuda" if torch.cuda.is_available() else "cpu"
132
 
133
- tokenizer = AutoTokenizer.from_pretrained(model_id)
134
- model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16).to(device)
135
 
136
- prompt = """User: Write a Python function to compute Fibonacci numbers.
137
- Assistant:"""
138
- inputs = tokenizer(prompt, return_tensors="pt").to(device)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
- with torch.no_grad():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  outputs = model.generate(
142
  **inputs,
143
  max_new_tokens=512,
 
 
144
  eos_token_id=tokenizer.eos_token_id,
145
  pad_token_id=tokenizer.eos_token_id,
146
  )
 
 
 
 
 
 
 
147
 
148
- print(tokenizer.decode(outputs[0], skip_special_tokens=True))
149
- ```
150
 
151
- 💡 *Trained using the “User:” / “Assistant:” dialogue format.*
152
 
153
- ---
154
 
155
- ## 🧾 Citation
156
 
157
- If you use **WIUAI.Mini.Coder (303M)** in your research, please cite:
 
 
 
 
 
 
 
 
158
 
159
- ```
160
- @misc{WIUAI.Mini.Coder,
161
- title = {WIUAI.Mini.Coder: A 303M-parameter Code LLM trained from scratch},
162
- author = {Da Silva, Ilan},
163
- year = {2025},
164
- url = {https://huggingface.co/WIUAI.Mini.Coder},
165
- note = {Trained with Google TPU Research Cloud (TRC) support}
166
- }
167
- ```
168
 
169
- ---
170
 
171
- ## 🙏 Acknowledgements
172
 
173
- This model was trained with support from the **Google TPU Research Cloud (TRC)** program.
174
- Special thanks to the open datasets that enabled this work:
175
- FineWeb, StarCoderData, Nemotron, and OpenWebMath.
176
 
177
- ---
 
 
 
 
 
 
178
 
179
- ## 🧩 Summary
180
 
181
- | Category | Description |
182
- | ------------------- | --------------------------- |
183
- | **Type** | Code LLM (LLaMA-style) |
184
- | **Parameters** | 303 M |
185
- | **Training tokens** | ~29.8 B |
186
- | **Specialty** | Code generation & reasoning |
187
- | **Context window** | 1 024 tokens |
188
- | **Tokenizer** | `bigcode/starcoder` |
189
- | **License** | Apache 2.0 |
190
- | **Hardware** | TPU v4 (TRC Program) |
191
 
192
- ---
 
 
 
 
193
 
194
- > 🔬 **WIUAI.Mini.Coder** demonstrates that a carefully designed <500M model can achieve near-SOTA coding performance, matching 1B-class models on HumanEval — proving that *efficient, compact, open models* still matter.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
 
196
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  library_name: transformers
7
  pipeline_tag: text-generation
8
  tags:
9
+ - WIUAI
10
  - WIUAI.Mini.Coder
11
  - code-llm
12
  - code-generation
13
+ - code-completion
14
+ - programming
15
+ - algorithmic-reasoning
16
+ - small-language-model
17
+ - compact-llm
18
+ - from-scratch
19
+ - causal-language-model
20
+ - llama
21
+ - starcoder-tokenizer
22
+ - supervised-fine-tuning
23
  - pretraining
24
+ - multi-stage-training
25
  - tpu
26
+ - google-tpu-research-cloud
27
+ - TRC
28
  - 303m
 
29
  datasets:
30
  - HuggingFaceFW/fineweb-edu
31
  - nvidia/Nemotron-Pretraining-SFT-v1
 
38
  - nvidia/OpenMathInstruct-2
39
  ---
40
 
41
+ * WIUAI.Mini.Coder
42
 
43
+ A 303M Parameter Code Language Model Trained from Scratch
44
 
45
+ Developed by WithIn Us AI
46
 
47
+ A compact, code-specialized causal language model designed for programming, code generation, algorithmic problem solving, and instruction-driven software development.
48
 
49
+ 303M parameters | 29.8B reported curriculum tokens | 1,024-token context
50
 
51
+ ⸻
52
 
53
+ 1. Introduction
54
 
55
+ WIUAI.Mini.Coder is a 303-million-parameter language model developed from scratch with a dedicated focus on programming and algorithmic reasoning.
 
 
 
 
 
 
56
 
57
+ The project explores how a relatively compact neural language model can develop useful code-generation capabilities through carefully structured multi-stage training.
58
 
59
+ 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.
60
+
61
+ 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.
62
+
63
+ The reported training curriculum encompasses approximately 29.8 billion cumulative tokens, culminating in a 6-billion-token instruction-tuning stage.
64
+
65
+ The resulting model is specialized for code generation and programming-oriented tasks rather than unrestricted general-purpose intelligence.
66
+
67
+ Project Objectives
68
+
69
+ The development of WIUAI.Mini.Coder explores five central objectives:
70
+
71
+ 1. Building a compact language model entirely from scratch.
72
+ 2. Developing programming capabilities through dedicated code pretraining.
73
+ 3. Combining general-language, code, and mathematical training.
74
+ 4. Improving instruction-following behavior through supervised fine-tuning.
75
+ 5. Investigating the relationship between training scale, model size, and coding performance.
76
+
77
+ 2. Model Specifications
78
 
79
+ Specification Configuration
80
+ Model name WIUAI.Mini.Coder
81
+ Developer WithIn Us AI
82
+ Model family WIUAI Mini
83
+ Architecture LLaMA-style causal decoder
84
+ Total parameters Approximately 303M
85
+ Hidden dimension 768
86
+ Transformer layers 24
87
+ Attention heads 8
88
+ Key/value heads 8
89
+ Attention type Standard MHA
90
+ Intermediate dimension 3,072
91
+ Vocabulary size 49,152
92
+ Tokenizer BigCode StarCoder
93
+ Maximum context 1,024 tokens
94
+ Training initialization From scratch
95
+ Final training stage Stage 4.1 EOS-corrected SFT
96
+ Reported cumulative tokens Approximately 29.8B
97
+ Final SFT token budget Approximately 6B
98
+ Training precision bfloat16
99
+ Optimizer AdamW XLA
100
+ Training hardware TPU v4-32
101
+ Training program Google TPU Research Cloud
102
+ License Apache 2.0
103
 
104
+ 3. Architecture
105
+
106
+ WIUAI.Mini.Coder uses a LLaMA-style autoregressive decoder with standard Multi-Head Attention (MHA).
107
+
108
+ The architecture is designed around a relatively deep but compact transformer configuration.
109
+
110
+ 3.1 Transformer Configuration
111
 
 
112
  LlamaConfig(
113
+ vocab_size=49152,
114
+ hidden_size=768,
115
+ num_hidden_layers=24,
116
+ num_attention_heads=8,
117
+ num_key_value_heads=8,
118
+ intermediate_size=3072,
119
+ max_position_embeddings=1024,
120
  )
 
 
 
 
 
 
 
 
 
 
 
121
 
122
+ 3.2 Architectural Components
123
 
124
+ Causal Self-Attention
125
 
126
+ The model uses standard multi-head causal attention to process contextual information while respecting autoregressive generation constraints.
 
 
 
 
 
127
 
128
+ Feed-Forward Networks
129
 
130
+ Each transformer layer incorporates feed-forward processing with a configured intermediate dimension of 3,072.
131
 
132
+ Token Embeddings
133
 
134
+ The model uses a 49,152-token vocabulary based on the BigCode StarCoder tokenizer.
 
 
 
 
 
 
 
135
 
136
+ Autoregressive Generation
137
 
138
+ The decoder predicts subsequent tokens based on previously processed context, enabling code completion and natural-language generation.
139
 
140
+ 3.3 Architecture Design
141
 
142
+ The architectural configuration prioritizes:
 
143
 
144
+ * Compact parameter allocation.
145
+ * Deep transformer processing.
146
+ * Code-oriented tokenization.
147
+ * Autoregressive language modeling.
148
+ * Efficient accelerator-based training.
149
 
150
+ 4. Tokenizer
 
151
 
152
+ WIUAI.Mini.Coder uses the bigcode/starcoder tokenizer.
153
 
154
+ The vocabulary contains 49,152 tokens.
155
 
156
+ The tokenizer was selected for its suitability for programming languages and source-code representation.
 
 
157
 
158
+ This design supports the model’s code-specialization objectives by using a vocabulary developed for code-oriented language modeling.
 
159
 
160
+ The tokenizer is an important part of the model architecture and should remain consistent between training, evaluation, and inference.
 
161
 
162
+ 5. Four-Stage Training Curriculum
163
+
164
+ WIUAI.Mini.Coder was developed through a four-stage training curriculum.
165
+
166
+ The curriculum gradually introduces general language knowledge, programming, mathematical material, and instruction-oriented supervision.
167
+
168
+ The reported cumulative training budget is approximately 29.8 billion tokens.
169
+
170
+ Stage 1 — Linguistic Foundation
171
+
172
+ 6.3 billion tokens
173
+
174
+ Dataset: HuggingFaceFW/fineweb-edu
175
+
176
+ Objective: General English grounding.
177
+
178
+ This stage establishes the initial language-modeling foundation.
179
+
180
+ The objective is to develop basic linguistic representations and general text-prediction capabilities before introducing specialized programming data.
181
+
182
+ Measurement Loss
183
+ Initial loss 10.87
184
+ Final loss 2.58
185
+
186
+ Stage 2 — Code Specialization
187
+
188
+ 7.5 billion tokens
189
+
190
+ Datasets:
191
+
192
+ * nvidia/Nemotron-Pretraining-Code-v1
193
+ * bigcode/starcoderdata
194
+
195
+ Reported mixture:
196
+
197
+ * 60% Nemotron synthetic code.
198
+ * 40% StarCoderData.
199
+
200
+ Objective: Code syntax, programming patterns, and algorithmic reasoning.
201
+
202
+ This stage introduces dedicated programming knowledge and source-code prediction.
203
+
204
+ The combination of synthetic programming material and real-world code data provides two complementary training sources.
205
+
206
+ Measurement Loss
207
+ Initial loss 5.00
208
+ Final loss 1.25
209
+
210
+ Stage 3 — Mathematics and Knowledge
211
+
212
+ 10 billion tokens
213
+
214
+ Datasets:
215
+
216
+ * nvidia/Nemotron-CC-Math-v1
217
+ * HuggingFaceFW/finewiki
218
+ * open-web-math/open-web-math
219
+
220
+ Objective: Mathematical reasoning, factual knowledge, and broader problem-solving foundations.
221
+
222
+ This stage expands the training distribution beyond programming syntax.
223
+
224
+ The intention is to improve the mathematical and informational foundations that support algorithmic problem solving.
225
+
226
+ Measurement Loss
227
+ Initial loss 2.77
228
+ Final loss 1.55
229
+
230
+ Stage 4.1 — EOS-Corrected Supervised Fine-Tuning
231
+
232
+ Final checkpoint
233
+
234
+ 6 billion tokens
235
+
236
+ Datasets:
237
+
238
+ * nvidia/Nemotron-Pretraining-SFT-v1
239
+ * nvidia/OpenCodeInstruct
240
+ * nvidia/OpenMathInstruct-2
241
+
242
+ Objective: Instruction following, code generation, mathematical instructions, and assistant-response alignment.
243
+
244
+ This stage represents the final instruction-tuning phase of the reported training curriculum.
245
+
246
+ A critical EOS token handling issue identified in earlier versions was corrected.
247
+
248
+ The corrected checkpoint is intended to improve generation termination behavior and instruction-oriented output handling.
249
+
250
+ Measurement Loss
251
+ Initial loss 1.73
252
+ Final loss Approximately 0.70
253
+
254
+ Training Curriculum Summary
255
+
256
+ Stage Training tokens Primary focus
257
+ Stage 1 6.3B Language foundation
258
+ Stage 2 7.5B Code specialization
259
+ Stage 3 10.0B Mathematics and knowledge
260
+ Stage 4.1 6.0B Instruction fine-tuning
261
+ Total 29.8B Complete curriculum
262
+
263
+ The stage token budgets represent cumulative training exposure as reported in the original project documentation, not unique dataset token counts.
264
+
265
+ Loss values are stage-specific training measurements and should not be directly interpreted as comparable measures of capability across different data distributions.
266
+
267
+ 6. Coding Performance
268
+
269
+ WIUAI.Mini.Coder Stage 4.1 was evaluated on HumanEval and MBPP.
270
+
271
+ The reported results are:
272
+
273
+ <grid columns={2} gap={3}>
274
+ <grid-item>
275
+ <box border radius="lg" padding={3} gap={1}>
276
+ <title size="2xl" color="success" tabularNums>27.4%</title>
277
+ **HumanEval pass@1**
278
+ <text color="secondary" size="xs">Zero-shot</text>
279
+ </box>
280
+ </grid-item>
281
+ <grid-item>
282
+ <box border radius="lg" padding={3} gap={1}>
283
+ <title size="2xl" color="success" tabularNums>31.0%</title>
284
+ **MBPP pass@1**
285
+ <text color="secondary" size="xs">Three-shot</text>
286
+ </box>
287
+ </grid-item>
288
+ </grid>
289
+
290
+ 6.1 Comparative Results
291
+
292
+ Model Parameters HumanEval MBPP
293
+ WIUAI.Mini.Coder Stage 4.1 303M 27.4% 31.0%
294
+ TinyLlama-1.1B 1.1B ~26.4% ~27.6%
295
+ MPT-1B-Instruct 1.0B ~22.0% ~25.0%
296
+ Zephyr-1.3B-SFT 1.3B 31.0% 34.0%
297
+ Mistral-7B-Base 7B 30.5% 47.5%
298
+
299
+ 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.
300
 
301
+ 6.2 Parameter Efficiency
302
+
303
+ At approximately 303 million parameters, WIUAI.Mini.Coder is substantially smaller than the larger models in the comparison.
304
+
305
+ Its reported HumanEval result is particularly interesting when considered against the TinyLlama-1.1B and MPT-1B-Instruct results.
306
+
307
+ The model demonstrates that meaningful code-generation performance can be explored within a sub-500M parameter budget.
308
+
309
+ It does not establish universal superiority over larger models.
310
+
311
+ 7. Broader Evaluation
312
+
313
+ In addition to code-generation benchmarks, the model was evaluated on mathematical, knowledge, and reasoning tasks.
314
+
315
+ Domain Benchmark Evaluation Score
316
+ Coding HumanEval pass@1, zero-shot 27.4%
317
+ Coding MBPP pass@1, three-shot 31.0%
318
+ Mathematics GSM8K Exact match, zero-shot 4.55%
319
+ Language modeling WikiText-2 Perplexity 167.6
320
+ Reasoning ARC-Easy Accuracy normalized 34.6%
321
+ Reasoning ARC-Challenge Accuracy normalized 22.8%
322
+ Commonsense HellaSwag Accuracy normalized 28.3%
323
+
324
+ Evaluation Methodology
325
+
326
+ HumanEval and MBPP were evaluated using manual generation and evaluation procedures.
327
+
328
+ Reported generation configuration:
329
+
330
+ * Maximum new tokens: 512.
331
+ * Temperature: 0.2.
332
+ * HumanEval: zero-shot.
333
+ * MBPP: three-shot.
334
+
335
+ The original project documentation identifies SFT formatting and truncation issues in the lm-eval evaluation pathway, which motivated the alternative evaluation procedure.
336
+
337
+ Consequently, these results should not be assumed to be directly interchangeable with results from standardized evaluation harnesses.
338
+
339
+ 8. Known Limitations
340
+
341
+ WIUAI.Mini.Coder is a specialized compact model, and its limitations are important when selecting deployment scenarios.
342
+
343
+ 8.1 General-Purpose Language Understanding
344
+
345
+ The model prioritizes programming and code-related tasks.
346
+
347
+ Its performance on general conversation, broad factual reasoning, and unrestricted language tasks may be limited.
348
+
349
+ 8.2 Mathematical Reasoning
350
+
351
+ The reported GSM8K result is 4.55%.
352
+
353
+ This indicates substantial limitations in complex mathematical reasoning despite the inclusion of mathematical training data.
354
+
355
+ 8.3 Context Length
356
+
357
+ The model was trained using a maximum sequence length of 1,024 tokens.
358
+
359
+ Long source files, extensive instructions, and large contextual inputs may exceed its effective training regime.
360
+
361
+ 8.4 Tokenizer Specialization
362
+
363
+ The StarCoder tokenizer is optimized for code-oriented language modeling.
364
+
365
+ Its tokenization behavior may be less efficient for general prose and other text distributions.
366
+
367
+ 8.5 Generation Reliability
368
+
369
+ Generated code may contain:
370
+
371
+ * Syntax errors.
372
+ * Incorrect assumptions.
373
+ * Logical mistakes.
374
+ * Missing edge-case handling.
375
+ * Incomplete implementations.
376
+
377
+ All generated code should be executed and tested before use in production systems.
378
+
379
+ 9. Recommended Applications
380
+
381
+ WIUAI.Mini.Coder is particularly suited to experimentation with compact programming models.
382
+
383
+ Potential applications include:
384
+
385
+ Code Generation
386
+
387
+ * Python functions.
388
+ * Algorithm implementation.
389
+ * Small programming tasks.
390
+ * Code completion.
391
+
392
+ Programming Education
393
+
394
+ * Basic programming explanations.
395
+ * Example generation.
396
+ * Programming exercises.
397
+ * Algorithm demonstrations.
398
+
399
+ Compact AI Systems
400
+
401
+ * Lightweight coding components.
402
+ * Local model experiments.
403
+ * Specialized coding agents.
404
+ * Research into small-model efficiency.
405
+
406
+ Multi-Agent Architectures
407
+
408
+ 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.
409
+
410
+ Its limitations should be accounted for when assigning responsibilities within an agent architecture.
411
+
412
+ 10. Usage
413
+
414
+ The model uses a User: / Assistant: dialogue format.
415
+
416
+ Transformers Inference
417
+
418
+ import torch
419
+ from transformers import AutoTokenizer, AutoModelForCausalLM
420
+ MODEL_ID = "YOUR_HF_USERNAME/WIUAI.Mini.Coder"
421
+ device = "cuda" if torch.cuda.is_available() else "cpu"
422
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
423
+ model = AutoModelForCausalLM.from_pretrained(
424
+ MODEL_ID,
425
+ torch_dtype=torch.bfloat16
426
+ ).to(device)
427
+ model.eval()
428
+ prompt = """User: Write a Python function that
429
+ checks whether a number is prime.
430
+ Assistant:"""
431
+ inputs = tokenizer(
432
+ prompt,
433
+ return_tensors="pt"
434
+ ).to(device)
435
+ with torch.inference_mode():
436
  outputs = model.generate(
437
  **inputs,
438
  max_new_tokens=512,
439
+ temperature=0.2,
440
+ do_sample=True,
441
  eos_token_id=tokenizer.eos_token_id,
442
  pad_token_id=tokenizer.eos_token_id,
443
  )
444
+ generated = outputs[0][inputs["input_ids"].shape[-1]:]
445
+ print(
446
+ tokenizer.decode(
447
+ generated,
448
+ skip_special_tokens=True
449
+ )
450
+ )
451
 
452
+ Replace YOUR_HF_USERNAME/WIUAI.Mini.Coder with the actual published repository ID.
 
453
 
454
+ For CPU inference, use an appropriate supported precision rather than assuming bfloat16 is supported by the hardware.
455
 
456
+ 11. Training Infrastructure
457
 
458
+ The reported training configuration used:
459
 
460
+ Component Configuration
461
+ Accelerator Google TPU v4-32
462
+ Training program TPU Research Cloud
463
+ Precision bfloat16
464
+ Optimizer AdamW XLA
465
+ Model initialization Random initialization
466
+ Training architecture LLaMA-style decoder
467
+ Tokenizer StarCoder
468
+ Total parameters 303M
469
 
470
+ The project acknowledges support from Google’s TPU Research Cloud program.
 
 
 
 
 
 
 
 
471
 
472
+ 12. Research Significance
473
 
474
+ 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.
475
 
476
+ Its development combines:
 
 
477
 
478
+ * From-scratch initialization.
479
+ * General-language pretraining.
480
+ * Dedicated code specialization.
481
+ * Mathematical and knowledge training.
482
+ * Large-scale supervised fine-tuning.
483
+ * EOS token correction.
484
+ * Code-generation evaluation.
485
 
486
+ The reported results provide a useful experimental reference for investigating how smaller models can allocate their training budget toward specialized capabilities.
487
 
488
+ The project also highlights the importance of training methodology and data composition when developing models with limited parameter capacity.
 
 
 
 
 
 
 
 
 
489
 
490
+ 13. Acknowledgements
491
+
492
+ WIUAI.Mini.Coder was developed with reported support from the Google TPU Research Cloud (TRC) program.
493
+
494
+ The project acknowledges the researchers and organizations responsible for the datasets used throughout the training curriculum, including:
495
 
496
+ * Hugging Face.
497
+ * NVIDIA.
498
+ * BigCode.
499
+ * Open Web Math.
500
+
501
+ Their open research contributions provide valuable resources for language-model development.
502
+
503
+ 14. License
504
+
505
+ WIUAI.Mini.Coder is released under the Apache License 2.0, as specified by its model repository metadata.
506
+
507
+ Users should independently review upstream dataset licenses and applicable redistribution requirements.
508
+
509
+ 15. Citation
510
+
511
+ @misc{WIUAI_Mini_Coder,
512
+ title = {
513
+ WIUAI.Mini.Coder:
514
+ A 303M-Parameter Code Language Model
515
+ Trained from Scratch
516
+ },
517
+ author = {Da Silva, Ilan},
518
+ year = {2025},
519
+ url = {
520
+ https://huggingface.co/WIUAI.Mini.Coder
521
+ },
522
+ note = {
523
+ Trained with Google TPU Research Cloud support
524
+ }
525
+ }
526
 
527
+ 16. Model Summary
528
+
529
+ Category Description
530
+ Model WIUAI.Mini.Coder
531
+ Model category Code-specialized LLM
532
+ Parameters 303M
533
+ Architecture LLaMA-style causal decoder
534
+ Layers 24
535
+ Hidden dimension 768
536
+ Attention 8-head MHA
537
+ Vocabulary 49,152
538
+ Tokenizer StarCoder
539
+ Context length 1,024
540
+ Training initialization From scratch
541
+ Training curriculum Four stages
542
+ Total reported tokens 29.8B
543
+ Final SFT 6B tokens
544
+ HumanEval 27.4%
545
+ MBPP 31.0%
546
+ Training hardware TPU v4-32
547
+ License Apache 2.0
548
+
549
+ ⸻
550
+
551
+ WIUAI.Mini.Coder — 303M
552
+
553
+ Purpose-built. Trained from scratch. Specialized for code.
554
+
555
+ WithIn Us AI
556
+
557
+ Exploring the potential of compact, specialized artificial intelligence through architecture, training, and research.