khursani.dev

How I do research: one folder per experiment

I teach small ready-made AI models to answer questions about Malaysian documents and Bahasa Malaysia, and to answer in the dialects people actually type. This is the flow I run, one folder per experiment.

2026-08-12

What I am training

My research is small language models. This line is my hobby, but the methodology is the same one I use for work. The models are ready-made and tiny, half a billion to a billion adjustable values, small enough to train on my 3090 in hours. I teach them to answer questions about Malaysian content: company documents, Bahasa Malaysia grammar exercises, and questions typed the way people actually type them, dialect included. The test prompt sitting in my training script is Kelantanese: buleh senaraikan semuo presiden US dengan tahu dio skali. A model that only speaks textbook Malay cannot touch that.

One folder per experiment

Every experiment line I run lives in its own folder with a number, and 001 is always the baseline, the run everything else gets measured against. The folder name says the one thing I am testing, nothing else. Small changes stay in the folder: a hyperparameter tune or a config tweak happens right there. The moment something breaks, a change to the training code itself, I copy the folder, bump the number, and start working in the copy. Inside I keep everything together: train.py, utils.py, my scratch notebook, and a log. Some folders keep a sqlite database as the log, one I name the wandb project from the folder. When I come back after months, I open one directory and I can see what I ran and what happened. I don't have to remember anything.

One experiment, one folder

My notebook is the lab bench

Each folder has an Untitled.ipynb. I work there first: load the model, cut the layers, watch the loss, the error score that has to go down while the model learns. Once it works I freeze it into train.py and commit. The notebook is where I think. The script is what I keep. If train.py cannot run alone, I am not done.

Small data first

I keep data in one place, data/ at the repo root, and I build it with datamaker notebooks: company report text in, a question-and-answer file out, one conversation per line, a human line and an answer line. My first run is always fifty rows, select(range(50)). Fifty rows show me in minutes if my pipeline is broken, my template is wrong, or my loss is dead. Only after that works do I scale up.

The robot that tried thousands of settings

There is a robot in this flow. Optuna is a tool that tries training settings for you and keeps the winner: learning rate, how many rounds, which parts of the model to train. Across twenty-three folders it ran about nine thousand three hundred trials for me, and the trials answered questions I could not guess. Which parts of a model carry the learning? I split the model's internal steps, called layers, two ways, trained one half against the other, and swept the deep ranges. The deeper layers, twenty and up, scored best, around 0.87 on my metric, which is why my current scripts train the middle-to-deep layers and leave the rest alone. Several folders reached a perfect 1.0; most strong runs sit at 0.85 to 0.87. Also kept from those runs: a fixed seed, a number that makes every run repeat exactly, and test questions the model never sees during training, kept aside so the score means something.

One change, one folder

My series is just that: 002_lora, 003_dora, 004_dora_scale, 005_lora. LoRA and DoRA are ways to train a tiny fraction of the model instead of all of it. I compare them by running each in its own folder.

Why I don't use a framework

No tracker product, no config framework, no pipeline tool. Plain scripts, a notebook, sqlite or wandb. Every hour spent wiring a tracker is an hour not spent on the experiment, and on a small team nobody wires it for you. Plain files survive a dead laptop, a framework change, and me forgetting a login. In an earlier post I said researchers have to build their own lifecycle. This folder system is mine.