Manuscript Offprint
arXiv:2610.27970Neural Closed-Loop Identification of Nonlinear Systems with Stability and Generalization Guarantees
Abstract
Neural networks are expressive models of nonlinear dynamics, but identifying such systems from closed-loop data raises two difficulties: the feedback loop correlates inputs with measurement noise, biasing standard open-loop estimators, and the identified model must be stabilized by the data-collection controller, so that its closed-loop behavior matches the true plant's. We derive a complete parameterization of all nonlinear systems stabilized by a given controller, generalizing the classical dual-Youla parameterization to the nonlinear setting. Building on this characterization, we propose Internal Controller Identification (ICI), a computationally tractable framework for identifying potentially unstable systems while ensuring closed-loop stability by construction; in the linear case, our indirect method reduces to an open-loop identification problem, for which standard consistency results apply. The framework accommodates contextual information, letting a single certified model identify a family of systems, and supports a PAC-Bayesian training objective that, when data are scarce and prior knowledge is available, bounds the identified operator's expected prediction loss. Experiments show that ICI identifies open-loop unstable plants where uncertified baselines diverge, outperforms direct methods under weak excitation and feedback-correlated noise, generalizes zero-shot to environments unseen during training, and, with limited data, avoids the overfitting of empirical risk minimization while providing a non-vacuous generalization bound.
Key words: Closed-loop identification; Nonlinear system identification; Neural networks; Stability of nonlinear systems; Probabilistic and Bayesian methods for system identification.
1 Introduction
Neural networks are flexible, expressive models for learning nonlinear dynamical systems from input-output data [42,38]. However, open-loop data collection is often impractical or unsafe: impossible for unstable systems, which can't be run without stabilizing feedback, and undesirable for stable ones that operate under feedback for safety, setpoint tracking, or disturbance rejection (e.g., drones or robotic manipulators). In these scenarios, data are gathered while the system operates in closed loop with a stabilizing controller, motivating closed-loop system identification [45,16,32,26]. Compared to the open-loop case, the central difficulty of this setting is the feedback-induced correlation between input signals and measurement noise [45,16]. Classical methods for closed-loop identification are typically classified into direct and indirect approaches [43].
Direct methods estimate the system and noise model independently of the feedback; in the linear case they are consistent provided the noise model is accurate, an assumption often violated by the complex disturbances of real-world systems [45,16].
Indirect methods instead exploit knowledge of the controller and target the closed-loop mapping, eliminating the noise contribution at the plant input and reducing the problem to open-loop identification [45,16,31]; in the linear case this yields consistency even under a misspecified noise model, and it is the route we follow.
A third family, joint input-output methods, simultaneously estimates the plant and controller from data jointly modeled as the output of a white-noise-driven system [43]; however, these methods are largely confined to the linear setting, do not extend naturally to general nonlinear plants, and additionally exhibit theoretically unbounded variance in the small-noise regime [1].
- This work was supported as a part of NCCR Automation, a National Centre of Competence in Research, funded by the Swiss National Science Foundation (grant number 51NF40_225155) and the NECON project (grant number 200021_219431)
Email addresses: laura.meroi@epfl.ch (Laura Meroi), mahrokh.ghoddousiboroujeni@epfl.ch (Mahrokh G. Boroujeni), l.massai@epfl.ch (Leonardo Massai), giancarlo.ferraritrecate@epfl.ch (Giancarlo Ferrari-Trecate).
Preprint submitted to Automatica
21 October 2026
For LTI systems, one commonly used framework for indirect identification is the dual-Youla parameterization. This formulation is constructed using coprime factorizations of the known controller and of the nominal plant stabilized by it, augmented by a Youla parameter that is optimized to minimize the discrepancy from the true system. Through this structure, the parameterization characterizes the complete set of all plants stabilized by the given controller [24]; as its name suggests, it is dual to the Youla-Kučera parameterization, which instead characterizes all controllers that stabilize a given plant [48]. A fundamental advantage of this approach is that any identified model is inherently stabilized by the controller, naturally preserving closed-loop stability properties observed in the true system [16]. Furthermore, in the linear case, the Youla parameter reduces to a stable rational transfer function; since the underlying function space is infinite-dimensional, it is truncated to a finite order in practice, yielding a tractable optimization.
Extensions to nonlinear plants under linear control exist (see [4] for a review, and [9,17] for coprime-factorization parameterizations) but face two obstacles: coprime factorizations exist only for subclasses of nonlinear systems and are hard to compute [4], and the parameterization requires optimizing over stable nonlinear operators and their inverses, which complicates the optimization, a difficulty also noted for Youla-based nonlinear controller learning [19]. Existing methods thus fall short of a computationally practical framework.
More recently, [32] proposed an alternative approach for closed-loop identification of nonlinear systems. While effective in practice, this method has two key limitations: (i) the closed-loop system of the learned model and controller may become unstable, and (ii) it assumes a predefined parametric form for the system, limiting flexibility. This leaves closed-loop identification of expressive, nonlinear models a critical, yet not sufficiently explored, challenge.
A further challenge is that real-world systems rarely operate in a single environment: friction, payload, or terrain vary, so the data are generated by a family of related plants. Identification across operating conditions is classically addressed by linear parameter-varying (LPV) methods, also in closed loop [47,44], but restricted to LPV model classes without closed-loop stability guarantees; meta- and in-context learning estimate a single meta-model for a class of systems [15,37], again without certificates.
A distinct concern is finite-sample reliability: closed-loop data collection is costly, safety-critical, and biased by the controller, so guarantees from limited data are valuable. Such guarantees can be obtained through PAC-Bayes theory [35,2], a powerful tool for certifying highly parameterized models, applied beyond supervised learning to meta-learning [41] and optimal control [5]. PAC-Bayesian bounds exist for open-loop identification of stochastic LTI systems [12,14] and stable recurrent models [13]; their use in closed-loop identification, under strict closed-loop stability constraints on the learned model, remains unexplored.
Contributions. We propose a computationally tractable framework for closed-loop identification of nonlinear, potentially open-loop unstable systems while guaranteeing stability of the interconnection with the data-collection controller. In particular: (i) we introduce the Internal Controller Identification (ICI) framework, a complete parameterization of all and only the nonlinear systems stabilized by a given controller, which generalizes the dual-Youla parameterization, guarantees closed-loop stability by construction, and reduces to a consistent open-loop problem in the linear case; (ii) we derive finite-sample generalization guarantees, introducing an informative prior over the parameters of the learnable operator and a tractable PAC-Bayesian bound on its expected prediction loss, optimized with Stein Variational Gradient Descent (SVGD); (iii) we develop context-aware identification, where bounded context wrappers let a single model identify an entire family of environments and generalize to members never observed during training, with the closed-loop stability certificate intact; (iv) we conduct a systematic experimental evaluation covering open-loop unstable plants, weak excitation, feedback-correlated noise, and partial observation, against closed-loop baselines.
A preliminary version of this work appeared in the conference paper [7], which introduced the base ICI parameterization and its stability guarantee. The present paper adds the context-aware formulation (Section 3.3), the PAC-Bayesian generalization framework and its SVGD-based training (Section 5), the four-experiment study (Section 6), and complete proofs.
-
-stable ( ) if for all .
-
incrementally -stable if such that , where is the incremental finite gain (i.f.g.) of .
We define ; for strictly causal , acts on . The sets of causal and strictly causal -stable operators are denoted and , respectively.
2 Problem formulation
2.1 Closed-loop system dynamics
We consider a discrete-time dynamical system described by the input-output model:
where is the nominal initial output. At each time , denotes the input, is the output, and is the measurement noise corrupting the output. The dynamics may be time-varying, nonlinear, and potentially unstable; by (1), depends only on , i.e., the system is strictly causal. In operator notation, system (1) reads:
where is a strictly causal operator such that , and , are defined in a similar way. The next example shows the relation between (1) and state-space models.
Example 1 (From state-space to input-output models)
Consider a strictly causal, time-invariant system in the state-space form:
where is the state at time and is the initial state. By recursion, the functions in (1) are defined as:
Note that depends on the initial state for all , consistent with input-output models in the literature [36]. When the system (3) is LTI and , reduces to a linear time-invariant convolution operator, equivalently described in the -domain by the strictly proper transfer matrix .
Next, we introduce the closed-loop system, illustrated in Figure 1 and described by:
where K is a causal, time-varying dynamical output-feedback controller and , , is an external excitation injected in addition to the feedback. In (4), CL[G, K] denotes the operator that the two equations define implicitly, i.e., the closed loop of Figure 1 seen as a single system mapping the exogenous signals to the internal ones. The same notation is used for any strictly causal system in place of G.

