betaFeedback

WorksComputer Science

Making Tensor Decoupling More Robust and Less Parametric

Abstract

Tensor decoupling algorithms recover compact representations of multivariate functions by combining linear factor matrices with univariate internal nonlinearities. We identify two limitations of recent methods. First, their performance is not invariant to mismatched output or gradient magnitudes, and second, their spline internals require manual tuning of their degrees of freedom. We propose two lightweight fixes. The first is a preprocessing step that rescales the input Jacobian tensor, removing both the bias towards larger magnitude outputs and the ill-conditioning of certain factor updates caused by such a mismatch. The second replaces B-spline internals by penalized splines coupled with generalized cross-validation, making the method less dependent on the user selecting the right number of control points. Finally, we release an efficient open-source JAX implementation of our algorithm.

Introduction

Tensor Decoupling

Tensor decoupling [1] is a methodology for finding compact representations of multivariate functions. Given a target function ff, decoupling algorithms look for an equivalent decoupled representation

f(x)≈Wg(VTx),(1)f(\mathbf{x}) \approx\mathbf{W}\mathbf{g}(\mathbf{V}^{\mathsf{T}}\mathbf{x}), \tag*{(1)}

in which a small number of univariate nonlinearities, collected in g\mathbf{g} and called internal functions, is sandwiched between two linear transformations W\mathbf{W} and V\mathbf{V}. Such a representation is compact and possibly interpretable, since all the nonlinear behaviour of the target function is captured by a small set of one-dimensional curves [2, 3].

More recent tensor decoupling algorithms [4, 5, 6] bring together several improvements over the original approach. Namely, they exploit the function values themselves (zeroth-order information) by coupling the tensor decomposition with a factorization of the output matrix, tie the last factor to the internal functions instead of fitting them afterwards, and represent the internals with more flexible models than polynomials, such as splines.

Contributions

Important limitations remain, and we identify two desirable properties that are not satisfied by current algorithms.

The first property is invariance to arbitrary rescaling of the target outputs or gradients. In particular, we show that all current least-squares-based approaches are not suited for functions with highly mismatched output or gradient ranges (common in real-world problems) but that this can be easily fixed via a cheap preprocessing step.

The second is the ability for the algorithm to self-tune its expressivity through soft regularization. The use of B-splines to model the univariate internals, while being a powerful and flexible approach, introduces a new hyperparameter which is non trivial to tune and easily leads to under- or overfitting. We show that adding a smoothing penalty to the spline internals, coupled with generalized cross-validation, leads to a penalized splines formulation that is less-parametric with respect to the number of control points.

Both contributions are illustrated on synthetic examples, and an efficient open-source JAX [7] implementation is released1, together with the source code to reproduce our experiments2.

Notation

Vectors, matrices and tensors are denoted by bold lower-case, bold upper-case and calligraphic letters, for example x\mathbf{x}, X\mathbf{X} and X\mathcal{X}. For a third-order tensor X\mathcal{X}, we write X(n)\mathcal{X}_{(n)}, X:k\mathcal{X}_{:k} and Xi::\mathcal{X}_{i::} for its nn-th mode unfolding, frontal slices and horizontal slices, respectively. The symbol ⊙\mathbin{\odot} denotes the Khatri-Rao product, and ∘\circ the outer-product.

Canonical polyadic decomposition

Given a tensor X∈Rm×n×p\mathcal{X} \in\mathbb{R}^{m \times n \times p}, a CP decomposition [8, 9, 10] of X\mathcal{X} aims to represent the tensor as a minimal sum of rank-one tensors

X≈∑i=1rai∘bi∘ci=[A,B,C],(2)\mathcal{X} \approx\sum_{i=1}^{r} \mathbf{a}_i \circ\mathbf{b}_i \circ\mathbf{c}_i = [\mathbf{A},\mathbf{B},\mathbf{C}], \tag*{(2)}

with factor matrices A∈Rm×r\mathbf{A} \in\mathbb{R}^{m \times r}, B∈Rn×r\mathbf{B} \in\mathbb{R}^{n \times r} and C∈Rp×r\mathbf{C} \in\mathbb{R}^{p \times r} collecting the component vectors as columns. The CPD rank rr is the smallest value for which (2) is an equality [11, 12]. This decomposition is unique under mild conditions, and Kruskal’s condition [13] on the k-ranks of the factor matrices κA+κB+κC≥2r+2\kappa_{\mathbf{A}} + \kappa_{\mathbf{B}} + \kappa_{\mathbf{C}} \ge2r + 2 is the most well-known sufficient condition, although others exist [14].

The decoupling problem

