[Paper Review] Rethinking the Harmonic Loss via Non-Euclidean Distance Layers
The paper extends harmonic loss by replacing Euclidean distance with a spectrum of non-Euclidean distances in the final classification layer, evaluating performance, interpretability, and sustainability across vision and language tasks.
Cross-entropy loss has long been the standard choice for training deep neural networks, yet it suffers from interpretability limitations, unbounded weight growth, and inefficiencies that can contribute to costly training dynamics. The harmonic loss is a distance-based alternative grounded in Euclidean geometry that improves interpretability and mitigates phenomena such as grokking, or delayed generalization on the test set. However, the study of harmonic loss remains narrow: only Euclidean distance is explored, and no systematic evaluation of computational efficiency or sustainability was conducted. We extend harmonic loss by systematically investigating a broad spectrum of distance metrics as replacements for the Euclidean distance. We comprehensively evaluate distance-tailored harmonic losses on both vision backbones and large language models. Our analysis is framed around a three-way evaluation of model performance, interpretability, and sustainability. On vision tasks, cosine distances provide the most favorable trade-off, consistently improving accuracy while lowering carbon emissions, whereas Bray-Curtis and Mahalanobis further enhance interpretability at varying efficiency costs. On language models, cosine-based harmonic losses improve gradient and learning stability, strengthen representation structure, and reduce emissions relative to cross-entropy and Euclidean heads. Our code is available at: https://anonymous.4open.science/r/rethinking-harmonic-loss-5BAB/.
Motivation & Objective
- Motivate alternative distance metrics for harmonic loss beyond Euclidean distance.
- Systematically evaluate a broad set of distance measures in the harmonic loss framework.
- Assess model performance, interpretability of representations, and energy efficiency across domains.
- Provide theoretical insights into geometry implications and convergence for different distances.
Proposed method
- Replace the Euclidean distance in the harmonic loss with a chosen metric d(·,·) from a set including Manhattan, Chebyshev, Minkowski, cosine, Hamming, Canberra, Bray-Curtis, and Mahalanobis.
- Learn class prototypes (weight vectors) jointly with the backbone in a drop-in classification head.
- Evaluate on vision (MNIST, CIFAR-10/100, MarathiSignLanguage, TinyImageNet) and language (OpenWebText with GPT/BERT/Qwen-style decoders) tasks under a unified training protocol.
- Analyze three facets: model performance (accuracy/F1, perplexity), interpretability (embedding geometry via PCA metrics), and sustainability (training time, GFLOPs, emissions).
- Provide theoretical results showing scale-invariance and finite minimizers for 1-homogeneous distances and a PAC-Bayes generalization bound.

Experimental results
Research questions
- RQ1RQ1: Do non-Euclidean harmonic losses yield higher accuracy or faster convergence than cross-entropy and Euclidean harmonic loss?
- RQ2RQ2: Do these losses produce more interpretable representations than cross-entropy?
- RQ3RQ3: Do gains in performance come with higher computational cost, or can they be achieved with similar or lower energy consumption?
- RQ4How do different distance choices affect the geometry of learned prototypes and feature spaces?
Key findings
- Cosine-based harmonic losses offer the most reliable overall performance across vision tasks with competitive accuracy and reduced or neutral emissions.
- Bray-Curtis and Chebyshev distances improve interpretability by increasing embedding structure and reducing dimensionality requirements for 90% variance explained.
- Mahalanobis distance yields strong representation clarity but at higher computational cost and sometimes less stable optimization on complex data.
- In language models, cosine-based and Minkowski distances improve gradient stability and representation structure, often with favorable sustainability profiles.
- Overall, non-Euclidean distances provide a three-way trade-off among accuracy, interpretability, and sustainability, with cosine commonly delivering the best balance.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.