Fig. 1. Block diagram of the closed-loop system formed by system G and controller K, with system input u, noisy output y, excitation signal r, and noise v.
As discussed in Section 1, data are collected while the system operates in closed loop. To ensure reliable data collection and prevent unbounded measurements, the closed-loop system must satisfy an appropriate notion of stability.
Definition 1 (Closed-loop -stability [18]) Let be a strictly causal operator and a causal operator. The closed loop of and in (4) is -stable if and for every and every . Equivalently, we write . We denote by strictly causal : the set of systems stabilized by .
Definition 1 constrains only the interconnection: neither G nor K is required to belong to individually. When G and K are LTI, Definition 1 recovers the standard notion: for every if and only if the transfer matrix describing is asymptotically stable.
2.2 Identification Objective
Our goal is to learn a dynamical model that best approximates the true system using closed-loop data collected with a known stabilizing controller . While may be open-loop unstable, capturing potential plant instability, we enforce , i.e., we constrain the search to .
The stochasticity of the closed-loop data stems from the unobserved measurement noise v and from the excitation r, actively sampled from a user-designed distribution to make the input informative. Since the system operates under feedback, the control input u is a deterministic function of the measured signals (r, y) through the closed-loop equations (4). Consequently, a data sample from a given experiment is the fully observable, infinite-length trajectory , which is drawn from the underlying closed-loop data distribution D induced by the distributions of r and v.
Ideally, we seek to minimize an expected identification loss c over D, as follows:
where quantifies the mismatch between the predicted output and the measured . Importantly, (5) does not commit to how is generated from : this choice, deferred to Section 4, gives rise to the direct and indirect strategies.
Directly solving the optimization problem in (5) is impractical due to three fundamental challenges:
(C1) Complex constraints: The set is generally non-convex and difficult to parameterize directly.
(C2) Intractable horizon: Evaluating the objective over infinite-length trajectories is computationally infeasible.
(C3) Unknown distribution: The true data distribution D is unknown, preventing the direct computation of the expectation.
In the following, we address these challenges systematically. We first focus on the stability constraint (C1) via the ICI framework described in Section 3. Subsequently in Section 4 we tackle challenges (C2) and (C3), by adopting an Empirical Risk Minimization (ERM) approach defined over finite-length trajectories.
3 Internal Controller Identification (ICI) framework
3.1 Parameterization of Stabilized Systems
Problem (5) requires learning over , a constraint that is hard to enforce directly because this set is generally non-convex. We parameterize all and only such systems through a dual formulation of Internal Model Control (IMC) architectures [11], which we call the Internal Controller Identification (ICI) framework. Specifically, is the negative feedback interconnection in Figure 2 of a copy of the controller and a trainable strictly causal operator , so that, for an input , the predicted output satisfies
This parameterization transforms the problem of learning into optimizing over the set [19,18].
The next theorem relates to the models representable in the ICI framework. Note that statements T.1 and T.2 are not symmetric: sufficiency requires and incrementally -stable, whereas necessity uses only causality of . Note that the second hypothesis of T.1 subsumes the first whenever .

