liveBook · Manning

Machine translation

As explained in Introduction to Generative AI, Second Edition

Machine translation is the automated conversion of text or speech from one human language into another.

Machine translation automatically converts text or speech from one human language to another. It is a long-standing language technology: early systems used programmed language rules, while later approaches learned translation patterns from text. section 1.10

For neural translation, an input sentence is split into tokens and represented mathematically. A model processes that representation, then decodes its output as text. Attention can help the model focus on relevant parts of the input while generating a translation. section 1.2

An English sentence translated into Spanish

The input “The cat wore red socks” can be encoded and processed by a model, which decodes the Spanish output “El gato usó calcetines rojos.” section 1.2

Figure 1.2 The distribution of attention for the word “it” in different contexts.
A screenshot of a video game

AI-generated content may be incorrect.

The figure illustrates how attention to the word “it” can differ across contexts. section 1.2

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains tokenization, representation, processing, decoding, and attention conceptually without detailing implementation.
Examples
Uses an English-to-Spanish sentence and traces the history from programmed rules to statistical and LLM-based translation.
What you can do after
Understand how a neural model turns an input sentence into a translation and uses attention to weigh relevant input.
How it connects
Connects machine translation to large language models, natural language processing, sequence-to-sequence models, and attention.

Also explained in

Compare how 8 books explain machine translation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.