AI Notes
Complete translation guide. Seq2seq, attention, transformers. NLP advanced 2024.
What is Machine Translation?
Machine translation (MT) is the automated translation of text or speech from one natural language to another. From early rule-based systems to modern neural approaches, MT has evolved from producing awkward word-by-word substitutions to generating fluent, contextually appropriate translations that rival human quality for many language pairs.
MT is one of the oldest AI applications—Warren Weaver proposed it in 1949—and remains one of the most commercially important. Google Translate serves over 500 million users daily, processing 100 billion words. The evolution of MT mirrors the evolution of AI itself: from hand-crafted rules to statistical learning to deep neural networks.
Approaches to Machine Translation
Rule-Based MT (RBMT) — 1950s-1990s
Architecture
Source text → Analysis → Transfer → Generation → Target text
Components
- Bilingual dictionary (word mappings)
- Grammatical rules (source language)
- Transfer rules (structural transformation)
- Generation rules (target language grammar)
Example (English→French):
"The cat is on the mat"
Analysis: Det(The) N(cat) V(is) Prep(on) Det(the) N(mat)
Transfer: Le/La? chat est sur le/la? tapis
Generation: "Le chat est sur le tapis"
(Must know: chat=masculine, tapis=masculine → "le")
Pros: Predictable, explainable Cons: Enormously expensive to build, brittle, can't handle idioms well
Statistical MT (SMT) — 1990s-2015
| Core idea | Translation as a probabilistic problem |
| Translation model | learned from parallel corpora (aligned translations) |
| Language model | learned from target-language text (fluency) |
Phrase-Based SMT
| "kick the bucket" | "mourir" (not "donner un coup de pied au seau") |
| "the cat" | "le chat" (probability 0.8) |
| "is on" | "est sur" (probability 0.7) |
| "the mat" | "le tapis" (probability 0.9) |
| Decoding | Find best combination of phrases covering entire source |
Neural MT (NMT) — 2014-present
| "The cat sat" | [h₁, h₂, h₃] (contextualized representations) |
| Context + previous words | next target word |
| [context] | "Le" → "chat" → "est" → "assis" |
The Transformer Revolution in MT
Attention-Based Translation
| - Word reordering ("I yesterday went" | "I went yesterday") |
| Training | Millions of parallel sentence pairs |
| Modern MT models | 6 encoder + 6 decoder layers |
Translation Quality Metrics
| candidate | "The cat is on the mat" |
| reference | "The cat sits on the mat" |
| Unigram precision | 5/6 matched |
| Bigram precision | 3/5 matched |
| Scale | 0-100, human quality ≈ 60-80 BLEU |
Challenges in Machine Translation
Structural Divergence
| English (SVO) | "The cat chases the mouse" |
| Japanese (SOV) | "猫が ネズミを 追いかける" (cat mouse chases) |
| Arabic (VSO) | "يطارد القط الفأر" (chases cat mouse) |
Ambiguity Resolution
| Interpretation 1 | I saw her pet duck (animal) |
| Interpretation 2 | I saw her duck down (verb, crouch) |
| Context: "near the pond" | pet duck → "canard" |
| Context: "as the ball flew" | ducking → "se baisser" |
Low-Resource Languages
| High-resource | English, French, Chinese (billions of parallel sentences) |
| Low-resource | Welsh, Yoruba, Quechua (thousands of sentences) |
| - Zero-shot: train on En | Fr, En→De → infer Fr→De |
Modern MT Systems
| System | Approach | Languages | Notable Feature |
|---|---|---|---|
| Google Translate | Transformer NMT | 130+ languages | Zero-shot multilingual |
| DeepL | Transformer NMT | 30+ languages | Often higher quality |
| Meta NLLB | Multilingual | 200 languages | Low-resource focus |
| GPT-4 | Large LM | 100+ languages | Context-aware, conversational |
Interview Questions
Q: Why did neural MT replace statistical MT? A: NMT handles the entire translation in a single model (end-to-end), while SMT required separate components (language model, translation model, reordering model) trained independently. NMT captures long-range context through attention, handles word order naturally, and produces more fluent output. NMT achieved +5-6 BLEU improvement over phrase-based SMT.
Q: What is the attention mechanism's role in translation? A: Attention creates a soft alignment between source and target words. For each target word being generated, attention computes which source words are most relevant and creates a weighted context vector. This solves the information bottleneck of fixed-size encoder vectors and enables the model to handle long sentences and word reordering.
Q: How do multilingual models handle 100+ languages? A: They share a single encoder-decoder across all languages, using a language tag to indicate the target. Shared multilingual representations emerge: similar concepts in different languages map to nearby vectors. This enables zero-shot translation between language pairs never seen together in training.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Machine Translation - Neural MT.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Artificial Intelligence topic.
Search Terms
artificial-intelligence, artificial intelligence, artificial, intelligence, natural, language, processing, machine
Related Artificial Intelligence Topics