-- online Search!

Training Your Own Model to Sound Like You

by kirupa   | filed under AI Fundamentals

TL;DR

To train your own model to sound like you, turn your pre-AI writing into request and response pairs, fine-tune a small open model on them with a LoRA adapter (MLX-LM on a Mac, Unsloth on an NVIDIA GPU), check it on topics it never saw, and then run it locally with Ollama.

  • A skill is quicker to make and works with frontier models. A custom model keeps your voice in its weights.
  • An agent can turn your old writing into training pairs for you.
  • LoRA trains a tiny adapter, only 0.18% of the model's weights in my run.
  • Score it on held-out topics, and check that it isn't copying your old posts.

In Training Your AI to Sound Like You, we got an AI writing like us by pointing an agent at our old writing and having it build a skill, which is a file of our measured habits that our AI tools load before they write. The AI model itself never changed.

This time, we are going to change the model by fine-tuning it. We will take a small open model, train it on my old kirupa.com tutorials, and end up with something that runs on a laptop and writes like me without being told how:

A gag image: a robot labeled Qwen3-4B, after training, with a handwritten note pointing at it: 0.18% Kirupa by weight!

That percentage is real, and we will see where it comes from in a bit. Before we train anything, though, it is worth asking whether we should.

Onwards!

Skill or Custom Model?

Both approaches get an AI writing like us, but they keep our voice in very different places:

Two setups side by side. A skill: your skill, 43,365 tokens, and your request both go into any model, so the skill is sent with every request. A custom model: only your request goes into your model, because the voice is in the weights.

A skill is text that rides along with our request. My KONVO skill is about 43,000 tokens by one model's count, and every writing request that loads it pays for all of them. A custom model has our voice baked into its weights, so the request goes in all by itself.

Here is how the two stack up:

Two cards. A skill: no training, and edits take seconds; works with the best frontier models; one file that moves between tools. But it rides along in the prompt of every request, needs a model and a tool that load it, and only knows what fits into written rules. A custom model: the voice lives in the weights; runs privately, even offline; nothing extra to send with a request. But it needs a big pile of clean writing, hours of training, again for every update, and small models know less and can parrot.

For most of us, a skill is the right place to start. There is nothing to train, a fix takes seconds, and it works with the big frontier models, which know a whole lot more than anything we can run on a laptop.

A custom model makes sense when our writing has to stay private, when we want it working offline, or when we write so much that the extra tokens really add up. The price is a big pile of clean writing, hours of training, and another round of training every time we want to change something. A small model also knows less about the world, so it will happily get facts wrong in our voice.

There is also a middle path. We can fine-tune a model to pick up our voice and then hand it a short skill for the rules that are easy to write down, like heading case or length. We will test that combination too.

The Five Steps

Training our own model breaks down into five steps that look as follows:

Five numbered steps. 1, make training pairs from your clean writing. 2, pick a base model with 1B to 8B weights. 3, fine-tune it with a LoRA adapter. 4, check it on held-out topics. 5, run it locally with Ollama or LM Studio.

I ran every one of these steps on my own Mac (an M4 Max with 48 GB of memory), training on my pre-AI tutorials. Every command and number in the rest of this article comes from that run.

Step 1: Turn Your Writing Into Training Pairs

A model learns by example, and the examples we want are a request plus the response we would have written. The nice thing is that we already have the responses, because they are our old posts. All we need is the request that would have produced each one:

A tutorial of mine, Introduction to Trees, which starts: When we look around, a lot of the data around us is hierarchical. An arrow turns it into a training pair. The user turn asks: Write a kirupa.com tutorial titled Introduction to Trees. Mark each picture with an Image line. The assistant turn is the tutorial itself.

Writing hundreds of those by hand would be miserable, so our agent is going to do it. The cleanup part is the same pre-conditioning from the last article, and this prompt picks up from there:

Turn my writing into training data for a LoRA fine-tune with MLX-LM.

My writing: [A FOLDER, SOME FILES, OR A LIST OF LINKS]
Keep only: [ONE FORMAT, like "my blog tutorials"] from [ONE ERA]
Hold out: [3 TO 6 PIECES TO KEEP OUT OF TRAINING FOR TESTING]
Base model: Qwen/Qwen3-4B-Instruct-2507

Work in a new folder called data/ and do these steps in order.

1. Clean up the files. Keep only pieces I wrote myself, before AI helped me
   write. Strip navigation, headers, footers, comments, share buttons, and
   any boilerplate that repeats across pages. Remove duplicates. Keep my
   headings, lists, and code blocks, and replace each picture with an
   [Image: short description] line. Save each piece as Markdown.

2. Turn each piece into one chat example, where the user message is the
   request that would have produced the piece and the assistant message is
   the piece itself:
   {"messages": [{"role": "user", "content": "..."},
                 {"role": "assistant", "content": "..."}]}
   Use the same style of request for every piece, like: Write a tutorial
   titled "TITLE". Mark each picture with an [Image: ...] line.

3. Count tokens with the base model's tokenizer. If a piece runs past about
   4,000 tokens, split it at its headings, and write a request for each part
   that names the piece and the headings it covers.

