Code: github.com/PhilippMarquardt/everdream

Everdream: Pre-Training, RL Post-Training, Drone Simulation and Architecture Experiments

I wanted a single repo where I could train models end to end on hardware I can actually afford: Google Colab sessions that time out after 24 hours, the occasional rented H100, and my RTX 5070 Ti at home. Everdream started as a small pre-training codebase and gradually turned into a workspace for four separate tracks: LLM pre-training, GRPO post-training, GPU drone simulation, and small-scale transformer architecture experiments.

Everything lives under one structure so the evaluation and reward code stays shared:

  • everdream/pretraining: nanochat-style distributed trainer using Muon + Adam, FP8, FlashAttention 3, torch.compile, and weighted parquet mixing
  • everdream/posttraining: GRPO via TRL with vLLM rollouts and pluggable verifiable rewards
  • everdream/evaluation: phase-agnostic eval suites (pretrained checkpoints, RL checkpoints, and HuggingFace models all run through the same YAML config, using the exact same verifier functions as the RL rewards)
  • everdream/sim: MuJoCo and MuJoCo Warp quadrotor simulation and RL
  • archlab: a lightweight harness for comparing transformer variants with one CLI flag per change

Pre-training 1B and 3B models on Colab

Most of the pre-training runs happened on single H100 80 GB GPUs in Google Colab over two weeks in March 2026 (~330 GPU hours total). I trained a custom 32k tokenizer with a 2048 context length and 524,288 tokens per optimizer step. Because Colab kills sessions around the 24-hour mark, the trainer writes full model and optimizer checkpoints to Google Drive every 500 steps, so every run is really a chain of resumed sessions (the 3B runs alone took 22 sessions across two attempts).

The main data mix was weighted parquet shards: 70% ClimbMix (filtered web text), 25% code from The Stack (Python, JS, TS, Java, Go, Rust), and 5% Nemotron-CC-Math. The restarted 3B run used an earlier mix with 10% code, 10% math, and 10% Wikipedia.

ModelGPUSessionsGPU timeTokensThroughputVal bits/byte
3B custom (restart)H100761 h7.6B40k tok/s0.695
3B custom, no value embeddingsH1005105 h8.9B28k tok/s0.682
1B nanochat baselineRTX PRO 6000231 h8.9B91k tok/s0.673
1B customH100828 h5.5B133k tok/s0.710
3B custom, first attempt (discarded)H1001588 h8.1B40k tok/sunreliable

Pre-training validation curves

The surprise here was that the 1B nanochat baseline beat both 3B runs by ~9B tokens. The 3B model without value embeddings trained on the exact same data mix as the 1B baseline: it pulled ahead early, flattened out, and got overtaken around 8B tokens. At the same token budget a 3x larger model should be winning, which tells me my 3B setup (depth 31–33, value embeddings, learning rates) wasn't well tuned. None of these runs hit their full planned token budget, so they're mid-training snapshots rather than finished models.

Watching the generations evolve

Every 500 steps the trainer logs completions on the same four prompts, which makes it much easier to see what a validation bits-per-byte number actually corresponds to. Here is how the two matched-data runs progress on two factual prompts (shortened):

"The capital of France is …"

Tokens3B, no value embeddings1B nanochat
0.26B"Aonne, a German city in the southern part of the country.""Averageddon, situated in the village near the capital of the French state."
0.52B"still a vibrant center of art and heritage …""called Bouligle, or 'French Capital of the World.'"
2.6B"called Paris, and it is located in the southern part of the country. It is located 450 kilometers southeast of Paris …""Lyon, and it is the capital of the United States."
5.2B"still not as large as you would think, as in the case of its capital Paris, the capital of France is still in the capital …""Lyon, which serves more than 40 million people."
8.9B"Paris, the seat of France. The French are the second most educated in the world …""Aix-Marseille. Aix-Marseille was founded as the capital of France in 1375 …"

"The chemical symbol of gold is …"

Tokens3B, no value embeddings1B nanochat
0.26B"atomic number 82, which is a platinum-pearl element.""gold's ability to bring you joy, loyalty, and happiness."
0.52B"Au, which means 'tooth' … The chemical name for the element is 'Zinc'.""Au, which means 'the precious, precious gift of the Earth'."
2.6B"Au … a densely radioactive metal.""Au, and the atomic number is 19."
5.2B"Au, which stands for 'atomic gold'. It is the heaviest element in the periodic table.""Au … a white, soft metal that's slightly yellow."
8.9B"Au, which means 'unusual,' in Latin … has an atomic number of 99.""Au, which means 'gold' in Latin. Gold is … a soft, silvery, dense metal that is often used to make jewelry."

By half a billion tokens both models already write convincing encyclopedia-style prose and know gold is Au, even while inventing atomic numbers and geography. On "If 5*x + 3 = 13, then x is", the 3B model at 5.2B tokens formats a multiple-choice question, writes 5 * x = 13 - 3, and then concludes x = 6 ... Thus, x = 4 is the solution. Neither model ever gets it right. On def fibonacci(n):, the 1B run goes from print(n)print(n)print(n)... at 0.26B tokens to clean, commented (still buggy) Python at 8.9B, while the restarted 3B run writes the standard return fibonacci(n-1) + fibonacci(n-2) recursion by 5.2B tokens. Across these steps validation bits/byte dropped from 0.875 to 0.682 (3B) and 0.903 to 0.673 (1B), which is enough for fluent structure but nowhere near enough for reliable facts.

The discarded first 3B run

Checking generations every 500 steps saved me from trusting a broken run. My very first 3B attempt spent 88 GPU hours reporting validation bits/byte between 0.39 and 0.48, way better than it had any right to be.

Failed first 3B attempt vs restart

Looking at the text immediately gave the bug away:

StepReported val bits/byte"The capital of France is …"
1,5000.48"[BOS]The capital of France is a major source of economic security."
3,0000.44"[BOS]The capital of France is Sansevieria, and the capital of India is Madagascar."
5,5000.43"[BOS]The capital of France is Vermont."
10,000 (after resume)0.69"[BOS]The capital of France is Vermont. France has two major cities, Los Angeles and Paris."

Every output began with a literal [BOS] token (which never happened in the clean restart), and when Colab killed the session and I resumed at step 6,050, validation bits/byte jumped straight from 0.39 to 0.71, right in line with the other runs. Training loss also sat around 1.0 instead of ~2.1 throughout. I never tracked down the exact root cause, so I scrapped the run and restarted with a cleaned-up config. All W&B histories, configs, and samples (including the failed run) are exported into the repository so nothing depends on an external dashboard.

GRPO post-training with verifiable rewards

For post-training I wired up GRPO in TRL with vLLM generating 256 rollouts per step (~3 seconds/step on a single H100 NVL) on tasks with deterministic verifiers. Because the evaluation suite calls the same verifier code as the RL reward, the reward signal and the test metric can't drift out of sync.

Held-out accuracy for Qwen3-1.7B:

TaskBeforeBestStepsNotes
GSM8K (grade-school math)75.585.0300Drops back to 80.0 by step 500
Banking77 (77-way intent classification)16.562.0500Pure RL without SFT; still climbing at step 500
MedCalc-Bench (medical calculations)17.029.5200Trained jointly with GSM8K without hurting math

A few practical things showed up quickly. First, without a KL penalty and with a constant learning rate, GSM8K peaked at step 300 (85.0%) and then degraded back to 80.0% by step 500, so running held-out evals every 100 steps and selecting checkpoints by eval score rather than run end was necessary. Second, on Banking77, most of the initial jump came from formatting (zero-shot Qwen wanted to explain the intent in prose instead of outputting a class label), followed by slower gains in actual classification, still well behind a supervised fine-tune (~85–93%).

MedCalc-Bench ended up being the most interesting target: real clinical notes, 55 medical calculators, and numeric answers checked within tolerance bounds, where even GPT-4 is around 50% one-shot. I plan to keep building this side of the repo toward a medical RL testbed starting from MedCalc.

GPU drone simulation in MuJoCo Warp

The simulation track started as a procedural MuJoCo arena with buildings, trees, gates, wind gusts, and turbulence for a PX4 X500 quadrotor. Running 12 CPU MuJoCo environments with Stable-Baselines was way too slow for motor control, and a CPU policy that passed my open-space and pillar tests still flew straight into obstacles when I took over manually. I rewrote the whole RL loop on GPU using MuJoCo Warp, where one RTX 5070 Ti reaches 24.5M physics steps/sec:

Parallel worldsPhysics steps / sGPU memory
4,09612.1 M0.7 GB
8,19220.2 M1.4 GB
16,38424.5 M2.7 GB

One debugging detour worth mentioning: I lost two days to two hand-written drone XMLs having rotors 0 and 1 swapped relative to the mixer signs. Every arena now loads the canonical drone asset and a unit test checks the match.

With GPU throughput in place, I trained three policies:

  • Landing under gusts (PPO with a 5-stage weather curriculum): 26/30 landings (86.7%) with 0.137 m mean touchdown error.
  • Low-level velocity tracking (direct 4-motor control): transferred zero-shot to a Unity version of the drone at 8/8 runs and 0.17 m/s velocity RMSE.
  • Indoor room navigation: flying through a 3×3 grid of rooms where Dijkstra picks doorway sequences on the known map, the policy outputs 10 Hz waypoints, and a 500 Hz cascaded PID tracks them.

