IPA vs Spelling

Yet another mostly useless investigation: this time I was wondering if it could be useful to train an embedder for LLMs that was based on the International Phonetic Alphabet (IPA), and not using the normal spelling of words.

My idea behind it was that a lot of words across different languages have similar pronunciations, while the way they are written might be quite different. The goal was to check if such an embedder would prove to be better than a normal one in looking for omologous (cognates) words across different languages: they are words that share an ancestor.

Spoiler: no

As it often happens with these investigations of mine, the results prove my theory wrong. Now you know the answer, you might as well read how I got to it.

The method

Words from two different languages get embedded, each in their own space, then I train a model that maps a word to its cognate on the other space. Actually, two models: a linear one and a more complex one, a small Neural Network.

The data about cognates words comes from Wikictionary: it has information on the etimology of words, which is great if I want to track down each couple of cognates in a language. It’s not complete though, and some cognates were actually missing.

So the next step is to give those models word pairs that weren’t used to train them, both cognates and not, and check if the model is able to recognize them.

The results

The models are quite good at that: using AUC as the metric, the results are in the .95 range, for both spelling and IPA. But the same can be said also by just using the Levensthein distance instead of a model on top of 2 embeddings.

Of course IPA works better than spelling when two cognates are quite different in how they are written, but that’s no new information.

One actually interesting tidbit

Actually an interesting result was found: the following is a heatmap built looking at the model trained on Italian/English. It shows the affinity between couples of letters in the two languages, and it shows that the model has “discovered” Grimm’s law, a set of correspondences between letters in early germanic and other indoeuropean languages.

A Heatmap of letter compatibility

So, next?

I don’t think I will continue with this. It was interesting to see something like this at a language level, now I’m curious to see if it would be possible to convey tone in written language, since it might help an LLM whose only interface is the text to understand the meaning of something.