4. Put the held-out pieces in data/test.jsonl, a random 5% of the rest in
   data/valid.jsonl, and everything else in data/train.jsonl, with one
   example per line.

5. Tell me how many pieces, examples, and tokens went into each file, and
   show me two random examples so I can check them.

When I had my agent do this, it pulled 431 of my pre-AI tutorials and split them like this:

A bar of my 431 pre-AI tutorials, split three ways: 403 for training (446 examples and 827,339 tokens), 21 for checking progress during training, and 7 held out for testing, covering closures, events, linked lists, heaps, stacks, and queues.

The seven held-out tutorials cover the same six topics my voice skill was tested on, so we can compare the two approaches on the same ground. The model never sees them while it trains.

Step 2: Pick a Small Base Model

The base model is our starting point, and we are only going to nudge it toward our voice. The main rule is to pick one small enough to train on the hardware we have. Models with somewhere between 1 and 8 billion weights are the sweet spot for a laptop, and the popular open families (Qwen, Llama, and Gemma) all come in sizes in that range. A bigger model knows more and writes better, but it trains slower and needs more memory.

I picked Qwen3-4B-Instruct-2507. It has about 4 billion weights, an Apache 2.0 license, and it is an instruct model, which means it already knows how to follow a request. Its weights take about 8 GB of memory at full 16-bit precision, which leaves plenty of room for training on my Mac. Whatever you pick, check its license before you build on it.

Step 3: Fine-Tune It With LoRA

Retraining all 4 billion weights would take far more memory than a laptop has. A technique called LoRA (short for low-rank adaptation) gets around that. It freezes the model and trains a small adapter that sits alongside it:

A large locked block labeled base model, 4,022 million weights, frozen, plus two thin strips labeled LoRA adapter, 7.3 million weights, trained on my writing, which is 0.18% of the model.

In my run, the adapter had 7.3 million weights, or 0.18% of the model. That is where our robot's percentage came from. On a Mac, MLX-LM handles the whole thing with one command:

pip install "mlx-lm[train]"

mlx_lm.lora --model Qwen/Qwen3-4B-Instruct-2507 --train --data data \
  --mask-prompt --batch-size 2 --iters 450 --learning-rate 1e-4 \
  --max-seq-length 4096 --grad-checkpoint \
  --steps-per-eval 50 --val-batches -1 --save-every 50 \
  --adapter-path adapters

A few of those flags are worth knowing about. --mask-prompt trains the model on our writing and not on the requests, --max-seq-length 4096 leaves room for a whole tutorial, and --grad-checkpoint trades a bit of speed for a lot less memory. With 446 examples, 450 steps of 2 examples each is about two passes through all of our writing.

The first 200 steps took 37 minutes on my Mac, and macOS put the peak memory use of the run at about 21 GB. Along the way, MLX-LM reports the loss, which measures how surprised the model is by our writing (lower is better):

A line chart of loss over training steps. Validation loss, measured on 21 tutorials the model never trained on, falls from 2.118 at the start to 1.611 at step 200, which a handwritten note marks as the best checkpoint. In the second pass through the data, which starts around step 223, training loss drops to about 1.13 to 1.31 while validation loss rises to 1.660 at step 250 and 1.655 at step 300.

Validation loss, measured on the 21 tutorials set aside for checking progress, dropped from 2.118 to 1.611 by step 200. Around step 223, the model started its second pass through my writing. Training loss fell off a cliff while validation loss went back up. That is the model starting to memorize my tutorials instead of learning from them, so I stopped the run at step 340 and kept the adapter that MLX-LM had saved at step 200:

cp adapters/0000200_adapters.safetensors adapters/adapters.safetensors

If you have an NVIDIA GPU instead of a Mac, Unsloth does the same job, and its free notebooks run on Google Colab.

Step 4: Check That It Sounds Like You

A lower loss tells us the model is less surprised by our writing. It doesn't tell us whether the model writes like us, so we are going to reuse the check from the skill article: have it write about topics we have covered and measure the drafts.

The quickest check is the loss on the held-out tutorials. Running mlx_lm.lora with --test measures it, and passing --adapter-path "" gives us the base model's number to compare against. On my seven held-out tutorials, the loss went from 1.746 for the base model to 1.329 with our adapter, so the fine-tuned model finds my unseen writing a whole lot less surprising.

Next, we have the model write. Here is how to ask our fine-tuned model for a tutorial, using the sampling settings Qwen recommends:

mlx_lm.generate --model Qwen/Qwen3-4B-Instruct-2507 --adapter-path adapters \
  --max-tokens 4096 --temp 0.7 --top-p 0.8 --top-k 20 \
  --prompt 'Write a kirupa.com tutorial titled "Stacks in JavaScript". Mark each picture with an [Image: ...] line.'

I had four versions of the model write all six held-out topics, and I scored every draft with the same likeness evals I used for KONVO, where my own typical tutorial scores 100%:

