Vector-Based Loss Functions
- Vector-based loss functions are designed for vector outputs, preserving geometry, magnitude, and direction to capture intrinsic data structures.
- They are applied in fields like turbulent flow reconstruction, probability modeling, and embedding learning to improve task-specific optimization.
- Hybrid approaches combine vector-specific metrics with traditional losses like MSE, balancing physical realism with numerical stability.
Searching arXiv for the cited papers and closely related material on vector-based loss functions. Vector-based loss functions are loss terms designed explicitly for settings in which the basic prediction object is a vector rather than an independent collection of scalar channels. In the most concrete formulation, they arise when the data themselves are vector fields, such as 2D velocity vectors in particle image velocimetry; more broadly, they also include losses defined on probability vectors, embedding vectors, class-weight vectors, box-parameter vectors, feature maps, and other high-dimensional outputs. Across these settings, the common aim is to make the optimization objective reflect the geometry, algebra, or physical interpretation of vector-valued data more faithfully than purely component-wise objectives such as mean squared error (MSE) or standard cross-entropy (Baker et al., 6 Sep 2025, Elharrouss et al., 5 Apr 2025).
1. Conceptual Scope
A broad view of the subject treats a loss as a scalar-valued functional applied to vector outputs of deep networks—logits, probabilities, embeddings, pixels, feature maps, sequences, or vector fields. In this sense, vector-based losses are not confined to one task family: they appear in multiclass classification, metric learning, scientific machine learning, structured prediction, generative modeling, and support-vector methods (Elharrouss et al., 5 Apr 2025, Ciampiconi et al., 2023).
A narrower and more physically explicit use of the term appears in turbulent-flow reconstruction, where each pixel carries a 2D velocity vector
and standard practice treats and as separate scalar channels. The central criticism is that such component-wise losses do not explicitly preserve direction, magnitude, or coherent vector structures such as vortices and jets (Baker et al., 6 Sep 2025).
The literature therefore spans several distinct but related constructions.
| Setting | Vector object | Representative formulation |
|---|---|---|
| Scientific vector fields | 2D velocity vectors on a grid | Cosine, magnitude-index, vector, and hybrid losses (Baker et al., 6 Sep 2025) |
| Probability modeling | Logit and probability vectors on | Fenchel–Young losses from -divergences (Roulet et al., 30 Jan 2025) |
| Representation learning | Embeddings and class-weight vectors on a unit hypersphere | AM-Softmax, Arc-Softmax, SV-Softmax (Wang et al., 2018) |
| High-dimensional structured outputs | Pixels, masks, feature maps, sequences | Dice, Jaccard, perceptual, contrastive, diffusion, and -based losses (Elharrouss et al., 5 Apr 2025, Liu et al., 2022) |
This breadth suggests that “vector-based” denotes not a single formula class but a design principle: the loss should operate on the geometry or structure of the vector object itself, rather than only on isolated coordinates.
2. Mathematical and Geometric Foundations
One major foundation is divergence-based. Given a convex with , the discrete -divergence between positive measures is
0
Using 1 as a regularizer on the probability simplex yields the Fenchel–Young family
2
with prediction operator
3
For 4 and uniform 5, this recovers standard softmax and logistic or cross-entropy loss; for 6-divergences it recovers sparse entmax-type operators and associated losses (Roulet et al., 30 Jan 2025).
A second foundation is convex-geometric. In the framework of proper multiclass losses, the conditional Bayes risk is represented as the concave support function of the closed convex hull of the superprediction set, and a proper loss is characterized by the condition that its loss vector is a subgradient of that support function. This perspective links losses to convex sets, concave gauges, anti-norms, antipolars, and a calculus of loss construction via 7-sums and dual 8-sums of sets (Williamson et al., 2022). A plausible implication is that proper vector-based losses can be designed by first specifying the geometry of admissible loss vectors and only then extracting the loss as a subgradient selection.
A third foundation is metric geometry on embedding spaces. In normalized softmax formulations, features 9 and class weights 0 are 1-normalized, logits are proportional to 2, and the loss acts directly on angular relations in a unit hypersphere. Margin-based variants replace the ground-truth cosine by 3, while support-vector-guided variants modify non-ground-truth logits using class-specific geometric masks 4 defined by pairwise cosine comparisons (Wang et al., 2018). In this regime, “vector-based” means that both the predictions and the notion of hardness are explicitly functions of vector angles and inner products.
3. Vector Similarity Losses for Scientific Vector Fields
The most explicit physical instantiation of vector-based loss functions is the turbulent flow field inpainting problem studied on the Transparent Combustion Chamber III (TCC-III) optical engine. The data are 2D2C PIV snapshots on a 5 grid of velocity vectors, zero-padded to 6 for training, with field of view approximately 7 mm diameter and vector spacing 8 mm. The task is to reconstruct a central 9 gap, corresponding to 10% of visible data, from the surrounding flow field using a U-Net implemented via MONAI (Baker et al., 6 Sep 2025).
The baseline loss is component-wise MSE,
0
where 1 is the ground-truth vector and 2 is the predicted vector. The critique is that MSE mixes magnitude and orientation indirectly and provides no explicit guidance toward preserving coherent vector structures.
To address this, the paper defines a cosine-similarity loss
3
and a magnitude-index loss
4
The cosine term isolates angular mismatch, whereas the magnitude-index term normalizes the vector difference by the sum of magnitudes and is bounded between 0 and 1 for non-zero vectors. These are combined as
5
with 6, and further hybridized with MSE as
7
with 8, both selected by grid search on normalized 9 performance (Baker et al., 6 Sep 2025).
The training setup is deliberately controlled: 5205 snapshots are available; 1041 snapshots at 0 crank angle are held out as test data, and the remaining 4164 are used for training. All models use the same U-Net, ADAM with weight decay 1, initial learning rate 2, halving every 100 epochs, and 600 training epochs. No incompressibility or PDE-based constraints are imposed, so the intervention is strictly at the loss-function level (Baker et al., 6 Sep 2025).
Evaluation uses normalized 3 error and Kullback–Leibler divergence between predicted and ground-truth velocity-magnitude distributions, each reported as median and floor, where the floor represents the worst 5% of predictions. The main quantitative pattern is sharply differentiated. Pure cosine loss performs poorly, with 4 median 5 and KL median 6, and qualitatively produces small nearly uniform vectors. MSE yields the best pixel-wise accuracy, with 7 median 8 and floor 9, but its KL median 0 is much higher than the best vector-based alternatives. The vector loss achieves the best KL median, 1, with 2 median 3, and the hybrid loss obtains the best compromise, with 4 median 5 and KL median 6 (Baker et al., 6 Sep 2025).
The physical interpretation is central. The cosine term is invariant to uniform scaling and targets orientation, which is essential for vortices, jets, shear layers, circulation, and flow topology. The magnitude-index term targets relative speed and combined vector discrepancy, which matters for differentiating high-speed intake jets from slow recirculation zones. MSE, by contrast, favors pointwise component accuracy and can smooth or shrink extreme values. The empirical conclusion is therefore not that vector-based losses dominate MSE universally, but that they preserve multi-scale flow patterns and magnitude distributions more effectively, while a hybrid objective balances physical realism and pixel-wise fidelity (Baker et al., 6 Sep 2025).
4. Embedding-Space, Margin-Based, and Support-Vector Constructions
In face recognition and related embedding problems, vector-based losses operate on normalized feature vectors and class-weight vectors. The normalized softmax baseline is
7
with logits 8. Margin-based variants replace the ground-truth cosine by 9, including A-Softmax, AM-Softmax, and Arc-Softmax; support-vector-guided softmax instead defines a class-wise mask
0
and amplifies violating non-ground-truth logits through
1
This yields SV-Softmax and, with a margin-augmented ground-truth logit, SV-X-Softmax, whose explicit purpose is to combine mining-based emphasis with margin-based angular discrimination in feature-weight space (Wang et al., 2018).
In end-to-end speaker verification, an analogous family of embedding losses is studied on 512-dimensional speaker embeddings produced by a SincNet plus x-vector architecture. The compared losses are cross-entropy, congenerous cosine loss, additive angular margin loss, center loss, contrastive loss, and triplet loss. The additive angular margin formulation,
2
outperforms all other losses in the study and yields more robust embeddings for cosine scoring, with the authors emphasizing improved intra-class compactness and inter-class separation on the hypersphere (Coria et al., 2020).
A related line in binary large-margin learning reworks the penalty applied to margin deficits. The Slide loss
3
introduces a zero-penalty confidence threshold at 4, a linear penalty band for intermediate-confidence points, and a full-penalty region for 5. The resulting 6-SVM is optimized by an ADMM scheme with a working set derived from the closed-form proximal operator of 7, and the reported experiments show robustness and effectiveness on real-world datasets, including under label noise (Li et al., 2024).
Other support-vector formulations generalize this theme through asymmetry, boundedness, or insensitive regions. The bounded asymmetric elastic net loss
8
wraps an asymmetric elastic-net margin loss inside a bounded transform, leading to bounded influence, a violation tolerance upper bound, and Fisher consistency in BAEN-SVM (Du et al., 6 Mar 2026). In support vector quantile regression, the asymmetric 9-insensitive pinball loss
0
creates a fixed-width but asymmetrically split insensitive zone
1
restoring sparsity while preserving quantile asymmetry (Anand et al., 2019). Taken together, these constructions show that vector-based loss design extends beyond Euclidean similarity: it also includes explicit shaping of margin geometry, confidence regions, and class-wise angular relationships.
5. Structural Regularization for High-Dimensional Vector Outputs
A further extension concerns losses on high-dimensional vector outputs such as masks, feature maps, sequences, and reconstructed images. Surveys of deep-learning losses treat MSE, MAE, cross-entropy, binary cross-entropy, focal loss, Dice loss, Jaccard loss, IoU-type losses, KL divergence, contrastive loss, triplet loss, perceptual loss, style loss, adversarial loss, and diffusion losses as scalar objectives defined on vector predictions and then aggregated across components, pixels, anchors, or time steps (Elharrouss et al., 5 Apr 2025, Terven et al., 2023). This perspective places vector-based losses at the center of modern deep learning rather than at its periphery.
In segmentation and detection, region-level vector losses operate on sets represented as vectors or grids. Dice loss,
2
and Jaccard loss,
3
are explicitly geometric: they optimize overlap rather than component-wise deviation. In embedding learning, contrastive and triplet losses directly shape the geometry of the representation space by minimizing Euclidean or cosine distance for positives and enforcing a margin for negatives (Elharrouss et al., 5 Apr 2025, Ciampiconi et al., 2023).
An analytically distinct but conceptually related family uses total variation of real order. Real-order total variation 4, defined through Riemann–Liouville fractional derivatives, provides isotropic and an-isotropic seminorms for 5, with lower semicontinuity and compactness studied both with respect to the function 6 and the order 7. The proposed learning use is a loss or regularization term of the form 8 or 9, where 0 is produced either by a variational model or a neural network (Liu et al., 2022). This gives a continuum linking 1-type behavior near 2, classical TV at 3, and higher-order smoothness for 4. A plausible implication is that vector-based loss design can also be understood as choosing the derivative order and anisotropy with which vector-valued outputs are measured.
6. Design Principles, Evaluation, and Research Directions
Taken together, these works suggest several recurring design principles. First, the vector nature of the target should be respected at the level of the loss. In turbulent flow, this means operating on direction and magnitude rather than on 5 and 6 independently; in embedding learning, it means normalizing vectors and acting on angles or distances; in probability modeling, it means treating logits and target distributions through convex divergences or support-function geometry rather than only through a fixed cross-entropy template (Baker et al., 6 Sep 2025, Wang et al., 2018, Roulet et al., 30 Jan 2025).
Second, many successful constructions separate complementary aspects of the vector object and then recombine them. The flow-field vector loss separates angular alignment from magnitude discrepancy; speaker and face losses separate normalization, scale, and margin; quantile and SVM variants separate insensitive regions from asymmetric penalties; total-variation approaches separate derivative order from isotropy (Baker et al., 6 Sep 2025, Coria et al., 2020, Anand et al., 2019, Liu et al., 2022).
Third, hybridization is repeatedly used to reconcile structure preservation with numerical stability or familiar optimization behavior. The hybrid turbulent-flow loss combines vector similarity with MSE; center loss is added to softmax; detection systems combine classification, localization, and objectness terms; VAE and diffusion systems combine reconstruction and probabilistic regularization (Baker et al., 6 Sep 2025, Elharrouss et al., 5 Apr 2025, Terven et al., 2023). This suggests that vector-based losses are often most effective not as total replacements for classical objectives but as structured complements.
Fourth, evaluation must match the intended geometry. In the turbulent inpainting study, KL divergence of velocity-magnitude distributions reveals structural gains that normalized 7 alone obscures. In metric learning and face or speaker verification, cosine scoring, retrieval performance, or verification metrics are more revealing than classification accuracy alone. In segmentation, Dice, IoU, or mIoU can be better aligned with the objective than pixel-wise cross-entropy (Baker et al., 6 Sep 2025, Coria et al., 2020, Terven et al., 2023).
Finally, the literature points toward increasingly adaptive loss design. One direction is principled generalization beyond cross-entropy through 8-divergence-generated Fenchel–Young losses and 9-softargmax operators; another is automated loss-function search, where multivariate Taylor polynomial parameterizations discovered by CMA-ES outperform cross-entropy on MNIST, CIFAR-10, and SVHN and appear to regularize by discouraging extreme confidence (Roulet et al., 30 Jan 2025, Gonzalez et al., 2020). Survey work correspondingly identifies adaptive, robust, interpretable, and multi-modal loss design as an open frontier (Elharrouss et al., 5 Apr 2025, Terven et al., 2023).
Vector-based loss functions therefore form a heterogeneous but coherent research area. Their unifying premise is that the loss should encode the geometry of the object being predicted—whether that object is a velocity vector, an embedding direction on a hypersphere, a probability distribution on the simplex, a box parameter vector, a mask, or a fractional-gradient field. Where that premise is consequential, the resulting objectives can preserve physical structure, improve discriminative geometry, yield bounded robustness, or better align optimization with downstream evaluation.