For text generation, key metrics include perplexity and BLEU score. Perplexity measures how well the model predicts the next word, showing if the text is fluent and natural. BLEU score compares generated text to human-written text, checking if the output is relevant and accurate. These metrics matter because they tell us if the generated text makes sense and solves the user's problem, like writing emails or answering questions.
Why text generation solves real problems in Prompt Engineering / GenAI - Why Metrics Matter
Text generation does not use a confusion matrix like classification. Instead, we look at perplexity and BLEU scores:
Perplexity: Lower is better (closer to 1 means better prediction)
Example: 10 (bad) vs 2 (good)
BLEU score: Between 0 and 1 (1 means perfect match)
Example: 0.2 (poor) vs 0.7 (good)
In text generation, the tradeoff is between creativity and accuracy. A very creative model may produce interesting but incorrect or irrelevant text (low accuracy). A very accurate model may produce safe but boring or repetitive text (low creativity). For example, a chatbot that is too creative might give wrong answers, while one that is too safe might not engage users well.
Good: Perplexity close to 1-5, BLEU score above 0.5, generated text is clear, relevant, and helpful.
Bad: Perplexity above 10, BLEU score below 0.2, generated text is confusing, irrelevant, or nonsensical.
- Overfitting: Model repeats training text exactly but fails on new prompts.
- Data leakage: Model trained on test prompts, inflating BLEU scores falsely.
- Ignoring diversity: Low perplexity but boring, repetitive text.
- Misleading BLEU: High BLEU doesn't always mean good quality if text is copied.
This question is from classification but helps understand metric importance. A model with 98% accuracy but only 12% recall on fraud misses most fraud cases. So, it is not good for fraud detection because it fails to catch fraud, even if overall accuracy looks high. For text generation, similarly, a model might produce fluent text (high accuracy) but fail to cover important topics (low recall of key info), which is not good.