WIUAI.Mini.Coder / README.md
11-47's picture
Update README.md
692a128 verified
|
Raw History Blame
16.9 kB
---
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.