Field Notes

The Win-Win Strategy in AI for Engineers

The Win-Win Strategy in AI for Engineers

I am not a maths person, and I fine-tuned a model anyway

In August I fine-tuned Gemma 3 270M with LoRA on my AMD Strix Halo. The first training step froze the whole PC, twice. The fix was to force fp32 and set HSA_ENABLE_SDMA=0. Then my first working model turned out to be a confident liar: asked who I am, it described a freelance photographer in Marrakech. Thirty epochs later the loss had gone from 2.85 to 0.29 and it recited my facts correctly. I exported it to GGUF and ran it locally (the full write-up).

Maths is not my strong side. Before that run I had written eight posts in Maths for LLMs: cosine similarity, softmax, cross-entropy, how one weight learns from its gradient. I did not do that because I like maths. I did it because I wanted the model, and the model needed the maths.

That is the whole strategy in short. The rest of this post is how I apply it, and where it breaks.

The strategy: every hour counts twice

I do not learn a technology and AI separately. I stack them. Either AI is my tutor for the new technology, or an AI feature is the thing I build with it. Most of the time it is both. So each hour pays once in the language I am learning and once in my understanding of AI. That is what I mean by win-win.

The last four months show it better than any principle I could write:

A two-lane timeline from August to November 2026. The tech lane goes from Python to Scala, Cats and Cats Effect. The AI lane goes from Maths for LLMs and a LoRA fine-tune to the Claude API and anthropic4s 1.0.0.
Two tracks on one calendar. Every crossing point is an hour that taught me two things.

Python came first, in August, as my on-ramp from Java to AI. It was the language the LLM book and the fine-tuning tools spoke. In September I started Scala, coming from years of Java. In October my day job moved to Scala and Play, and I moved this site from Spring Boot to Play too. In November the two tracks met head-on: I built a Scala SDK for the Claude API.

Loop one: AI as my tutor, but I type

The fastest way to learn nothing is to let the model write the code for the concept you are trying to learn. So I split the work in two. For the new concept, the AI explains and reviews, and I type every line myself. For everything around it (README, build tweaks, running the tests, committing), it just does it. In one session I had to say it out loud: "Add everything needed, be more autonomous." The chores are not the lesson.

The other rules came from failures, not from a plan:

  • One idea per lesson. Build the type class by hand in plain Scala first, then meet the Cats version.
  • Smallest example first, on my own code. Then climb one rung at a time, and only when I say I am ready.
  • The tutor follows my pace. Telling it where I really stand is my job.

My first attempt at Cats Core went badly. Abstractions came before mechanisms and I got lost. When I restarted with hand-rolled type classes, I wrote: "Now I begin to understand. Man, I lost days in the other session without understanding a thing." When the Kubernetes lessons jumped straight to control-plane internals, I had to stop it: "Remember that I have never touched Kubernetes in my life." The tutor does not have to be one model either. The explanation of Applicative versus Monad that finally clicked came from DeepSeek, and I carried it back into the Claude lessons.

Each of those sessions taught me Scala. They also taught me how to steer a model: how to state my level, when to narrow the scope, and when to say "start again". That is the second win, and I use that skill at work every day.

Loop two: build the AI thing in the language I am learning

On 1 November I opened an empty repo to learn how to call Claude from Scala. It was a Play app using the official Java SDK, and I typed all of it. That morning I wrote my first Scala test and told Claude: "so excited I wrote my first Scala test." At the end of the session I wrote: "everything is converging to a point where I'm learning Scala, I see the fruit of my endeavor." A few minutes later the idea came: turn this into a library other Scala developers can use.

The learning repo had also shown me what hurt. To keep Jackson in step with Play, each app needed 14 lines of dependencyOverrides. And every call site converted Optional and CompletableFuture to Scala types and back. On 22 November anthropic4s 1.0.0 went to Maven Central. It is a pure-Scala SDK with no Kotlin or Jackson on its runtime classpath. I set the direction and made the calls. Claude wrote most of the code and the tests, and I ran every example against the live API.

A table mapping lessons from the claudesdkplay learning repo to features of anthropic4s 1.0.0: dependency overrides to a pure-Scala client, a first Scala test behind a trait to the ScriptedModel testkit, Optional and CompletableFuture to case classes in and out, Play JSON comfort to the play-json module and FutureAnthropic, and Cats Effect to the next lesson.
Almost every design choice in the library goes back to something I typed by hand three weeks earlier.

This is the clearest win-win I have. On the Scala side, every abstraction I had studied got a real job. Case classes became the source of the JSON schema. Testing behind a trait became a testkit that runs agents without calling the model. Future became a Play-friendly client, so a Play app never touches IO. On the AI side, I now know the Claude API from the wire up: the tool loop, structured output, stop reasons, streaming. You do not learn those from a chat window.

Then the loop closed on itself. On the day I started the library I told Claude I was "not knowledgeable about Cats Effect", and the library is built on Cats Effect and fs2. The next morning I opened a new tutor session: "Dude the Cats Effect IO doc is so frustrating, I need to learn Cats Effect." The AI project chose my next Scala lesson.

Loop three: write it down

Every lesson ends as a post. Scala and the JVM has 21 of them, Cats Core 11, LLMs, the whole thing 11 and Maths for LLMs 8. Writing is where I find the holes. If I cannot explain why Order also decides equality, I did not understand Order. The posts are also my notes for the next time I forget.

A four-step loop: hit a wall, learn with AI as tutor, build with AI as the project, write one post per lesson, then the project exposes the next gap. Below it, three rules: I type the new concept, one idea per lesson, smallest example first.
The loop. The project I build decides the next thing I need to learn.

Where it breaks

The win-win has one failure mode, and I wrote about it in my honest take about vibe coders. An agent writes code faster than I can understand it. If I let it write the concept I am learning, I keep the AI win and lose the tech one. My rule is simple: on what I am learning, I type. On what I already know, I delegate.

That is also why I am fine with Claude writing most of anthropic4s. I had already typed the Scala underneath it in the lessons, so I can review it as a Scala developer, not as a passenger. Where I could not do that yet, with Cats Effect, I went back to typing.

What it gave me

  • A Scala and Play day job, weeks after my first Scala post.
  • An open-source Scala SDK for the Claude API, with its own documentation site.
  • A fine-tuned model running locally, and enough maths to explain what its loss curve means.
  • A working sense of how to use AI as a tutor without letting it learn in my place.

If you want to try it, pick a language you need and an AI project that needs that language. Type the new concepts yourself. Write one post per lesson. When the project exposes a gap, that gap is your next lesson.

Keep reading

Security and privacy, in practice

Adding Claude Haiku to my CV builder: sign-in first, a spend cap, and a fallback

BuildCV ran entirely in the browser. Here is how I added four opt-in Claude Haiku 5.5 actions on my own API credit: behind LinkedIn sign-in, capped three ways, falling back to built-in coaching when the money runs out, plus what the first real calls got wrong.

31 Oct 2026 · 8 min read ·113 views ·Written with Claude