Neural machine translation

Also known as: NMT

On this page 8

Neural machine translation (NMT) is an approach to automatic translation in which a single neural network, trained end to end on parallel text, reads a source sentence and generates its translation one token at a time. Within Speech & language AI, it replaced phrase-based statistical systems in production during 2016 and 2017 and remains the foundation of modern translation services.

Unlike earlier systems that stitched together translated phrases, NMT models the probability of the entire target sentence given the entire source sentence. This lets it handle word order, agreement and context far more fluently, although it introduces new failure modes such as fluent but unfaithful output.

How neural machine translation generates a sentence

NMT follows an encoder-decoder architecture. The encoder converts the source sentence into a sequence of contextual vectors, and the decoder produces the target sentence autoregressively, predicting each token from the source representation and the tokens already generated. An attention mechanism lets the decoder focus on the relevant source positions at every step.

Text is first split into subword units with methods such as byte-pair encoding or SentencePiece, typically with vocabularies of 16,000 to 64,000 tokens. Subwords let the model translate rare words and names by composing familiar pieces. At inference time, beam search with a beam width of about 4 to 6 keeps several candidate translations and selects the most probable complete sentence, usually with a length penalty.

The architecture has evolved through three main generations, summarized below with their defining strengths and weaknesses.

ArchitecturePeriodCore mechanismMain limitation
RNN encoder-decoder2014 to 2015LSTM or GRU with fixed context vectorDegrades on long sentences
RNN with attention2015 to 2017Decoder attends to all encoder statesSlow sequential training
Transformer2017 onwardSelf-attention and cross-attention layersQuadratic cost in sentence length
Large language model translation2022 onwardDecoder-only model prompted to translateHigher cost and less control
Generations of NMT architectures

Training data and model variants

NMT quality depends above all on parallel corpora: aligned sentence pairs in two languages. High-resource pairs such as English and German have hundreds of millions of pairs, while a low-resource language may have only tens of thousands. Techniques such as back-translation, which translates monolingual target text into the source language to create synthetic pairs, help close this gap.

The main model variants differ in how many languages they cover and how they use data, as the following table shows.

VariantDescriptionTypical use
Bilingual modelOne model per language directionHigh-quality pairs with abundant data
Multilingual modelOne model for many directions with a target-language tagBroad coverage and transfer to rare languages
Zero-shot translationTranslates pairs never seen together in trainingPairs lacking direct parallel data
Domain-adapted modelFine-tuned on legal, medical or technical textConsistent terminology in one field
Document-level modelUses surrounding sentences as contextPronouns, tense and style consistency
Common NMT system variants

How NMT compares with other translation approaches

NMT is best understood against the methods it replaced and the methods now competing with it. The comparison below covers fluency, adequacy and practical control.

ApproachFluencyAdequacyControl and predictability
Rule-based translationLowPredictable on covered grammarHigh, through hand-written rules
Phrase-based statistical translationModerateGood on short phrasesModerate, through phrase tables
Neural machine translationHighHigh, with occasional omissionsModerate, through glossaries and tuning
Prompted large language modelVery highHigh, with risk of additionsLower, output varies with prompts
Translation approaches compared

Speech-to-speech translation systems often place an NMT model between speech-to-text and text-to-speech, although end-to-end speech models increasingly skip the text step. In each case, the translation component is evaluated with metrics such as BLEU, chrF and COMET, and serious deployments add human evaluation, because automatic scores correlate only partly with perceived quality.

Limitations and typical errors

The most important limitation of NMT is that its output sounds natural even when it is wrong. A statistical system produced visibly broken sentences when it failed; an NMT system produces a smooth sentence that may drop a negation or invent a detail. Readers therefore trust it more than they should.

ErrorCauseMitigation
HallucinationNoisy training data or out-of-domain inputData filtering and quality estimation
OmissionDecoder ends the sentence too earlyCoverage checks and length penalties
Terminology driftGeneric training dataGlossary constraints or domain fine-tuning
Gender biasSkewed patterns in the corpusBalanced data and gender-aware rewriting
Context lossSentence-by-sentence translationDocument-level models
Typical NMT errors and mitigations

Another frequent misconception is that a higher BLEU score always means a better system. BLEU counts overlapping word sequences with a reference translation, so it penalizes valid paraphrases and rewards literal output. Neural metrics such as COMET track human judgments more closely, yet they can still miss a single mistranslated number or name.

Choosing and configuring an NMT system

Selecting an NMT setup is a trade-off between quality, cost, latency and data control. A general cloud service is fast to adopt, while a self-hosted model keeps confidential text inside the organization and can be adapted to its terminology. The decision table below links common situations to a sensible starting point.

SituationRecommended setupReason
Occasional gisting of foreign emailsGeneral multilingual serviceLow effort and broad language coverage
Confidential legal or medical textSelf-hosted model with post-editingData stays internal and errors are reviewed
Large catalog with fixed terminologyDomain fine-tuned model with glossaryConsistent product and part names
Real-time chat or subtitlesSmall distilled model on fast hardwareLatency below a few hundred milliseconds
Decision guide for NMT deployments

Configuration details also matter. Knowledge distillation compresses a large teacher model into a smaller student that runs several times faster with a small quality loss, and quantization to 8-bit integers further reduces memory. Teams should evaluate any change on a held-out test set from their own domain rather than on public benchmarks alone.

Human review of NMT output

For regulated content such as contracts, medical instructions or safety notices, the accepted practice is machine translation post-editing, in which a qualified translator reviews and corrects every segment. Raw NMT output is suitable for gisting and internal use, not for published material with legal consequences.

The short version

Neural machine translation is how modern translation apps work. A computer program learns from millions of example sentences that people have already translated. It then reads a new sentence in full and writes the translation word by word.

Because it looks at the whole sentence, the result usually sounds natural. The catch is that natural does not always mean correct. Important texts still need a human to check them.

Where it makes a difference

A manufacturer of industrial pumps must deliver user manuals in 14 languages, each around 80 pages. Fully human translation took about six weeks per release and was a major cost. The company deployed a multilingual NMT model fine-tuned on 10 years of its approved translations and connected it to a terminology glossary so that part names stayed consistent.

Professional translators now post-edit the machine output instead of translating from scratch. In typical projects of this kind, translators report throughput gains of 30 to 60 percent on well-matched content, while safety warnings still receive a full independent review. For this manufacturer, the release cycle fell to about three weeks, and terminology errors flagged by regional distributors dropped noticeably because the glossary was enforced automatically.