WEBVTT

00:00:01.290 --> 00:00:02.210
Hi, I'm Miso!

00:00:02.210 --> 00:00:04.972
Laya is a small model that picks between options.

00:00:04.972 --> 00:00:07.120
Two ports bring it to Apple silicon.

00:00:07.120 --> 00:00:08.654
Here's how it works there.

00:00:10.225 --> 00:00:12.678
Laya scores every option in a single pass.

00:00:12.678 --> 00:00:16.357
But exporting it for the Neural Engine welds the number of options

00:00:16.357 --> 00:00:17.583
into the graph itself.

00:00:20.633 --> 00:00:24.173
A question and its options are packed into one sequence, with a

00:00:24.173 --> 00:00:26.238
marker token standing in for each option.

00:00:26.658 --> 00:00:30.615
A bidirectional ModernBERT encoder reads the whole sequence, once.

00:00:31.035 --> 00:00:34.131
One shared head reads a score at every marker, and the

00:00:34.131 --> 00:00:35.256
scores become a choice.

00:00:35.256 --> 00:00:37.789
Cost grows with the length of the packed sequence.

00:00:39.233 --> 00:00:41.833
The MLX port reimplements the model natively.

00:00:41.833 --> 00:00:45.919
It keeps lengths flexible, and batches a Snake move's three questions

00:00:45.919 --> 00:00:47.405
into one forward pass.

00:00:47.825 --> 00:00:52.985
The Core ML port hand-writes a graph for the Neural Engine: channel-first

00:00:52.985 --> 00:00:55.135
layout, one-by-one convolutions, static masks.

00:00:55.135 --> 00:00:57.284
Everything lands in fixed buffers.

00:00:58.925 --> 00:01:02.344
Every one of the six published bundles freezes its option count.

00:01:02.344 --> 00:01:03.277
Five at thirty-two.

00:01:03.277 --> 00:01:05.453
The one that plays Snake, at four.

00:01:06.967 --> 00:01:11.445
The fifty-times claim that travelled divides a hosted round trip by a local call.

00:01:11.445 --> 00:01:15.603
The repo's own ratio, on one machine, is one point three nine four.

00:01:17.183 --> 00:01:19.652
Going closer to the metal costs more of the shape.

00:01:19.652 --> 00:01:22.614
A fixed graph is a bet on the shape of your traffic.

00:01:25.817 --> 00:01:29.561
To recap: one pass over every option, a flexible port and a

00:01:29.561 --> 00:01:32.682
fixed one, and an option count frozen into the shape.

00:01:33.102 --> 00:01:35.132
Every source is in the full article.

00:01:35.132 --> 00:01:35.712
I'm Miso.

00:01:35.712 --> 00:01:36.002
Bye!