Fig. 2. In the ICI framework, the model consists of the negative feedback interconnection of a copy of the controller and a trainable operator . The model input and output are denoted by and , respectively.
Theorem 1 Let K be causal and let . Let be the ICI model defined by (6).
T.1 (Sufficiency.) If and is incrementally -stable, then is strictly causal and , i.e., .
T.2 (Necessity.) Conversely, for every there exists a unique such that the ICI model (6) satisfies .
Corollary 1 Under the hypotheses of T.1, the map defined by (6) is a bijection from onto .
Proof of Theorem 1 We first state a useful result from [25].
Lemma 1 ([25]) Consider a causal operator such that is strictly causal, where is the identity operator. Then, the causal operator exists, and the sequence satisfies
We start by proving T.1: for every and we show that both and , so that . Denote by the input to the operator . In the external copy of is driven by the measured output , while the copy internal to is driven by ; hence
Since is strictly causal and is causal, in (8) depends only on , and ; hence exists and is unique, so the loop is well posed, and the same recursion shows that is strictly causal.
Let denote the truncation operator defined as for and otherwise.
Every truncated signal belongs to , and causality of gives . Since for every , the i.f.g.
inequality holds for the truncated signals [46]. Truncating (8) and using together with the triangle inequality,
uniformly in M, where is the incremental finite gain of K.
Since is nondecreasing and bounded above, it converges to as ; therefore and .
Since , it follows that , and so is the measured output . Consequently, since , we obtain . Therefore , i.e., .
Next, we prove T.2. Given , define , where the inverse exists by Lemma 1 since is strictly causal. The operator is strictly causal, being the composition of the causal operator with the strictly causal ; moreover , since it coincides with the restriction of to , i.e., with the map , which belongs to because (see also [10]). Note that this construction gives automatically.
We apply the same input to both and , as illustrated in Figure 2, and denote their respective outputs by and . Our goal is to prove that , or equivalently, for all .
For G we have , while from (6),
These relations are equivalent to the causal relations
where we used the strict causality of G to truncate the operands at time . Moreover, by the recursion (7) of Lemma 1,
The second relation in (9) gives , so the two controller terms in (10) cancel identically and for all . Substituting into (9) yields for all .
Uniqueness is forced by (6). If satisfies , then for every . Setting and using the invertibility of from Lemma 1 gives for every , i.e., .
Proof of Corollary 1 By T.1, the map is well defined from into , and existence in T.2 makes it surjective onto . For injectivity, let induce the same model . Then by T.1, so uniqueness in T.2 gives .
Remark 1 (Open-loop instability of ) Note that Theorem 1 certifies , but itself need not be -stable: while by construction, the corresponding , recovered through the feedback equation (6), may be open-loop unstable. This is precisely what allows the ICI framework to identify inherently unstable plants while keeping the identified closed-loop behavior consistent with the true one.
Since , point T.2 in Theorem 1 associates with a unique operator , which we call the true ICI operator. By Corollary 1, the constrained problem (5) can be replaced by the following unconstrained optimization over :
where the associated model is the interconnection of and defined in (6). The key difference is that the constraint is now structurally satisfied for every .
Remark 2 (Recursive implementation of ) Since is strictly causal, the output depends on past outputs only up to time . This observation enables a recursive computation of , eliminating the need to solve the implicit nonlinear equation (6) at each time step. Additionally, if and are input-output operators associated with dynamical systems (see Example 1), their state-space representations can be used to implement (6) as a Markovian dynamical system, thereby avoiding the need to store the full history of and .
3.2 Unconstrained optimization of the operator
While the ICI parameterization (11) removes the explicit stability constraint, optimizing over the infinite-dimensional space remains intractable. To make this feasible, the operator can be modeled using families of operators described by a finite-dimensional parameter vector , such as Recurrent Equilibrium Networks (RENs) [39], certain classes of State-Space Models (SSMs) [23,33,50], or neural network representations of Hamiltonian systems [49], which admit a state-space form enabling recursive output computation (see Remark 2). Crucially, these families yield a free parameterization, guaranteeing that the parameterized operator belongs to for any arbitrary . Defining as the ICI model (6) built from and , problem (11) reduces to a tractable, unconstrained optimization over :
which can be efficiently solved using gradient-based methods. Since the predictor is uniquely determined by , with a small abuse of notation, hereafter we use instead of .
3.3 Context-enriched ICI
Plants often operate under varying conditions, e.g., for robotic systems, changes in payload or terrain-dependent friction. When measurable, we represent information about these conditions by a context sequence , with . Providing context can help a model adapt its predictions across operating regimes without having to infer those conditions solely from the input history.
Crucially, context may persist even when the dynamical input decays: for example, a constant nonzero payload signal is bounded but does not belong to for . Simply appending context to the input of an -stable operator therefore does not automatically preserve its stability properties. Therefore, to inject context, we instead adapt the operator decomposition of [34] to the ICI predictor:
Here, generates stable dynamical features from , while the strictly causal mixer produces matrices satisfying . The product acts pointwise: . Intuitively, context changes how the features are scaled and combined, while their magnitude remains controlled by the stable module . Indeed, the pointwise bound gives [34, Thm. 1]
uniformly over context sequences. Thus, , and under the controller assumptions of T.1, the resulting ICI model remains stabilized by for every admissible context.
Under the mild weighted-envelope input assumption and context-uniform envelope-preservation condition of [34, Thm. 2], the needed factorization (13) is also necessary and hence non-conservative.
Finally, context can also be computed from predicted outputs, . The mixer's strict causality prevents an algebraic loop, and the same bound holds along the resulting trajectory. Consequently, known state-dependent context features can be supplied during simulation, as in Section 6.4, without requiring recorded context trajectories. In the sequel, for simplicity, we omit including context variables in the available data; indeed, they can always be incorporated in a plug-in fashion, as described so far, without altering the main result.
4 Tractable Identification via the ICI Parameterization
We now turn (12) into a practical learning problem: we restrict it to finite horizons, introduce the direct (Section 4.2) and indirect (Section 4.3) predictors, and fix the loss to the simulation error criterion (Section 4.4).
4.1 Finite-Horizon Empirical Risk Minimization
To address challenges (C2) and (C3), we restrict (12) to finite horizons and approximate the expectation empirically. Let denote the distribution over closed-loop trajectories truncated to a finite horizon , where a single trajectory is denoted by . We define the true finite-horizon identification risk as:
where quantifies the discrepancy between the measured outputs and the predicted sequence . This is the quantity bounded in Section 5. Since is unknown, we rely on independent closed-loop experiments, with i.i.d., and approximate (15) with the empirical risk:
The value of depends on how is generated from : the following subsections introduce the direct and indirect strategies, which differ precisely in this choice.
4.2 Direct ICI identification
In the direct ICI strategy the measured plant input is fed directly to the reconstructed model, , treating the closed-loop data as if collected in an open-loop experiment:
The model built from through (6) satisfies , as guaranteed by point T.1 in Theorem 1.
While direct methods lead to tractable optimization problems, they have two fundamental drawbacks.
D.1 They can be used only when is stable [16], since with a simulation criterion, as adopted in Section 4.4, the risk J is evaluated on open-loop predictions of , which may diverge if the model is unstable.
D.2 The regressor is noise-corrupted. Feedback makes v enter the trainable operator's input through (Figure 1), so the regressor and the residual are correlated at first order. Even in the linear case this makes direct methods inconsistent under a misspecified noise model: the true G is not recovered from infinite data [43,45,21].
4.3 Indirect ICI identification


