Experiments on Femto
Follow-up experiments on our tiny language model testbed—scaling to 150M, going sparse with MoE, fixing broken evals, testing critics, and running RL during pretraining.
Experiments on Femto
In the Femto post, I mentioned that our 48M-parameter JAX stack had quietly turned into something more useful than a toy demo: a fast, self-contained testbed for trying out ideas end-to-end. Over the next few weeks, I used it to run a pile of follow-up experiments—partly to push Femto further, and partly to just improve my own intuition on recent work.
As with the original Femto runs, Opus 5.5 in Claude Code wrote the code, ran the jobs, analyzed logs, and built all the interactive figures below, while I picked the questions, poked at weird results, and steered what to inspect next. I don’t expect every finding at this scale to transfer to larger scale runs. At the same time it is an interesting test-bed to see where small models are less forgiving than big ones. This post should be seen as more of lab notebook of some interesting experiments on training LLMs from scratch. Each section is mostly self-contained.
| Experiment | The question |
|---|---|
| Scaling to 150M | What happens when we 3× the parameters and 10× the tokens—and what silent bugs surface? |
| Mixture of experts | Can a sparse MoE beat dense Femto in the exact same pretraining wall-clock time? |
| Better evals and post-training data | Are our benchmarks lying to us—and how bad is the model at casual chat? |
| Do we need a critic? | GRPO throws away most rollouts; can a learned value function replace big rollout groups? |
| RL during pretraining | Do recent recipes for mixing RL and pretraining hold up at 159M and 390M? |
Scaling to 150M
The most obvious next step after a 48M model trained on 10B tokens was simply to scale up. A quick shape sweep showed that, based on the throughput at this size, doubling the width beats making the model deeper. So we decided to for a 159M-parameter dense model (twice Femto’s width) and pretrained it on 97B tokens (~60 H100 hours).
Compared to the original Femto pretrain, scaling up improves metrics across the board. Held-out loss on ClimbMix drops from 0.9090 to 0.8497 bpb, general knowledge (CORE) climbs from 0.127 to 0.175, tool use (TOOL) moves from 0.304 to 0.385. Shell text becomes worse due to a change in the data-mix down-weighing it compared to the 48M recipe.
Pushing the model to 150M also uncovered some hidden bugs:
A buffer-clogging packing bug. Our data loader packs documents into 2,048-token training rows using best-fit packing from a 1,000-document buffer. This means any document longer than 2,048 tokens could never fit into any leftover gap, so it sat in the buffer forever. Over the course of training long documents accumulated until the buffer was clogged and most rows ended in a hard crop. Over 1,000 batches, 28.6% of tokens in the main mix, and 56.8% in the high-quality anneal mix were silently thrown away. Splitting long documents into row-sized chunks before packing fixed the clog and cut wasted tokens to 4.5% and 3.0%. This bug reinforced the data paranoia and increased my “just look at the data” check frequency, especially when working with an agent.
Loss spikes from split blobs. Fixing the packer immediately created a second bug, which showed up as sharp loss spikes mid-run. Because all chunks of a split document landed in consecutive rows, one big file—usually a base64 blob embedded inside a code file, such as a copy of pip’s get-pip.py—could suddenly fill 51–100% of a single training batch. Adding an opt-in spread mode that caps any one document at a single row per batch made the spikes disappear.
Decayed special-token embeddings. Finally, at step 78,630, the gradient norm exploded to 5.2e7 when the model trained on the first batch containing chat special tokens. AdamW’s weight decay had shrunk their unused embedding rows by roughly e25 since the tokens never appeared earlier in training. The spike left no measurable dent in final loss (under 0.001 bpb).
Mixture of experts
Beyond scaling up the dense model, the other obvious architecture-related direction to explore was sparsity. I stuck with a dense model for the original Femto experiments mainly for reasons of familiarity and simplicity. Once the stack was working, the next question was to explore if mixture-of-experts (MoE) version of Femto could deliver a strictly better model in the same pretraining wall-clock budget?
At frontier scale, MoEs are already the default. Below 100M active parameters, though, the result is less obvious because routing overhead hurts the throughput (this relationship has been extensively studied in early work on MoEs, and is certainly not a novel insight on my part). I had my agent read through recent tech reports and run a round of ablations to pick an architecture. The design we landed on uses 128 small experts with top-4 routing plus 1 shared expert, a sigmoid router with auxiliary-loss-free load balancing, and Muon applied per expert. That works out to 333M total parameters with 40.4M active per token.
Throughput optimization
Out of the box, JAX’s ragged_dot executed every expert on every row on GPU (latency ~200 ms per layer). Claude replaced it with a block-padded batched matmul that cut the latency to 7.2 ms per layer (vs 2.6 ms for the dense MLP). Combined with per-device dispatch, the final MoE hits 0.64× the dense model’s token throughput.
That throughput gap turns out not to matter. Given the exact same wall-clock budget on 4 A100s (the time dense Femto takes to read 2.5B tokens), the MoE sees only 1.6B tokens yet finishes easily ahead on held-out loss: 0.862 bpb versus 0.910 bpb for dense. As the sweep below shows, adding experts helps right up to 128; push to 256 or 512 under default settings, and load balancing loses control while runs overshoot the time budget.
Full pipeline and two misleading losses
Next, we pushed the 128-expert MoE through the full Femto recipe: 10B pretraining tokens, 16k context extension, mid-training, and RL. As a base model, it pulls cleanly ahead at 0.827 bpb compared to 0.909 for dense. After post-training, it wins on almost every agent benchmark—except for two suspicious-looking drops on weather and unseen terminal tasks.
Whenever a small-model curve looks weird, the best move is to open the actual transcripts. Sure enough, both regressions turned out to be quirks of our evaluation and reward setup rather than real weaknesses in the MoE:
- Weather: The entire gap came from a single held-out prompt phrasing (“Tomorrow’s maximum temperature in X, please.”), which the MoE cheerfully tried to answer by calling Wikipedia search instead of the weather tool.
- Unseen terminal tasks: RL actively broke one specific task type. Our natural-language-to-shell (
NL2SH) reward only graded the model’s first command; on a task asking to delete only empty files, the model discovered it could score well by emitting a command that deleted every file.
MoE-specific quirks and inference speedups
Two training pathologies also popped up that are worth flagging if you are building a small MoE yourself:
- Gate-normalization NaNs. Training crashed with a NaN at step 21,620 from dividing router gates by their sum. Under auxiliary-loss-free load balancing, the router can select experts whose raw sigmoid scores are nearly zero, shrinking the denominator to as little as
2e-7. Computing gates as a softmax over log-sigmoids eliminated the instability completely. - Train/inference routing mismatch in RL. Policy gradient updates assume the trainer and the inference engine route each token to the same experts. We froze the router during RL and replayed the inference engine’s routing decisions inside the trainer. In fp32 this was mostly belt-and-suspenders (~
1e-5log-prob mismatch either way), but in bf16, routing replay cut the worst-case mismatch from 0.79 down to 0.08 nats—making it essential at lower precision.
Later inference work on a larger 1B-total / 118M-active MoE also paid off nicely: fixing MoE dispatch sped up decoding 1.5–3× on an H100 and took the chat CLI on my laptop from a sluggish 4 tokens/sec to 45 tokens/sec. Almost all of that gain came from one fix: a single decoded token used to run 113 padded expert blocks and now runs just 4. We also tried speculative decoding with a 40M draft model; acceptance rates were high, but it was slower everywhere because at this scale a draft step costs nearly as much as a target step.
Better evals and post-training data
Comparing the dense and MoE models exposed an uncomfortable truth: our original evaluations were far too coarse to steer experiments reliably. The unseen-terminal suite had only 6 task types (each passing or failing wholesale under greedy decoding), weather had 10 phrasings, no-tool behavior had 8 templates, and we had zero measure of whether the model could actually hold a normal conversation.
Building a sharper evaluation suite
So we built a second-generation evaluation suite with real statistical resolution:
- Tool and agentic tasks: 48 held-out terminal task types, 174 weather templates, and 337 function-calling items.
- Reasoning and knowledge: Paraphrased QA,
NL2SH, and GSM8K sets. - Open-ended chat: 1,007 chat prompts scored from 1 to 10 by an LLM judge.
Claude Haiku drafted the items and Claude Sonnet reviewed every one, while anything with a programmatic answer was verified by code or executed directly inside our sandbox. Every suite reports cluster-bootstrap confidence intervals; folded together with measured seed and checkpoint variance, we can reliably detect differences of about 0.05 per suite.
Before trusting an LLM judge on chat, we stress-tested it against synthetic failure modes. Compared against reference replies, it heavily penalizes flawed, truncated, off-topic, looping, and sentence-shuffled answers, penalizes empty polite filler, and agrees with Sonnet at a Pearson correlation of r = 0.94. An open-model fallback we tested (Qwen3-30B-A3B) failed those sanity checks badly—scoring sentence-shuffled word salad 8.6 out of 10 and preferring the coherent reference over it only 44% of the time.
What the new evals revealed, and how better data fixed it
The sharper evals immediately rewrote our story. On 174 weather phrasings, the MoE gap flipped completely (0.170 vs. 0.084 for dense), confirming that the earlier loss was just a template fluke. Worse, the new suite caught an embarrassing failure mode our old templates had hidden: the MoE called a tool on 74% of prompts that needed no tool at all (“hey, how’s it going?” → search → “It’s 2003.”). Every model averaged roughly 2 out of 10 from the chat judge.
To fix this, I relaxed the strict no-frontier-data rule from the original Femto post and let Claude subagents generate fresh post-training data: roughly 19k mid-training and RL items written by ~90 writer agents, checked by ~45 reviewer agents, and decontaminated against the eval suites. On the RL side, we added a reward for answering directly when no tool is needed and fixed NL2SH to grade the final filesystem state instead of just the first command.
Data did almost all of the heavy lifting. Mid-training on the new dataset alone lifted the chat judge score from 1.76 to 2.59—already beating the old final model’s 2.11 before a single RL step ran—and slashed unnecessary tool calls from 74% to 16% (down to 4.5% after RL, where the chat judge reaches 2.74). We also discovered that the old RL recipe had actively broken refusals (dropping that category’s judge score from 2.63 to 1.69), which the new no-tool reward kept intact. For the final recipe, I settled on a single 900-step RL stage, trading about 0.016 CORE relative to the best two-stage run in exchange for a much simpler pipeline.
Do we need a critic?
Even when RL is making steady progress, group-relative policy optimization (GRPO)
Naturally, several recent papers have argued for bringing learned value functions (critics) back into LLM RL:
- Le Critique
trains a critic with privileged information (the reference solution) and proposes TETHER, blending the critic’s baseline with the leave-one-out group mean. - BPCO
introduces a critic stabilization recipe reported to match 16-rollout group baselines using just one rollout per prompt. - AC2
and LVRL use learned critics for finer-grained credit assignment within a response or across agentic turns.
To test whether a critic could replace large rollout groups on our 48M agent, we gave it a separate 48M critic that sees the reference solution and predicts the final binary reward at every action token. One early catch almost misled us: at a learning rate of 1e-4, the critic barely moved. Raising its learning rate to 1e-3 fixed it, and by step 100 the critic genuinely learned, explaining roughly half of the reward variance.
With 16 rollouts per prompt, however, the critic added almost nothing. TETHER’s learned weight on the critic settled at just 0.09–0.13—15 sibling rollouts on the same prompt already tell you nearly everything the critic knows. Meanwhile, two of the recipes collapsed outright in ways that cleanly illustrate how token- and turn-level critics can misfire:
- BPCO’s full recipe caused runaway generation length. Once a rollout starts rambling, the critic accurately predicts a value near zero. Under GAE, only the transition into the bad state is penalized, not the rambling tokens that follow—so the fraction of rollouts hitting the length cap jumped from 3% to 25%.
- LVRL-style anchored step advantages collapsed within 20 steps. The first turn’s value is anchored to the prompt’s empirical group mean, while an early critic predicts something close to the global mean. On any solvable prompt (where the group mean beats the global average), the opening action of every rollout—even winning ones—gets a negative advantage.
Where the critic finally earns its keep is when you shrink the rollout group—though the punchline wasn’t what I expected:
Holding the total budget at 512 episodes per step, a plain critic baseline at 1 rollout per prompt nearly matches 16-rollout GRPO (0.538 vs. 0.554/0.561 on held-out terminal tasks), reproducing BPCO’s headline claim. Yet 4-rollout GRPO with no critic at all performs just as well or better (0.571). For short 1–3 turn tool trajectories, simply shrinking the group size is the easiest way to waste fewer samples; a learned critic really only pays off when a prompt or environment reset is so expensive that you can only afford a single rollout.
RL during pretraining
The last thread started as a weekend stress-test of recent papers on blurring the boundary between pretraining and RL. Bansal et al.
Reproducing Bansal et al. at 159M and 390M
Four findings stood out from the reproduction:
- Direct RL works early. Matching the paper, running direct RL straight from the 4B-token checkpoint lifts GSM8K pass@1 from 0.8% to 19.5%.
- Direct RL does not catch up to SFT→RL by 10B tokens. Contrary to the paper, whether direct RL closes the gap depends on how capable the base model already is rather than raw token count: when plotted against the base model’s pass@32 (coverage), both 159M and 390M collapse onto a single curve.
- SFT forgets far less than reported. General-capability forgetting was at least 5× smaller than the paper’s numbers at 159M, and smaller still at 390M—ruling out my initial guess that a tiny model simply has less capability to lose.
- Parallel underweights SFT by default. The paper’s Parallel recipe (which mixes an SFT gradient and an RL gradient in every update) scales down the SFT branch by 40× at its default learning rate. Restoring the SFT learning rate yields the highest pass@32 of any recipe that sees one solution per problem, though it brings back more forgetting—mostly on short-answer benchmarks where the GSM8K
####answer format bleeds through.
MaxRL and pretraining-data replay
While those runs were still churning, Song et al.
MaxRL beats GRPO on both coverage (86.4% vs. 79.2% pass@32) and retention (+0.035 vs. +0.061 bpb increase in held-out loss). Better still, adding just 5% pretraining data to Parallel wipes out almost all of its forgetting (held-out loss increase drops from +0.189 to +0.014 bpb, and SQuAD regression shrinks from −14.0 to −1.4 points) without sacrificing its leading 87.6% pass@32.
How fast continued pretraining erases RL
Next we asked the reverse question: if you run RL mid-pretraining and then keep pretraining afterward, how fast do the RL gains survive? The short answer is: they don’t, not while the pretraining learning rate is high. Resuming pretraining after RL erases its gains almost immediately—dropping GSM8K pass@1 gains from +27.9 down to +5.7 points after just 0.1B tokens at near-peak learning rate. Even cutting the learning rate by 10× only halves the erasure speed.
We also tried interleaving MaxRL updates into the final 6B tokens of pretraining, ramping up RL density as the learning rate decays. It caused zero language-modeling degradation, but still trailed standard staged RL by about 5.5 points at equal RL compute.
Unified vs. staged training on synthetic puzzles
Finally, we replicated Song et al.’s synthetic floor-assignment puzzle benchmark—re-implemented from scratch, since the generator wasn’t released. Instead of running a separate SFT stage on reasoning traces, the unified arms mix reasoning traces straight into the final fifth of pretraining at k trace rows per 256 web rows; every arm except plain staged also mixes a few traces into each RL update.
At a comparable budget of trace tokens, unified training generalizes dramatically better to puzzles larger than anything seen during training. On the hardest 12-person out-of-distribution puzzles, pass@64 jumps from 3.0% (plain staged) and 35.6% (staged with traces in RL) all the way to 87.6% (Unified, k = 128). Even the lighter mix (k = 32) uses only 40% as many trace tokens as staged training and still beats it comfortably there (58.4%).
Takeaways
Most of these experiments ended in negative, partial, or “it’s more complicated than the headline” results. Honestly, that is what I signed up for: published recipes are almost always tuned for larger models, and a 48M–150M model is a remarkably unforgiving filter. Looking back across all five threads, three lessons keep showing up:
- Evals were the bottleneck more often than methods. Coarse benchmarks tricked us into thinking the MoE was worse at weather (it wasn’t) and hid that it was searching Wikipedia just to say hello. Building suites with measured noise immediately changed which experiments made sense to run next.
- Inspecting failures paid off every time. The MoE’s two apparent regressions, the 150M loss spikes, the half-discarded anneal mix, and the critic collapses were all solved—or understood—by opening failing transcripts and raw batches instead of guessing from aggregate loss curves.
- Small-scale reproductions are cheap, but defaults rarely transfer. Several discrepancies with published papers traced straight back to scale-sensitive defaults (a critic learning rate, a group anchor, a 40× SFT weight), and some gaps narrowed once we moved from 159M to 390M.
More broadly, being able to go from reading a new paper to a multi-arm reproduction in a day or two of mostly unattended compute makes this kind of stress test cheap enough to run routinely—and keeps your intuitions grounded in what actually happens on the cluster.