concept decoder in category nlp

This is an excerpt from Manning's book Real-World Natural Language Processing.
Why is this a good idea? If you think of a layer of RNN as a machine that takes in something concrete (for example, word embeddings) and extracts some abstract concepts (for example, scores for POS tags), you can expect that, by repeating this process, RNNs are able to extract increasingly more abstract concepts as the number of layers increases. Although not fully theoretically proven, many real-world NLP applications use multi-layer RNNs. For example, Google’s Neural Machine Translation (NMT) system uses a stacked RNN consisting of eight layers for both the encoder and the decoder (http://realworldnlpbook.com/ch5.html#nmt-paper).
Likewise, the decoder of a Seq2Seq model is similar to the language model we covered in Chapter 5. In fact, they are identical except one crucial difference—a decoder takes an input from the encoder. The language models we covered in Chapter 5 are called unconditional language models because they generate language without any input or precondition. On the other hand, language models that generate language based on some input (condition) are called conditional language models. A Seq2Seq decoder is one type of conditional language model where the condition is the sentence representation produced by the encoder. See figure 6.12 for an illustration of how a Seq2Seq decoder works.
Figure 6.12: Decoder of a Seq2Seq model
![]()
Just as with language models, Seq2Seq decoders generate text from left to right. Like the encoder, you can use an RNN to do this. A decoder can also be a multilayer RNN. However, a decoder cannot be bidirectional—you cannot generate a sentence from both sides. As mentioned in Chapter 5, models that operate on the past sequence they produced are called autoregressive models.