Fig. 3. Top: Closed-loop system connecting the true plant G (represented within the ICI framework by the operator S) and the controller K (left), alongside its linearized approximation (right). Bottom: In the linear case, noise injection can be shifted to enable loop cancellation, yielding the exact simplified form on the right.
Indirect identification estimates the closed-loop response to the exogenous excitation and uses the known controller to recover the plant [43]. In the ICI framework, this amounts to learning the true operator associated with by point T.2 in Theorem 1, and recovering the plant through (6), evaluated by the recursion in Remark 2; this implements the dual-Youla parameterization idea [4,10] with the finite-dimensional stable operator models of Section 3.2. The closed loop under analysis is then equivalent to the interconnection of and in the top-left plot of Figure 3, and the measured output satisfies
Identity (18) shows where the noise enters: additively at the output, and through the controller inside the argument of S; only the first entry is exogenous. Writing gives the residual in closed form, , which vanishes with : then and reduces to the noise-free map of CL[G, K] in T.2. Fitting S from thus has the form of an open-loop output-error problem, but with a non-exogenous disturbance whose dependence on sets the bias. To expose this, assume and twice continuously differentiable near the operating trajectories, so that is as well by (7), and linearize [4] S around and around :
where and are causal linear operators, block lower triangular by causality and strictly so for . The second line follows by expanding both terms of at : the constant terms cancel and the linear ones combine into . Since and are by incremental -stability of and local Lipschitz continuity of , both approximations in (19) hold up to with coefficients depending on alone, so that, to first order in the noise, propagates through alone (top-right plot of Figure 3). The same identity holds for the ICI model with in place of , so is its first-order closed-loop response to , which we adopt as predictor. Accordingly, we adopt the open-loop learning problem
with reconstructed as the interconnection of the learned and the known K. Problem (20) is not an exact reformulation: its regressor is , while the signal driving S in the experiment is , which equals only for . By (19) the first-order residual is linear in with -dependent coefficients, hence of zero conditional mean given ; the minimizer of (20) is therefore biased at , set by the curvature of S and K, against the first-order correlation of D.2. Superposition makes the separation exact in the linear case (Remark 4).
Remark 3 (Validity of linear approximations) The approximation (19) is exact in the absence of noise and when S and K are affine, with and their linear parts; in the linear case the equivalent output disturbance ( ) makes the loops cancel exactly (bottom plots of Figure 3). In the nonlinear case it is a local small-noise approximation: both v and the induced perturbation must stay where the Taylor remainders are small. Incremental -stability of K bounds that perturbation by times the noise norm on each truncated horizon, and bounds the induced -norm of every truncated Jacobian of K by , so extends to a bounded operator on . Accuracy therefore depends on local curvature and noise amplification; a high signal-to-noise ratio alone does not guarantee it.
Remark 4 (Properties of the indirect predictor) Fitting S from the exogenous pair (r, y) via (20) avoids the open-loop simulation issue in D.1: for every , implies whenever , even if is unstable. Regarding D.2, the predictor is driven by , assumed independent of , rather than by noise-corrupted measurements; as discussed after (20), this reduces the bias to second order but does not eliminate it. Consistency is thus limited to the linear case, where exactly and is the output sensitivity of the true loop: with zero-mean finite-variance noise independent of , output-error identification is consistent irrespective of the noise spectrum, provided the model class contains , the excitation identifies it, and the usual statistical regularity and global optimization conditions hold [16]. Direct methods, instead, can require a correctly specified noise model to avoid feedback-induced bias [45,30].
4.4 The Simulation Error Objective
A fundamental advantage of the unconstrained optimization problem (12) is that closed-loop stability is guaranteed entirely by the ICI parameterization, so the identification loss c can be freely designed to incorporate different modeling objectives without jeopardizing the stability of the learned model. For instance, the empirical loss could embed physics-informed penalties to enforce known physical constraints, state-dependent weightings to prioritize accuracy near critical equilibrium points or safety boundaries, or negative log-likelihoods to capture non-Gaussian noise profiles. In this work we adopt the standard Simulation Error Method (SEM): when the intended use of the model is simulation or control design, the multi-step simulation error is the natural fitting criterion and the standard choice for training deep networks on dynamical systems [38], whereas one-step criteria optimize more easily but transfer poorly to free-run simulation. We define the trajectory discrepancy c as the Mean Squared Error (MSE) between predicted and measured outputs, averaged over both the finite horizon T and the output coordinates:
where the sequence of predicted outputs is generated according to either the direct or indirect identification strategy defined in the previous subsections. Substituting (21) into (16) yields an unconstrained least-squares problem for each strategy, efficiently minimized by gradient-based methods since is differentiable.
5 PAC-Bayesian training for improved generalization
System identification must operate on a finite set of noisy closed-loop trajectories. This finite-sample setting introduces a generalization gap: a model that successfully minimizes the empirical risk on the training data may still perform poorly on unseen realizations of excitation and noise. The goal of this section is to quantify this gap using PAC-Bayesian theory, and to translate the resulting bound into a principled, generalization-aware training objective for the ICI operator .
5.1 PAC-Bayes Generalization Bound
To certify the finite-sample reliability of the identified model, we seek to formally upper-bound the true expected loss (15) using its empirical estimate (16). We achieve this via the PAC-Bayesian framework, which casts the learning process as an update from a data-independent prior distribution P over the model parameters , to a data-dependent posterior distribution Q based on the observed dataset.
Within our system identification framework, both the prior and the posterior are defined over the parameters, , of the ICI operator . Crucially, this directly integrates the PAC-Bayesian framework with the ICI architecture: because every maps to an operator , any model configuration sampled from the posterior is guaranteed by construction to be stabilized by the controller .
PAC-Bayesian theory requires a bounded loss:
Assumption 1 The finite-horizon identification loss in (21) is upper-bounded by , i.e., , for all and in the support of .
An unbounded loss is mapped to via:
with : the map is near-linear on and saturates smoothly to , so a suitable keeps training in the linear regime. Throughout this section and are understood on the transformed loss .
We now bound the true identification risk J in (15).
Theorem 2 (Adapted from Theorem 2.7 in [2]) Consider the distribution of closed-loop trajectories , a dataset , a prior distribution independent of , and the identification loss . Under Assumption 1, for every , confidence level , posterior distribution , and model parameters , the inequality
holds with probability at least over simultaneously sampling the N i.i.d. trajectories of from and . The true and empirical risks, J and , are defined in (15) and (16) respectively.
The bound combines the empirical risk, a log-density ratio measuring the deviation of Q from P at , and a -independent complexity term. It adapts Theorem 2.7 in [2] to time-series data by treating independent closed-loop trajectories as the i.i.d. samples, so that c compares entire predicted and observed sequences. Standard PAC-Bayesian bounds control the risk averaged over Q, i.e., the risk of a randomized predictor that redraws at every use, which is at odds with deploying one identified model. Theorem 2 is instead a disintegrated bound: it holds for a single parameter drawn once from the posterior, , matching the identification objective of deploying one model.
5.2 Optimal Posterior
Unlike Bayesian inference, Q need not come from Bayes' theorem: we select it to minimize the expected value, over , of the upper bound in (23):
where KL stands for the Kullback–Leibler divergence. The objective trades off, through , empirical risk against closeness to the prior (which can encode structural knowledge or regulate complexity). In the two limiting regimes, concentrates on the minimizers of as , and as .
Corollary 2 (Lemma 1.1.3 in [8]) The minimizer of (24) is the Gibbs distribution, characterized by:
where normalizes the distribution .
Substituting the optimal posterior (25) into (23) yields the tightest bound:
holding with probability at least over simultaneously sampling and . The term lies in and decreases when the (data-independent) prior assigns more mass to parameters with lower empirical risk (26): the bound tightens when is “aligned” with . The bound (27) holds for the optimal posterior and does not depend on the drawn . Since minimizes the expectation over of the right-hand side of (23), it yields the tightest instance of (23) in expectation over the posterior draw, though not necessarily for every realization of .
Tightening (27) amounts to tuning , which Theorem 2 leaves free. Since requires an expectation (26) and lies in under Assumption 1, we replace it by C and select by minimizing the resulting looser bound.
Proposition 1 The optimal that minimizes the upper bound on the right-hand side of (27) obtained by replacing with C, is given by:
The same is obtained by replacing with the tighter bound , which follows from Jensen's inequality and is likewise independent of . Crucially, does not depend on , as required for Theorem 2 to hold with .
Given P and , (25) and (28) fully specify the optimal posterior. In practice, hyperparameters of the prior (e.g., its width) and may also be selected from a finite, data-independent set of m candidates by minimizing the bound: by a union bound over the candidates, (27) holds for the selected pair with probability at least upon replacing with , including in (28).
5.3 Sampling from the posterior
The optimal posterior in (25) is known only up to the normalization constant , and sampling from unnormalized distributions is generally difficult: Markov chain Monte Carlo methods are applicable in principle, but are typically expensive for large datasets [22]. Following [3], we adopt instead a variational approximation, in which is replaced by a tractable distribution that is easy to sample from. Specifically, we employ Stein Variational Gradient Descent (SVGD) [29], which represents the posterior by particles . Each particle , , collects the parameters of one model, i.e., ; the particles are initialized from the prior and iteratively updated by gradient descent, so that their empirical density in parameter space approximates . Since the updates are gradient-based, SVGD integrates naturally with our unconstrained parameterization. After training, is approximated by , the uniform distribution over the resulting particles, so that sampling from the approximate posterior amounts to selecting one particle uniformly at random. The use of SVGD for approximating Gibbs posteriors arising in PAC-Bayesian methods is well established, e.g. [41,6] and we refer the reader to [29] for further implementation details. One caveat is worth noticing: Theorem 2 and its specialization (27) certify a single draw from , whereas SVGD provides the particle approximation . The value of (27) depends only on P and , not on the particles, and (23) cannot be applied to directly, since a discrete particle distribution is not absolutely continuous with respect to P. The certificate therefore refers to ; the deployed particle is an approximate draw from it, and the discrepancy between and is not quantified by the bound.
6 Numerical experiments
We evaluate the ICI framework across four scenarios validating: (i) the identification of open-loop unstable plants with guaranteed closed-loop stability, (ii) accuracy against standard baselines on stable systems, (iii) context-aware identification across environment families, and (iv) the generalization benefits of PAC-Bayesian training under data scarcity. Section 6.1 describes the benchmark systems, the compared strategies, the evaluation metric, and the architectures, sample sizes, and signal levels of each experiment; layer widths, learning rates, whitening, training safeguards, per-seed protocols, and the complete result grids are in the public repository at https://github.com/DecodEPFL/Nonlinear_system_identification_PAC.git.
6.1 Experimental Setup
Target Systems. Throughout the experiments, we benchmark our methods on two distinct dynamical systems:
(1) A nonlinear, open-loop unstable system defined by the state-space equations:
Being open-loop unstable, the system is operated in closed loop during data collection, stabilized by the nonlinear controller . This controller satisfies the hypotheses of Theorem 1 globally: , and for every , so is incrementally -stable with incremental gain . Together with this yields . The system input is then .
(2) A stable planar robot tracking a target, modeled as a point mass [18]. The state comprises position and velocity , the output is a noisy position measurement, and the input is a planar force:
where is the sampling time, and the function , with , models nonlinear drag forces, such as air or water resistance. The coefficient can represent either a uniform environment or a position-dependent spatial friction map. The robot is subject to nonlinear drag. To regulate its position toward the target , we apply a static proportional controller with gain matrix , where . The control law is , and the system input is .
Unless otherwise specified, the reference excitation is independently sampled at each time step from a zero-mean Gaussian distribution, , and the output is corrupted by measurement noise ; both are on the finite horizon of each trajectory, so Theorem 1 applies. While persistent excitation is most commonly defined and analyzed in linear settings, in this nonlinear setting Gaussian excitation qualitatively promotes exploration of an informative range of the state space [30].
Baselines. To highlight the benefits of the ICI stability certificate, we benchmark our approaches (both the indirect strategy (20) and the direct counterpart (17)) against two uncertified baselines that minimize the simulation error (21). Instead of incorporating structural guarantees, these baselines parameterize as a generic neural network, discarding the prior knowledge that the true plant is stabilized by K. The two baseline strategies differ fundamentally in how the networks are simulated and, consequently, in which data drive the predictor:
• Direct OE (Direct Output Error). This is the standard direct identification baseline, widely used in neural system identification [38,40]. A generic neural model is trained to minimize the simulation error on the recorded input u:
(30)
• CLOE (Closed-Loop Output Error). This strategy [28,27] simulates the closed-loop system driven by the exogenous reference r. By placing the neural model in feedback with the known controller K, thus closing the loop around the model's own predictions, CLOE avoids feeding the noisy recorded input into the predictor:
(31)
Evaluation metrics. All identification strategies are evaluated using the FIT metric on a fixed, noise-free test set, common to every method within each training condition, in both open-loop (OL) and closed-loop (CL) settings; measurement noise affects the training data only, so the test isolates the quality of the identified dynamics.
Goodness of fit is computed per test trajectory as [%], where is the noise-free true output, the model's, and the temporal mean of trajectory , subtracted at every ; FIT ranges in [38]. For open-loop-unstable plants, the open-loop comparison is shown graphically (on a logarithmic scale); closed-loop FIT/RMSE are computed over the bounded rollouts only, with the divergence rate reported separately.
We report the mean one standard deviation across the test trajectories; training seeds are fixed and all protocols are deterministic given the seed, so every number is exactly reproducible from the public repository.
Models and datasets
Table 1 collects the model classes, sample sizes, and signal levels of the four experiments.
6.2 Feedback-Stabilized Unstable Scalar System
This experiment validates on the unstable plant (29) that (a) every identified ICI model is guaranteed to be stabilized by the data-collection controller, whereas a model returned by an uncertified method may not be, and (b) using the indirect approach training does not diverge and recovers the open-loop unstable dynamics. The two ICI strategies use a contractive SSM as the operator , while the two baselines use a vanilla RNN with unbounded ReLU activations, a class chosen because saturating networks can't represent unstable dynamics and would fail the second question by construction. The baselines are given more capacity than the ICI models, so that no conclusion can be attributed to a capacity advantage of the latter.
Results. Table 2 summarizes the structural properties of each method, while Figure 4 shows the open-loop behavior. The analysis yields two main observations:
(a) Only the ICI framework guarantees closed-loop stability. No ICI model destabilized the loop in any of the S = 40 runs, at any noise level, as Theorem 1 guarantees. Among the uncertified methods, Direct OE returned a model that K fails to stabilize in 25% of the runs, with the loop diverging from a large fraction of the initial conditions. CLOE with the ReLU-RNN instead generates an unstable closed loop in 2.5% of the runs.
(b) Indirect ICI ensures well-posed training and identifies unstable dynamics. As shown in Figure 4, the true plant exhibits unstable open-loop trajectories, which are accurately reproduced by indirect ICI. Both direct strategies fail

Fig. 4. Unstable scalar plant. Open-loop trajectories (log scale, 8 steps) from of the models returned by S=40 independent training runs (solid = median over runs, shaded = 10–90 percentile band); the indirect strategies reproduce the diverging behavior, while both direct strategies return an inert surrogate.
in every run: as anticipated by Drawback D.1, they simulate the candidate model on the recorded input, and for unstable models the finite-cost region shrinks exponentially around the true plant [40], so unconstrained gradient descent diverges. CLOE avoids open-loop simulation, but its rollout stays bounded only while gradient updates keep the model stabilized by K, which nothing guarantees. For a fair comparison, we therefore equip these methods with heuristic training safeguards (horizon curricula, gradient clipping, learning-rate backoff [40]); with them, the direct approaches converge, but to stable surrogates that miss the open-loop instability. In contrast, indirect ICI restricts the search space to models that K certifiably stabilizes, keeping every training rollout bounded and recovering the unstable dynamics without such heuristics.
6.3 Point-Mass Robot under Partial Observation
This experiment evaluates the accuracy of the ICI strategies against the generic-network baselines on the stable point-mass robot of Section 6.1 in a uniform environment , under partial observation: only the (noisy) positions are measured, the velocities remain hidden. We evaluate the closed-loop identification performance through two distinct parameter sweeps: varying the reference excitation level on noise-free data, and varying the level of colored measurement noise under constant excitation. The two ICI strategies share the same certified deep SSM as the operator in (17) and (20), and the two baselines share a generic LSTM as the model in (30) and (31).
Results. Figure 6 visualizes both sweeps, with their corresponding FIT measures detailed in Table 3. The analysis yields three main observations.
(a) Informativity at low excitation. At low excitation (e.g., ) the input is dominated by the feedback loop ( ), and this lack of informativity makes the direct methods fail in open loop (FIT -28 for direct ICI) despite passing the regulation test. As the excitation grows ( ), informativity is restored and the gap between the methods closes.
(b) Bias of direct methods under colored noise. Feedback
Table 1
Model classes and data of the four experiments. are the number and length of the training trajectories, , the excitation and measurement-noise levels, and , the number and length of the test trajectories. Initial conditions are (training) and (redeployment test) in Section 6.2, and with zero initial velocity elsewhere. The redeployment test of Section 6.2 is repeated at for each of the training runs per strategy.
| Section | System | Observation | ICI operator | Baseline class | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 6.2 | 1 | full state | deep SSM | ReLU RNN | 40 | 100 | 0.5 | 0.1 | 100 | 200 |
| 6.3 | 2 | positions | deep SSM | LSTM | 200 | 100 | 100 | 100 | ||
| 6.4 | 2 | full state | deep SSM | deep SSM, no context | 60 | 50 | 20 | 0.1 | 100/20 | 50 |
| 6.5 | 2 | positions | REN | — | 1–64 | 50 | 20 | 0.5 | 100 | 50 |
Table 2
Unstable scalar plant (29): identifiability of the unstable plant, certified closed-loop stability with the known controller, and fraction of the independent training runs whose model the data-collection controller fails to stabilize ().
| Strategy | Identifiability of unstable G | Certified CL stability | Unstable CL runs |
|---|---|---|---|
| Indirect ICI | ✓ | ✓ | 0% |
| Direct ICI | — | ✓ | 0% |
| CLOE | ✓ | — | 2.5% |
| Direct OE | — | — | 25% |

Fig. 5. Out-of-distribution excitation waveforms (square, multisine) at the training amplitude; training cell , , AR(1); channel (the analogous figure and all other training cells are in the repository). Indirect ICI transfers to the unseen shapes more accurately.
injects noise into the control input via , so the regressor loses orthogonality with the residual and direct identification is biased (Drawback D.2) [16]. In Figure 6 (right, ), as grows from 0.1 to 2 the open-loop FIT of direct ICI collapses (82.9 → -7.0) while indirect ICI degrades gracefully (86.7 → 60.9), its regressor being noise-independent by construction. We examine the Pearson correlation between the model's simulation error and the actual measurement noise. For the -driven models, this correlation is significant (0.28 for direct ICI, 0.21 for Direct OE), confirming that they erroneously absorb the noise into the learned dynamics.
(c) Generalization to out-of-distribution excitation. To probe whether the true open-loop dynamics were captured, the identified models are evaluated on unseen input waveforms (square wave, multisine) at the training amplitude (Figure 5).

