Run this model with HF Jobs

Run nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

TinyBrainBot-61M-A10M-v4.1-MoE-Base

The first mixture-of-experts TinyBrainBot and the first model of the v4.1 series. Every layer holds 16 experts and each token is routed to 2 of them, so the model stores 60.6M parameters but runs only 10.0M per token (non-embedding; plus a 3.6M tied embedding).

It was trained on exactly the same 11B tokens, in the same order, with the same schedule and tokenizer as the v4 scaling study's dense models, so the comparison below isolates one change: dense feed-forward layers vs experts. At the compute of the dense 10M it scores higher on 10 of 13 benchmarks and averages 37.5 against the dense 10M's 36.5, and it beats every model here, including the dense 25M, on MMLU, PIQA, MathQA and ARC-Challenge.

Benchmark (0-shot) MoE 61M (10M active) dense 10M dense 25M Pythia-70M Pythia-31M
ARC-Easy 42.2 40.2 42.7 36.0 33.7
ARC-Easy (raw acc) 45.1 42.8 47.3 38.2 37.2
ARC-Challenge 25.0 23.1 24.9 21.8 21.0
ARC-Challenge (raw acc) 20.4 18.9 21.0 17.6 16.6
SciQ 61.7 58.4 65.9 56.4 51.5
SciQ (raw acc) 69.4 68.8 73.7 64.0 60.0
OpenBookQA 28.6 28.2 31.2 25.4 26.8
OpenBookQA (raw acc) 16.8 15.4 17.2 12.6 13.0
MMLU 26.0 23.1 23.7 22.9 22.9
HellaSwag 36.5 35.1 37.2 33.8 33.6
HellaSwag (raw acc) 32.6 32.2 32.5 30.8 31.2
PIQA 60.8 57.3 60.2 59.2 56.6
PIQA (raw acc) 60.9 59.6 60.0 59.8 57.5
WinoGrande 51.4 51.5 52.6 52.9 49.3
Social IQa 36.4 36.1 37.2 35.4 35.1
CommonsenseQA 19.2 20.6 20.3 19.8 19.7
LAMBADA (OpenAI) 21.1 17.6 23.4 23.4 17.8
BoolQ 56.0 60.8 58.8 59.6 51.0
MathQA 23.1 21.9 21.9 20.4 19.5
MathQA (raw acc) 24.2 22.0 23.2 20.9 19.2
Average (13) 37.5 36.5 38.5 35.9 33.7
LAMBADA perplexity (lower is better) 151 311 125 129 270

EleutherAI lm-eval-harness v0.4.13, 0-shot, up to 2,000 examples per task. Each task's first row is acc_norm where the task reports it (acc otherwise); the "(raw acc)" row under it is acc. The average uses the first rows. Every model was run by us on the same harness and settings.

Quick start

It is a standard Mixtral model, so it needs no custom code:

from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)

ids = tok("Once upon a time, a little fox", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=80)       # defaults from generation_config.json
print(tok.decode(out[0], skip_special_tokens=True))

GGUF (llama.cpp, LM Studio, Ollama): tinybrainbot-61m-a10m-v4.1-moe-base-F16.gguf (129 MB). It tokenizes and generates identically to the transformers version.

llama-completion -m tinybrainbot-61m-a10m-v4.1-moe-base-F16.gguf -no-cnv -p "Once upon a time, a little fox" -n 80 --temp 0.7 --repeat-penalty 1.15

Default sampling: temperature 0.7, top_p 0.95, top_k 40, repetition_penalty 1.15.

Samples

Unedited, at the default settings.

Once upon a time, a little fox named Sammy had an idea. He wanted to create an amazing treehouse made of pebbles and stones so that it could be easily accessed by everyone.

Photosynthesis is the process by which plants absorb light energy and convert it into chemical energy.

The best way to learn a new language is to try it out. To learn a new language, you need to know the words and phrases that make up the language.

Model

Architecture Mixtral-style sparse MoE decoder: RoPE, RMSNorm, grouped-query attention, SwiGLU experts
Shape hidden 256, 14 layers, 4 heads of 64, 2 KV heads; 16 experts of width 336 per layer, top-2 routing
Parameters 60.62M non-embedding total, 10.04M active per token, + 3.58M tied embedding
Context 1,024 tokens
Vocabulary 14,000 (the v4 byte-level BPE: digits split, newlines kept, no unknown tokens)

Attention is identical to the dense 10M; only the feed-forward layer changes. Its width (672) is split into experts of half that width, and each token uses two, so a token costs exactly what it costs in the dense model while the layer stores 8x the feed-forward parameters. Routing is Mixtral's (softmax over the experts, keep the top 2, renormalise their weights), trained with a 0.01 load-balancing loss, which keeps all 16 experts in use: in a typical training batch the least-used expert still gets about half of its fair share of tokens.

Training

11.0B tokens on 2x Tesla V100 16GB, about 25.5 hours, fp16, AdamW (0.9, 0.95), weight decay 0.1, peak LR 3e-3, 131k tokens per step, warmup-stable-decay - the v4 scaling study's exact data and schedule. The expert layers run on the sigma-MoE Triton kernel (Csordas et al.), which fuses token routing into the matrix multiply.

Group Share Sources
Web 37% FineWeb-Edu 28, DCLM 9
Reference 13.5% Wikipedia article leads 12, full Wikipedia 1.5
Narrative 11% Project Gutenberg 8, BookCorpusOpen 3
Code 9% The Stack (smol) 7.5, Python/JS 1.5
Math 9% MegaMath-Web-Pro 6, FineMath-4+ 3
Synthetic textbooks 7.5% Cosmopedia (Stanford, OpenStax, auto-math)
Q&A and facts 7% distilled Q&A, short facts, cause-and-effect explanations
Educational PDFs 5.5% FinePDFs-Edu
Reasoning 0.5% distilled short reasoning

Then 500M tokens of the same mix plus 7.8% generated everyday-commonsense, procedural, worked arithmetic and short-fact writing (no benchmark data), and an 803M-token fact-dense anneal while the learning rate decays to zero.

Reproduce the benchmarks

lm_eval --model hf --model_args pretrained=nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base,dtype=float32 \
  --tasks arc_easy,arc_challenge,sciq,openbookqa,mmlu,hellaswag,piqa,winogrande,social_iqa,commonsense_qa,lambada_openai,boolq,mathqa \
  --num_fewshot 0 --limit 2000 --batch_size 8 --seed 1234

TinyBrainBot v4.1 (mixture of experts)

  • TinyBrainBot-61M-A10M-v4.1-MoE-Base (this model)

Dense comparison models: TinyBrainBot-25M-v4-Base and the v4 scaling study (500K to 25M).

Downloads last month
134
Safetensors
Model size
64.2M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base

Collections including nkthebass/tinybrainbot-61m-a10m-v4.1-moe-base

Evaluation results