---
title: 'HL-Gauss: Gaussian Histogram Loss for Regression'
url: https://www.emergentmind.com/topics/gaussian-histogram-loss-hl-gauss
type: topic
---

# HL-Gauss: Gaussian Histogram Loss for Regression

Gaussian Histogram Loss, usually abbreviated **HL-Gauss**, is a histogram-based distributional regression loss in which a scalar target is replaced by a **truncated Gaussian target distribution** centered at the observed label, while the model predicts a **categorical histogram** over a bounded output range and is trained by **cross-entropy** or, equivalently up to an additive constant, by minimizing a KL-divergence from target to prediction. The method reframes scalar regression as **distribution matching**: the network learns an estimate of the conditional distribution \(Y \mid \mathbf{x}\), and the final regression output is obtained from the **mean of the predicted histogram** rather than from a directly regressed scalar [1806.04613, 2402.13425].

## 1. Historical emergence and problem setting

HL-Gauss emerged from work on **distributional losses for regression**, motivated by the observation that supervised learners can benefit when hard targets are converted to soft targets. The 2018 paper “Improving Regression Performance with Distributional Losses” introduced the method as a **novel distributional regression loss** and argued that its gains are associated less with learning richer semantics than with producing **better-behaved gradients** during optimization [1806.04613]. The 2024 paper “Investigating the Histogram Loss in Regression” revisited the method as a “recent approach to regression” and undertook a more detailed theoretical and empirical analysis of **why and when** the performance gain appears [2402.13425].

The general setting assumes that the output variable lies in a bounded support \([a,b]\). Instead of directly fitting \(f(\mathbf{x}) \approx y\) with \(\ell_2\) or \(\ell_1\), the model emits a probability vector over \(k\) bins, and each scalar label \(y_j\) is converted into a target distribution whose bin masses can be computed through its CDF. In the HL-Gauss instantiation, this target distribution is a **Gaussian-smoothed neighborhood** around the label, truncated to the histogram support [2402.13425].

A central conclusion shared across the regression analyses is that the advantage of HL-Gauss is not adequately explained by **representation learning**, by a generic **auxiliary-task** effect, or by simply “learning a distribution.” The reported evidence instead points to the **geometry of the loss and the associated optimization dynamics** as the main source of the gain [2402.13425].

## 2. Mathematical formulation

Let the support \([a,b]\) be partitioned into \(k\) bins, with bin \(i\) occupying \([l_i, l_i + w_i]\). The model outputs a softmax vector
\[
\mathrm{hist}(\mathbf{x}) \in [0,1]^k, \qquad \sum_{i=1}^{k} \mathrm{hist}_i(\mathbf{x})=1,
\]
which is interpreted as a histogram density: the probability mass in bin \(i\) is \(\mathrm{hist}_i(\mathbf{x})\), and the corresponding density value inside that bin is \(\mathrm{hist}_i(\mathbf{x})/w_i\) [2402.13425].

With a softmax parameterization, the bin probabilities are
\[
\mathrm{hist}_i(\mathbf{x}) =
\frac{\exp(\phi_\theta(\mathbf{x})^\top \mathbf{w}_i)}
{\sum_{j=1}^{k}\exp(\phi_\theta(\mathbf{x})^\top \mathbf{w}_j)}.
\]
Here \(\phi_\theta(\mathbf{x})\) denotes the learned feature representation and \(\mathbf{w}_i\) the output-layer parameters for bin \(i\) [2402.13425].

For a target distribution with CDF \(F\), the target mass assigned to bin \(i\) is
\[
p_i = F(l_i+w_i)-F(l_i).
\]
The Histogram Loss is then
\[
HL(p,q_{\mathbf{x}}) = - \sum_{i=1}^{k} p_i \log \mathrm{hist}_i(\mathbf{x}),
\]
which is the discrete cross-entropy between the target histogram and the predicted histogram [1806.04613, 2402.13425].

For **HL-Gauss**, the target distribution is a **truncated Gaussian** centered at the label \(y_j\), with variance \(\sigma^2\), over \([a,b]\). Its truncation normalizer is
\[
Z=\frac{1}{2}\left(
\operatorname{erf}\!\left(\frac{b-\mu}{\sqrt{2}\sigma}\right)
-
\operatorname{erf}\!\left(\frac{a-\mu}{\sqrt{2}\sigma}\right)
\right),
\qquad \mu = y_j,
\]
and the target mass in bin \(i\) is
\[
p_i =
\frac{1}{2Z}
\left[
\operatorname{erf}\!\left(\frac{l_i+w_i-\mu}{\sqrt{2}\sigma}\right)
-
\operatorname{erf}\!\left(\frac{l_i-\mu}{\sqrt{2}\sigma}\right)
\right].
\]
This construction spreads target mass across neighboring bins in a controlled way through \(\sigma\), rather than collapsing the label into a one-hot categorical target [1806.04613, 2402.13425].

