FemtoLlama is a lightweight implementation of transformer-based language models designed for educational purposes and small-scale experiments.
Project Report (Markdown) Project Report (PDF)
-
Install
uv(if not already installed):curl -LsSf https://astral.sh/uv/install.sh | shOr via pip:
pip install uv
-
Install dependencies:
uv venv uv sync
Open the pre-training.ipynb notebook in Jupyter and run all cells to prepare the training data.
Run the training script with the desired configuration. For example:
uv run python train.py --mix control --batch-size 32 --eval-steps 500 --epochs 5Available mixes: control, more_heads, more_layers, more_dimensions, all. Adjust batch size, eval steps, and epochs as needed.
Run the model comparison script to evaluate trained models:
uv run python compare_models.pyThis will generate plots and print a summary of model performance.