For room navigation I froze a set of 64 (start, goal) evaluation episodes before training and reported task metrics rather than reward:

MetricTarget16 range sensors64 range sensors
Success rate≥ 90%98.4%100%
Collision rate≤ 2%1.6%0.0%
SPL (path efficiency)≥ 0.750.9841.000
Mean speed≥ 1.5 m/s2.37 m/s2.37 m/s

A hand-written route follower gets 98.7% at 2.16 m/s on the same 64 episodes, so the learned policy is both slightly faster and cleaner. Testing the 16-sensor policy zero-shot on unseen layouts and geometry changes showed where it generalizes and where it breaks:

ConditionSuccess
Training layout100%
20 unseen layouts97.5%
4×4 grid, 5–6 doorway routes (longer than training)97.9%
Rooms 5.0 m apart (trained at 6.4 m)100%
Rooms 8.0 m apart88.1%
Doorways 2.4 m wide (trained at 1.8 m)100%
Doorways 1.2 m wide66.0%

The failures on narrow doorways and larger rooms came from the same bottleneck: at 3–4 m distance, 16 coarse ray casts return identical readings for a 1.2 m and a 1.8 m opening, and the drone commits ~1.65 m out at 2.4 m/s without slowing down. I tried training a 64-sensor version with randomized doorway widths from 1.0 to 2.4 m, expecting higher resolution to fix it. Narrow-door success stayed at 65.6%. Even when it could see the tighter gap, nothing in the reward encouraged slowing down, so it kept accepting a ~34% crash rate in exchange for speed. I left that reward-shaping problem open for now.

Transformer architecture experiments (archlab)

archlab is a small testbed for comparing transformer ideas against a clean modern baseline (RMSNorm, RoPE, QK-norm, ReLU², logit softcap, Muon + Adam on FineWeb, evaluated on a fixed 10.5M-token validation split). Every architecture variant (GQA, MLA, MoE, nGPT, differential attention, looped transformers, encoder-decoders, and others, 13+ total) is toggled with a single flag, and every comparison runs three seeds with identical data order. Small runs happen locally; larger sweeps run on rented H100s (~740k tokens/s for a 30M model).

python train.py --arch loop_add --loop-iters 4 --dim 512 --tokens 504e6 --seed 0 --out runs/loop_add

Every run writes log.jsonl and summary.json, negative results included. Three experiments stood out:

1. Input re-injection in looped transformers

Looping the middle layers 4 times at 30M parameters / 504M tokens (mean of 3 seeds):

VariantVal loss (3-seed mean)
Modern baseline3.734
loop_add (additive re-injection)3.708
loop_parcae (contractive injection)3.718
Loop adapter (concat + projection)3.902

Simple additive re-injection beat the baseline on all three seeds, whereas the concat-and-project adapter I expected to work reasonably well lost by 0.17 nats because its non-residual projection drifted away from identity during training.

2. Flow-matched future token drafts

Here a small flow-matching head predicts a window of 8 future tokens and feeds that draft back into the residual stream. To check the upper bound, I also ran an oracle that gets the true future tokens:

VariantVal loss
Modern baseline3.736
Flow draft3.722
Multi-token prediction3.719
Oracle (true future tokens)3.486

There is a real 0.25-nat ceiling if the future tokens are accurate, but the flow draft's small improvement came entirely from its auxiliary training loss. The model learned to gate the sampled draft down to zero because the sampled draft was noisier than a trivial prediction (MSE 1.13 vs 1.01).

3. Bidirectional looped encoder with a 32-slot memory bank

A looped bidirectional encoder compresses the context into 32 learned memory slots that a small decoder attends to. On a synthetic multi-hop lookup benchmark (3 seeds), it worked great:

Accuracy1 hop2 hops3 hops4 hops
Decoder-only1.000.960.820.59
Encoder-decoder1.001.000.990.96
Encoder-decoder, 4 encoder loops1.001.001.001.00

On real language modeling (124M parameters, 250M FineWeb tokens), the picture flipped:

Experiment C/D loss curves

VariantVal lossPerplexity
Decoder-only baseline3.94151.5
Prefix-LM4.12561.9
Encoder-decoder, 4 loops (decoder reads only the 32 slots)4.13962.7
Encoder-decoder4.16564.4
Encoder-decoder + encoder MLM loss4.37579.4

Every bidirectional-prefix design lagged the causal decoder-only baseline by 0.18–0.25 nats at this compute budget. Within the encoder-decoder group, though, restricting the decoder to read only the 32 compressed memory slots actually beat letting it attend to all 512 encoder tokens, so the bottleneck itself was doing real compression, just not enough to beat the causal baseline on standard next-token prediction.