At inference time, the regression prediction is the **mean of the predicted histogram**. In the RL formulation this is written explicitly as an expectation over bin centers \(z_i\):
\[
\hat{Q}(s,a)=\sum_{i=1}^{k} h_i(x)\, z_i, \qquad z_i=l_i+\frac{w_i}{2},
\]
which is the same principle specialized to value estimation [2607.01880].

## 3. HL-Gauss within the histogram-loss family

A generic histogram loss requires only three ingredients: a histogram output layer, a target distribution, and cross-entropy between target and predicted histograms. HL-Gauss is therefore a **specific instantiation** rather than the entire class [2402.13425].

Its distinctive features are the use of a **truncated Gaussian target distribution**, the explicit control of smoothing via \(\sigma\), and the fact that bin masses are computed by **integrating the Gaussian CDF over bin intervals** rather than by heuristic assignment. The 2024 analysis also stresses the role of **padding**: because the Gaussian is truncated to \([a,b]\), the support should be enlarged so that tail mass outside the histogram is negligible [2402.13425].

| Variant | Target construction | Reported behavior |
|---|---|---|
| **HL-OneBin** | All mass in the single bin containing the label | Often much worse than HL-Gauss; associated with higher bias and more extreme gradients |
| **HL-Uniform** | Mixture of a delta target and a uniform distribution with smoothing parameter \(\epsilon\) | Generally hurts performance; can bias the mean toward the center of the output range |
| **HL-Projected** | Mass assigned to the two nearest bins so the expected value equals the label exactly | Performs much better than HL-OneBin and close to HL-Gauss |
| **HL-Gauss** | Truncated Gaussian centered at the label with variance \(\sigma^2\) | Main recommended variant; usually performs best |

The contrast with **HL-OneBin** is especially important. HL-OneBin is effectively standard cross-entropy over bins, with
\[
HL = -\log \mathrm{hist}_{i_j}(\mathbf{x}_j),
\]
for the label bin \(i_j\). The empirical finding that HL-OneBin is often markedly worse than HL-Gauss indicates that the gain is not produced by the histogram representation alone, but by the particular form of **Gaussian target smoothing** [2402.13425].

A related point concerns **HL-Uniform**. Uniform smoothing might appear to be a generic label-smoothing substitute for Gaussian smoothing, but the reported results indicate that it generally hurts performance because it biases the histogram mean toward the center of the support. By contrast, **HL-Projected** removes discretization bias by design and comes close to HL-Gauss, although HL-Gauss still tends to win empirically [2402.13425].

## 4. Theoretical interpretation and optimization properties

The principal theoretical claim in the regression literature is that histogram losses help primarily through **optimization effects**, not because the network learns “extra information” in a richer probabilistic sense [1806.04613, 2402.13425].

For the softmax-parameterized histogram, the last-layer gradient has the familiar cross-entropy form \(p_i-f_i(\mathbf{x})\), and the 2024 analysis gives the bound
\[
\left\|\nabla_{\theta,\mathbf{w}} HL(\mathbf{t},\mathbf{p})\right\|
\le
\left(l + \|\phi_\theta(\mathbf{x})\|\right)
\sum_{i=1}^{k} |p_i - \mathrm{hist}_i(\mathbf{x})|.
\]
This is contrasted with squared error, whose gradient scale depends on \(|f(\mathbf{x})-y|\), which can be much larger and more variable. The reported interpretation is that HL-Gauss keeps gradients in a **smaller, more stable range**, so gradient descent makes steadier progress [2402.13425].

The same body of work also analyzes **bias** introduced by histogram discretization. When the target distribution is Gaussian and the bins are sufficiently wide and padded, the discretization bias in the histogram mean is bounded by half the bin width:
\[
\mathrm{bias} \le \frac{w}{2}.
\]
This matters because HL-Gauss is not merely a softer version of a one-bin classifier; with appropriate binning and smoothing, the mean of the best histogram approximation remains close to the label [2402.13425].