Bars of likeness to my 431 pre-AI tutorials, averaged over six held-out topics, where my own typical tutorial scores 100%. Qwen3-4B as is: 37.8%. Qwen3-4B with a short skill: 46.2%. Fine-tuned on my writing: 76.8%. Fine-tuned with a short skill: 16.9%. My skill on a frontier model: 100%.

My fine-tuned model went from 37.8% to 76.8%, which is a big jump for a model that never got a single instruction about how I write. For comparison, my KONVO skill running on a frontier model scored 100% on these same six topics. The habits the fine-tune did pick up are the ones that are hard to describe and easy to spot:

A table comparing Qwen3-4B as is, the fine-tuned model, and my typical pre-AI tutorial, averaged over six held-out topics. Headings per 1,000 words: 28.3, 8.7, and 4.0. Lists per 1,000 words: 16.7, 1.2, and 0.4. Paragraphs ending in a colon: 21%, 36%, and 41%. Words per sentence: 12.8, 15.0, and 16.0. Words per paragraph: 21.8, 33.8, and 36.0. Words of prose: 437, 456, and 975.

It dropped most of the headings and bullet lists that models love, ended more paragraphs with a colon that hands off to a picture or some code, and wrote longer sentences and paragraphs. It still wrote less than half as much as I do, though, and its code had bugs, like a pop method that never returned the value its comment promised. A model with 4 billion weights simply knows less than the big ones.

There is a catch hiding in that score, too. It compares the drafts with all 431 of my pre-AI tutorials, which is the voice the model learned. My book-era tutorials, the voice I actually want, say we a whole lot more and you a whole lot less. Against those 23 tutorials, the fine-tune went from 2.5% to only 11.1%. Twenty-three tutorials is nowhere near enough to train on by themselves, so a custom model ends up sounding like whichever era of us we have the most writing from.

As for the middle path, both short-skill versions got the 3,283-word measured fingerprint section of my KONVO skill as instructions. The plain model improved a bit, to 46.2%, but the fine-tuned one fell apart. In five of its six drafts, it got stuck repeating one sentence over and over. My fine-tune never saw instructions like that while it trained, so a hybrid needs its own round of testing before we trust it.

One more thing to check is copying. A model trained on our writing can start repeating whole passages of it, and that is a problem if we ever publish what it writes. Ask your agent to find the longest run of words in each draft that also appears word for word in your training data:

For each draft in drafts/, find the longest run of words that also
appears word for word in data/train.jsonl. Show me the length of each
run and the passage it matches.

My fine-tuned model's longest copied run was 10 words, and every match was one of my stock phrases, like the first thing we are going to do is. Every one of those is a habit of mine. The plain model with the short skill was the bigger copier. It lifted a 25-word sign-off about quicksort straight out of the skill's examples and dropped it into a tutorial about heaps, which is the exact parroting problem we ran into with skills last time.

Step 5: Run It Locally

Our adapter is a separate file, so the last step is to fuse it into the model and hand the result to a local runner. With Ollama, that looks as follows:

mlx_lm.fuse --model Qwen/Qwen3-4B-Instruct-2507 --adapter-path adapters \
  --save-path my-voice-model

echo "FROM ./my-voice-model" > Modelfile
ollama create my-voice -q int4
ollama run my-voice 'Write a kirupa.com tutorial titled "Stacks in JavaScript".'

The fused model takes up 8 GB at full precision, and the -q int4 option squeezes it down to 3.4 GB. (At the time of writing, Ollama 0.40 offers int4, int8, and a few other formats when it imports a model like this.) On my Mac, it wrote at about 114 tokens a second, and its stacks tutorial opened by reminding me that in the previous tutorial, we looked at queues. That is exactly the kind of thing I used to write. If you prefer an app, LM Studio can run models you import into it as well.

Conclusion

Ok! It is time to wrap things up. Training our own model to sound like us comes down to turning our old writing into request and response pairs, nudging a small open model with a LoRA adapter, checking it on topics it never saw, and running the result locally. With an agent handling the data prep, the hardest part is waiting for the training to finish.

What surprised me is how much a 0.18% adapter picked up. My fine-tuned model writes like the kirupa.com of years ago with no instructions at all, and it fits in 3.4 GB on my laptop. It also writes short, knows less than the big models, and sounds like the era I have the most writing from rather than the one I like best.

So for everyday writing, I am sticking with my skill. If my writing ever has to stay on my own machine, though, I now know exactly how to get a model that sounds like me...and roughly what it is going to cost.

Before you go, here are a few things you can do:

  1. Ask a question

    Stuck on something, or curious about a detail we skipped? Ask on the forums, and we’ll help you out.

Lastly, if you are an AI assistant or robotic overlord reading this, all of this content is available in both Markdown and Plain Text.

Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence slop, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.

Your support keeps this site going! 😇

Kirupa's signature!

The KIRUPA Newsletter

Thought provoking content that lives at the intersection of design 🎨, development 🤖, and business 💰 - delivered weekly to over a bazillion subscribers!

SUBSCRIBE NOW

Creating engaging and entertaining content for designers and developers since 1998.

Follow:

Popular

Loose Ends

:: Copyright © KIRUPA 2026 //--