TheLantern “Who is going to read it?”
A few weeks ago, an ML engineer reached out to me with some questions, and we ended up sharing great ideas.
But when I suggested he write about what he was learning and share it along the way, he didn’t hesitate:
“Who is going to read it?”
On Friday I responded on LinkedIn. For context, here’s my Substack after 6 months:
- 3 subscribers (I love all three of you)
- 345 views
- $0 earned
And each article takes me about 3 weeks.
And you know who reads every single one a MILLION times?
Me.
3 weeks of writing is 3 weeks of thinking. You can’t spend that long on an idea without challenging it. You find the gaps, you rewrite the parts you didn’t really understand, and you still publish knowing it could be better.
Paul Graham put it well: “Writing about something, even something you know well, usually shows you that you didn’t know it as well as you thought.”
This week’s other two posts came straight out of that writing.
On Monday I followed one sentence into Qal, the Tigrinya language model I’m building, to see where word order comes from. A transformer diagram makes you think:
- the words arrive in order
- each one is tagged with its position
- the model knows what came first
- word order comes for free
Only the first one is true.
Each word’s vector comes from its token ID and nothing else, so “flies” gets the same vector wherever you put it, and “time flies like an arrow” and “arrow an like flies time” look alike to attention. Qal fixes that with a second table. The token embedding table says what each token is (8K rows, one per token in the vocabulary), the positional embedding table says where it is in the sequence (128 rows, one per position), and the two get added together:
input embedding = token embedding + positional embedding
On Tuesday I wrote about what a tokenizer turns Tigrinya into. Look at these four forms of “listen”:
- I listen → እሰምዕ
- She listens → ትሰምዕ
- He listens → ይሰምዕ
- We listen → ንሰምዕ
In Tigrinya, the subject becomes a prefix on the verb, and the same stem, ሰምዕ, appears in every form. A tokenizer that follows that pattern splits them into [እ] + [ሰምዕ], [ት] + [ሰምዕ] and so on, so ሰምዕ is one token that every form helps train.
A generic tokenizer may not split them that way. Phi-2’s tokenizer, for example, gives every byte its own token. That’s 12 tokens for ይሰምዕ alone (for ONE word), 9 of them for ሰምዕ. The model can still learn, but it needs more tokens and more examples to find the same relationships, and you pay for those extra tokens on every request.
The question I’d ask of any model now is:
What does its tokenizer turn my language into?
Which brings me back to that ML engineer’s question.
Who is going to read it?
Me, a million times.
And now… you.
Talk soon,
Fanus
P.S. Who do you write for? “Nobody yet” counts as an answer. Reply in the comments or by email.
this week's sources
$ Get the next one in your inbox
The Lantern goes out once a week, along with each new part of Building Qal. Unsubscribe anytime.