ArticleslgStudy

computer science

Neural machine translation

Neural machine translation is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Neural machine translation rather than just read about it. In short: Neural machine translation (NMT) is an approach to machine translation that uses an artificial neural network to predict the likelihood of a sequence of words, typically modeling entire sentences in a single integrated model. It is the dominant approach today and can produce translations that rival human translations when translating between high-resource languages under specific conditions.

Key takeaways

  • Neural machine translation belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Neural machine translation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Neural machine translation from memory before moving on to harder problems.

Reference excerpt

Neural machine translation (NMT) is an approach to machine translation that uses an artificial neural network to predict the likelihood of a sequence of words, typically modeling entire sentences in a single integrated model. It is the dominant approach today and can produce translations that rival human translations when translating between high-resource languages under specific conditions. However, there still remain challenges, especially with languages that have less high-quality data available, and with domain shift between the data a system was trained on and the texts it is supposed to translate. NMT systems also tend to produce fairly literal translations.

Overview In the translation task, a sentence x = x 1 , I {\displaystyle \mathbf {x} =x_{1,I}} (consisting of I {\displaystyle I} tokens x i {\displaystyle x_{i}} ) in the source language is to be translated into a sentence y = x 1 , J {\displaystyle \mathbf {y} =x_{1,J}} (consisting of J {\displaystyle J} tokens x j {\displaystyle x_{j}} ) in the target language. The source and target tokens (which in the simple event are used for each other in order for a particular game ] vectors, so they can be processed mathematically. NMT models assign a probability P ( y | x ) {\displaystyle P(y|x)} to potential translations y and then search a subset of potential translations for the one with the highest probability. Most NMT models are auto-regressive: They model the probability of each target token as a function of the source sentence and the previously predicted target tokens. The probability of the whole translation then is the product of the probabilities of the individual predicted tokens:

P ( y | x ) = ∏ j = 1 J P ( y j | y 1 , i − 1 , x ) {\displaystyle P(y|x)=\prod _{j=1}^{J}P(y_{j}|y_{1,i-1},\mathbf {x} )}

NMT models differ in how exactly they model this function P {\displaystyle P} , but most use some variation of the encoder-decoder architecture: They first use an encoder network to process x {\displaystyle \mathbf {x} } and encode it into a vector or matrix representation of the source sentence. Then they use a decoder network that usually produces one target word at a time, taking into account the source representation and the tokens it previously produced. As soon as the decoder produces a special end of sentence token, the decoding process is finished. Since the decoder refers to its own previous outputs during, this way of decoding is called auto-regressive.

History

Early approaches In 1987, Robert B. Allen demonstrated the use of feed-forward neural networks for translating auto-generated English sentences with a limited vocabulary of 31 words into Spanish. In this experiment, the size of the network's input and output layers was chosen to be just large enough for the longest sentences in the source and target language, respectively, because the network did not have any mechanism to encode sequences of arbitrary length into a fixed-size representation. In his summary, Allen also already hinted at the possibility of using auto-associative models, one for encoding the source and one for decoding the target. Lonnie Chrisman built upon Allen's work in 1991 by training separate recursive auto-associative memory (RAAM) networks (developed by Jordan B. Pollack) for the source and the target language. Each of the RAAM networks is trained to encode an arbitrary-length sentence into a fixed-size hidden representation and to decode the original sentence again from that representation. Additionally, the two networks are also trained to share their hidden representation; this way, the source encoder can produce a representation that the target decoder can decode. Forcada and Ñeco simplified this procedure in 1997 to directly train a source encoder and a target decoder in what they called a recursive hetero-associative memory. Also in 1997, Castaño and Casacuberta employed an Elman's recurrent neural network in another machine translation task with very limited vocabulary and complexity. Even though these early approaches were already similar to modern NMT, the computing resources of the time were not sufficient to process datasets large enough for the computational complexity of the machine translation problem on real-world texts. Instead, other methods like statistical machine translation rose to become the state of the art of the 1990s and 2000s.

Hybrid approaches During the time when statistical machine translation was prevalent, some works used neural methods to replace various parts in the statistical machine translation while still using the log-linear approach to tie them together. For example, in various works together with other researchers, Holger Schwenk replaced the usual n-gram language model with a neural one and estimated phrase translation probabilities using a feed-forward network.

seq2seq

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Neural machine translation

Start with the simplest possible case. Write down what Neural machine translation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Neural machine translation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Neural machine translation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Neural machine translation

In research
Neural machine translation appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Neural machine translation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Neural machine translation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Applications of artificial intelligence, Computational linguistics, Machine translation, so understanding it makes those chapters shorter.
In everyday life
Look for Neural machine translation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Neural machine translation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Neural machine translation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Neural machine translation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Neural machine translation in simple terms?

Neural machine translation (NMT) is an approach to machine translation that uses an artificial neural network to predict the likelihood of a sequence of words, typically modeling entire sentences in a single integrated model. It is the dominant approach today and can produce translations that rival…

Why does Neural machine translation matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Neural machine translation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Neural machine translation.

Tags

  • Applications of artificial intelligence
  • Computational linguistics
  • Machine translation
  • Tasks of natural language processing

Keep exploring