Indirect ICI (SSM)
Direct ICI (SSM)
Direct OE (LSTM)
CLOE (LSTM)
Fig. 6. Point-mass robot: open-loop (top) / closed-loop (bottom) FIT, mean±std over 100 test trajectories. Left: noise-free training vs. excitation (observation (a)); right: AR(1) noise sweep at (observation (b)).
The indirect ICI model tracks the true response; the direct methods and the generic baselines exhibit drift and unphysical oscillations.
6.4 Generalization across environments via context-aware ICI
This experiment evaluates the context-enriched parameterization of Section 3.3 across a family of environments. We consider the stable point-mass robot of Section 6.1 with full-state measurements and the proportional controller on the position components; unlike Section 6.3, the robot now operates in a family of environments with position-dependent friction: in environment , the nominal friction force is scaled by , a superposition of random “sticky patches” with intensities , radii , and centers . Two of these fields are shown in Figure 9: the test trajectories repeatedly traverse the patches, so the field shapes the dynamics along the whole data record.
Two indirect-ICI models share the same certified deep SSM core, with and without access to the local drag scale as context. The contextual model instantiates (13), with the deep SSM acting as the stable feature generator :
Table 3
Point-mass robot under partial observation (Section 6.3): open-loop and closed-loop FIT [%], mean std over the 100 test trajectories. Top: nominal excitation and AR(1) measurement noise () of increasing level . Bottom: noise-free training () and increasing excitation level ; at the LSTM baselines fall below open-loop FIT. Colored cells indicate the best result per column (ties are highlighted in both entries). Both sweeps are shown in Figure 6; the complete grids, including , are in the repository.
| Strategy | ||||||||
|---|---|---|---|---|---|---|---|---|
| OL | CL | OL | CL | OL | CL | OL | CL | |
| Direct OE (LSTM) | 72.3±13.3 | 83.0±7.2 | 66.3±17.2 | 80.7±7.9 | 45.9±22.5 | 72.4±11.9 | -36.2±55.0 | 43.5±30.7 |
| CLOE (LSTM) | 78.9±10.6 | 87.0±5.4 | 70.2±16.5 | 82.8±8.4 | 39.1±34.1 | 77.1±14.5 | -86.1±123.0 | 30.3±54.8 |
| Direct ICI (SSM) | 82.9±6.5 | 92.1±3.1 | 79.0±6.8 | 91.7±3.0 | 62.0±9.7 | 90.2±3.0 | -7.0±33.6 | 87.8±4.3 |
| Indirect ICI (SSM) | 86.7±5.1 | 92.0±4.4 | 84.3±6.0 | 91.7±3.7 | 74.0±10.0 | 89.6±3.9 | 60.9±15.7 | 82.7±6.1 |
| Strategy | ||||||||
| OL | CL | OL | CL | OL | CL | OL | CL | |
| Direct OE (LSTM) | -170.1±118.6 | 86.0±8.9 | -64.9±71.3 | 83.3±10.1 | 45.1±32.1 | 86.1±6.0 | 76.0±12.3 | 85.1±4.9 |
| CLOE (LSTM) | -136.4±135.5 | 89.7±4.1 | -59.5±107.3 | 89.7±5.9 | 69.3±20.1 | 91.3±3.3 | 82.3±10.1 | 90.1±4.8 |
| Direct ICI (SSM) | -27.6±28.2 | 95.3±3.6 | 68.6±10.6 | 95.4±3.9 | 78.9±7.0 | 95.6±2.5 | 83.2±6.7 | 92.3±3.0 |
| Indirect ICI (SSM) | 64.4±15.6 | 96.5±2.6 | 78.7±9.2 | 96.1±2.6 | 86.3±5.6 | 95.5±2.3 | 87.0±5.0 | 92.0±4.4 |
-
SSM-no-context receives without terrain information;
-
SSM-context uses a context-only mixer producing , applied to the core features and rescaled so that . This also bounds its induced Euclidean norm, as required by Section 3.3.
During training, the context sequence is refreshed once per epoch by evaluating the terrain map at the model's predicted positions. During deployment, it is recomputed sequentially as , where is the position component of the predicted output. The mixer uses context with a one-step delay, so affects predictions only from step , preserving strict causality. The terrain map is assumed known, but no measured or recorded test trajectory is used to construct context.
Two training regimes share a budget of 60 trajectories: for Case A the training dataset contains trajectories collected on a single field, while in Case B the training trajectories are collected from 12 fields; both are tested on the training fields and on 6 held-out unseen fields.
Results. The open-loop identification accuracy is illustrated in Figures 7–8, with comprehensive per-environment tables available in the public repository. Bound (14), together with T.1, certifies stability of the identified closed-loop models. All evaluated closed-loop rollouts remained bounded across models, seeds, and fields. From these experiments, two primary conclusions emerge:
(a) Context distinguishes environment-specific responses. The initial state and excitation do not specify the environment, so a predictor receiving only these inputs must fit a common response across fields. Under family training, the no-context model attains similar open-loop FIT on seen and unseen fields (42.4% and 42.2%). Increasing its pa-

Fig. 7. Distribution of the open-loop per-trajectory FIT for the two models (box = median and interquartile range, whiskers = Tukey, ◇ = mean; all seeds and test trajectories pooled). Columns vary the training regime (Case A, a single field / Case B, a family of fields) and rows the test set (seen fields, top / unseen fields, bottom); the y-axis is FIT in percent. The contextual model dominates the uncontextualized one in every panel, and under family training its seen- and unseen-field distributions nearly coincide.
parameter count from 2793 to (42249) does not improve unseen-field FIT (36.9–40.7%), consistent with a limitation due to missing environment information. Figure 8 shows the resulting prediction errors inside the strong-friction patches.
(b) Context enables generalization to unseen fields without retraining. Under family training, the contextual model reaches unseen-field FIT against without context, an improvement of 44.4 percentage points with a smaller reported standard deviation. Its unseen-field score is close to the seen-field score (86.6% versus 87.0%), showing generalization to the tested unseen environments. This transfer uses the same learned parameters, with each new terrain map available for context evaluation.

Fig. 8. Case B, open-loop response on a seen (left) and unseen (right) field: (top), (bottom); shaded = strong friction ( ). The no-context prediction departs from the truth inside the patches, while the contextual model tracks it; the analogous figures are in the public repository.

