Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Small Language Model Experiments

A small causal language model built with PyTorch. The experiments test training time, learning rate, residual connections, and an MLP.

Recent model: Residual + MLP, trained for 75k steps. See my Hugging Face profile and the 30k language-model case study.

Layout

  • language_model/ — shared model, data, seeding, and validation code.
  • experiments/ — one folder per experiment. Each folder has its README, runner when available, and outputs/.
  • Each experiment has models/ (ignored by Git), outputs/ (plots and metrics), and evaluations/ (JSON results).
  • artifacts/legacy_graphs/ — older graphs that are not mapped to one experiment.
  • hf_release/ — recent model release files, ignored by Git.
  • data/ — local training data. This folder is ignored by Git.
  • Language-model checkpoints stay local and are not committed.

Run

Run commands from the project root after uv sync:

uv run python -m experiments.exp01_30k_vs_40k.train
uv run python -m experiments.exp03_learning_rate.train
uv run python -m experiments.exp04_residual_retrofit.train
uv run python -m experiments.exp05_residual_from_scratch.train
uv run python -m experiments.exp07_residual_75k.train
uv run python -m experiments.exp08_mlp_comparison.train
uv run python eval.py experiments/exp06_residual_50k/models/exp06_scratch_residual_50k.pt
uv run python generate.py

Generation uses the tokenizer implementation and model included in language_model/tokenizer/; no separate tokenizer clone is needed.

Experiments 02 and 06 have saved outputs, but no runner in this checkout. Training requires local files in data/. Checkpoints are not committed. Experiment 03 requires the local checkpoint experiments/exp02_controlled_training/models/exp02_controlled_40k.pt before it can run.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages