does a turkish-speaking model think in english?
i had four models translate words from french and german into turkish and looked inside them layer by layer. qwen keeps the concept close to english, and just as close to chinese. kumru doesn't need english at all when it translates.
- type
- experiment
- turkish model
- kumru-2b
- data
- 93 words · fr, de → tr
- gpu
- colab t4
- code
- github
- series
- opening up the model · part 4
- reading
- 11 min
- lang
- en · tr
- status
- ongoing
whenever i asked an ai something in turkish, i used to wonder whether it first translated it into english in its head before answering. this time i wanted to open up four models and look for myself.
i'm not the first one to wonder, of course. in 2024 wendler looked at llama-2 and showed that the model passes through somewhere close to english in its middle layers. i didn't come across a study that did the same for turkish. i picked two kinds of models. the first is qwen3.5, a multilingual model trained on text in lots of languages from the internet, and i'd guess english weighs quite heavily in its data. i took three sizes of it: 0.8b, 2b and 4b. against it i put kumru-2b, which vngrs trained from scratch for turkish.
the experiment #
i took wendler's setup as is. i showed the model four example translations and left the fifth one half finished:
Français: "fleur" - Türkçe: "çiçek"
...
Français: "chien" - Türkçe: "
the model should say "köpek" here, and notice that there's no english anywhere in the task. i picked 106 concrete nouns like book, water, tree and house and wrote them in four languages. i dropped the words that start with the same piece in two languages, since i couldn't tell which one was being read, and 93 words were left for french to turkish.
to look inside the model i used a method called logit lens. in the first post we thought of the model as a building: the words go up floor by floor and get processed a bit more on each floor. logit lens takes the half-done work on each floor and asks the model "if you had to answer right now, what would you say?". on every floor i tracked the probability of three words: the turkish answer ("köpek"), the english word for the concept ("dog") and the source word ("chien").
qwen 0.8b
qwen 2b
qwen 4b
kumru 2b
when i first looked at the chart it felt like the job was done. "dog" shows up in qwen's middle layers and gives way to "köpek" towards the last ones. the english share grows with the model: from 7.5% in 0.8b to 39% in 4b, and english is ahead of turkish in 92 of the 93 words. in kumru turkish is there from the start and english is almost nowhere.
honestly, i could have said "ok, that's the answer" and finished the post here. i didn't, because two things bothered me.
is logit lens fooling us #
the first was logit lens itself. it hands the half-done work of a middle layer straight to the model's output, and qwen's output is used to english. the english i saw could just as well have come from the output.
to check this i used tuned lens. tuned lens trains a small translator for each layer, and the translator turns that layer's "language" into one the last layer understands. the model itself isn't touched, only the lens i look through gets better. so that the translators wouldn't favour any language, i trained them on equal amounts of wikipedia text in four languages.
| model | english, logit lens | english, tuned lens | turkish, tuned lens |
|---|---|---|---|
| qwen 0.8b | 0.075 | 0.067 | 0.075 |
| qwen 2b | 0.229 | 0.118 | 0.104 |
| qwen 4b | 0.386 | 0.179 | 0.092 |
through the translators, english and turkish came out almost even in the small qwen. in 4b english halved but was still twice turkish. in kumru i saw the opposite: translating from turkish to french, the turkish in the middle layers was 66% with logit lens and dropped to 7% with tuned lens. whichever model it looks at, logit lens inflates the language that model's output is used to. so part of the english in the chart really does come from the lens.
seeing vs using #
the second issue was bigger. something showing up in the middle layers doesn't mean the model uses it. the way to find out is to delete that thing from inside the model and see whether the answer breaks. it's like cooking a dish without salt to find out what the salt does.
in my first attempt i found a direction for each language. i took the average of that language's words minus the average of all languages and deleted the english direction from the middle layers. since i computed the directions on one half of the words and tested them on the other half, i had few words to work with. the small qwen's turkish translation collapsed and 6 correct answers dropped to 0.
then i looked at the directions one by one and saw that in qwen the english and turkish directions were almost opposite, with a cosine similarity of -0.60. turns out i'd been deleting turkish while deleting english. when i took turkish's share out of the english direction and deleted what was left, the effect went away and correct answers only went from 6 to 5. i'd thrown out the sugar while trying to take out the salt. i made the same mistake in kumru.
so i set up a narrower test. for each word i deleted only the english word for that concept: "dog" while translating "chien", "book" while translating "livre". i did the deleting in the middle layers, by removing the direction the model pushes to say that word. on top of that i added three controls:
- deleting the turkish target word. this should break the answer. if it doesn't, the method doesn't work.
- deleting the german word for the concept. this shouldn't break it. if it does, deleting any foreign word is enough.
- deleting an unrelated english word. for example "apple" instead of "dog". this shouldn't break it either.
i also took out the part of the english word that overlaps with the turkish and source words and deleted the rest. otherwise, while deleting "dog", i might have deleted "köpek" or "chien" without noticing.1
kumru's result was very clear. deleting the turkish target took correct answers from 38 to 1, so the method really can break things. deleting english took them from 38 to 40. kumru doesn't need english at all to translate from french to turkish. the interesting part is that going from turkish to french, english really does appear in the middle layers, but deleting it doesn't break the translation.
qwen 4b #
what i really wanted to know about was the big qwen. 4b gets the first piece of the answer right in 77 of the 93 words from french to turkish.
| deleted | correct | how much the right answer's probability dropped | |
|---|---|---|---|
| turkish target | 65 | 0.11 | |
| english (cleaned) | 70 | 0.12 | |
| german (cleaned) | 76 | 0.02 | |
| unrelated english word | 76 | 0.00 | |
deleting the english word for the concept lowered the probability of the turkish answer as much as deleting the turkish target did. deleting german or an unrelated english word did almost nothing. i saw the same picture translating from german to turkish, where i deleted french as the control language.
at first it struck me as odd that deleting turkish itself had less effect. turns out the reason was the layers i was deleting in. in 4b turkish only shows up after layer 30, and i was deleting between layers 16 and 27. in those layers, what carries the concept is the direction that sits close to english. i'll come back to how "english" that really is in a moment.
i had one more suspicion. german "haus" and english "house" look a lot alike, so maybe while deleting english i was really deleting information about the source word. to check, i split the words into ones whose spellings look alike and ones that don't. french "chien" and "dog" have nothing in common, and in the 83 words that don't look alike, deleting english also lowered the probability by 0.11. so the effect doesn't come from similar spellings.
one more size in between #
up to here everything looked very neat. i was about to write "the small qwen doesn't use english, the big one does" when, at the last minute, i decided to run the 2b in between through the same tests too, and i'm glad i did.
| model | correct | lost when english is deleted | |
|---|---|---|---|
| qwen 0.8b | 15 / 93 | 18% | |
| qwen 2b | 49 / 93 | 24% | |
| qwen 4b | 77 / 93 | 16% | |
the last column shows what percentage of the right answer's probability goes away when english is deleted. in all three sizes roughly a fifth goes. the german and unrelated-word controls stayed at 8% or less in all three. translating from german to turkish gave similar numbers (16%, 22%, 12%).2
that's why i couldn't see the effect in the small model. 0.8b gives the right answer a very low probability to begin with, 0.07 on average. when a fifth of that goes, what's left is a difference that's hard to measure. 2b sits right where it can be measured, and there the number of correct answers dropped from 49 to 38. it was the cleanest result of all the runs.3
as the model grows it gets better at translating and the english in the middle layers becomes more visible. how much it leans on english, though, stays about the same. of course, with three sizes and two language pairs it's still too early to say "the share is always the same". at least i didn't see a clear rise or fall with size.
so why english #
one thing still nagged at me. deleting german hadn't worked, deleting english had. and in qwen's training data there's far more english than german. maybe the model didn't keep the concept close to english for any english-specific reason, it just kept it close to the language it had seen the most. and german didn't show up often enough, so deleting it did nothing.
qwen is alibaba's model and was trained on plenty of chinese text alongside english. so i ran the same test with the chinese word for the concept too. while translating "chien" i deleted "狗" instead of "dog".4
| model, pair | english deleted | chinese deleted | german / french |
|---|---|---|---|
| 4b, fr → tr | 16% | 15% | 2% |
| 4b, de → tr | 12% | 10% | 0% |
| 2b, fr → tr | 24% | 24% | 8% |
| 2b, de → tr | 22% | 22% | -1% |
the numbers in the table are again the percentage of the right answer's probability that went away. deleting chinese broke things as much as deleting english. in none of the four cases could the difference between the two be told apart from zero.
honestly, i didn't expect this. the effect isn't specific to english. qwen keeps the concept close to the words of the two languages it has seen the most, english and chinese, and german and french just aren't close enough to that spot. english standing out so much in logit lens most likely comes from qwen's output being used to english. i didn't separately check how much chinese can be read in the middle layers.
evlerimizden #
finally i wondered: does the model first build an english sentence inside and then translate it?
turkish is great for testing this. french "de nos maisons" is "from our houses" in english, and in turkish it's a single word: "evlerimizden". the english phrase starts with "from", the turkish word with "ev". if the model built an english sentence and translated it, i should have run into "from" somewhere in the middle layers. i prepared 60 phrases from 20 nouns and 3 case endings, and 4b wrote 40 of them exactly right.
| layer | "house" | "ev" | "from" |
|---|---|---|---|
| 27 | 0.087 | 0.012 | 0.001 |
| 28 | 0.150 | 0.022 | 0.000 |
| 30 | 0.011 | 0.235 | 0.001 |
| 32 | 0.000 | 0.715 | 0.000 |
"house" is there in the middle layers, and it even shows up before the turkish root, more strongly than it. "from" isn't in any layer. the model doesn't seem to build a sentence like "from our houses" in its head. it builds the word in turkish from the start, and only "house" sits for a while where "ev" will go. i found this just by reading. so i count it as a strong hint more than a firm result.
conclusion #
does a turkish-speaking model think in english? for qwen my answer is partly yes. it keeps the concept somewhere close to english and chinese, and deleting those directions breaks its translation. on the other hand i found no trace of it building an english sentence, it builds the turkish word order itself. kumru didn't need english at all to translate from french to turkish. going from turkish to french, english showed up in the middle layers, but deleting it didn't break the translation.
what surprised me most was chinese. deleting chinese broke the translation as much as deleting english did, and deleting german or french didn't. qwen seems to keep the concept near the languages it has seen the most, and english is just one of them. that's why english standing out the most in logit lens is a bit misleading.
the code and raw results are on github.
Footnotes
-
deleting means removing the output vector of the word's first piece (its row in the output matrix, multiplied by the weights of the final normalization) from the hidden state in the middle layers as a projection. in 4b i deleted in layers 16-27, in 2b and 0.8b in the layers at the same relative depth. in the "cleaned" versions i first removed the target and source word vectors from that vector. 93-95% of the english vector lies outside those two. i found the ranges by resampling the words 10,000 times (bootstrap). in 4b the 95% range is 0.08 to 0.15 for english and 0.01 to 0.03 for german. i trained the tuned lens translators for 1500 steps in 0.8b and 800 steps in 2b and 4b. ↩
-
95% confidence ranges i found by resampling the words (bootstrap, 10,000 repeats). from french to turkish, deleting english: 18% [7, 29] in 0.8b, 24% [17, 31] in 2b, 16% [12, 21] in 4b. from german to turkish: 16% [2, 28], 22% [16, 28], 12% [7, 17]. the difference between english and the control language is above zero in all six cases, the lowest lower bound being 2 points (0.8b, from german). the ranges of the three sizes overlap, so i can't claim a difference between sizes. ↩
-
in a mcnemar test, from french to turkish 13 words went from right to wrong and 2 from wrong to right (p 0.007). from german to turkish 10 to 1 (p 0.012). in 4b the same test was borderline (p 0.07 to 0.09), because 4b is so sure about most words that even when the probability drops, the top answer doesn't change. ↩
-
i wrote the common chinese word for all 106 words (书, 水, 狗, 房子 and so on). no chinese word's first piece overlapped with the turkish target, so all 93 words went into the test. the deleting method and the layers are exactly the same as for english. without cleaning, deleting chinese as it is breaks things even more (22% and 17% in 4b, 35% and 38% in 2b). there i might also be deleting the part that overlaps with turkish. i didn't run this test on 0.8b. 95% ranges of the difference between english and chinese: [−0.007, +0.033] and [−0.009, +0.035] in 4b, [−0.020, +0.017] and [−0.020, +0.016] in 2b. ↩
opening up the model
- 1 the model knows but can't decide
- 2 the model has a finish button
- 3 with thinking mode on, the model copies itself
- 4 does a turkish-speaking model think in english?