BubblSpace MoE-0.9B-A0.2B

Building a small language model from scratch, in the open.

BubblSpace is AIEdx’s open research project. We built a 915M-parameter mixture-of-experts model, pretrained its English base on 10B tokens, and completed another 12B tokens of continual pretraining on English, code, tool use, and entity binding. Phase 2.5 added knowledge and relations and stretched the context window from 2,048 to 16,384 tokens. Supervised fine-tuning and a first round of reinforcement learning then turned it into a chat and tool-calling model.

Total budget
$1,000
Total budget
Tokens of pretraining
~40B
Tokens of pretraining
GPU for training
1 H100
GPU for training
Context window
16k
Context window
Phase 2 final · step 22,888BubblSpace MoE-0.9B-A0.2B is ahead of OLMo-2 1B on WinoGrande twin pairsBoth twins right: 18.3% vs 17% for OLMo-2 1B · Written right: 1.8% vs 1%

Architecture

16 pre-norm transformer blocks. Each has grouped-query attention (16 query heads sharing 4 key/value heads, QK-norm before RoPE, and a sigmoid output gate) and a routed mixture-of-experts layer that sends every token to 8 of 64 small SwiGLU experts. That’s 915M parameters in total, of which 211M are used per token.

BubblSpace MoE-0.9B-A0.2B architecture: tied embedding, 16 pre-norm transformer blocks (ZeroCenteredRMSNorm, grouped-query attention with 16 query and 4 key/value heads, per-head QK-norm before RoPE and a sigmoid output gate; a routed MoE layer with 64 SwiGLU experts of 1,024 → 256 → 1,024, an FP32 softmax router, top-8 renormalized, no shared experts), a final norm, and a tied LM head
Each token passes through 16 blocks of attention and a 64-expert layer that runs 8 experts. Drawn from the model code; vocabulary padding, the document mask and router losses are left out. View full size

Models, datasets, and checkpoints

  • Inference weights

    The main branch serves the chat model: Phase 4 RL v1, step 500, with a 16k context and a chat template. The base model, Phase 2.5b final, is on the phase25b-step2861-tokens39B branch, and every SFT and RL checkpoint has its own branch.

  • Full training states

    18 checkpoints, from Phase 1 to RL v1 step 500, each with the weights, optimizer, learning-rate scheduler, and random-number generator state. The RL branches also carry every rollout, and the training logs are included.

  • BubblSpace collection

    Find the model, training states, contrastive binding dataset, and all 222,088 Wikipedia-grounded relational passages, now fully released, in one place.

    The FirstBreakAI notebooks folder includes the latest relational dataset EDA notebook comparing v3 and v4.

The training journey

  1. Model and training stack

    Built the model

    We implemented the architecture and training pipeline from scratch, and extended SmolLM2's tokenizer with 12 tokens for code infilling, tool calls and reasoning. The model routes each token through 8 of 64 experts, using roughly 211M of its 915M parameters per token.

  2. Phase 1 · Complete

    Trained the English base

    We pretrained on 10B FineWeb-Edu tokens on one H100 and released the final checkpoint at step 19,073. The model could write fluent English but still struggled to associate facts and attributes with the right entities.

  3. Phase 2 · Complete

    Continued into code and tool use

    Phase 2 finished on November 23, 2026, at step 22,888 after 12B more tokens and about 39 hours and 50 minutes on one H100. During the final 2B tokens, the learning rate fell and the mix shifted toward tool use and entity binding.

  4. Phase 2.5 · Complete

    Added knowledge and long context

    Phase 2.5a added 15.6B tokens of factual text, relations, and code. Phase 2.5b then extended the context window from 2,048 to 16,384 tokens over 1.5B more tokens, for 39B in total.

  5. Phase 3 SFT · Complete

    Taught it to chat and call tools

    Supervised fine-tuning on about 0.8B tokens of chat, function calling, agent traces, and step-by-step maths turned the base model into an assistant. It answers directly, stops at the end of its turn, and makes parallel tool calls.

  6. Phase 4 RL v1 · Complete

    Rewarded answers a program can check

    500 steps of GRPO with verifiable rewards, in 1 hour 40 minutes on one H100. Tool calling, instruction following, and maths improved, harmless prompts stopped being refused, and English held steady.

