In machine learning, we often find ourselves in a "do as I say, not as I mean" situation. We want a speech enhancement model to sound natural to humans, but because human perception (measured by metrics like PESQ) is non-differentiable, we force the model to minimize Mean Squared Error (MSE) instead. This discrepancy is known as loss-metric mismatch: a model can successfully lower its training loss while failing to improve—or even degrading—the actual evaluation metric we care about.
To bridge this gap, researchers have developed a strategy of training differentiable surrogates. Instead of deriving a mathematical gradient for a "black-box" metric, we train a secondary neural network to mimic that metric. This surrogate network, being a differentiable function, can then provide the gradients necessary to optimize the primary model.
The Training-Evaluation Gap
The fundamental problem is that many real-world objectives are discrete, combinatorial, or involve complex simulations. For example, in Multiple Object Tracking, Andrii Maksai notes that models are often trained on frame-level classification but evaluated on the Identification F-score (IDF), which measures long-term trajectory consistency. Similarly, in video captioning, Nasib Ullah and Partha Pratim Mohanta point out that models are trained to predict the next word (cross-entropy) but evaluated on phrasing similarity metrics like BLEU or CIDEr.
When the training objective (the loss) and the goal (the metric) are misaligned, the model may "cheat." Danilo de Oliveira and colleagues demonstrate this via Goodhart’s Law: when a measure becomes a target, it ceases to be a good measure. They show that models optimized solely for the PESQ metric can achieve state-of-the-art scores by using artifacts like the "click trick," resulting in audio that sounds terrible to humans despite high objective scores.
Learning a Differentiable Proxy
The solution is to treat the evaluation metric as a black box and train a neural network to approximate it. This approach, often called Metric Learning or Surrogate Loss Learning, follows a general pattern:
- Metric Approximation: A "surrogate" or "proxy" network is trained to take the output of the primary model and predict the resulting metric score.
- Gradient Backpropagation: Once the surrogate is accurate, its weights are frozen. The primary model is then updated by backpropagating gradients through the surrogate.
- Iterative Refinement: Because the primary model's outputs change during training, the surrogate must be periodically updated to remain accurate in the new regions of the output space.
Szu-Wei Fu and Yu Tsao pioneered this in speech enhancement with Quality-Net and later MetricGAN. In their framework, the "discriminator" acts as the surrogate, learning to predict the PESQ score of enhanced speech. This allows the "generator" (the enhancement model) to optimize directly for human-perceived quality.
Applications Across Domains
This mechanism is remarkably versatile because it decouples the optimization process from the mathematical properties of the target metric.
- Computer Vision: In image super-resolution, Wenlong Zhang and Chao Dong introduced RankSRGAN, which uses a "Ranker" network to mimic non-differentiable perceptual metrics like NIQE. This allows the generator to produce images that are more visually pleasing to humans than those optimized for standard pixel-wise error.
- Combinatorial Optimization: For warehouse logistics, Lu Duan and Zili Wu developed BTOGCN, which uses a task-oriented estimator to bypass the non-differentiable constraints of order batching, allowing the system to minimize actual travel distance.
- Medical Imaging: Gourav Jhanwar and Saad Nadeem utilize moment-based surrogates to predict 3D radiation doses. By approximating clinical Dose Volume Histograms (DVHs) with differentiable moments, they ensure the model respects critical safety constraints, like sparing the spinal cord.
- Physics and Simulations: At the Large Hadron Collider, Javier Duarte and R.G. Shenoy used a CNN surrogate to approximate the Earth Mover’s Distance (EMD), a computationally expensive metric, to optimize on-detector data compression.
Why It Works: Smoothing the Landscape
The intuition behind neural surrogates is that they provide a smooth approximation of a jagged landscape. Many evaluation metrics are step functions (like accuracy) or involve discrete selections (like the shortest path in a graph). These functions have zero gradients almost everywhere, making them impossible to optimize with gradient descent.
A neural network, by contrast, is a continuous and differentiable function. When trained to fit a discrete metric, it essentially "interpolates" between the discrete points, creating a smooth surface that points the way toward better performance. Josif Grabocka and Lars Schmidt-Thieme formalized this in Learning Surrogate Losses, showing that a neural surrogate can turn virtually any "black-box" metric—even non-decomposable ones like AUC or F1-score—into a differentiable objective.
By shifting the focus from "minimizing error" to "maximizing the surrogate of the metric," researchers can align models with the actual goals of the task, whether that is clinical accuracy, human-perceived audio quality, or business profit.