Fig. 9. Case B: true open-loop test trajectories (black) and SSM-context rollouts (dashed) over the friction field (darker = stickier), on a seen (left) and unseen (right) field, under the causal predicted-position context. Dots mark the initial positions.
6.5 PAC-Bayesian Identification under Data Scarcity
This experiment considers the regime in which the PAC-Bayesian framework of Section 5 is most useful, namely scarce and noisy data with no validation set, where ERM does not merely add variance but memorizes the measurement noise.
On the point-mass robot example, we demonstrate three key properties: (a) under data scarcity ERM overfits and destroys a good prior, whereas the SVGD approximation of the Gibbs posterior over the same ICI parameterization generalizes and preserves it; (b) Theorem 2 provides a non-vacuous generalization certificate, spending no held-out data, that tightens with the sample size N; and (c) this certificate requires only an informative prior, which may be supplied by cross-domain transfer or, in the absence of a source system, obtained from data split.
In this experiment, we apply the transformation in (22) to the identification loss, setting and : every risk bound then takes values in and is vacuous as soon as it reaches 1. The identified operator and every posterior particle are contractive RENs, certified closed-loop stable by Theorem 1. Four estimators share the same parameterization: the un-adapted prior mean, ERM from scratch, ERM fine-tuned from the prior and one particle drawn uniformly from the SVGD approximation of the Gibbs posterior (25) (Section 5.3). The prior parameters are obtained by ERM pretraining on (20) using trajectories from a nominal plant with uniform linear drag; at deployment the plant has drifted to a heavier drag, modeling wear, and must be re-identified from only noisy trajectories, with no validation set. Being trained on a different plant, is independent of the target sample, so Theorem 2 applies with no data splitting. The prior distribution is the per-parameter Gaussian .
Results. Figures 10–11 report three complementary quantities. Figure 10 (left) shows the PAC-Bayes certificate (27) of a single draw from the exact Gibbs posterior ; Figure 10 (right) shows the empirical risk (16) computed on c rather than on the transformed loss (22), against noisy outputs; and Figure 11 shows deployment FIT against the noise-free plant. Only the first quantity is certified by Theorem 2; the latter two are complementary empirical diagnostics. The complete numerical table is provided in the repository. The analysis yields three main observations.
(a) At scarce data ERM memorizes the noise; the SVGD estimator does not. For both ERM models drive their training MSE below the noise floor , fitting the specific realization, while their test error explodes and their deployment FIT drops below the initial pre-trained prior (67.7% vs. 86.6% at ; Figure 11). Fine-tuning from the good prior overfits just the same, isolating the benefit as the KL anchoring of (24) rather than a good initialization: the SVGD estimator, optimizing the same trajectories, keeps its training error at the floor and its FIT at the prior's level, and is unaffected even at .
(b) The SVGD estimator performs well at scarce data; the Gibbs bound becomes non-vacuous. Across N (Figure 11) the posterior holds an almost constant ≈85% FIT, whereas the ERM starts far below the prior, catches up around N = 8, and overtakes only as the sample size grows. This plateau is the price of anchoring to the prior, and it is exactly what protects the posterior where unconstrained fitting ruins ERM. The certificate (27) behaves consistently (Figure 10): vacuous at the smallest N, it becomes informative from N = 4 and tightens with more data, at the rate of ; the point where it stops being vacuous thus marks the onset of the useful regime. The bound is fully computed from data (no oracle term) and it holds with probability ( ). Every SVGD particle is certified closed-loop stable by Theorem 1, whereas the loss certificate applies to an exact draw from . The approximation error for the deployed particle is not covered (Section 5.3). Neither guarantee uses held-out data.
The prior width trades deployment fit against certification: with a wide prior (Figure 11, pink) the posterior detaches from and reaches a higher FIT, but a wide prior rarely

Fig. 10. Certificate and overfitting diagnostics vs. sample size N. Left: the (27) bound for the transfer prior (blue) and the transfer-free data-split prior (light blue); the shaded band marks the vacuous region (C = 1). Right: train (dark) vs. test (light) empirical risk (16) built on the untransformed loss (21) for the ERM (orange) and PAC-Bayes (blue) models, against noisy outputs (log scale). The left panel bounds the true risk in (15) for a draw from ; the right is an empirical diagnostic. The MSE noise floor is (dotted), and training below it indicates noise memorization.
samples low-loss models, so the bound turns vacuous, which is precisely why the selected configuration keeps small.
(c) The informative prior can be built without a source system. When no related plant is available for transfer, an equally good prior is obtained from the target data alone, by splitting it in two (Prop. 2 of [20]): a short ERM run on one half provides the prior center, and the posterior and its certificate are computed on the other half. This route reaches a comparable FIT ( 93%) with a valid certificate (Figure 10), at the cost of needing more data than transfer, since half the sample is spent on the prior. Either way, an informative prior is essential: a non-informative one forfeits the certificate.
Remark 5 (Estimating the log-partition) The certificate (27) requires , an expectation under the prior with no closed form. We estimate it by Monte Carlo, drawing i.i.d. prior samples and averaging . Since the integrand lies in , a one-sided Hoeffding bound on this average controls the estimation error, so that is replaced by a high-probability upper bound; the resulting certificate remains valid, now jointly over the sample, the posterior draw, and the Monte-Carlo draws.
7 Conclusions and future work
This paper presented a computationally tractable framework for closed-loop identification of nonlinear systems. By leveraging a complete parameterization of all systems stabilized by a given controller, the proposed Internal Controller Identification (ICI) framework guarantees closed-loop stability of the identified model by construction. Moreover, this approach ensures that training remains well posed even for open-loop unstable plants, and reduces to a consistent open-loop problem in the linear case.
Our numerical experiments validate these theoretical claims across several distinct operating regimes. For open-loop unstable plants, the certified models successfully captured

