Theory of Intelligence
DEEP LEARNING•Sequences And Transformers•Nlp With Deep Learning•3.4 Encoder–Decoder & Beam Search

Introduction

Sequence-to-sequence models for translation: how an encoder summarizes the input and a decoder writes the output, training with teacher forcing, and decoding with greedy and beam search.

Introduction

Some tasks turn one sequence into another sequence of a different length: translating "I love deep learning" into French ("J'adore l'apprentissage profond"), summarizing an article into a few sentences, converting speech into text, or turning a question into an answer. The output length isn't known in advance, and the word order can be completely different.

The encoder–decoder (or sequence-to-sequence, seq2seq) architecture handles this with two networks:

  • an encoder reads the whole input and summarizes it;
  • a decoder writes the output one token at a time, using that summary and the tokens it has written so far.

Think of a human interpreter at a conference. They listen to the speaker's whole sentence first (encoder), form an understanding of its meaning, and then speak the translation word by word in the other language (decoder), each word depending on what they've already said.

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!