Training a 58M language model from scratch on free GPUs

Zero dollars and a full public record: a 58M-parameter model trained from random initialization on free Kaggle GPUs. v0.1.2 stopped at 73% of its schedule; v0.2.0 finished and improved held-out loss by 0.2285 nats. At 2,000 samples only LAMBADA is outside its stability rule; the earlier 500-sample ARC-Easy regression did not replicate. The most useful result was discovering that the project’s best architecture win was noise.

58M parameters, zero dollars

KALIA is a 58M-parameter language model trained from random initialization on free Kaggle GPUs. No pretrained weights. No fine-tuning. No budget.

The first release, v0.1.2, stopped at 73% of its schedule and scored 3.0533 held-out loss / 0.9992 bits-per-byte. The second, v0.2.0, finished the schedule and reached 2.8248 / 0.9244, 0.2285 nats better. At 2,000 samples only LAMBADA is outside the stability rule; the 500-sample ARC-Easy regression did not replicate. It remains an experiment, not the new default.

The most useful result was not a better model. It was discovering that the project's best architecture result was noise.

version   tokens   held-out loss   bits/byte   status
v0.1.2    1.82B    3.0533          0.9992      released
v0.2.0    2.50B    2.8248          0.9244      experiment
Same held-out set, same 100-batch protocol. The old 2.4366 is a different yardstick and is never compared (D43).

Where this fits

The architecture is deliberately standard: pre-norm decoder-only, RMSNorm, SwiGLU, RoPE, QK-Norm, logit soft-cap (tau=30), weight tying, no biases. The optimizer is Muon on hidden matrices and AdamW for embeddings, head, and norms.

The contribution is not a new block. It is the record: pre-registered ablations, replication at fresh seeds, and published failures. That is what makes the numbers checkable.

model        params   tokens   PIQA   ARC-Easy
KALIA v0.1.2 58M      1.82B    59.6   46.0
KALIA v0.2.0 58M      2.50B    61.4   46.4
OPT-125M     125M     ~180B    63.0   43.5
Scale context, not a head-to-head. Harness versions differ; KALIA uses lm-eval 0.4.9, 0-shot, 2,000 samples.

The constraint

The free tier gives 2x T4 (32GB total), about 30 GPU-hours a week, and 8.5-hour sessions. The trainer had to resume by design: checkpoints every 30 minutes to the HuggingFace Hub, an atomic swap, and a barrier so two workers never write the same file.

Two rules shaped the run. From scratch: every weight is learned by this project's own training. Pre-registration: every experiment gets a SHA-256 hash before it runs, every decision is numbered, every incident is published.

The first release used about 20 GPU-hours. The total cash cost was zero dollars.

The corpus is 2.4B tokens: FineWeb-Edu 60%, TinyStories 20%, Cosmopedia 15%, permissively licensed Python 5%. The licence audit and rebuild are their own story, below.

Measure before you spend

When quota is the scarce resource, the worst thing you can do is discover a bad recipe with it. Every change is screened at 30M params on 50M tokens, about 30 minutes per arm, same seed and token budget.

  • AdamW: 3.8041 step-700 validation loss.
  • Muon: 3.5937, a 0.21 improvement.
  • Muon + QK-Norm + logit soft-capping: 3.5103, a 0.29 improvement.
Bar chart comparing step-700 validation loss for AdamW, Muon, and Muon with QK-Norm and logit soft-capping; lower is better, and the combined recipe wins.
The optimizer ladder: each change screened at 30M params before spending full-run quota.

At full scale the recipe reached the AdamW baseline's final loss with about 23% fewer tokens: 3.2214 at step 1,730 versus 3.2702 at step 2,250.

Muon+ beat plain Muon on 7 of 7 checkpoints by 0.015 nats. The promotion bar, fixed before the run, was 0.02. It did not ship. A threshold bent for a favored result is not a threshold.

The run: a plateau and a quota wall

v0.1.2 trained across three sessions. For a thousand steps validation loss refused to move while training loss kept falling. A single point cannot tell a noisy eval from a real plateau.

The deterministic evaluation settled it: 100 fixed-seed batches over 819,200 tokens returned 3.0533 loss and 0.9992 bits-per-byte.

The weekly quota ran out at step 3,478 of 4,770, 73% of the schedule. The pre-registered rule said stop on a plateau; the quota made the stop physical. The plateau and the stop are published, not smoothed over.

Zero-shot at the 500-sample release: PIQA 61.4, ARC-Easy 45.8, HellaSwag 36.8, WinoGrande 50.2, LAMBADA 23.0. The 2,000-sample re-measurement gives PIQA 59.6, ARC-Easy 46.0, HellaSwag 35.6, WinoGrande 50.3, LAMBADA 25.2. The custom Abhimanyu gap, reversed-text loss minus forward loss, was 6.06 nats. The model can enter fluent text but cannot exit it.

The experiment that failed

The Abhimanyu gap suggested a fix: chunk-preserving reversal training. Reverse the order of short chunks, keep the tokens inside each chunk readable.

The prediction, threshold, and analysis plan were hashed before the run. Both seeds missed both pre-registered bars, and the gap got worse by 0.14 nats. The transform was rejected.

arm          gap       forward val
control      5.1107    3.8816
reversal     5.2465    3.9641
Both metrics moved in the wrong direction. The negative result is published with the same prominence as a win.

Token-level reversal remains a separate hypothesis. It is not a quiet retry of the same experiment.

The best result that wasn't

The architecture search produced a candidate that looked like the project's best result: X20, a static per-channel modulation, beat control by 0.1358 nats, 3.1x any previous architecture effect.

It was one seed. The project had already learned to distrust a 0.0436 result on those grounds, so X20 got a pre-registered replication at two fresh seeds.