prior only
ERM scratch
ERM fine-tuned
PAC-Bayes (data-split prior)
PAC-Bayes (transfer prior)
PAC-Bayes (transfer prior, a large)
Fig. 11. Deployment FIT vs. N (mean over seeds): left, open loop; right, closed loop; against the noise-free plant. Key comparisons: 1) ERM methods (orange/gold) overfit to noise under data scarcity, degrading performance below the baseline prior. 2) The SVGD estimator (blue), anchored to the transfer prior, resists overfitting and preserves the prior's quality at scarce N. ERM overtakes it only at larger sample sizes. 3) Relying solely on target data, the data-split prior approach (green) adapts well and maintains a valid certificate. 4) Using a wide prior (pink) yields high FIT but results in a vacuous certificate.
the unstable dynamics without ever destabilizing the loop, avoiding the divergence seen in uncertified baselines. On a partially observed robotic system, the indirect criterion proved to be the most accurate under conditions of weak excitation and feedback-correlated noise. We also showed that bounded context wrappers allow a single certified model to identify an entire family of environments, generalizing even to members unseen during training. Finally, in data-scarce regimes, the PAC-Bayesian extension prevented the noise memorization that typically degrades ERM, while providing non-vacuous certificates without requiring held-out data.
Future work will focus on applying these identified models to adaptive control schemes and designing an iterative procedure that seamlessly integrates system identification with controller synthesis.
References
[1] M. Abdalmoaty and R. S. Smith. Small noise analysis of non-parametric closed-loop identification. In IEEE Conf. Decision and Control (CDC), pages 7988–7993, 2024.
[2] P. Alquier. User-friendly introduction to PAC-Bayes bounds. Found. Trends Mach. Learn., 17(2):174–303, 2024.
[3] P. Alquier, J. Ridgway, and N. Chopin. On the properties of variational approximations of Gibbs posteriors. J. Mach. Learn. Res., 17(236):1–41, 2016.
[4] B. D. Anderson. From Youla–Kucera to identification, adaptive and nonlinear control. Automatica, 34(12):1485–1506, 1998.
[5] M. G. Boroujeni, C. L. Galimberti, A. Krause, and G. Ferrari-Trecate. A PAC-Bayesian framework for optimal control with stability guarantees. In IEEE Conf. Decision and Control (CDC), pages 8237–8244, 2024.
[6] M. G. Boroujeni, A. Krause, and G. Ferrari-Trecate. Personalized federated learning of probabilistic models: A PAC-Bayesian approach. arXiv preprint arXiv:2401.08351, 2024.
[7] M. G. Boroujeni, L. Meroi, L. Massai, C. L. Galimberti, and G. Ferrari-Trecate. Neural identification of feedback-stabilized nonlinear systems. In IEEE Conf. Decision and Control (CDC), pages 4201–4207. IEEE, 2025.
[8] O. Catoni. Pac-bayesian supervised classification: the thermodynamics of statistical learning. arXiv preprint arXiv:0712.0248, 2007.
[9] S. Dasgupta and B. D. Anderson. A parametrization for the closed-loop identification of nonlinear time-varying systems. Automatica, 32(10):1349–1360, 1996.
[10] C. A. Desoer and R.-W. Liu. Global parametrization of feedback systems with nonlinear plants. Syst. Control Lett., 1(4):249–251, 1982.
[11] C. Economou, M. Morari, and B. Palsson. Internal model control: Extension to nonlinear system. Industrial and Engineering Chemistry Process Design and Development, 25(2):403–411, 1986.
[12] D. Eringis, J. Leth, Z.-H. Tan, R. Wisniewski, A. F. Esfahani, and M. Petreczky. Pac-bayesian theory for stochastic lti systems. In 2021 60th IEEE Conference on Decision and Control (CDC), pages 6626–6633. IEEE, 2021.
[13] D. Eringis, J. Leth, Z.-H. Tan, R. Wisniewski, and M. Petreczky. Pac-bayes generalisation bounds for dynamical systems including stable rnns. arXiv preprint arXiv:2312.09793, 2023.
[14] D. Eringis, J. Leth, Z.-H. Tan, R. Wisniewski, and M. Petreczky. Pac-bayesian error bound, via rényi divergence, for a class of linear time-invariant state-space models. In Forty-first Int. Conf. Machine Learning (ICML), 2024.
[15] M. Forgione, F. Pura, and D. Piga. From system models to class models: An in-context learning paradigm. IEEE Control Syst. Lett., 7:3513–3518, 2023.
[16] U. Forssell and L. Ljung. Closed-loop identification revisited. Automatica, 35(7):1215–1241, 1999.
[17] K. Fujimoto, B. D. Anderson, and F. De Bruyne. A parametrization for closed-loop identification of nonlinear systems based on differentially coprime kernel representations. Automatica, 37(12):1893–1907, 2001.
[18] L. Furieri, C. L. Galimberti, and G. Ferrari-Trecate. Learning to boost the performance of stable nonlinear systems. IEEE Open J. Control Syst., 3:342–357, 2024.
[19] C. L. Galimberti, L. Furieri, and G. Ferrari-Trecate. Parametrizations of all stable closed-loop responses: From theory to neural network control design. Annu. Rev. Control, 60:101012, 2025.
[20] M. Ghoddousi Boroujeni, C. L. Galimberti, A. Krause, and G. Ferrari-Trecate. PAC-Bayesian optimal control with stability and generalization guarantees. arXiv preprint arXiv:2512.02858, 2025.
[21] G. C. Goodwin and J. S. Welsh. Bias issues in closed loop identification with application to adaptive control. Communications in Information and Systems, 2(4):349–370, 2002.
[22] P. J. Green, K. Łatuszyński, M. Pereyra, and C. P. Robert. Bayesian computation: a perspective on the current state, and sampling backward and forwards. Stat. Comput, 25(4):835–862, 2015.
[23] A. Gu, K. Goel, and C. Ré. Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations, 2022.
[24] F. Hansen, G. Franklin, and R. Kosut. Closed-loop identification via the fractional representation: Experiment design. In 1989 American Control Conference, pages 1422–1427, 1989.
[25] D. Ho. A system level approach to discrete-time nonlinear systems. In 2020 American Control Conference (ACC), pages 1625–1630, 2020.
[26] D. Jones and M. A. Dahleh. Closed loop system identification with known feedback: A non asymptotic viewpoint. In 2022 American Control Conference (ACC), pages 4094–4100, 2022.
[27] I. Landau, B. D. Anderson, and F. De Bruyne. Recursive identification algorithms for continuous-time nonlinear plants operating in closed loop. Automatica, 37(3):469–475, 2001.
[28] I. D. Landau and A. Karimi. An output error recursive algorithm for unbiased identification in closed loop. Automatica, 33(5):933–938, 1997.
[29] Q. Liu and D. Wang. Stein variational gradient descent: A general purpose Bayesian inference algorithm. In Adv. Neural Inf. Process. Syst. (NeurIPS), volume 29, 2016.
[30] L. Ljung. System Identification: Theory for the User. Prentice Hall PTR, 1999.
[31] L. Ljung and U. Forssell. An alternative motivation for the indirect approach to closed-loop identification. IEEE Trans. Autom. Control, 44(11):2206–2209, 1999.
[32] I. Maruta and T. Sugie. A simple framework for identifying dynamical systems in closed-loop. IEEE Access, 9:31441–31453, 2021.
[33] L. Massai and G. Ferrari-Trecate. Free parametrization of 12-bounded state space models. arXiv e-prints, pages arXiv–2503, 2025.
[34] L. Massai, S. Messina, N. Kirsch, and G. Ferrari-Trecate. Context-enriched performance boosting via operator decomposition, 2026.
[35] D. A. McAllester. Some pac-bayesian theorems. Machine Learning, 37(3):355–363, 1999.
[36] A. Paice and A. van der Schaft. The class of stabilizing nonlinear plant controller pairs. IEEE Trans. Autom. Control, 41(5):634–645, 1996.
[37] D. Piga, F. Pura, and M. Forgione. On the adaptation of in-context learners for system identification. IFAC-PapersOnLine, 58(15):277–282, 2024.
[38] G. Pillonetto, A. Aravkin, D. Gedon, L. Ljung, A. H. Ribeiro, and T. B. Schön. Deep networks for system identification: A survey. Automatica, 171:111907, 2025.
[39] M. Revay, R. Wang, and I. R. Manchester. Recurrent equilibrium networks: Flexible dynamic models with guaranteed stability and robustness. IEEE Trans. Autom. Control, 69(5):2855–2870, 2023.
[40] A. H. Ribeiro, K. Tiels, J. Umenberger, T. B. Schön, and L. A. Aguirre. On the smoothness of nonlinear system identification. Automatica, 121:109158, 2020.
[41] J. Rothfuss, V. Fortuin, M. Josifoski, and A. Krause. PACOH: Bayes-optimal meta-learning with PAC-guarantees. In Int. Conf. Machine Learning (ICML), pages 9116–9126. PMLR, 2021.
[42] J. Sjöberg, H. Hjalmarsson, and L. Ljung. Neural networks in system identification. IFAC Proceedings Volumes, 27(8):359–382, 1994.
[43] T. Söderström and P. Stoica. System identification. Prentice-Hall, Inc., 1988.
[44] R. Tóth. Modeling and identification of linear parameter-varying systems, volume 403. Springer, 2010.
[45] P. Van den Hof. Closed-loop issues in system identification. Annu. Rev. Control, 22:173–186, 1998.
[46] A. Van der Schaft. L2-gain and passivity techniques in nonlinear control. Springer, 2000.
[47] J.-W. Van Wingerden and M. Verhaegen. Subspace identification of bilinear and lpv systems for open-and closed-loop data. Automatica, 45(2):372–381, 2009.
[48] D. Youla, H. Jabr, and J. Bongiorno. Modern Wiener-Hopf design of optimal controllers—part ii: The multivariable case. IEEE Trans. Autom. Control, 21(3):319–338, 1976.
[49] M. Zakwan and G. Ferrari-Trecate. Neural port-hamiltonian models for nonlinear distributed control: An unconstrained parametrization approach. IEEE Trans. Autom. Control, 2026.
[50] M. Zakwan, V. Gupta, A. Karimi, E. C. Balta, and G. Ferrari-Trecate. Controller design for structured state-space models via contraction theory. arXiv preprint arXiv:2604.07069, 2026.