Training roadmap

  1. Phase 1 · Done

    English base

    Learns the language itself.

  2. Phase 2 · Done

    Coding + agentic

    Code and agent-style tasks. It now writes working Python.

  3. Phase 2.5 · Done

    More knowledge, longer context

    More facts and relations, better code, and a context window eight times longer: 16,384 tokens.

    • Factual data
    • Relational data
    • 16k context
  4. Phase 3 · Done

    SFT: instruction following

    Chat, tool calling, agent traces, and step-by-step maths: 1,500 steps, about 0.8B tokens, at 16,384 tokens.

  5. Phase 4 · RL v1 done

    RL: reinforcement learning

    500 GRPO steps with rewards a program can check: maths, time problems, instruction constraints, code in a sandbox, tool calls, binding, and refusal balance.

    • Verifiable rewards
    • Tool calls
    • Instructions
  6. Next · Deciding

    More knowledge or a bigger RL round

    RL sharpens what the model already knows; it can’t add facts. The benchmarks decide which comes first: a knowledge round from the base model, or a larger RL run. Still to run on the RL model: 8 samples per question, the long-context tests, and the hand tests against OLMo-2 1B.

Context window

8× longer

Phases 1–2.5a · 2,048 tokens
Since Phase 2.5b · 16,384 tokens
Passkey: find a number hidden in the text. 2-hop: chain two facts placed far apart. Loss: lower deeper into a document means the model uses earlier context.
CheckpointPasskey 4kPasskey 16k2-hop 4k2-hop 16kLoss 1–2k / 8–16k
Phase 2 final (trained at 2k)15%0%0%0%2.60 / 4.26
Phase 2.5b, step 1,00062%35%21%8%2.52 / 2.27
Phase 2.5b, step 2,00072%45%21%17%2.50 / 2.25
Phase 2.5b final (step 2,861)70%48%29%17%2.49 / 2.24

The model uses the extra context: its loss keeps falling deeper into a document, to 2.24 at 8k–16k tokens, where Phase 2 final rose to 4.26. Retrieval works well up to 8k and about half the time at 16k.

What fine-tuning and RL changed

Supervised fine-tuning turned the base model into an assistant that answers directly, picks the right tool, and makes parallel calls. Then 500 steps of reinforcement learning, where the model answers each task 8 times and plain code checkers score every answer, sharpened it further. Tool calling went past both fine-tuning runs, and the model got a passive sentence right for the first time (“The letter was written by Maya… who wrote it?” → Maya).

Over-refusal, fixed. The first fine-tuning run refused harmless requests like “give me the capital of India”: 9 of 45 in our check. Rebalanced refusal data brought that to 1, and after RL the model answers all 45, while still refusing harmful requests and saying when it has no live data.

The SFT model that RL started from compared with RL v1 step 500, the model on Hugging Face main. Same harness for both; BFCL has 100 questions per category, so ±5 points is noise.
EvaluationAfter SFTAfter RL v1
Function calling, BFCL simple / multiple / parallel63 / 36 / 2471 / 43 / 40
Knows when no tool is needed (BFCL)56.269.6
Instruction following, IFEval prompt / instruction23.1 / 36.029.6 / 43.5
Grade-school maths, GSM8K9.6%12.4%
HumanEval / MBPP pass@115.2% / 21.8%16.5% / 22.2%
Harmless prompts refused (of 45)10
Harmful requests refused (of 8)87
Honest about having no live data (of 8)78
English benchmark average (forgetting check)47.9148.00

Maths stays weak: before RL, the model never solved 81% of maths tasks in 8 tries, a knowledge gap that rewards alone can’t fix. The one harmful request it didn’t refuse, it discouraged without a refusal phrase.

What Phase 2.5a showed

English, knowledge, code and binding all finished above Phase 2; function calling shifted from simple to multiple calls. The decay started early, at step 24,000, with a mix that shifted toward code, tool calling, math and narrative English, plus contrastive data that alternates word order. The held-out binding probe, which includes passive sentences, rose from 10 to 54 out of 120.