Let f:Rm→Rn\mathbf{f} : \mathbb{R}^{m} \to\mathbb{R}^{n} be a multivariate vector-valued function. A single-layer decoupled representation of f\mathbf{f} is one for which (1) holds exactly, with W∈Rn×r\mathbf{W} \in\mathbb{R}^{n \times r}, V∈Rm×r\mathbf{V} \in\mathbb{R}^{m \times r}, and univariate internals collected in g\mathbf{g} such that

g(u)=[g1(u1)  g2(u2)  ⋯  gr(ur)]T,(3)\mathbf{g}(\mathbf{u}) = [g_1(u_1)\ \ g_2(u_2)\ \ \cdots\ \ g_r(u_r)]^{\mathsf{T}}, \tag*{(3)}

for u∈Rr\mathbf{u} \in\mathbb{R}^{r} with univariate functions gi:R→Rg_i : \mathbb{R} \to\mathbb{R}. Solving the decoupling problem amounts to finding the matrices W\mathbf{W}, V\mathbf{V}, and representations of the internal functions gig_i. Under this decoupled model assumption and via application of the chain rule, the Jacobian of f\mathbf{f} evaluated at a point x∈Rm\mathbf{x} \in\mathbb{R}^{m} is

J(x)=Wdiag⁡(g′(VTx))VT,(4)\mathbf{J}(\mathbf{x}) = \mathbf{W}\operatorname{diag}(\mathbf{g}'(\mathbf{V}^{\mathsf{T}}\mathbf{x}))\mathbf{V}^{\mathsf{T}}, \tag*{(4)}

with g′(u)=[g1′(u1) … gr′(ur)]T\mathbf{g}'(\mathbf{u}) = [g'_1(u_1)\ \ldots\ g'_r(u_r)]^\mathsf{T} [1]. Evaluating (4) in NN points and stacking the resulting matrices as frontal slices yields the Jacobian tensor J∈Rn×m×N\mathcal{J} \in\mathbb{R}^{n \times m \times N} with CPD structure

J=[[W,V,H]]withH:j=g′(VTxj)T.(5)\mathcal{J} = [[\mathbf{W},\mathbf{V},\mathbf{H}]] \quad\text{with} \quad\mathbf{H}_{:j} = \mathbf{g}'(\mathbf{V}^\mathsf{T}\mathbf{x}_j)^\mathsf{T}. \tag*{(5)}

The solution strategy forming the basis of most decoupling methods can be summarized as

  1. evaluate the Jacobians and build the 3-way tensor J\mathcal{J},

  2. compute the rank-rr CPD of J\mathcal{J} to retrieve W\mathbf{W}, V\mathbf{V} and H\mathbf{H},

  3. recover the internal univariates g1…grg_1 \ldots g_r.

This approach, however, assumes uniqueness of the underlying CP decomposition, and is therefore not suited for dealing with so-called noisy CPD scenarios.

Coupled matrix-tensor B-spline decoupling (CMTF-BSD)

We briefly describe the CMTF-BSD approach [6], used as a baseline in this work. Besides J\mathcal{J}, this algorithm uses the corresponding inputs X∈RN×m\mathbf{X} \in\mathbb{R}^{N \times m} and outputs Y∈RN×n\mathbf{Y} \in\mathbb{R}^{N \times n}. Zeroth-order information is exploited by coupling the CPD of J\mathcal{J} with a factorization of the output matrix Y≈RWT\mathbf{Y} \approx\mathbf{R}\mathbf{W}^\mathsf{T} [15, 5], where the factor R∈RN×r\mathbf{R} \in\mathbb{R}^{N \times r} collects the (zeroth-order) evaluations of the internals. Then, H\mathbf{H} and R\mathbf{R} are constrained to be consistent with a common internal representation [4], where each ii-th internal gig_i is modeled as a spline of degree dd evaluated at the projected samples zi=Xvi∈RN\mathbf{z}_i = \mathbf{X}\mathbf{v}_i \in\mathbb{R}^{N}

H:i=Bi′ci,R:i=Bici,(6)\mathbf{H}_{:i} = \mathbf{B}'_i\mathbf{c}_i,\qquad\mathbf{R}_{:i} = \mathbf{B}_i\mathbf{c}_i, \tag*{(6)}

where Bi′,Bi∈RN×(df+1)\mathbf{B}'_i,\mathbf{B}_i \in\mathbb{R}^{N \times(d_f+1)} are the B-spline design matrices (with an added column of zeros or ones [6]) evaluated at zi\mathbf{z}_i, and ci∈Rdf+1\mathbf{c}_i \in\mathbb{R}^{d_f+1} are the B-spline coefficients. The resulting problem

min⁡W,V,H,R∥J−[[W,V,H]]∥2+γ∥Y−RWT∥2,(7)\min_{\mathbf{W},\mathbf{V},\mathbf{H},\mathbf{R}} \left\lVert\mathcal{J} - [[\mathbf{W},\mathbf{V},\mathbf{H}]] \right\rVert^2 + \gamma\left\lVert\mathbf{Y} - \mathbf{R}\mathbf{W}^\mathsf{T} \right\rVert^2, \tag*{(7)}

subject to (6) with γ∈R≥0\gamma\in\mathbb{R}_{\ge0} weighting the zeroth-order term, is solved by alternating least-squares. These constraints allow the algorithm to find sound representations even in noisy CPD scenarios.

Output Scale Mismatch

Unbalanced Jacobian magnitudes

The first pathology is general to all existing least-squares-based decoupling algorithms. Namely, existing solutions do not account for the possibility of the Jacobian values of different component functions falling into very unbalanced magnitude ranges. In terms of the tensor J\mathcal{J}, we are considering targets whose horizontal slices have mismatched norms ∥Ji::∥≫∥Jj::∥\lVert\mathcal{J}_{i::}\rVert\gg\lVert\mathcal{J}_{j::}\rVert for some pair (i,j)(i,j). Note that this covers both a mismatch in output ranges and in gradients only.

The CMTF update of factor W\mathbf{W} [5] (the first update performed in each ALS iteration) derived from (7), is given by

W←argmin⁡W ∥J(1)−W(H⊙V)T∥2+γ∥YT−WRT∥2.(8)\mathbf{W} \leftarrow\underset{\mathbf{W}}{\operatorname{argmin}}\ \left\lVert\mathcal{J}_{(1)} - \mathbf{W}(\mathbf{H} \mathbin{\odot} \mathbf{V})^\mathsf{T} \right\rVert^2 + \gamma\left\lVert\mathbf{Y}^\mathsf{T} - \mathbf{W}\mathbf{R}^\mathsf{T} \right\rVert^2. \tag*{(8)}

Both targets J(1)\mathcal{J}_{(1)} and YT\mathbf{Y}^\mathsf{T} have rows indexed by output, and the design matrix is shared across rows. The problem therefore separates into nn independent row problems, such that the ii-th row of the solution is scaled proportionally to the scaling of the ii-th output, leading to the imbalance being absorbed in the row norms of W\mathbf{W}. For convenience, we write W=SW~\mathbf{W} = \mathbf{S}\widetilde{\mathbf{W}}, with S=diag⁡(∥W1:∥ … ∥Wn:∥)\mathbf{S} = \operatorname{diag}(\lVert\mathbf{W}_{1:}\rVert\ \ldots\ \lVert\mathbf{W}_{n:}\rVert) such that sii≫sjjs_{ii} \gg s_{jj} and W~\widetilde{\mathbf{W}} the row-normalized W\mathbf{W}.

The output bias problem

The most direct consequence of dealing with functions having mismatched magnitudes is that the algorithm becomes biased towards larger outputs. Looking at the other factor updates [12, 5]

V←argmin⁡V ∥J(2)−V(H⊙SW~)T∥2,(9)\mathbf{V} \leftarrow\underset{\mathbf{V}}{\operatorname{argmin}}\ \left\lVert\mathcal{J}_{(2)} - \mathbf{V}(\mathbf{H} \mathbin{\odot} \mathbf{S}\widetilde{\mathbf{W}})^\mathsf{T} \right\rVert^2, \tag*{(9)}
H←argmin⁡H ∥J(3)−H(V⊙SW~)T∥2,(10)\mathbf{H} \leftarrow\underset{\mathbf{H}}{\operatorname{argmin}}\ \left\lVert\mathcal{J}_{(3)} - \mathbf{H}(\mathbf{V} \mathbin{\odot} \mathbf{S}\widetilde{\mathbf{W}})^\mathsf{T} \right\rVert^2, \tag*{(10)}
R←argmin⁡R ∥Y−R(SW~)T∥2,(11)\mathbf{R} \leftarrow\underset{\mathbf{R}}{\operatorname{argmin}}\ \left\lVert\mathbf{Y} - \mathbf{R}(\mathbf{S}\widetilde{\mathbf{W}})^\mathsf{T} \right\rVert^2, \tag*{(11)}

each of these splits into one independent subproblem per row of the unknown factor, and each such row is fit against a target spanning all nn outputs at once. J(2)\mathcal{J}_{(2)} and J(3)\mathcal{J}_{(3)} are indexed by input variable and by sample respectively, and each is a concatenation of nn segments (a length-mm Jacobian block for V\mathbf{V} and H\mathbf{H}, a single scalar for R\mathbf{R}), whose ii-th segment carries the scale siis_{ii} of the ii-th output.

A single shared unknown is therefore fit against differently scaled quantities: the residual of the largest output dominates, and small magnitude outputs are in effect ignored.

The conditioning problem

The second issue caused by targets with vastly different output magnitudes is an increase of the condition number of the design matrix in the updates of R\mathbf{R} (always), H\mathbf{H} (when m<rm < r), and V\mathbf{V} (when N<rN < r).

First, in the update of R\mathbf{R} (11), the design matrix is W\mathbf{W} itself, whose rows are scaled by the corresponding factors in S\mathbf{S}. This always affects the condition number as soon as n,r≥2n,r \ge2.

Now, consider the update of H\mathbf{H} (10) with design matrix A=(V⊙SW~)\mathbf{A} = (\mathbf{V} \mathbin{\odot} \mathbf{S}\widetilde{\mathbf{W}}). Up to a row permutation, A\mathbf{A} may be written as

A=[s11⋅Vdiag⁡(w~1)⋮snn⋅Vdiag⁡(w~n)]=[s11⋅M1⋮snn⋅Mn],(12)\mathbf{A} = \begin{bmatrix} s_{11}\cdot\mathbf{V}\operatorname{diag}(\widetilde{\mathbf{w}}_1)\\ \vdots\\ s_{nn}\cdot\mathbf{V}\operatorname{diag}(\widetilde{\mathbf{w}}_n) \end{bmatrix} = \begin{bmatrix} s_{11}\cdot\mathbf{M}_1\\ \vdots\\ s_{nn}\cdot\mathbf{M}_n \end{bmatrix}, \tag*{(12)}

with Mi∈Rm×r\mathbf{M}_i \in\mathbb{R}^{m \times r}. The condition number of A\mathbf{A} is

κ(A)=λmax⁡ATAλmin⁡ATA,(13)\kappa(\mathbf{A}) = \sqrt{\frac{\lambda_{\max}^{\mathbf{A}^\mathsf{T}\mathbf{A}}}{\lambda_{\min}^{\mathbf{A}^\mathsf{T}\mathbf{A}}}}, \tag*{(13)}

where λmax⁡ATA\lambda_{\max}^{\mathbf{A}^\mathsf{T}\mathbf{A}} and λmin⁡ATA\lambda_{\min}^{\mathbf{A}^\mathsf{T}\mathbf{A}} denote the largest and smallest eigenvalue of ATA=∑isii2⋅MiTMi\mathbf{A}^\mathsf{T}\mathbf{A} = \sum_i s_{ii}^2\cdot\mathbf{M}_i^\mathsf{T}\mathbf{M}_i. We study how κ(A)\kappa(\mathbf{A}) evolves with respect to smax⁡=max⁡(S)s_{\max} = \max(\mathbf{S}) while the other scaling factors are fixed, and let jj be the index such that sjj=smax⁡s_{jj} = s_{\max}.

For the largest eigenvalue, we directly have

smax⁡2⋅λmax⁡MjTMj≤λmax⁡ATA≤smax⁡2⋅∑i=1nλmax⁡MiTMi,(14)s_{\max}^2\cdot\lambda_{\max}^{\mathbf{M}_j^\mathsf{T}\mathbf{M}_j} \le\lambda_{\max}^{\mathbf{A}^\mathsf{T}\mathbf{A}} \le s_{\max}^2\cdot\sum_{i=1}^{n}\lambda_{\max}^{\mathbf{M}_i^\mathsf{T}\mathbf{M}_i}, \tag*{(14)}

which yields λmax⁡ATA=Θ(smax⁡2)\lambda_{\max}^{\mathbf{A}^\mathsf{T}\mathbf{A}} = \Theta(s_{\max}^2). For λmin⁡ATA\lambda_{\min}^{\mathbf{A}^\mathsf{T}\mathbf{A}}, we treat the m≥rm \ge r and m<rm < r cases separately.

When m≥rm \ge r, Mj\mathbf{M}_j generically has full column rank rr, so that ∥Mjx∥2≥λmin⁡MjTMj>0\lVert\mathbf{M}_j\mathbf{x}\rVert^2 \ge\lambda_{\min}^{\mathbf{M}_j^\mathsf{T}\mathbf{M}_j} > 0 for every unit vector x\mathbf{x}. Therefore we have

λmin⁡ATA≥smax⁡2⋅λmin⁡MjTMj,(15)\lambda_{\min}^{\mathbf{A}^\mathsf{T}\mathbf{A}} \ge s_{\max}^2\cdot\lambda_{\min}^{\mathbf{M}_j^\mathsf{T}\mathbf{M}_j}, \tag*{(15)}

which combined with (14) yields λmin⁡ATA=Θ(smax⁡2)\lambda_{\min}^{\mathbf{A}^\mathsf{T}\mathbf{A}} = \Theta(s_{\max}^2) and κ(A)=Θ(1)\kappa(\mathbf{A}) = \Theta(1). On the other hand, when m<rm < r, which is common in practice, Mj\mathbf{M}_j is column rank deficient. Picking a unit vector x\mathbf{x} such that Mjx=0M_jx = 0, and denoting by s(2)s_{(2)} the second largest scaling factor, we observe that

λmin⁡ATA≤∑i≠jsi2∥Mix∥2≤s(2)2⋅∑i≠jλmax⁡MiTMi,(16)\lambda_{\min}^{\mathbf{A}^{\mathsf{T}}\mathbf{A}} \le\sum_{i\ne j} s_{i}^{2}\left\|\mathbf{M}_{i}\mathbf{x}\right\|^{2} \le s_{(2)}^{2}\cdot\sum_{i\ne j}\lambda_{\max}^{\mathbf{M}_{i}^{\mathsf{T}}\mathbf{M}_{i}}, \tag*{(16)}

in other words, λmin⁡ATA\lambda_{\min}^{\mathbf{A}^{\mathsf{T}}\mathbf{A}} cannot exceed a fixed ceiling set by s(2)s_{(2)}. Since λmax⁡ATA=Θ(smax⁡2)\lambda_{\max}^{\mathbf{A}^{\mathsf{T}}\mathbf{A}}=\Theta(s_{\max}^{2}), the condition number grows at least as fast as smax⁡/s(2)s_{\max}/s_{(2)}, and κ(A)→∞\kappa(\mathbf{A})\to\infty as smax⁡→∞s_{\max}\to\infty. Similar reasoning applies to the update of V\mathbf{V} (9), however, NN is typically chosen by the user to be larger than the rank [1]. The conditioning problem mainly affects the updates of H\mathbf{H} and R\mathbf{R}.

Solution: tensor rescaling

A straightforward and cheap solution to both problems is to enforce

∥J1::∥=∥J2::∥=⋯=∥Jn::∥,(17)\|\mathcal{J}_{1::}\|=\|\mathcal{J}_{2::}\|=\cdots=\|\mathcal{J}_{n::}\|, \tag*{(17)}

that is, equality on the Frobenius norms of the horizontal slices of J\mathcal{J} (since Ji::\mathcal{J}_{i::} contains all partial derivatives with respect to the ii-th output). This suppresses the imbalance at its source, preventing it from being inherited by S\mathbf{S}. Requiring (17) therefore solves both the output bias problem and the factors conditioning problem. It is easily achieved by rescaling J\mathcal{J} and Y\mathbf{Y} as follows

J~i::←Ji::⋅mN∥Ji::∥andY~:i←Y:i⋅mN∥Ji::∥,(18)\widetilde{\mathcal{J}}_{i::}\leftarrow\mathcal{J}_{i::}\cdot\frac{\sqrt{mN}}{\|\mathcal{J}_{i::}\|}\quad\text{and}\quad\widetilde{\mathbf{Y}}_{:i}\leftarrow\mathbf{Y}_{:i}\cdot\frac{\sqrt{mN}}{\|\mathcal{J}_{i::}\|}, \tag*{(18)}

where the factor mN\sqrt{mN} ensures that the norm does not shrink as the number of samples increases. Both the Jacobian tensor and the output matrix must be scaled by the same per-output factor, so that the coupling between the two terms is preserved. Also note that the representation returned by the algorithm must be unscaled before it can be compared to the target.

The Jacobian measurements used to compute the scaling factors in (18) may themselves be noisy, leading to poor estimates. One alternative in this scenario is to estimate them using a larger set of K>NK>N samples, since the cost of this preprocessing is cheap.

Finally, this rescaling can be seen as a simple diagonal instance of the more general weighted formulation introduced in [4], which addresses the noisy setting, and in which the CPD residual is weighted by the inverse covariance of the Jacobian entries. General weights make it possible to encode per-output measurement noise levels or relative output importance, if such information is available.

Spline Internals Smoothing

Degrees of freedom and overfitting

CMTF-BSD uses B-splines to model the internal univariates. This introduces two hyperparameters: the internal spline degree dd, which is commonly set to d=3d=3 (cubic splines), and degrees of freedom dfdf, defining the number of control points (number of basis functions). It is tempting to increase dfdf, as it maximizes the expressivity of the decoupled representation. However, B-splines with high dfdf values (close to NN) tend to interpolate noisy points (especially in early iterations, after random initialization of the factors) and generalize poorly to unseen samples [16]. The question is therefore how to increase the number of control points while controlling for overfitting.

Solution: penalized splines

Instead of B-splines, we use penalized splines [16, 17] (P-splines) to represent our internals. This formulation adds a smoothing penalty term to the estimation of the spline coefficients

c←argmin⁡c ∥h−B′c∥2+γ∥r−Bc∥2+λ∥Dc∥2,(19)\mathbf{c}\leftarrow\underset{\mathbf{c}}{\operatorname{argmin}}\ \|\mathbf{h}-\mathbf{B}'\mathbf{c}\|^{2}+\gamma\|\mathbf{r}-\mathbf{B}\mathbf{c}\|^{2}+\lambda\|\mathbf{D}\mathbf{c}\|^{2}, \tag*{(19)}

where c∈Rdf+1\mathbf{c}\in\mathbb{R}^{df+1} is the coefficient vector for one of the rr internals, h∈RN\mathbf{h}\in\mathbb{R}^{N} and r∈RN\mathbf{r}\in\mathbb{R}^{N} are the corresponding first and zeroth-order information (columns of H\mathbf{H} and R\mathbf{R}) and γ∈R≥0\gamma\in\mathbb{R}_{\ge0} is the CMTF weighting term. We introduce D∈R(df−1)×(df+1)\mathbf{D}\in\mathbb{R}^{(df-1)\times(df+1)}, a second-order finite difference matrix,3 and λ∈R≥0\lambda\in\mathbb{R}_{\ge0} is the weight of the smoothing term. Note that λ=0\lambda=0 recovers the CMTF-BSD formulation.

Generalized cross-validation

At first glance, our P-spline formulation (19) simply trades one hyperparameter (dfdf) for another (λ\lambda). However, λ\lambda can be tuned automatically and efficiently using generalized cross-validation (GCV) [18, 19]. At each iteration and for each internal, we search for

λ∗=argmin⁡λ GCV⁡(λ)=argmin⁡λ 1Neff∥y−B^c∥2(1−tr⁡(G(λ))Neff)2,(20)\lambda^{*}=\underset{\lambda}{\operatorname{argmin}}\ \operatorname{GCV}(\lambda)=\underset{\lambda}{\operatorname{argmin}}\ \frac{\frac{1}{N_{\mathrm{eff}}}\|\mathbf{y}-\widehat{\mathbf{B}}\mathbf{c}\|^{2}}{\left(1-\frac{\operatorname{tr}(\mathbf{G}(\lambda))}{N_{\mathrm{eff}}}\right)^{2}}, \tag*{(20)}

with y=[h;γr]T\mathbf{y}=[\mathbf{h};\sqrt{\gamma}\mathbf{r}]^{\mathsf{T}}, B^=[B′;γB]T\widehat{\mathbf{B}}=[\mathbf{B}';\sqrt{\gamma}\mathbf{B}]^{\mathsf{T}} and the hat-matrix G(λ)=B^(B^TB^+λDTD)−1B^T\mathbf{G}(\lambda)=\widehat{\mathbf{B}}(\widehat{\mathbf{B}}^{\mathsf{T}}\widehat{\mathbf{B}}+\lambda\mathbf{D}^{\mathsf{T}}\mathbf{D})^{-1}\widehat{\mathbf{B}}^{\mathsf{T}}. We empirically set Neff=N(1+γ)N_{\mathrm{eff}}=N(1+\gamma) as the effective number of observations, accounting for the fact that zeroth-order rows of B^\widehat{\mathbf{B}} are downweighted by γ\gamma.

This approach makes our method effectively non-parametric, or at least, less-parametric with respect to the number of control points, since dfdf can now be set by default to a generous value df≤Ndf\le N. The algorithm self-tunes its expressivity through the smoothing penalty, removing the need for extensive hyperparameter tuning of dfdf.

Implementation and cost

This P-spline formulation introduces computational overhead. Indeed, a smoothing term λ∗\lambda^{*} must be selected rr times for each of the TT iterations, and the cost of this search grows with both dfdf and NN. A naive implementation (forming the hat-matrix G(λ)\mathbf{G}(\lambda) and refitting (19) for every candidate) would be prohibitively expensive.

Instead, we search over a grid of candidates in a Demmler-Reinsch-type basis [20, 21], obtained from a pair of QR and singular value decompositions, in which the fitting and penalty terms are simultaneously diagonalized. In this basis, both the residual and tr⁡(G(λ))\operatorname{tr}(\mathbf{G}(\lambda)) are available in closed-form for every candidate. In other words, the whole grid is searched for essentially the price of a single fit, and G\mathbf{G} is never formed explicitly. Combined with JAX’s JIT compiler [7], this makes the GCV search very fast in practice.

Concerning the knot placement, although evenly-spaced knots are more commonly used with P-splines [16, 21], we found quantile-based knot placement to be more stable and perform better in our experiments.

Experiments

Setup

We now show both improvements separately using the following synthetic target function f:R2→R2f:\mathbb{R}^{2}\to\mathbb{R}^{2}

f(x1,x2;σ)=[σ001]⋅[cos⁡(4πx1)+x22−sin⁡(3πx2)+x13],(21)f(x_1,x_2;\sigma)= \begin{bmatrix} \sigma& 0\\ 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} \cos(4\pi x_1)+x_2^2\\ -\sin(3\pi x_2)+x_1^3 \end{bmatrix}, \tag*{(21)}

where varying the value of σ≥1\sigma\ge1 allows us to illustrate scaling problems. Most hyperparameters are common to all experiments, such as the rank which is set to r=4r=4, the number of iterations T=100T=100, the spline degree d=3d=3, the CMTF weighting term γ=0.1\gamma=0.1, and the number of random seeds which is set to 10. We use N=100N=100 random points sampled uniformly in [0,1]2[0,1]^2.

Per-output error is computed as follows

ei=1N∑j=1N(fi(xj)−f^i(xj))21N∑j=1N(fi(xj)−Ex∼X[fi(x)])2×100,(22)e_i = \frac{\sqrt{\frac{1}{N}\sum_{j=1}^{N}\left(f_i(x_j)-\hat{f}_i(x_j)\right)^2}} {\sqrt{\frac{1}{N}\sum_{j=1}^{N}\left(f_i(x_j)-\mathbb{E}_{x\sim X}[f_i(x)]\right)^2}} \times100, \tag*{(22)}

where eie_i denotes the error of the ii-th output and mean per-output error denotes the average of this metric taken over all random seeds. This metric is always computed on a test set (Xtest,Ytest)(X_{\mathrm{test}},Y_{\mathrm{test}}), consisting of NN points sampled independently and unseen, to better evaluate the generalization capabilities of the returned representation.

Output scale mismatch

We first show the benefits of rescaling the input Jacobian tensor (§ 2) by showing that when this preprocessing step is not applied (Figure 1), increasing the value of σ\sigma in (21) leads to an increase of e2e_2 (bias problem) and to a decrease of the reciprocal condition number 1/κ1/\kappa for RR and HH (since m=2<r=4m=2<r=4) (conditioning problem). For the condition number, we report the median value over the TT iterations. In this experiment we used df=14df=14 control points, and ranges of 100 different values for σ\sigma.

Figure 1. Per-output errors and median reciprocal condition numbers when running CMTF-BSD without rescaling, as a function of σ\sigma. Note that the two plots use different upper bounds for σ\sigma.

Applying the tensor preprocessing step fixes both the bias and the conditioning problem. This is illustrated in Figure 2, where we perform the same experiment with the same hyperparameters and data, with J\mathcal{J} rescaled according to (18) before running CMTF-BSD, effectively reaching the desired invariance to arbitrary rescaling.

Figure 2. Per-output error and median reciprocal condition numbers when running the CMTF-BSD algorithm with tensor rescaling.

Internals smoothing

To show the benefits of smoothing, that is, of replacing B-splines with P-splines coupled with GCV, we set σ=1\sigma=1 and vary the value of dfdf from 10 to NN. Mean error in Figure 3 is defined as (e1+e2)/2(e_1+e_2)/2, again averaged over all random seeds. For the GCV search, we use a fixed grid of 512 λ\lambda values evenly spaced between 0 and 10310^3. Results are grouped in buckets, allowing us to visualize the median and variance for similar dfdf values. When smoothing is not applied, the algorithm tends to overfit as df→Ndf\to N, yielding poor representations, while splines with a smoothing prior degrade far more slowly.

Figure 3. Mean error box-plot (in log-scale) for df=10,11…Ndf=10,11\ldots N.

Conclusion

We identified two desirable properties for tensor decoupling algorithms: invariance to output or gradient rescaling, and the ability to tune the internals’ expressivity in a non-parametric fashion. We addressed both with lightweight fixes. The first rescales the Jacobian tensor prior to decomposition, removing the bias and ill-conditioning that arise when outputs or gradients have mismatched magnitudes. The second replaces the B-spline internals of CMTF-BSD with P-splines tuned via GCV, making the algorithm less dependent on the user choosing the right number of control points. Both were shown to resolve their targeted pathology on a synthetic example, and an open-source JAX implementation of our algorithm is released.

Future work includes applying our algorithm to more complex real-world (e.g., nonlinear system identification [22]) problems, exploring alternatives for the smoothing penalty matrix, and investigating why quantile-based knot placement seemingly outperforms the equidistant placement more commonly used with P-splines.

Acknowledgment

This work was supported by the Fonds Wetenschappelijk Onderzoek (FWO) fundamental research fellowship 11A2H25N.

References

  1. [1]Philippe Dreesen, Mariya Ishteva, and Johan Schoukens, “Decoupling multivariate polynomials using first-order information and tensor decompositions,” SIAM Journal on Matrix analysis and Applications, vol. 36, no. 2, pp. 864–879, 2015.DOI
  2. [2]Philippe Dreesen, Maarten Schoukens, Koen Tiels, and Johan Schoukens, “Decoupling static nonlinearities in a parallel wiener-hammerstein system: A first-order approach,” in 2015 IEEE International Instrumentation and Measurement Technology Conference (I2MTC) Proceedings. IEEE, 2015, pp. 987–992.DOI
  3. [3]Philippe Dreesen, Jeroen De Geeter, and Mariya Ishteva, “Decoupling multivariate functions using second-order information and tensors,” in International Conference on Latent Variable Analysis and Signal Separation. Springer, 2018, pp. 79–88.arxiv.org/abs/1805.08479
  4. [4]Gabriel Hollander, Multivariate polynomial decoupling in nonlinear system identification, Ph.D. thesis, Vrije Universiteit Brussel, 2017.
  5. [5]Yassine Znyied, Konstantin Usevich, Sebastian Miron, and David Brie, “A tensor-based approach for training flexible neural networks,” in 2021 55th Asilomar Conference on Signals, Systems, and Computers. IEEE, 2021, pp. 1673–1677.
  6. [6]Joppe De Jonge and Mariya Ishteva, “Non-parametric b-spline decoupling of multivariate functions,” in 2025 33rd European Signal Processing Conference (EUSIPCO). IEEE, 2025, pp. 2117–2121.
  7. [7]James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Yash Katariya, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang, “JAX: composable transformations of Python+NumPy programs,” 2018.
  8. [8]Frank L Hitchcock, “The expression of a tensor or a polyadic as a sum of products,” Journal of Mathematics and Physics, vol. 6, no. 1-4, pp. 164–189, 1927.DOI
  9. [9]Richard A Harshman et al., “Foundations of the parafac procedure: Models and conditions for an “explanatory” multi-modal factor analysis,” UCLA working papers in phonetics, vol. 16, no. 1, pp. 84, 1970.
  10. [10]J Douglas Carroll and Jih-Jie Chang, “Analysis of individual differences in multidimensional scaling via an n-way generalization of “eckart-young” decomposition,” Psychometrika, vol. 35, no. 3, pp. 283–319, 1970.DOI
  11. [11]Tamara G Kolda and Brett W Bader, “Tensor decompositions and applications,” SIAM review, vol. 51, no. 3, pp. 455–500, 2009.DOI
  12. [12]Grey Ballard and Tamara G. Kolda, Tensor Decompositions for Data Science, Cambridge University Press, June 2025.DOI
  13. [13]Joseph B Kruskal, “Three-way arrays: rank and uniqueness of trilinear decompositions, with application to arithmetic complexity and statistics,” Linear algebra and its applications, vol. 18, no. 2, pp. 95–138, 1977.DOI
  14. [14]Nicholas D Sidiropoulos, Lieven De Lathauwer, Xiao Fu, Kejun Huang, Evangelos E Papalexakis, and Christos Faloutsos, “Tensor decomposition for signal processing and machine learning,” IEEE Transactions on signal processing, vol. 65, no. 13, pp. 3551–3582, 2017.DOI
  15. [15]Evrim Acar, Tamara G. Kolda, and Daniel M. Dunlavy, “All-at-once optimization for coupled matrix and tensor factorizations,” in MLG’11: Proceedings of Mining and Learning with Graphs, August 2011.arxiv.org/abs/1105.3422
  16. [16]Paul HC Eilers and Brian D Marx, “Flexible smoothing with b-splines and penalties,” Statistical science, vol. 11, no. 2, pp. 89–121, 1996.
  17. [17]Paul HC Eilers, Brian D Marx, and Maria Durbán, “Twenty years of p-splines,” SORT: statistics and operations research transactions, vol. 39, no. 2, pp. 0149–186, 2015.
  18. [18]Peter Craven and Grace Wahba, “Smoothing noisy data with spline functions: estimating the correct degree of smoothing by the method of generalized cross-validation,” Numerische mathematik, vol. 31, no. 4, pp. 377–403, 1978.
  19. [19]Gene H Golub, Michael Heath, and Grace Wahba, “Generalized cross-validation as a method for choosing a good ridge parameter,” Technometrics, vol. 21, no. 2, pp. 215–223, 1979.DOI
  20. [20]A. Demmler and Christian Reinsch, “Oscillation matrices with spline smoothing,” Numerische Mathematik, vol. 24, no. 5, pp. 375–382, 1975.DOI
  21. [21]David Ruppert, “Selecting the number of knots for penalized splines,” Journal of computational and graphical statistics, vol. 11, no. 4, pp. 735–757, 2002.DOI
  22. [22]Jan Decuyper, Koen Tiels, Mark C Runacres, and Johan Schoukens, “Retrieving highly structured models starting from black-box nonlinear state-space models using polynomial decoupling,” Mechanical Systems and Signal Processing, vol. 146, pp. 106966, 2021.DOI

Paper details

vlnc:W_58jj6d6y
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 5

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents