Sequence-to-sequence models create one sequence from another, like translating languages or summarizing text. The main metrics to check are BLEU and ROUGE. These compare the model's output to the correct answer by looking at matching words or phrases. BLEU focuses on precision (how many predicted words are correct), while ROUGE focuses on recall (how many correct words were found). These metrics matter because they show how well the model captures the meaning and structure of the target sequence.
Sequence-to-sequence architecture in NLP - Model Metrics & Evaluation
For sequence-to-sequence tasks, confusion matrices are less common because outputs are sequences, not single labels. Instead, we use n-gram overlap counts. For example, BLEU counts how many 1-word, 2-word, 3-word, and 4-word sequences in the prediction match the reference.
Reference: "I love machine learning"
Prediction: "I enjoy machine learning"
1-gram matches: I, machine, learning (3 matches)
2-gram matches: machine learning (1 match)
3-gram matches: none
4-gram matches: none
This overlap helps calculate BLEU or ROUGE scores.
In sequence-to-sequence, precision means how many predicted words are correct, recall means how many correct words were predicted.
Example 1: High precision, low recall
Model predicts only very common words it is sure about, so most predicted words are correct but misses many words from the reference. Result: output is short and incomplete.
Example 2: High recall, low precision
Model predicts many words including many incorrect ones. It covers most of the reference words but adds noise. Result: output is long but less accurate.
Good models balance precision and recall to produce fluent and accurate sequences.
Good BLEU/ROUGE scores: Around 0.5 to 0.7 or higher usually means the model produces meaningful and relevant sequences close to the reference.
Bad BLEU/ROUGE scores: Below 0.2 means the model output is often very different from the reference, likely missing key words or structure.
Note: Scores depend on task difficulty and dataset size, but higher is always better.
- Ignoring sequence length: Very short outputs can get high precision but miss meaning.
- Overfitting: Model memorizes training sequences, scoring high on training but low on new data.
- Data leakage: If test data is too similar to training, metrics look better than real performance.
- BLEU limitations: It does not measure meaning or grammar well, only word overlap.
- ROUGE limitations: Focuses on recall, so it can favor longer outputs with extra words.
Your sequence-to-sequence model has a BLEU score of 0.65 on the test set but produces very short summaries missing important details. Is this good?
Answer: Not fully. A high BLEU score is good, but very short outputs missing details show the model may have high precision but low recall. You want balanced metrics and qualitative checks to ensure summaries are complete and useful.