The original small-model experiment

I Fine-Tuned a Small LLM on My Laptop

A complete local LoRA experiment in under 30 minutes on a 16 GB Apple MacBook Air—with every script and result included.

By Simon Chong · September 23, 2026
SmolLM2-135M-Instruct · LoRA · 16 GB Apple MacBook Air

<30 min
for the complete experiment on a fanless 16 GB Apple MacBook Air
Only 0.34% of parameters were trainable

A complete fine-tuning loop small enough to understand

I ran the complete experiment in under 30 minutes on an Apple MacBook Air with 16 GB of RAM: record a baseline, train a LoRA adapter, reload it, and test both the desired behavior and an unrelated control.

No hosted training service or high-end GPU was required. The point was to make the entire loop small enough to run locally and understand.

The base model is SmolLM2-135M-Instruct. A tiny chat dataset teaches it to answer identity questions with “My name is Simon.” Two arithmetic examples reinforce a simple control behavior. This is a demonstration, not a claim that twelve examples are enough for a real product.

This experiment has its own self-contained folder. Inspect the training implementation, dataset, end-to-end runner, executed notebook, and recorded results.

What changed

Before training, the model invented a fantasy identity and gave a verbose arithmetic answer. After training, the exact prompt and a held-out paraphrase both produced the target identity, while the arithmetic control remained correct.

PromptBeforeAfter
What is your name?“Kaelin Blackwood…”“My name is Simon.”
Introduce yourself in one line.“A humble guide…”“My name is Simon.”
What is 2+2?Long, correct explanation“2 + 2 = 4”

Only 460,800 of roughly 135 million parameters were trainable. On the 16 GB MacBook Air, the recorded training phase completed 60 optimization steps in 59.25 seconds and ended with a training loss of 0.3425. Including setup, model download, baseline, training, and evaluation, the complete exercise took less than 30 minutes.

Reproduce it

From the repository root, create the same Python environment used by the JEV experiment, then enter the isolated experiment directory:

git clone https://github.com/shmcsensei/easy-jev-fine-tune.git
cd easy-jev-fine-tune
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt

cd experiments/small-llm
python run_experiment.py

The runner records the untouched model’s answers, trains the adapter, evaluates the same three prompts, writes JSON evidence, and exits with an error if the declared checks do not pass.

Run one stage at a time

python ask.py - "What is your name?"
python train.py --data data.jsonl --output adapter --epochs 20
python ask.py adapter "Introduce yourself in one line."

What the code is doing

Each line of the dataset is a chat conversation. The tokenizer applies the model’s chat template, while user and padding tokens receive a label of -100, so only assistant-response tokens contribute to loss.

PEFT adds rank-8 LoRA matrices to the attention model’s q_proj and v_proj modules. The base weights stay frozen. Evaluation covers the exact training prompt, an unseen paraphrase, and an unrelated arithmetic control.

What it proves—and what it does not

If the checks pass, the experiment shows that a small LoRA adapter can steer a compact model’s responses for a narrow family of prompts on consumer hardware. It does not prove that the model learned a durable fact, that unrelated capabilities were preserved, or that this recipe scales to production.

A serious project needs separate training and evaluation sets, broader regression tests, repeated runs, careful data review, and metrics tied to the real task. Tiny repetitive datasets can overfit quickly. Treat this as an inspectable starting point.