On September 22, the day after Paradigma released Violetto, their little math model, I asked “where is the coreml version”.

A goose flaps at a fleeing runner’s heels. A second goose stands in the way.

They invited me to try it, and I replied “gonna try, but it’s my first time doing it (sending astra in a bit)”. By October 12 my update was that I had a baby etc etc, though Oliver was born back in February, so really this was me trying (and failing) to convey that things weren’t super tidy at that moment in my life.

You can run Violetto on a Mac with MLX or llama.cpp these days. But I did say I’d come back to it. So, ladies and gentlemen, Violetto runs on Core ML.

Try it yourself

On an Apple Silicon Mac with Xcode and uv, follow the setup guide once. Then, from the same shell, try:

.build/release/violetto "$VIOLETTO_MODEL_DIRECTORY" 'Compute 17 * 23.'

On a virtual M4 Pro, generating the full answer on the CPU took nearly sixteen minutes.

How do you know it’s still the same model?

In October I’d been comparing the Core ML port to my own PyTorch version, which could reproduce its own mistakes quite faithfully. This time I compared it to Paradigma’s, one failing test at a time. One of my three test questions asked for the sum of the roots of x² − 5x + 6 = 0. Both my port and Paradigma’s version got 5. They even wrote the same first 233 tokens. However, mine wrote “We must ensure we follow instructions” while theirs wrote “We need to be careful”.

After “We”, Paradigma continued with “need to be careful” and finished in 703 tokens. My port continued with “must ensure we follow instructions” and took 879. Both boxed the same 5.
After “We”, Paradigma’s version gave “need” and “must” the same score. Mine gave “need” a little less. From there, each model generated a different sentence.

I replayed those steps with the same tokens on both sides and compared the activations. In layer 34 I could reproduce the difference with the rest of the model out of the picture. It came down to how much weight to give one earlier token.

The two ticks are neighboring values the model can store. Before the fix the weight lay just above halfway and rounded up. With the reference exponential it lay exactly halfway and rounded down.
Paradigma’s calculation landed exactly halfway between the two nearest values the model could store. The rounding rule picked the lower one. Mine had landed just above halfway, by about 0.00000003.

Both versions use the same rounding rule, so for that calculation I changed the Swift code to use the same exponential function that Paradigma’s implementation uses on the Mac CPU. Then I ran the three test questions again on two Macs. Every token matched.

Besides those three answers, I compared 280 sets of scores, around 42 million numbers, on prompts of up to 2,047 tokens.

I consider these results sufficient for a first pass, though I can’t tell you whether my Core ML port will match Paradigma’s every time.

Ahh, models <3