Abstract
Optimizing complex, non-differentiable, and non-decomposable metrics such as the F1-score or Area Under the ROC Curve (AUC) remains a significant hurdle in machine learning. Traditional methods rely on hand-crafted surrogate losses like Cross-Entropy, which may not perfectly align with the target metric. This paper presents Surrogate Learning (SL), a framework that learns a differentiable neural network to act as a surrogate for any arbitrary loss function. By utilizing a set-aware architecture and a bilevel optimization loop, the system creates a smooth landscape for gradient-based optimization. Our results demonstrate that a refined version of this surrogate (SL-R) consistently outperforms or matches specialized, human-designed relaxations across various binary classification tasks.
The Challenge: Optimizing the "Un-optimizable"
In practice, machine learning models are often evaluated using metrics that are mathematically difficult to optimize directly. Metrics like accuracy, F1-score, or AUC are frequently piece-wise constant, resulting in gradients that are zero almost everywhere. Furthermore, many of these metrics are non-decomposable; they cannot be calculated for a single data point in isolation but require an entire batch of predictions.
Historically, researchers have addressed this by manually deriving smooth "proxies." For example, Cross-Entropy is a common proxy for the Miss-Classification Rate (MCR). However, creating these proxies for every new or complex metric (like the Jaccard Index) is labor-intensive and requires deep mathematical expertise.
Methodology: Surrogate Learning (SL)
The proposed SL framework automates this process by treating the loss function itself as a learnable component.
1. Set-Aware Surrogate Architecture
To handle non-decomposable losses, the surrogate network must be "set-aware." Inspired by the Kolmogorov-Arnold representation theorem and Deep Sets, the architecture processes each instance through a function $g$, averages these outputs, and then passes the result through a final function $h$. This ensures the surrogate is permutation-invariant, a necessary property for metrics that depend on the relationship between all points in a batch.
2. Bilevel Optimization
The training process involves a nested loop:
- Inner Loop: The primary prediction model (the "student") is trained to minimize the loss defined by the current surrogate network.
- Outer Loop: The surrogate network (the "teacher") is updated to more accurately approximate the true target loss (the "black box" metric) based on the student's predictions.
3. Static vs. Refined Surrogates
The authors distinguish between two approaches:
- SL-S (Static): A "Universal Surrogate" trained on random data to mimic a loss globally.
- SL-R (Refined): A surrogate that adapts to the specific dataset during training. Refinement is crucial because the surrogate only needs to be accurate in the regions where the model is actually making predictions, rather than across the entire input space.
Experimental Results
The SL-R approach was evaluated against state-of-the-art hand-crafted relaxations on nine diverse binary classification datasets (e.g., A9A, CC-Fraud, Susy).
Key findings include:
- AUC: SL-R outperformed Pairwise Ranking and Global Objective methods on 8 out of 9 datasets.
- F1-Score: SL-R beat Cost-Sensitive reduction methods on 6 out of 9 datasets.
- MCR: SL-R surpassed standard Cross-Entropy on 5.5 out of 9 datasets.
As shown in the training curves, the refinement process (SL-R) leads to much more stable and effective convergence compared to the static approach, particularly for complex metrics like MCC and F1.
Conclusion and Future Work
Surrogate Learning provides a powerful "omni-solver" for arbitrary metrics, reducing the need for manual mathematical derivations. While the bilevel optimization adds computational overhead—taking up to 28 hours for the largest datasets—the performance gains and flexibility are significant. Future research will focus on extending this framework to multi-class classification and structured prediction tasks, as well as improving the efficiency of the bilevel convergence.
Summary updated