A further theoretical result links histogram matching to scalar prediction accuracy. If the KL divergence between target and prediction is small, then the squared error between their means is bounded:
\[
(\mathbb{E}_{p_y}[z]-\mathbb{E}_{q}[z])^2
\le
4 \max(|a|,|b|)^2
\min\!\left(
\frac{1}{2}D_{KL}(p_y\|q),
1-e^{-D_{KL}(p_y\|q)}
\right).
\]
This provides a direct formal connection between minimizing histogram cross-entropy and improving the quality of the decoded scalar mean [2402.13425].

The literature also notes a connection to **entropy-regularized search** or maximum-entropy RL, in the sense that HL can be interpreted as minimizing divergence to an exponentiated reward distribution. The 2024 study presents this as an intuition for the improved optimization behavior rather than as a complete explanatory theory [2402.13425].

## 5. Empirical behavior and implementation practice

Across the reported regression benchmarks, HL-Gauss often improves on plain \(\ell_2\) loss. The 2024 study reports gains on **CT Position**, **Song Year**, **Bike Sharing**, **Pole**, **time-series forecasting datasets**, and **Atari value prediction**, and characterizes the recommended recipe as broadly viable without costly hyperparameter tuning [2402.13425].

The 2018 results provide concrete examples. On **CT Position**, the reported test MAE is **19.110** for \(\ell_2\) and **8.992** for HL-Gaussian, while test RMSE moves from **29.512** to **19.980**. On **Bike Sharing**, the reported test MAE changes from **2899.84** to **2495.21**, and RMSE from **4601.21** to **4182.06**. On **Song Year**, the gain is described as smaller, with HL-Gaussian slightly outperforming or matching \(\ell_2\) [1806.04613].

The empirical analysis in 2024 systematically examines several alternative explanations and largely rejects them. The performance gain is reported to be **not just representation learning**, **not just an auxiliary task**, **not just robustness to outliers**, and **not just label augmentation**. A softmax output layer helps, but \(\ell_2\)+softmax is usually still worse than HL-Gauss. This pattern reinforces the view that the decisive factor is the **loss geometry / optimization behavior** [2402.13425].

Training curves and diagnostic measurements are consistent with that view. HL-Gauss is reported to reduce training error faster early in training, to exhibit **more stable gradients** than \(\ell_2\), and to benefit in some settings from **annealing \(\sigma\)**. The 2018 work likewise reports **smaller, more stable gradients** and **faster and smoother convergence** than \(\ell_2\) [1806.04613, 2402.13425].

The reported hyperparameter behavior is structured rather than arbitrary. Too few bins increase bias. Larger bin counts generally do not cause overfitting. Varying \(\sigma\) yields a **U-shaped / v-shaped error curve**, with performance degrading when \(\sigma\) is either too small or too large. The analysis does not strongly support a classical bias–variance tradeoff story, because train and test errors often move together; this suggests that \(\sigma\) acts mainly through **smoothing, optimization, and truncation effects** [2402.13425].

The practical recipe emphasized in the 2024 paper is deliberately simple: **100 evenly sized bins**, **\(\sigma\) about 2 bin widths**, and **padding** to enlarge the support, in some experiments described as about **\(3\sigma\)** on each side. The main regression experiments use **Adam**, **minibatch size 256**, **standard neural nets with ReLU hidden layers**, and a **softmax over bins**. The method is explicitly presented as not requiring expensive dataset-specific hyperparameter tuning to work reasonably well [2402.13425].

## 6. Extension to reinforcement learning and dynamic supports

HL-Gauss has also been applied to RL critics by reframing scalar Bellman targets as **Gaussian-smoothed categorical targets** over a support interval \([\nu_{\min}, \nu_{\max}]\). The critic predicts a categorical distribution \(h_i(x)\), the target bin probabilities \(c_i\) are obtained by integrating a truncated Gaussian over the bins, and the loss is
\[
\mathcal{L} = -\sum_{i=1}^{k} c_i \log h_i(x).
\]
The predicted value can then be decoded by taking the expectation over bin centers [2607.01880].

In this setting, a fixed support interval creates a specific difficulty. If the support is **too narrow**, target mass is truncated, causing **truncation bias**. If it is **too broad**, the same number of bins covers a larger range, so each bin is broader and **quantisation bias** increases. The problem is especially acute in RL because return scales are **non-stationary** as the policy changes during training [2607.01880].

