Jonathan Montolalu Email me

Notes

Notes

What I’m learning, written down as I go: fine-tuning, small tools, data and electronics. Many of the examples come from MangARTI, so they overlap with its write-up on the Work page.

Fine-tuning language models

Adapting an open model to a low-resource language: building the dataset, training on a laptop, then checking the output with real speakers.

Most of my time on MangARTI went into the dataset and into fitting training onto a laptop GPU. These are the habits I’ve kept from it.

  1. Decide the task before collecting data

    A classifier and a translator need different data, different evaluation and a different interface. MangARTI changed task once, and the data had to change with it. Now I write down the exact input and output before anything else.

  2. Build the dataset if there isn’t one

    For a language with almost no resources, there was nothing to download. A strong general model drafted source sentences in bulk and native speakers wrote the target side. Each example is stored as an instruction, an input and an output in Alpaca-format JSONL, one example per line.

  3. Pick a method that fits the GPU

    On a laptop GPU, VRAM decides what’s possible. QLoRA keeps the base model frozen in 4-bit precision and trains only small low-rank adapters, which is what let me fine-tune an 8B model on a laptop. Gradient checkpointing and an 8-bit optimiser cut memory use further.

  4. Test on sentences the model hasn’t seen

    Training loss only tells me how well a model fits its training data. For MangARTI mini I wrote a separate set of 300 test sentences and score every run on it with chrF, BLEU and exact match. I still read the outputs too, because a score can’t tell me whether a sentence sounds like something a Manado speaker would say.

  5. Check the data before the hyperparameters

    Revising the dataset by hand, not changing the training settings, is what fixed MangARTI’s hallucinations. Now I look at the data first.

Finally, I write down where the model stops working: MangARTI’s model card says plainly that it translates single sentences and degrades on paragraphs.

Building small tools

A demo app for MangARTI and two static web pages, IterMath and BSQShuttle.

Decide inputs and outputs first

Before writing code, I try to settle what goes in, what comes out and what happens when the input is wrong. MangARTI’s demo app is a small example. It loads the 4-bit model and its adapter once, builds the Alpaca prompt from the chosen translation direction, rejects empty input before it reaches the GPU, and shows only the controls a tester needs: output length, sampling, temperature and top-p.

Fail early, before the GPU

The demo app taught me to check input early, do the expensive work once, and keep each step small enough to test on its own. A request that is going to fail should fail before the model spends GPU time on it.

Answer the one question people ask

BSQShuttle isn’t Python at all. It’s a single JavaScript page that compares the device clock with each route’s departures every minute to mark the last bus and the next one. The logic stays simple because the data is shaped around the one question people ask: when does the next bus leave?

Store data the way it’s read

Training data lives in JSONL because each line is one complete example I can read, correct and review by hand. The timetable is a list of departures per route, because that’s how it’s displayed.

Say when it might be wrong

If people rely on a tool, it should tell them when it might be wrong. MangARTI’s model card lists what it shouldn’t be used for. BSQShuttle shows the operator’s caveats beside the schedule, including that a full bus may leave before its scheduled time.

Working with data

Making a dataset that didn’t exist yet, deciding how to handle messy spelling, and measuring what I ended up with.

Making a dataset from scratch

For MangARTI there was nothing to download, so I made the data with native speakers. Coordinating the volunteers and checking their translations became a project of its own.

Spelling variants

Manado Malay (Manadonese) has no standardised spelling, and the same word appears as Ngana, Ngna or ngn. Whether to normalise those forms or teach a model to accept all of them changes how it reads real messages, so I decide it before training rather than during cleanup.

Measuring the dataset

MangARTI’s published training file holds 3,454 sentence pairs, each written in both directions as 6,908 training examples, with source sentences averaging under nine words. That’s why I describe the model as a sentence-level translator, and it matches the test results: every model I’ve tested struggles most with rare words and almost never gets a long sentence exactly right.

Tinkering with electronics

An interest I’m exploring on the side. There’s no project to show here yet.

For now it’s tinkering out of curiosity. If I build something worth showing, it’ll go on the Work page.

Hardware limits already shape my machine learning work, though: MangARTI’s training was planned around the memory of one laptop GPU, and MangARTI mini is being sized for devices people already own.