SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Curve Your Enthusiasm: Concavity Regularization in Differentiable Generalized Additive Models
Julien Siemens*†
siemsj@cs.uni-freiburg.de
Konstantin Ditschuneit*‡
Scenarium AI
ko.ditschuneit@gmail.com
Winfried Ripken*
Merantix Momentum
winfried. ripken@merantix.com
Alma Lindborg*
alma.lindborg@merantix.com
Maximilian Schambach
maximilian.schambach@merantix.com
Johannes S. Otterbach
nyonic
johannes@nyonic.ai
Martin Genzel
martin.genzel@merantix.com
Generalized Additive Models (GAMs) have recently experienced a resurgence in popularity due to their interpretability, which arises from expressing the target value as a sum of non-linear transformations of the features. Despite the current enthusiasm for GAMs, their susceptibility to concavity – i.e., (possibly nonlinear) dependencies between the features – has hitherto been largely overlooked. Here, we demonstrate how concavity can severely impair the interpretability of GAMs and propose a remedy: a conceptually simple, yet effective regularizer which penalizes pairwise correlations of the non-linearly transformed feature variables. This procedure is applicable to any differentiable additive model, such as Neural Additive Models or Neural Prophet, and enhances interpretability by eliminating ambiguities due to self-canceling feature contributions. We validate the effectiveness of our regularizer in experiments on synthetic as well as real-world datasets for time series and tabular data. Our experiments show that concavity in GAMs can be reduced without significantly compromising their prediction quality, improving interpretability and reducing variance in the feature importances.<sup>1</sup>
Interpretability has emerged as a critical requirement of machine learning models in safety-critical decision-making processes and applications subject to regulatory scrutiny. Its importance is particularly underscored by the need to ensure fairness, unbiasedness, accountability and transparency in
${}^{ \ddagger  }$  Work done while at Merantix Momentum
$^{1}$ Code: https://github.com/merantix-momentum/concurvity-regularization
Figure 1: Concavity in a Neural Prophet model: Fitting a time series composed of daily and weekly seasonallities, each represented by Fourier terms. (left) Using few Fourier terms results in uncorrelated components but a poor fit. (middle) A more complex model improves the fit but sacrifices interpretability due to self-canceling high-frequency terms. (right) The same complex model, but with our regularizer, achieves both good predictive performance and interpretable (decorrelated) components. See Section 4.2 for more details.
many applications and domains [6, 42], such as medical diagnoses [10], loan approvals [4], and hiring practices [16]. In such cases, model interpretability can even be favored over prediction accuracy [31].
A popular model class for interpretable machine learning is Generalized Additive Models (GAMs) [24], in which the target variable is expressed as a sum of non-linearly transformed features. GAMs combine the interpretability of (generalized) linear models with the flexibility of capturing non-linear dependencies between the features and the target. GAMs have recently seen a resurgence in interest with prominent examples being Neural Additive Models (NAMs) [2] and its variants [11, 19, 20, 39, 50] for tabular data, as well as Prophet [45] and Neural Prophet [46] for time-series forecasting. Both domains will be further explored in our experiments.
A significant obstacle to the interpretability of additive models is the phenomenon of concavity [9]. As a non-linear analog to multicollinearity, concavity refers to the presence of strong correlations among the non-linearly transformed feature variables. Similarly to multicollinearity, concavity can impair interpretability because parameter estimates become unstable when features are correlated [40], resulting in highly disparate interpretations of the data depending on the model initialization. Although this issue is known and addressed by various techniques such as variable selection [28] in traditional GAMs, it has been overlooked in more recent works. Unlike the prevalent GAM package  $mgcv$  [47], we are not aware of any differentiable GAM implementations that include concavity metrics.
In this work, we propose a novel regularizer for reducing concavity in GAMs by penalizing pairwise correlations of the non-linearly transformed features. Reducing concavity improves interpretability because it promotes the isolation of feature contributions to the target by eliminating potentially correlated or self-canceling transformed feature combinations. As a result, the model becomes easier to inspect by clearly separating individual feature contributions. In addition, our regularizer encourages the model to learn more consistent feature importances across model initializations, which increases interpretability. The trade-off between increased interpretability and prediction quality will be further explored in Section 4.
Figure 1 provides a first intuition of the practical effects of concavity and how they can be addressed by our regularizer. We use the additive time-series model NeuralProphet [46] in this example, restricted to daily and weekly seasonality components. Here, each component is modeled via periodic functions with adjustable complexity. For more details on the experiment, see Section 4.2. We find that while the default NeuralProphet parameters effectively mitigate concavity by producing a very
simple model, they provide a worse fit to the data than the more complex models. However, if left unregularized, a more complex model is subject to strong correlation between the seasonalities, an effect visually apparent in self-canceling periodic components in the middle column of Figure 1. In contrast, when using our regularization, the seasonalities are less correlated, resulting in a clearer separation between the components. While the predictive performance of the two complex models is comparable, the regularized model is more interpretable because daily and weekly effects are clearly separated.
This idea forms the basis of our argument: Comprehending a standard GAM typically requires answers to two questions: How do the features relate to my output? How do the features interact, possibly negating their contributions? By applying concavity regularization, we simplify the interpretation of a GAM by eliminating the need for the second question.
1. We showcase the susceptibility of modern GAMs to concavity and present a revised formal definition of the concept.
2. We propose a concavity regularizer applicable to any differentiable GAM.
3. We validate our approach experimentally on both synthetic and real-world data, investigating the trade-off between concavity and prediction quality, as well as the impact of regularization on interpretability.
2.1 Generalized Additive Models
Generalized Additive Models (GAMs) [24] form a class of statistical models that extends Generalized Linear Models [36] by incorporating non-linear transformations of each feature. Following [24], GAMs can be expressed as:
$$
g \left(\mathbb {E} [ Y | X ]\right) = \beta + \sum_ {i = 1} ^ {p} f _ {i} \left(X _ {i}\right), \tag {GAM}
$$
where  $Y = (y_{1},\ldots ,y_{N})\in \mathbb{R}^{N}$  is a vector of  $N$  observed values of a target (random) variable,  $X = [X_{1},\dots,X_{p}]\in \mathbb{R}^{N\times p}$  assembles the observed feature variables  $X_{i} = (x_{i,1},\dots,x_{i,N})\in \mathbb{R}^{N}$ , and  $f_{i}:\mathbb{R}\to \mathbb{R}$  are univariate, continuous shape functions modeling the individual feature transformations. Furthermore,  $\beta \in \mathbb{R}$  is a learnable global offset and  $g:\mathbb{R}\rightarrow \mathbb{R}$  is the link function that relates the (expected) target value to the feature variables, e.g., the logit function in binary classification or the identity function in linear regression. The shape functions  $f_{i}$  precisely describe the contribution of each individual feature variable in GAMs, and can be visualized and interpreted similarly to coefficients in a linear model. This allows practitioners to fully understand the learned prediction rule and gain further insights into the underlying data.
While early GAMs primarily used splines [24] or boosted decision trees [10, 34, 35] to model  $f_{i}$ , more recent GAMs such as Neural Additive Models (NAMs) [2] use multilayer perceptrons (MLPs) to fit the functions  $f_{i}$ , benefitting from the universal approximation capacity of neural networks [15] as well as the support of automatic differentiation frameworks [1, 8, 38] and hardware acceleration. As a result, one can now solve the GAM fitting problem
$$
\text {G A M - F i t :} \quad \min  _ {\beta , \left(f _ {1}, \dots , f _ {p}\right) \in \mathcal {H}} \mathbb {E} \left[ L \left(Y, \beta + \sum_ {i = 1} ^ {p} f _ {i} \left(X _ {i}\right)\right) \right] \tag {1}
$$
by common deep learning optimization techniques such as mini-batch stochastic gradient descent (SGD). Here,  $L: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$  is a loss function and  $\mathcal{H} \subset \{(f_1, \dots, f_p) \mid f_i: \mathbb{R} \to \mathbb{R}\}$  any function class with differentiable parameters, e.g., MLPs or periodic functions like in NeuralProphet [46].
2.2 Multicollinearity and Concavity
Multicollinearity refers to a situation in which two or more feature variables within a linear statistical model are strongly correlated. Formally, this reads as follows:
As usual, when  $f_{i}$  or  $g$  are applied to a vector, their effect is understood elementwise.
<sup>5</sup>Our definition is based on a fixed (deterministic) feature design, but one could also formulate a probabilistic version, see also Appendix A.2(1).
Definition 2.1 (Multicollinearity). Let  $X_{1},\ldots ,X_{p}\in \mathbb{R}^{N}$  be a set of feature variables where  $X_{i} = (x_{i,1},\dots,x_{i,N})\in \mathbb{R}^{N}$  represents  $N$  observed values. We say that  $X_{1},\ldots ,X_{p}$  are (perfectly) multicollinear if there exist  $c_0,c_1,\ldots ,c_p\in \mathbb{R}$ , not all zero, such that  $c_{0} + \sum_{i = 1}^{p}c_{i}X_{i} = 0$ .
According to the above definition, every suitable linear combination of features that fits a target variable, say  $Y \approx d_0 + \sum_{i=1}^{p} d_i X_i$ , can be modified by adding a trivial linear combination  $c_0 + \sum_{i=1}^{p} c_i X_i = 0$ , i.e.,  $Y \approx (c_0 + d_0) + \sum_{i=1}^{p} (c_i + d_i) X_i$ . So there exist other (possibly infinitely many) equivalent solutions with different coefficients. This can make individual effects of the features on a target variable difficult to disambiguate, impairing the interpretability of the fitted model. However, even in the absence of perfect multicollinearity, difficulties may arise. For example, if two features are strongly correlated, estimating their individual contributions becomes challenging and highly sensitive to external noise. This typically results in inflated variance estimates for the linear regression coefficients [40], among other problems [17].
The notion of concavity was originally introduced in the context of GAMs to extend multicollinearity to non-linear feature transformations [9]. In analogy with our definition of multicollinearity, we propose the following definition of concavity:
Definition 2.2 (Concurvity). Let  $X_{1},\ldots ,X_{p}\in \mathbb{R}^{N}$  be a set of feature variables and let  $\mathcal{H}\subset \{(f_1,\dots ,f_p)\mid f_i:\mathbb{R}\to \mathbb{R}\}$  be a class of functions. We have (perfect) concurvity w.r.t.  $X_{1},\ldots ,X_{p}$  and  $\mathcal{H}$  if there exist  $(g_{1},\ldots ,g_{p})\in \mathcal{H}$  and  $c_{0}\in \mathbb{R}$  such that  $c_{0} + \sum_{i = 1}^{p}g_{i}(X_{i}) = 0$  with  $c_{0},g_{1}(X_{1}),\ldots ,g_{N}(X_{N})$  not all zero.
Technically, concavity simply amounts to the collinearity of the transformed feature variables, and Definition 2.1 is recovered when  $\mathcal{H}$  is restricted to affine linear functions. Concavity poses analogous challenges to multicollinearity: Any non-trivial zero-combination of features can be added to a solution of GAM-Fit in Equation (1), rendering the fitted model less interpretable as each feature's contribution to the target is not immediately apparent. Finally we note that, although concavity can be considered as a generalization of multicollinearity, neither implies the other in general, see Appendix A.2(2) for more details.
3 Concavity Regularizer
Concurvity easily arises in highly expressive GAMs, such as NAMs, since the mutual relationships between the functions  $f_{i}$  are not constrained while solving GAM-Fit in Equation (1). This results in a large, degenerate search space with possibly infinitely many equivalent solutions. To remedy this problem, it appears natural to constrain the function space  $\mathcal{H}$  of (1) such that the shape functions  $f_{i}$  do not exhibit spurious mutual dependencies. Here, our key insight is that pairwise uncorrelatedness is sufficient to rule out concavity. Indeed, using  $\mathcal{H}$  from Definition 2.2, let us consider the subclass
$$
\mathcal {H} _ {\perp} := \left\{\left(f _ {1}, \dots , f _ {p}\right) \in \mathcal {H} \mid \operatorname {C o r r} \left(f _ {i} \left(X _ {i}\right), f _ {j} \left(X _ {j}\right)\right) = 0, \forall i \neq j \right\} \subset \mathcal {H},
$$
where  $\mathrm{Corr}(\cdot ,\cdot)$  is the Pearson correlation coefficient. It is not hard to see that concavity w.r.t.  $X_{1},\ldots ,X_{p}$  and  $\mathcal{H}_{\perp}$  is impossible, regardless of the choice of  $\mathcal{H}$  (see Appendix A.1 for a proof). From a geometric perspective,  $\mathcal{H}_{\perp}$  imposes an orthogonality constraint on the feature vectors. The absence of concavity follows from the fact that an orthogonal system of vectors is also linearly independent. However, it is not immediately apparent how to efficiently constrain the optimization domain of Equation (1) to  $\mathcal{H}_{\perp}$ . Therefore, we rephrase the above idea as an unconstrained optimization problem:
$$
\operatorname {G A M - F i t} _ {\perp}: \quad \min  _ {\beta , \left(f _ {1}, \dots , f _ {p}\right) \in \mathcal {H}} \mathbb {E} \left[ L \left(Y, \beta + \sum_ {i = 1} ^ {p} f _ {i} \left(X _ {i}\right)\right) \right] + \lambda \cdot R _ {\perp} \left(\left\{f _ {i} \right\} _ {i}, \left\{X _ {i} \right\} _ {i}\right), \tag {2}
$$
where  $R_{\perp}:\mathcal{H}\times \mathbb{R}^{N\times p}\to [0,1]$  denotes our proposed concavity regularizer:
$$
R _ {\perp} \left(\left\{f _ {i} \right\} _ {i}, \left\{X _ {i} \right\} _ {i}\right) := \frac {1}{p (p - 1) / 2} \sum_ {i = 1} ^ {p} \sum_ {j = i + 1} ^ {p} \left| \operatorname {C o r r} \left(f _ {i} \left(X _ {i}\right), f _ {j} \left(X _ {j}\right)\right) \right|.
$$
Using the proposed regularizer, GAM-Fit $_{\perp}$  simultaneously minimizes the loss function and the distance to the decorrelation space  $\mathcal{H}_{\perp}$ . In situations where high accuracy and elimination of
<sup>6</sup>Informally, non-perfect multicollinearity describes situations where  $\sum_{i=1}^{p} c_i X_i \approx 0$ . However, a formal definition would also require an appropriate correlation or distance metric.
concurvity cannot be achieved simultaneously, a trade-off between the two objectives occurs, with the regularization parameter  $\lambda \geq 0$  determining the relative importance of each objective. An empirical evaluation of this objective trade-off is presented in the subsequent experimental section.
Since  $R_{\perp}$  is differentiable almost everywhere, GAM-Fit in Equation (2) can be optimized with gradient descent and automatic differentiation. Additional computational costs arise from the quadratic scaling of  $R_{\perp}$  in the number of additive components, although this can be efficiently addressed by parallelization (see Appendix E.3.2 for a runtime analysis). A notable difference to traditional regularizers like  $\ell_1$ - or  $\ell_2$ -penalties is the dependency of  $R_{\perp}$  on the data  $\{X_i\}_i$ . As a consequence, the regularizer is also affected by the batch size and hence becomes more accurate with larger batches. It is also worth noting that our regularizer does not necessarily diminish the quality of the data fit, for instance, when the input feature variables are stochastically independent, see Appendix A.2(3).
Common spline-based concavity metrics proposed in the literature [28, 47] are not directly applicable to other differentiable models such as NAMs or NeuralProphet. Thus, similarly to [40], we decided to report the average  $R_{\perp}(\{f_i\}_i,\{X_i\}_i) \in [0,1]$  as a model-agnostic measure of concavity.
In order to investigate the effectiveness of our proposed regularizer, we will conduct evaluations using both synthetic and real-world datasets, with a particular focus on the ubiquitous applications of GAMs: tabular and time-series data. For the experiments involving tabular data, we have chosen to use Neural Additive Models (NAMs), as they are differentiable and hence amenable to our regularizer. For time-series data, we investigate Neural Prophet models which contain an additive component modeling seasonality. Further elaboration on our experimental setup, including detailed specifications and parameters, can be found in Appendix C.
4.1 Toy Examples
In the following, we design and investigate two instructive toy examples to facilitate a deeper comprehension of the proposed regularizer as well as the relationship between the regularization strength  $\lambda$  and the corresponding model accuracy. Results for an additional toy example from [28] are presented in Appendix E.2.
Toy Example 1: Concavity regularization with and without multicollinearity To compare the effect of concavity regularization on model training in the presence of multicollinearity, we generate synthetic data according to the linear model  $Y = 1 \cdot X_{1} + 0 \cdot X_{2}$ , where  $X_{1}$  and  $X_{2}$  are each drawn from a uniform distribution. We consider three different settings of input feature correlation: (1) the stochastically independent case where  $X_{1}$  and  $X_{2}$  are independently sampled, (2) the strongly correlated case where  $\mathrm{Corr}(X_1,X_2) = 0.9$ , and (3) the perfectly correlated case with  $X_{1} = X_{2}$ .
We first investigate the effect of concavity regularization on the contribution of each feature to the target by measuring the correlation of the transformed features  $f_{1}(X_{1}), f_{2}(X_{2})$  with the target variable  $Y$ . The results are shown in Figure 2a. In the stochastically independent case, the NAM accurately captures the relationship between the input features and target variable regardless of the regularization setting, as observed by the high correlation for  $f_{1}(X_{1})$  and zero correlation for  $f_{2}(X_{2})$  with the target. This result emphasizes the minimal impact of the regularizer when features are independent (see Appendix A.2(2) for details). In the perfectly correlated case, the NAM trained without concavity regularization displays a high correlation for both  $f_{1}(X_{1})$  and  $f_{2}(X_{2})$  with the target, thus using both features for its predictions. In contrast, when concavity regularization is applied, the NAM is pushed towards approximately orthogonal  $f_{i}$ , which encourages feature selection, as indicated by high correlation of either  $f_{1}(X_{1})$  or  $f_{2}(X_{2})$  with the target as there is no natural preference. Interestingly, the situation is slightly different in the strongly correlated case, as  $X_{1}$  is more likely to be selected here, which means that the model has correctly identified the true predictive feature. This nicely illustrates the impact of the proposed regularization on correlated feature contributions. A more detailed visualization of the impact of regularization under perfectly correlated features can be found in Figure 8 in Appendix E.1.
Secondly, we examine the trade-off between the validation RMSE and concavity  $R_{\perp}$  in the perfectly correlated case in Figure 2b. Our findings suggest that with moderate regularization strengths  $\lambda$ , we can effectively eradicate concavity without compromising the accuracy of the model. Only when
(a)
Figure 3: Results for Toy Example 2. (a) Comparison of transformed feature correlation with and without concavity regularization. (b) Trade-off curve between model accuracy (validation RMSE) and measured concavity  $(R_{\perp})$
Figure 2: Results for Toy Example 1. (a) Effect of concavity regularization on uncorrelated and correlated features. For each of the six settings, 40 random initializations were evaluated. (b) Tradeoff curve between model accuracy (validation RMSE) and measured concavity (validation  $R_{\perp}$ ). Results are averaged over 10 random initializations per regularization strength  $\lambda$ .
(b)
the regularization strength is considerably high, the RMSE is adversely affected, without any further reduction in the measured concavity.
Toy Example 2: Concavity regularization in the case of non-linearly dependent features Next, we evaluate our regularizer in the case of non-linear relationships between features, a setting to which it is equally applicable. To this end, we design an experiment with feature variables that are uncorrelated, but not stochastically independent due to a non-linear relationship. We choose  $X_{1} = Z$  and  $X_{2} = |Z|$  where  $Z$  is a standard Gaussian, and let  $Y = X_{2}$  be the target variable. In this case, there is no multicollinearity by design, but the model may still learn perfectly correlated feature transformations. For example, a NAM could learn  $f_{1} = |\cdot|$  and  $f_{2} = \mathrm{id}$ , then  $f_{1}(X_{1}) = f_{2}(X_{2})$ , which are fully correlated, yet providing a perfect fit. For our experiment, we use the same NAM model configuration as in the previous toy example.
The transformed features for the NAM fitted with and without regularization are visualized in Figure 3a. We find that the regularizer has effectively led the NAM to learn decorrelated feature transformations  $f_{1}$  and  $f_{2}$ , reflected in the striking difference in feature correlation (Corr = -0.03 for the regularized NAM compared to Corr = 0.92 for the unregularized model). Moreover, these results suggest that the regularized model seems to have learned the relationship between the features, where  $f_{2}(X_{2})$  seems to approximate  $|f_{1}(X_{1})|$ .
Finally, a trade-off curve of the validation RMSE and  $R_{\perp}$  is shown in Figure 3b, illustrating that even in the case of non-linearly dependent features, our proposed regularizer effectively mitigates the measured concavity  $R_{\perp}$  with minimal impact on the model's accuracy as measured by the RMSE.
4.2 Time-Series Data
In this section, we provide more context and additional results for the motivational example in Figure 1 on time-series forecasting using NeuralProphet [46], which decomposes a time-series into various additive components such as seasonality or trend. In NeuralProphet, each seasonality  $S_{p}$  is modeled using periodic functions as
$$
S _ {p} (t) = \sum_ {j = 1} ^ {k} a _ {j} \cos {(2 \pi j t / p)} + b _ {j} \sin {(2 \pi j t / p)}
$$
where  $k$  denotes the number of Fourier terms,  $p$  the periodicity, and  $a_{j}, b_{j}$  are the trainable parameters of the model. In the synthetic example of Figure 1, we restrict the Neural Prophet model to two components, namely a weekly and daily seasonality. Our overall reduced model is therefore given by  $\hat{y}_{t} = S_{24\mathrm{h}}(t) + S_{7\mathrm{d}}(t)$ .
If  $k$  is sufficiently large, it can cause the frequency ranges of  $S_{24\mathrm{h}}$  and  $S_{7\mathrm{d}}$  to overlap, leading to concavity in the model. The default values of  $k$  provided by NeuralProphet for  $S_{24\mathrm{h}}$  ( $k = 6$ ) and  $S_{7\mathrm{d}}$  ( $k = 3$ ) are intentionally kept low to avert such frequency overlap, as demonstrated in Figure 1 (left). However, this "safety measure" comes at the cost of prediction accuracy due to reduced model complexity.
Figure 4: Trade-off curve for NeuralProphet model trained on step-function data.