How does a translation app decide which words to use?
A translation app decides which words in the other language best match what you typed. It looks at each word, the words around it and which sentences sound natural, then scores possible translations and picks the best one. It learned from sentences people already translated, so it can still get names and tricky sentences wrong.
In one line: A program that turns a sentence in one language into another by scoring possible translations and picking the best one.
Last reviewed: 25 October 2026 3 min read
What decision does it make?
You give it a sentence in one language. It has to choose the words, and the order of the words, for the same sentence in another language. There are usually many possible answers, so it picks the one with the best score.
| Decision | Possible answers |
|---|---|
| Which words fit in the other language? | Many possible translations. The app shows the one with the highest score. |
What does it look at?
- Words. Each word can match one or more words in the other language.
- The words around it. "Book" means one thing in "read the book" and another in "book a flight", and the other language may need two different words.
- Word order. English puts the verb before the object. Japanese usually puts it at the end, so the words must be moved around.
- Sounding natural. A translation that matches every word can still sound strange, so the app also checks how likely each sentence is in that language.
How does it learn the rule?
- Collect examples. Gather huge numbers of sentences that people have already translated, kept side by side in pairs.
- Line up the words. The program finds which words and phrases tend to appear together in each pair.
- Score new sentences. For a new sentence, it builds possible translations and scores how well each one matches the meaning and how natural it sounds.
- Pick the best. The top-scoring translation is shown.
Where can it go wrong?
- Words with two meanings. If the sentence does not make the meaning clear, it can pick the wrong one.
- Names. A name that is also an ordinary word can get translated by mistake.
- Word for word is not always best. The best translation can use quite different words from the original, so copying word by word can sound wrong.
- Too literal or too smooth. Caring only about matching words gives clumsy sentences. Caring only about sounding natural can give a smooth sentence that means something else.
Try it
Toy example: the Spanish sentence "Tengo hambre" needs an English translation. Change how much the app cares about each score and see which translation it picks.
Toy example: four possible translations of "Tengo hambre", each with a made-up score from 0 to 10 for matching word for word and for sounding natural.
| Item | Values | Score at starting weights |
|---|---|---|
| "I have hunger" | Matches word for word: 9; Sounds natural: 3 | 36 |
| "I am hungry" | Matches word for word: 7; Sounds natural: 10 | 51 |
| "Hungry I am" | Matches word for word: 7; Sounds natural: 2 | 27 |
| "I have a hamburger" | Matches word for word: 2; Sounds natural: 9 | 33 |
Check it
What does a translation app decide?
Answer: Which words fit best in the other language. It picks the words, and their order, for the same sentence in another language.
Why can word-for-word translation go wrong?
Answer: Languages use different words and word orders. One word can have several meanings, and languages put words in different orders.
Where does a translation app learn from?
Answer: Sentences people already translated. Pairs of sentences translated by people are its examples.
For older readers
Older systems were called statistical machine translation. They were trained on a parallel corpus (sentence pairs) and combined two scores: a translation model, for how well the words match, and a language model, for how likely the new sentence is in that language. The best translation has the highest combined score. Newer systems use a neural network called a transformer: an encoder turns the input into an internal representation, and a decoder turns that into text in the other language. Self-attention builds the meaning of each word by weighing and combining information from the other words in the sentence.
Questions
It picks the translation with the best score, and the score can miss things a person would notice, like a name or a word with two meanings.
Not the way a person does. It finds patterns in many sentences that people translated and uses them to score possible answers.
Use short, clear sentences and avoid sayings. If it matters, ask someone who speaks both languages to check it.
Sources
- University language processing course: machine translation, part 1 (lecture notes) (opens another website)
- Stanford University: Speech and Language Processing, chapter 13, machine translation (encoder-decoder transformers) (opens another website)
- Stanford University: Speech and Language Processing, chapter 7, transformers and pretraining (opens another website)