MiniGPT3-22M

MiniGPT3 is a tiny hybrid Mamba2 + attention language model trained from scratch by UltraLabs (SmallAICreator). It follows MiniGPT2 and uses the NVIDIA Nemotron-H layer layout, so it loads with transformers (NemotronHForCausalLM) and runs in llama.cpp (nemotron_h) on phones.

Parameters 27.0M total: 16.5M "brain" (non-embedding) + 10.5M embeddings (untied, 16K vocab)
Layers 24: 9 × Mamba2, 3 × attention, 12 × ReLU² MLP (pattern M-M-*-M-M-M-*-M-M-M-*-M-)
Width d_model 320, MLP 1280, Mamba2 10 heads × 64 (state 64), attention 5 query / 1 KV heads × 64
Positions none (the Mamba2 layers carry order; attention has no positional encoding)
Vocab 16,384 byte-level BPE (the MiniGPT2 tokenizer)
Context 2,048 tokens (trained)
Pretraining 37.7B tokens

Files

Folder / file What it is
final/ The chat model: pretraining + SFT + DPO. Use this one.
sft/ Pretraining + SFT, before DPO
pretrain-final/ The base model after the full cosine decay (continues text, doesn't chat)
MiniGPT3-22M-F16.gguf final/ for llama.cpp / phone apps (54.7 MB)
MiniGPT3-22M-pretrain-final-F16.gguf pretrain-final/ for llama.cpp (base, text completion)
checkpoint/, pretrain-s1/ Training checkpoint and the session-1 (undecayed) base

Training

  • Pretraining (JAX): session 1 on a Kaggle TPU v5e-8 at peak LR (36B tokens), then a cosine decay to 2% on 2× T4 (1.7B tokens). The second half of the decay blends in a knowledge/maths anneal mix: synthetic arithmetic, FineMath, MegaMath, WebInstructSub, Cosmopedia, Wikipedia, TinyStories and wikiHow. Muon + AdamW optimizers.
  • SFT: 489 steps on smol-smoltalk (67%), Tulu 3 (28%), distilled answers (5%) and an identity set.
  • DPO: 195 steps on Anthropic hh-rlhf preference pairs.

Benchmarks

lm-evaluation-harness 0.4.13, 0-shot, fp32, HF backend. The average uses arc_e acc_norm, arc_c acc_norm, hellaswag acc_norm, lambada_openai acc, piqa acc_norm and winogrande acc.

Model Brain (non-emb.) ARC-E ARC-C HellaSwag LAMBADA PIQA WinoGrande Avg
MiniGPT3-22M final 16.5M 37.16 22.01 28.73 24.72 58.38 49.80 36.80
MiniGPT3-22M pretrain-final 16.5M 36.28 22.27 28.84 26.30 57.89 49.17 36.79
MiniGPT2-22M 15.7M 40.0 23.1 28.2 23.1 58.1 50.0 37.08
TinyBrainBot-25M v4 base 25.2M 42.09 24.91 28.86 22.78 60.23 52.57 38.57

All rows were run on the same harness and settings (TinyBrainBot re-run on 2026-11-24, reproducing its earlier 38.6).

  • LAMBADA (predicting the next word from the whole passage) is MiniGPT3's strength: +3.5 over TinyBrainBot and +3.2 over MiniGPT2, with a brain ~1.5x smaller than TinyBrainBot's. It writes noticeably more fluent text than both.
  • HellaSwag is a tie with TinyBrainBot (28.84 vs 28.86). TinyBrainBot leads on the knowledge/reasoning tasks (ARC, PIQA, WinoGrande), which puts it 1.8 points ahead on the average.
  • For scale: Pythia-70M (~19M brain) averages 36.57 on the same six tasks.

Usage

transformers

from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("SmallAICreator/MiniGPT3-22M", subfolder="final")
model = AutoModelForCausalLM.from_pretrained("SmallAICreator/MiniGPT3-22M", subfolder="final")
msgs = [{"role": "user", "content": "Write a haiku about the ocean."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=80, do_sample=True, temperature=0.7, top_p=0.9)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))

llama.cpp / phone: load MiniGPT3-22M-F16.gguf in any llama.cpp-based app with Nemotron-H support (for example L-AI). The chat template is embedded in the file.

Chat format: <|user|>…<|end|><|assistant|>…<|end|>

Limitations

This is a 22M-parameter model. It is fluent at short text but has very little world knowledge, gets facts and arithmetic wrong, and can repeat itself. Use it for experiments, on-device demos and research on small models, not for anything that needs reliable answers.


Made by UltraLabs · SmallAICreator

Downloads last month
-
GGUF
Model size
27M params
Architecture
nemotron_h
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support