Task Loss Estimation for Sequence Prediction.

Dzmitry Bahdanau, Dmitriy Serdyuk, Philemon Brakel, Nan Rosemary Ke, Jan Chorowski, Aaron C. Courville, Yoshua BengioarXiv 2015

TL;DR

This paper introduces Task Loss Estimation (TLE), a novel framework for training sequence models by directly estimating the evaluation metric (like edit distance) rather than just maximizing likelihood. By training a model's scoring function to mimic the actual task loss, the authors achieve a significant 13% relative improvement in character error rate for speech recognition without needing extra language modeling data.

What Problem Does This Paper Address?

In machine learning, we often face a "training-evaluation gap." We evaluate our models using metrics we actually care about—like Character Error Rate (CER) in speech or BLEU scores in translation—but we can't optimize these directly because they are usually non-differentiable or computationally "messy."

Instead, we use surrogate losses like cross-entropy. While cross-entropy is easy to optimize, it is "task-agnostic." It treats all incorrect predictions equally, whether they are one character off or completely nonsensical. The authors argue that for structured output problems (like sequences), we need surrogate losses that are consistent with the task loss—meaning that minimizing the surrogate should provably minimize the actual error rate.

Methods

The core idea is simple but powerful: Train the model's scoring function $F(x, y)$ to be an estimate of the task loss $L(x, y)$.

  1. The Min-Min Loss: The authors propose a new surrogate loss, $L_{min,min}$, which measures the estimation error at two points: the ground truth and the model's current best prediction. They prove that if the model accurately estimates the loss at these points, it creates a mathematical upper bound on the actual task loss.
Figure 1: A graphical illustration of how the loss estimation error provides an upper bound for the task loss L, which is the underlying idea of Theorem 1. The segments S, S1, S2, S3 on the picture stand for the four main terms of the theorem statement, L(x, ˆy), |L(x, ˆy) −F(x, ˆy)|, |F(x, y)|, F(x, ˆy) −F(x, y) respectively. The location of the segments related to each other explains why the loss estimation error gives a bound on the task loss L(x, ˆy) of the prediction ˆy. Figure 1a displays the case when the mininum of F(x) is successfully found by hα(x). Figure 1b explains the term F(x, ˆy) −F(x, y) which appears when hα(x) is an approximate minimizer incapable to find an output with a score lower than F(x, y).
  1. Optimistic Task Loss for Sequences: For sequence models (Encoder-Decoders), the total loss is broken down into token-wise targets. They define an "optimistic task loss" $L_o(x, y)$ for a prefix, which represents the lowest possible loss one could achieve by completing that prefix. The model is then trained to predict the change in this optimistic loss at each step.
  2. Training on Mistakes: Unlike standard "teacher forcing" (where the model only sees correct prefixes), this method involves generating a prediction via greedy search during training and penalizing the model based on the estimated loss of that prediction.
A schematic representation of an Encoder-Decoder architecture implementing the score function.

Datasets

The researchers evaluated their approach on the Wall Street Journal (WSJ) speech corpus:

  • Training: The full 81-hour train-si284 set.
  • Validation: The dev93 development set.
  • Testing: The eval92 test set.
  • Benchmarks: They compared their results against standard cross-entropy baselines and existing Connectionist Temporal Classification (CTC) models.

Key Insights and Ideas

  • Fixed Targets: Unlike the generalized hinge loss (used in Structured SVMs), which relies on the relative difference between scores, TLE assigns a fixed target for every input-output pair. This makes the optimization landscape more stable.
  • Score-Landscape Shaping: By defining desired score levels for all possible sequences, the model doesn't just learn to "pull down" the score of the correct answer; it learns to "push up" the scores of incorrect ones by exactly the amount they are wrong.
  • Beyond Likelihood: The results suggest that for classification problems with a massive number of classes (like all possible sentences), cross-entropy might be a sub-optimal surrogate because it lacks the nuance of the task's structure.

Key Results

The TLE approach showed clear advantages, particularly when the model had to rely on its own internal logic without an external language model (LM):

  • 13% Relative Improvement: On the eval92 set without an LM, the TLE model achieved a 6.1% CER, compared to 7.6% for the cross-entropy baseline.
  • State-of-the-Art (at the time): The model reached an 18% Word Error Rate (WER) without an LM, which was the best reported in the literature for that category, significantly beating CTC-based models (which were around 26.9%).
  • Sentence Error Rate (SER): Surprisingly, the SER was also consistently lower, suggesting the model was better at getting the entire sequence right, not just individual characters.

Limitations and Future Work

  • Language Model Integration: The performance gap narrowed significantly when a strong external language model was added. The authors note that the Encoder-Decoder's implicit language modeling can lead to overfitting, which the LM helps correct regardless of the training loss.
  • Complexity of Loss Decomposition: While edit distance is easy to decompose into token-wise steps, more complex metrics like BLEU or METEOR are much harder to break down into "optimistic" prefix targets.
  • Computational Cost: While the authors found tricks to make it as fast as cross-entropy, the theoretical requirement to search for the best prediction during every training step can be expensive.

Summary updated

BibTeX
@misc{bahdanau2015task,
  author = {Dzmitry Bahdanau and Dmitriy Serdyuk and Philemon Brakel and Nan Rosemary Ke and Jan Chorowski and Aaron C. Courville and Yoshua Bengio},
  title = {{Task Loss Estimation for Sequence Prediction.}},
  year = {2015},
  eprint = {1511.06456},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1511.06456},
}
Figure