Advanced level · Module 4: Sequence-to-Sequence Architectures · Lesson 3 of 3
Decoding Strategies and Error Analysis
Learners compare greedy decoding and beam search, measure character error rates and analyse which input formats the model fails on.
In this lesson you will
- Implement greedy and beam search decoding
- Analyse seq2seq errors by input type
Key concepts
greedy decodingbeam searchbeam widthcharacter error rateerror analysis by format
The lesson
Greedy decoding picks the most likely token at each step. Beam search keeps the k best partial outputs and usually finds better complete sequences, at higher cost.
Character error rate (edits needed divided by reference length) shows how close wrong outputs are. Grouping errors by input format (for example written months versus numeric dates) shows what the model has not learned.
The same analysis applies to real translation and summarisation systems: measure, group errors, and fix data or model accordingly.
Step by step
- Implement greedy decoding and beam search with width 3.
- Compare exact-match accuracy on the test set.
- Compute character error rate for wrong outputs.
- Group errors by input format and propose a data fix.
Practice activity
Compare decoding strategies and write an error analysis for the date model.
Expected result: A comparison of decoders and an error analysis that leads to a concrete improvement.
Check your understanding
-
What does beam search keep at each step?
Show answer
The k most likely partial output sequences.
-
Why group errors by input format?
Show answer
To find which patterns the model has not learned and target data improvements.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.