What are two ways to generate text from a trained encoder-decoder model at serving time?Teacher forcing and attentionTeacher forcing and beam searchGreedy search and attentionGreedy search and beam search
Question
What are two ways to generate text from a trained encoder-decoder model at serving time?Teacher forcing and attentionTeacher forcing and beam searchGreedy search and attentionGreedy search and beam search
Solution
Two ways to generate text from a trained encoder-decoder model at serving time are:
-
Greedy Search: In this method, the model makes the most probable prediction at each step and then feeds this prediction as input to the next step. It's called "greedy" because it takes the best short-term decision at each step in the hope that these would lead to the best overall sequence.
-
Beam Search: This method is an improved version of the greedy search where instead of choosing the most probable next step as the prediction, the model keeps track of multiple predictions and chooses the sequence of predictions that has the overall highest probability. The number of alternative sequences that it keeps track of is determined by a parameter called the "beam width".
Similar Questions
What is the purpose of the attention mechanism in an encoder-decoder model?To translate text from one language to another.To extract information from the image.To allow the decoder to focus on specific parts of the image when generating text captions.To generate text captions for the image.
How does an attention model differ from a traditional model?The decoder only uses the final hidden state from the encoder.Attention models pass a lot more information to the decoder.The traditional model uses the input embedding directly in the decoder to get more context.The decoder does not use any additional information.
What is the main role of the decoder in a Transformer model?Question 14Answera.To generate output tokens based on the final encoder representation.b.To compute attention scores between input and output tokens.c.Learning positional encodings.d.To encode the input sequence.
What is the purpose of the decoder in an encoder-decoder architecture?To generate the output sequence from the vector representationTo convert the input sequence into a vector representationTo learn the relationship between the input and output sequencesTo predict the next word in the output sequence
What is the purpose of the encoder in an encoder-decoder architecture?To convert the input sequence into a vector representationTo generate the output sequence from the vector representationTo predict the next word in the output sequenceTo learn the relationship between the input and output sequences
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.