The 2026 paper “Learning the Supports for Categorical Critic in Reinforcement Learning” addresses this limitation by proposing **Dynamic Support Endpoint Learning (DySEL)**, which learns \(\nu_{\min}\) and \(\nu_{\max}\) jointly with the critic. The method derives an upper bound on the mean-squared Bellman error,
\[
\mathrm{MSE}_{\mathrm{Bellman}}
\le
8 \max(|\nu_{\min}|,|\nu_{\max}|)^2
\min\!\left(
\frac{1}{2}\mathcal{D}_{KL}(q_y\|h_x),
1-\exp(-\mathcal{D}_{KL}(q_y\|h_x))
\right)
+
2(\mathbb{E}_{q_y}[z]-(\mathcal{T}Q)(s,a))^2,
\]
and converts the support-selection problem into a constrained objective balancing a **width penalty**, the standard HL-Gauss cross-entropy term, and a **coverage constraint** based on the Gaussian mass \(Z\) inside the support [2607.01880].

The resulting Lagrangian min-max objective is
\[
\mathcal{L}(\theta,\phi,\lambda) =
\alpha \max(|\nu_{\min}|,|\nu_{\max}|) +
\frac{1}{\alpha}\left(-\sum_{i=1}^{k} c_i \log h_i(x)\right) +
\lambda\bigl((1-Z)-\epsilon\bigr),
\]
with the two principal forces interpreted as opposing: the width penalty favors a narrow support for tighter bounds and better resolution, while the mass constraint forces the support to remain wide enough to include most of the target Gaussian mass [2607.01880].

Empirically, DySEL is evaluated on **11 DeepMind Control Suite continuous-control tasks** using **TD3** as the base algorithm, against **TD3** and **TD3 + HL-Gauss** with fixed support \([-100,100]\). The reported configuration uses **\(k=128\) bins** and **sigma-to-width ratio \(=0.75\)**. The reported finding is that **TD3+DySEL is competitive with TD3+HLG on most tasks and improves on a subset**, with especially strong gains on **humanoid tasks**. Two support-evolution patterns are observed: some tasks converge quickly to a stable interval, while others gradually expand the support during training. Ablations show that removing the width penalty causes support explosion and divergence, whereas removing the mass constraint yields supports that are too narrow and degrades performance [2607.01880].

## 7. Related methods, disambiguation, and recurrent misconceptions

A recurrent source of confusion is the term **Histogram Loss** itself. The 2016 paper “Learning Deep Embeddings with Histogram Loss” defines a batch-level ranking loss for metric learning by estimating positive and negative similarity distributions with **1D histograms** and minimizing the probability that a negative pair has higher similarity than a positive pair. Its histogram estimator uses **linear interpolation** and is explicitly equivalent to a **triangular kernel**, not a Gaussian-smoothed regression target. It is therefore conceptually related to HL-Gauss at the level of differentiable histograms, but it is **not** HL-Gauss [1611.00822].

The same distinction applies to “Continuous Histogram Loss” (CHL), which generalizes the embedding-style histogram loss to **continuous-valued pairwise similarities** by constructing a **2D joint histogram** over distances and similarities. CHL also uses **triangular / piecewise linear binning**, not Gaussian kernels, and its objective is the probability of reversed ordering in the joint \((\mathrm{distance}, \mathrm{similarity})\) space. It is a histogram-based loss, but not the Gaussian regression formulation identified with HL-Gauss [2004.02830].

A second disambiguation concerns Gaussian losses outside histogram regression. The 2022 rotated-detection paper “Detecting Rotated Objects as Gaussian Distributions and Its 3-D Generalization” models boxes as Gaussians and trains with **KLD**, **GWD**, or **BCD** between predicted and target Gaussian distributions. Although this is Gaussian-distribution learning, it is not a histogram loss and should not be conflated with HL-Gauss [2209.10839].

The most important substantive misconception within the HL-Gauss literature is that its gain derives mainly from “learning the full conditional distribution.” The 2024 regression analysis argues against that interpretation and concludes that the benefits appear to come **mainly from optimization effects**, not from modeling extra information. A plausible implication is that HL-Gauss is best understood not as a generic density-estimation upgrade to regression, but as a **distributionally parameterized surrogate objective** whose Gaussian target smoothing and softmax histogram output create a more stable optimization landscape [2402.13425].

Source: https://www.emergentmind.com/topics/gaussian-histogram-loss-hl-gauss