Card and NOTICE (private staging)
Browse files
README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language: [en]
|
| 4 |
+
tags: [udgamlabs, small-language-model, trained-from-scratch, research-release, checkpoints, training-dynamics]
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+

|
| 8 |
+
|
| 9 |
+
**UDGAM LABS** · Training checkpoints · 152M parameters, every surviving state
|
| 10 |
+
|
| 11 |
+
# Laghu-Checkpoints
|
| 12 |
+
|
| 13 |
+
The raw training states behind [Laghu](https://huggingface.co/udgamlabs/Laghu), a 152M-parameter chat model trained from
|
| 14 |
+
scratch for $146 of pretraining compute: model weights, EMA weights and optimiser states from the end of pretraining
|
| 15 |
+
and of the 32K stretch, all three supervised fine-tuning runs (1, 2 and 3 passes), the reinforcement-learning run that
|
| 16 |
+
failed its gate, and the run logs. Together with the code on GitHub, they let you resume training, re-run the
|
| 17 |
+
fine-tuning, or study how the model changed between stages.
|
| 18 |
+
|
| 19 |
+
**Try it:** [the chat model](https://huggingface.co/udgamlabs/Laghu) · [code on GitHub](https://github.com/udgamlabs/laghu) · [udgamlabs.com/models/laghu](https://udgamlabs.com/models/laghu)
|
| 20 |
+
|
| 21 |
+
## Quick start
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
import torch
|
| 25 |
+
from huggingface_hub import hf_hub_download
|
| 26 |
+
|
| 27 |
+
p = hf_hub_download("udgamlabs/Laghu-Checkpoints", "pretrain/step_076294/model_ema_076294.pt")
|
| 28 |
+
state = torch.load(p, map_location="cpu", weights_only=True) # a state dict for nanochat's GPT model
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
These are nanochat files (`torch.save`), not transformers checkpoints. Load them with the training code in
|
| 32 |
+
[udgamlabs/laghu](https://github.com/udgamlabs/laghu) (`nanochat/`), or convert one to the transformers format with
|
| 33 |
+
`python -m scripts.export_hf --checkpoint-dir <folder> --weights final --out <dir>`. Ready-to-use transformers weights
|
| 34 |
+
are in [Laghu](https://huggingface.co/udgamlabs/Laghu), [Laghu-Base](https://huggingface.co/udgamlabs/Laghu-Base) and
|
| 35 |
+
[Laghu-Base-32K](https://huggingface.co/udgamlabs/Laghu-Base-32K), and in the `hf/` folders below.
|
| 36 |
+
|
| 37 |
+
## What is here
|
| 38 |
+
|
| 39 |
+
| Folder | Stage | Files |
|
| 40 |
+
|---|---|---|
|
| 41 |
+
| `pretrain/step_076000/` | pretraining, 99.6% | `model_076000.pt` (weights), `ema_076000.pt` (EMA), `optim_076000_rank{0-7}.pt` (one optimiser shard per GPU of the 8-GPU run), `meta_076000.json` |
|
| 42 |
+
| `pretrain/step_076294/` | end of pretraining | as above, plus `model_ema_076294.pt` (the EMA weights as a state dict; this is Laghu-Base) |
|
| 43 |
+
| `pretrain/logs/`, `pretrain/summary.txt` | | the main run's log (every step's loss, validation every 2,000 steps) |
|
| 44 |
+
| `ctx32k/step_001750/`, `ctx32k/step_001900/` | 32K stretch | `model_*.pt`, `optim_*_rank0.pt`, `meta_*.json`; step 1,900 is Laghu-Base-32K and the start of SFT |
|
| 45 |
+
| `ctx32k/logs/`, `ctx32k/eval/` | | training log; recall and short-text checks |
|
| 46 |
+
| `sft/1-pass/`, `sft/2-passes/`, `sft/3-passes/` | supervised fine-tuning | `ckpt/` (weights and optimiser at the halfway and final steps), `hf/` (transformers export of the final step), `logs/`; 2 passes is the released Laghu |
|
| 47 |
+
| `rl-r1-failed/` | reinforcement learning (GRPO + distillation from Gargi), 40 steps | `hf/` export, `eval/`, `logs/`; it failed its pre-registered gate (dev GSM8K 8.6% → 8.2%, bar 11.6%) and is published for study only |
|
| 48 |
+
|
| 49 |
+
File formats:
|
| 50 |
+
- `model_*.pt` and `model_ema_*.pt`: state dicts (the EMA ones in fp32), loadable with `torch.load(..., weights_only=True)`.
|
| 51 |
+
- `ema_*.pt`: the EMA as a list of fp32 tensors in `model.parameters()` order, used to resume the EMA.
|
| 52 |
+
- `optim_*.pt`: optimiser state dicts (Muon for matrices, Adam for embeddings, output and scalars), loadable with
|
| 53 |
+
`weights_only=True`.
|
| 54 |
+
- `meta_*.json`: model config, run settings, data-loader position and validation scores at that step. Measure a
|
| 55 |
+
checkpoint yourself rather than reading scores from its meta file.
|
| 56 |
+
|
| 57 |
+
## Results
|
| 58 |
+
|
| 59 |
+
Measured on the exported weights (details on the model cards and in the
|
| 60 |
+
[technical report](https://udgamlabs.com/research/laghu)):
|
| 61 |
+
|
| 62 |
+
| Checkpoint | Bits per byte on new text (lower is better) | Notes |
|
| 63 |
+
|---|---|---|
|
| 64 |
+
| pretraining step 76,294, EMA (Laghu-Base) | 0.919 | SmolLM2-135M 0.941, Falcon-H1-Tiny-90M-Base 0.979 |
|
| 65 |
+
| 32K step 1,900 (Laghu-Base-32K) | 0.921 | hidden-code recall 96-100% up to 16K tokens |
|
| 66 |
+
| SFT 1 / 2 / 3 passes | held-out SFT loss 1.724 / 1.784 / 2.036 | 2 passes was picked by a generation-based rule (60.0% judge win rate over 1 pass) |
|
| 67 |
+
|
| 68 |
+
## Where it falls short
|
| 69 |
+
|
| 70 |
+
- **Most of the pretraining trajectory is missing.** Checkpoints were saved every 2,000 steps, but the uploader kept
|
| 71 |
+
only the newest two on the main branch, and a storage clean-up on 2026-10-21 deleted the older versions (steps
|
| 72 |
+
2,000-74,000) and about six earlier 32K checkpoints. That was our mistake. Only the late states here survive, so this
|
| 73 |
+
repository cannot show how Laghu learned over the whole run.
|
| 74 |
+
- The 32K stretch states have one optimiser shard (one GPU); pretraining states have eight. Resuming on a different GPU
|
| 75 |
+
count needs re-sharding.
|
| 76 |
+
- The RL run is a failed experiment, not an improvement.
|
| 77 |
+
|
| 78 |
+
## How it was trained
|
| 79 |
+
|
| 80 |
+
Pretraining: 76,294 steps × 524,288 tokens (40.0B token positions) at 2,048 context on 8× A100 80GB, 13.2 hours, $146.26;
|
| 81 |
+
Muon; token bags for the first 25% of steps; cool-down data from 80%; EMA from 90% (β 0.998). 32K stretch: 1,900 steps at
|
| 82 |
+
32,768 context on one RTX PRO 6000. SFT: 41,467 conversations, sequence 16,384, batch 262,144 tokens. Every setting and
|
| 83 |
+
script: [GitHub](https://github.com/udgamlabs/laghu).
|
| 84 |
+
|
| 85 |
+
## Intended use and limitations
|
| 86 |
+
|
| 87 |
+
Research on training dynamics, continued pretraining, fine-tuning and reproduction. The weights carry no safety tuning
|
| 88 |
+
beyond light SFT data.
|
| 89 |
+
|
| 90 |
+
## Licence
|
| 91 |
+
|
| 92 |
+
Apache-2.0. Copyright 2026 Udgam Labs LLP. Training-data credits:
|
| 93 |
+
[DATA_LICENSES](https://github.com/udgamlabs/laghu/blob/main/docs/DATA_LICENSES.md).
|
| 94 |
+
|
| 95 |
+
## Citation
|
| 96 |
+
|
| 97 |
+
```bibtex
|
| 98 |
+
@misc{udgamlabs2026laghu,
|
| 99 |
+
title = {Laghu: a fully open 152M chat model trained from scratch},
|
| 100 |
+
author = {Prasad, Jitesh K},
|
| 101 |
+
year = {2026},
|
| 102 |
+
howpublished = {Udgam Labs},
|
| 103 |
+
url = {https://huggingface.co/udgamlabs/Laghu}
|
| 104 |
+
}
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
**About Udgam Labs.** Udgam Labs is an independent AI research lab. We work from first principles: before we build, we understand why things work, whether we are training a model, fine-tuning one or applying AI to a new problem. Udgam (उद्गम) is Sanskrit for origin. [udgamlabs.com](https://udgamlabs.com)
|