It inverted: +0.0516, worse than control, at both seeds. The replication also measured the control’s own spread: two sessions at seed 1337 agreed to 0.0018, but fresh seeds sat about 0.11 nats higher. That spread is larger than every earlier “win” (X18’s -0.0436, X19’s -0.0018).

Bar chart showing the X20 static gate below the control at seed 1337 and above the control at two fresh seeds, reversing the apparent gain.
The project’s best architecture result, replicated at two fresh seeds. The effect inverted.

At 58M the control spread is 0.2892 nats, 2.5x the 30M spread. That is the measurement floor. Every single-seed architecture delta in the project was read against a baseline nobody had measured. The architecture line closed; no arm may run from one seed again.

Chart of the 58M seed spread: the same recipe across three seeds and two sessions, with each seed re-landing within 0.004 nats of itself and the seeds sitting 0.29 nats apart.
The 58M seed spread. Same recipe, three seeds, two sessions: each seed re-lands within 0.004 nats of itself; the seeds sit 0.29 nats apart.

The lesson is uncomfortable and useful: a big effect from one seed is less established, not more. The budget moved to the continual-update corpus and the replay sweep.

v0.2.0: the loss improved, the benchmarks disagreed

v0.2.0 used a compliance-rebuilt 2.5B-token corpus and the full 4,770-step schedule. Held-out loss: 2.8248, 0.2285 nats better, 4.6x the 0.05 bar. Bits-per-byte: 0.9244.

Line chart of validation loss for v0.1.2 and v0.2.0 on the same rebuilt held-out set: v0.1.2 scores 3.0533 and v0.2.0 scores 2.8248, 0.2285 nats better.
Both versions on the same rebuilt yardstick. v0.1.2 was re-measured on the v2b set; the old 2.4366 is never compared.

At 2,000 samples the comparison is smaller: PIQA 61.4 (+1.74), HellaSwag 35.6 (0.00), WinoGrande 50.8 (+0.47), LAMBADA 23.9 (-1.25), ARC-Easy 46.4 (+0.45). No movement reaches 2 sigma. Only LAMBADA is outside the 1.0-point rule; the 500-sample ARC-Easy -3.8 did not replicate.

Grouped bar chart comparing v0.1.2 and v0.2.0 on five zero-shot benchmarks, with a grey band of plus or minus one standard error; no movement clears two standard errors.
Zero-shot accuracy, both versions, with the measurement noise drawn in. The grey band is about 2 points.

The stability rule allowed no task to regress by more than 1 point. v0.2.0 fails on two, so it is released as an experiment, not promoted over v0.1.2. The thresholds were not moved after seeing the result.

Loss improved; accuracy did not follow. That points at the data, not capacity or the method.

The corpus explains LAMBADA: only 17.7% of tokens are in documents long enough to fill the 1,024-token context. TinyStories is a fifth of the mixture, but only 0.03% of its documents are long enough. The model was trained mostly on short documents and tested on long-range cloze.

What failed, and what it taught

The model results are only half the record. The engineering failures are the other half.

  • Licence audit: 41.7% of the code corpus was non-permissive (39.5% GPL-family). The filter existed and was tested; it landed 40 minutes after the corpus that needed it. v0.1.2's code slice (~50M tokens, ~2% of training) was built without it. The model card discloses it; v0.2.0 is licence-clean by construction.
  • Dataset publisher: the Kaggle publisher defaulted to `--dir-mode skip`, so the code dataset shipped with no configs, no eval folder, and no JSON. Every upload reported success. Assert the interface, then trust it.
  • Held-out set: a corpus rebuild silently replaced the measuring stick, making a healthy run look 0.74 nats worse. Re-measure both sides before believing a cross-rebuild comparison (D43).
  • Accuracy thresholds: two pre-registered bars (0.5 pp, 1.0 pp) sat below the ~2 pp standard error. One passed on noise. Future bars must sit above the measured noise floor (D45).
  • Citations: one load-bearing continual-learning citation was about the wrong paper. It was retracted in place; the decision survived on weaker grounds (D49).

The record is the point. A run produces a loss curve; the decisions, incidents, and retractions are what make the curve checkable.

Reproduce this

The numbers above are from commit `5301db6`. The full test suite runs on CPU; heavy training belongs on Kaggle.

git clone https://github.com/subhajitlucky/kalia
cd kalia
git checkout 5301db6
python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python -m pytest -q
python tools/check_notebooks.py
The suite checks notebooks and the public claims before any GPU quota is spent.

Weights, model card, configs, and the full resumable checkpoint: `kalia-lm/kalia-v012` and `kalia-lm/kalia-v020` on HuggingFace (Apache-2.0). Source, journal, decisions, incidents, and the pre-registration ledger: GitHub (MIT). Training data is not redistributed; sources are attributed.

The old 2.4366 / 0.8184 BPB is v0.1.2 on the original held-out set. It is not comparable to 3.0533 / 0.9992 on the rebuilt set, and the two are never tabulated together.

KALIA model pageThe full paper-style record: replayable training console, benchmarks, decisions, incidents, and the recipe.KALIA on GitHubSource, tests, notebooks, journal, decisions, incidents, and the pre-registration ledger.

What is next

v0.3.0 is a continual update of v0.2.0, not a new base: new corpus, learning rate re-warmed and re-decayed, old data replayed. The replay ratio has to be measured at 58M because published replay results stop at 0.6B.

The programme also moved to inference-time levers: an entity-consistency holdout showed the recorded +0.061 was circular (the honest held-out half is +0.011 [-0.007, +0.032], while coverage survives), a best-of-N/retrieval probe, and four Vedic recitation orders as replay schedules. The 58M measurement floor stopped small architecture claims.

The pre-registration ledgerHashed predictions, registered amendments, and the rule that decided each experiment.