Phase 2 final (step 22,888) compared with Phase 2.5a final (step 29,723).
EvaluationPhase 2 finalPhase 2.5a final
English benchmark average (6 tasks)46.9247.88
ARC-Easy / ARC-Challenge54.1 / 28.657.4 / 31.1
Closed-book TriviaQA / NQ11.6% / 3.9%15.8% / 4.5%
HumanEval / MBPP pass@114.6% / 18.2%15.2% / 20.6%
Function calling (BFCL simple / multiple / parallel)25 / 17 / 116 / 26 / 0
Bits per byte on post-cutoff English / code (lower is better)0.913 / 0.6960.897 / 0.690
Held-out binding probe v5 (new sentence structures, incl. passive)10/12054/120
Read the Phase 2.5a chapter

What Phase 2 showed

Code generation scores rose through the final checkpoint. During the cooldown, binding improved on new names and phrasings, from 17 to 82 out of 112 on probe v4. On the separate test for new sentence structures, the score moved from 4 to 6 out of 70.

Phase 1 final compared with the latest recorded Phase 2 result for each evaluation.
EvaluationPhase 1 finalPhase 2
Code output prediction (CRUXEval-O pass@1)0.0%17.7%Step 19,000
Code generation (HumanEval pass@1)0.0%14.6%Step 22,888
Python programming tasks (MBPP pass@1)—18.2%Step 22,888
Valid call with the expected tool name (23 held-out episodes)0%39.1%Step 21,000
English benchmark average (6 tasks)47.1846.65Step 21,000
Held-out entity binding (probe v4, chance ≈ 28/112)13/11282/112Step 21,000
Browse Phase 2 benchmark files

BubblSpace MoE-0.9B-A0.2B is ahead of OLMo-2 1B on WinoGrande twin pairs

With 211M active parameters and 22B tokens, the Phase 2 final checkpoint is ahead of OLMo-2 1B and Pythia 410M–1.4B at the same token count. It matches OLMo-2 1B at 42B tokens, so it reaches the same score with about half the tokens.

Research shows that language models pass through two habits before they learn to pick the right entity. Chan, Huang, Elazar and Geiger (2026) traced three phases in entity comparison. We test whether the same phases show up when a model has to bind a property to a name inside one sentence.

  1. 1. Frequency

    Picks whichever answer is more common in its training data, whatever the sentence says.

    How it shows up: Same answer for both twins, so pair scores fall below 25% chance.

  2. 2. Position

    Picks a name by where it sits in the sentence: the first-mentioned one, or the last-mentioned one, nearest the blank.

    How it shows up: Still the same name for both twins. What it writes leans first or last.

  3. 3. Binding

    Reads the sentence and picks the name the property actually belongs to.

    How it shows up: Pair scores rise well above 25%, then the model starts writing the right name.

Every model here, BubblSpace included, is still in the habit phase at this token count, and the gap is within noise on 284 pairs. The research note has the scoring, what we have and haven’t observed, and the full table.

How we train and evaluate

Profiling showed that the H100 was spending time waiting for data. Loading batches in the background raised smoke-test throughput from roughly 69–71k to 85.5k tokens per second, moving the projected Phase 2 run time from about 48 to 39 hours.

We made evaluation deterministic so repeated runs give the same scores, and added per-layer routing inspection to see which experts handle different kinds of input as training progresses.

Recent Research Notes

All notes
WSD vs. cosine decay learning rate for Phase 2: continual pretraining

Phase 2 · Modeling·Continual pretraining means starting the next phase of training from a cooled checkpoint. A cosine decay learning-rate schedule is best suited for fixed-budget training. Phase 2 has a mix of code, agentic, and English data. What’s the best move for Phase 2? Should we continue with cosine decay or use WSD?

Team

Amardeep Singh Sidhu

Founder & AI Researcher

First-principles builder and researcher behind AIEdx and the BubblSpace MoE pretraining runs.

Join BubblSpace on Discord

Running a checkpoint? Bring a prompt, an eval result, or a failure case, or follow what comes after the first RL round.

Join BubblSpace Discord

For direct collaboration, contact AIEdx.