Kunwu-1-Wei-Pro-Base - an ultra-compact 3 million parameter language model
2 min read
This model by Kiln Labs was trained from scratch on 6.30 billion tokens of English and math text. At just 2.97 million parameters (using the WeiNet-v3-Pro architecture), it handles basic grammar, text generation, and school-level arithmetic. Features include unique non-recurrent layers, a custom tokenizer, and optimized attention blocks. The model is useful for researchers, developers, and hobbyists looking to run miniature language models locally on low-end hardware.
Key features
- Compactness: only 2.97M parameters in FP32 without weight sharing between layers.
- WeiNet-v3-Pro architecture: uses Apple XSA, QK-Norm, Half-RoPE, and ReLU² blocks for efficient text processing.
- Clean data training: a 6.30B token corpus featuring deduplication and spam removal.
- Tokenizer: a custom Byte-Level BPE with forced separation of digits 0 through 9.
What you can do
- Local run: test text generation on a PC or laptop with minimal hardware requirements.
- Research: study the behavior of ultra-small language model architectures featuring custom attention layers.
- Fine-tuning: fine-tune the model on your own specialized or educational datasets.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "eThAn18594/Kunwu-1-Wei-Pro-Base"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
trust_remote_code=True,
torch_dtype=torch.float32,
).eval()
prompt = "Once upon a time, a little fox found"
inputs = tokenizer(prompt, return_tensors="pt")
input_ids = torch.cat(
[torch.tensor([[tokenizer.bos_token_id]]), inputs["input_ids"]], dim=1
)
with torch.no_grad():
out = model.generate(
input_ids,
max_new_tokens=64,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.15,
)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Read more
DetailsBenchmarks: ArithMark-3 72.50%, PIQA 54.84%, HellaSwag 28.09%.
Hardware requirements: minimal VRAM/RAM usage due to the tiny size (2.97M parameters).
Limitations: unaligned base model is prone to hallucinations on open prompts; requires sampling or a repetition penalty.
Training details: hybrid Muon + AdamW optimizer, 10 unique layers, 1024 token context.










Comments