Manuscript Offprint
arXiv:2611.04893Fault-tolerant shallow recurrent decoders for sparse sensing with missing sensor measurements
Matteo Romilio Pasqual*, Matteo Tomasetto**, J. Nathan Kutz†, and Andrea Manzoni‡
- Department of Electronics, Information and Bioengineering, Politecnico di Milano, Milano, Italy
** Department of Mechanical Engineering, Politecnico di Milano, Milano, Italy
† Autodesk Research, London, UK and
‡ MOX - Department of Mathematics, Politecnico di Milano, Milano, Italy
Real-world sensing systems are inherently imperfect: sensors may fail, intermittently disconnect, operate with asynchronous sampling rates, and be subject to noise, leading to measurement streams that are irregular, incomplete, and heterogeneous. Nevertheless, sensing strategies for real-time state reconstruction typically assume synchronous and continuously active sensors, a constraint that substantially limits their applicability in operational environments. In this work, we introduce fault-tolerant sparse sensing strategies in the context of shallow recurrent decoders (SHRED) to enable high-dimensional state estimation from sparse, asynchronous, and missing sensor measurements. Specifically, we consider naive imputation strategies, fault-tolerant recurrent temporal encoders, and we introduce four different transformer-based masking mechanisms to make SHRED explicitly aware of sensor availability through the binary data-availability mask. Moreover, we further introduce a multi-step decoding training objective for SHRED, resulting in smoother latent trajectories and more robust predictions. Throughout a synthetic benchmark and three real-world problems in hydrodynamic and ocean modeling, we show that (i) transformer-based masking mechanisms outperform standard imputation techniques and fault-tolerant recurrent architectures, (ii) the multi-step decoding training objective enhances reconstruction fidelity and robustness in the presence of heterogeneous missing-data patterns, while (iii) the computational efficiency of SHRED is preserved, with no additional inference-time overhead.
I. INTRODUCTION
Many real-world dynamical systems evolve in high-dimensional state spaces that cannot be directly observed in their entirety [1, 26]. This challenge arises across a wide range of scientific and engineering applications, including fluid and solid mechanics, weather and climate modeling, plasma physics, and structural health monitoring. In these systems, sensors provide the primary interface between theory and reality, yet their deployment is inevitably limited by cost, reliability, physical inaccessibility, and operational constraints. However, being able to access local measurements is crucial to, e.g., inferring full state dynamics, designing feedback control strategies, or predicting quantities of interest.
Recovering the state of a dynamical system from partial observations enables downstream tasks such as monitoring, forecasting, anomaly detection, and control, while avoiding expensive and impractical full-field measurements. Traditional approaches to state reconstruction are grounded in linear algebra frameworks. The singular value decomposition (SVD) – also known as proper orthogonal decomposition (POD) [4, 6, 31, 35] – provides an optimal low-rank approximation of high-dimensional state data through a linear projection onto a low-dimensional basis of spatial functions capturing most of the data variability. After computing the dominant POD modes from the training data, the coefficients of the low-rank representation can be estimated from a limited number of point measurements by solving a linear inverse problem, provided that the sensing matrix is well-conditioned [22, 49]. However, the requirement for
a well-conditioned sensing matrix imposes constraints on both the number and placement of sensors, leading to an NP-hard optimization problem for identifying the optimal configuration [12, 29, 30] and potentially limiting its applicability in real-world settings [11, 36]. Moreover, the reconstruction accuracy of this method is bounded by the expressiveness of the POD modes used, so that fine-scales or nonlinear features of the field cannot be recovered entirely when only a few modes are retained.
The advent of scientific machine learning has introduced new data-driven methods for addressing limitations of traditional linear methods [5, 23, 40]. Neural networks and, in particular, shallow decoder networks (SDNs), leverage the universal approximation theorem of feedforward architectures [14] to learn an end-to-end nonlinear mapping from sensor measurements directly to the corresponding high-dimensional state [8, 19, 34, 42], without requiring an explicit basis representation as in POD-based methods. Similarly, the Senseiver [43] employs an attention-based architecture inspired by the Perceiver IO [28] to reconstruct spatio-temporal fields at arbitrary query locations from sparse observations. Once trained on a set of snapshots, these strategies can capture nonlinear spatial correlations in the data that are inaccessible to linear methods and have been shown to outperform linear POD-based architectures in field reconstruction, particularly in ill-posed settings, i.e., with few or poorly placed sensors. Nevertheless, POD-based methods, SDNs, and the Senseiver all share an intrinsic limitation: they operate on static snapshots, treating each time instant independently and discarding the temporal dynamics of the measurement signal. The tempo-

FIG. 1. Overview of fault-tolerant shallow recurrent decoders for state reconstruction from sparse sensors under missing sensor measurements. Sensor measurements with possibly missing entries are padded, lagged, and processed by a fault-tolerant encoder to produce a latent embedding , which is subsequently decoded into the POD coefficients via the shallow decoder . The state reconstruction at time is then given by , where denotes the (possibly field-specific) dominant POD modes. The upper panel illustrates the four Transformer-based masking strategies proposed where the binary data-availability mask is injected at different levels of the encoder architecture, namely channel-wise masking, hidden-space masking, MHSA masking, and learned MHSA masking. The training box reports the standard last-step SHRED loss function and the multi-step decoding objective, where the decoder is supervised at intermediate time steps to encourage temporally consistent latent representations across the observation window.
ral history of observations, naturally available whenever sensors operate continuously over time, is essential for capturing intrinsic dynamical features, such as temporal correlations between consecutive measurements.
The shallow recurrent decoder (SHRED) framework proposed by Williams et al. [51] addresses this limitation by combining a recurrent temporal encoder with a shallow spatial decoder. The encoder, which is typically modeled via recurrent neural networks such as, e.g., long short-term memory (LSTM) [25, 33] or gated recurrent unit (GRU) [10] networks, processes a sliding window of lagged sensor measurements, compressing their temporal history into a latent representation, which is subsequently mapped to the full field by a SDN. Thanks to the temporal history of sensor readings, SHRED achieves dramatically lower reconstruction errors than classical techniques, even with a very limited number of randomly placed sensors. Different SHRED extensions have recently been proposed in the literature. For instance,
Riva et al. [41] take into account an ensemble of SHRED models to cope with noisy measurements. Moreover, the SHRED framework has been extended to parametric systems [46, 47], demonstrating that the temporal history of a handful of sensors suffices to reconstruct and control high-dimensional fields across varying physical and geometrical parameters. Gao et al. [24], instead, introduce a regularization based on sparse identification of nonlinear dynamics (SINDy) [7] to promote interpretable latent dynamics, further improving forecasting performance and explainability in challenging scenarios. More recently, Yermakov et al. employ a Transformer [48] as temporal encoder in the so-called T-SHRED framework [52], thus exploiting the multi-head self-attention mechanism to capture long-range temporal dependencies among lagged sensor measurements.
SHRED has been successfully employed in a wide range of applications, while typically considering only simulated data, synchronous sensors with uninterrupted op-eration throughout the observation period, and point-wise field evaluations as synthetic sensor readings. The deployment of SHRED in real-world environments must account for challenging sensing conditions, including incomplete, noisy, and asynchronous data streams [44]. This results in time-series that are irregular, with different sampling rates, and may contain gaps and missing values [37]. Moreover, in practical settings, sensor measurements do not exactly match direct pointwise evaluations of the underlying state, but rather provide (possibly indirect) observations that are correlated with the system state through an observation process. Note that discarding all sensors that are not jointly available over the entire observation period severely degrades reconstruction quality, particularly in the ultra-sparse-sensor regime. Moreover, this naive strategy becomes infeasible when sensor observation windows do not overlap, as naturally occurs under fully asynchronous sampling. To overcome this limitation, CS-SHRED [15] and LAPIS-SHRED [3] employ, respectively, (possibly expensive) convex minimization problems and latent-space inference to recover missing sensor values and reconstruct spatio-temporal dynamics from corrupted or incomplete observations.
In this work, we consider different efficient fault-tolerant sparse sensing strategies in the context of SHRED. First, naive imputation strategies are taken into account to infer missing sensor values, at the price of introducing additional estimation errors and potentially biasing the reconstructed field. In particular, standard baselines include mean, median, or last observation carried forward (LOCF) imputation. Rather than imputing missing sensor measurements before feeding the resulting sequence to the SHRED temporal encoder, we take into account recurrent models specifically designed to handle missing data in the context of time-series forecasting, such as GRU-D [9] and its attention-augmented variant attnGRU-D [53]. Finally, we introduce four different transformer-based masking mechanisms to conveniently handle missing and asynchronous sensor values in the SHRED temporal encoder. Specifically, we explore both fixed and learnable masking mechanisms applied at the channel level (channel-wise masking), at the hidden space level (hidden-space masking), or at the multi-head self-attention level (fixed or learned MHSA masking). Naive missing-data imputation strategies, fault-tolerant recurrent temporal encoders and the proposed masked shallow recurrent decoders are then compared on a synthetic benchmark and on three real-world problems in hydrodynamic and ocean modeling, where sensor data are not always available or synchronous. This work thus aims at providing practical guidance for the deployment of fault-tolerant SHRED models in operational settings characterized by heterogeneous and incomplete sensor coverage.
A further contribution of this work concerns the training objective considered to fit SHRED. The temporal encoders within the original SHRED architecture and its extensions, such as T-SHRED, entail a hidden state for every time step received as input. However, only the
last latent representation is passed to the decoder both during training and deployment, leaving the intermediate temporal representations entirely unexploited. This limitation is particularly consequential in the context of heterogeneous missing data: when sensor observations are irregular or partially absent, it is beneficial to leverage the temporal context accumulated across the lookback window to compensate for the missing information. Therefore, rather than relying on a SINDy regularization [24, 52], which requires careful dictionary selection and dedicated optimization routines, we propose a multi-step decoding training strategy. This approach is inspired by the auxiliary classifiers in GoogLeNet [45], which enforce representational regularity at intermediate layers of a deep convolutional neural network by attaching additional supervision at multiple depths. Under the proposed framework, we decode intermediate hidden states of the temporal encoder using the same spatial decoder, and combine the corresponding reconstruction losses into a weighted objective, thus providing supervision across multiple temporal depths. The multi-step decoding training strategy acts as a powerful regularizer, forcing the temporal encoder to build informative latent representations throughout the entire temporal window. By ensuring that the latent trajectory remains well-structured at every step, this strategy leads to improved reconstruction accuracy and enhances the model robustness to missing data. Finally, during inference, the additional decoding heads are discarded, allowing the architecture to reduce to the standard, computationally-efficient SHRED pipeline. An overview of fault-tolerant SHRED architectures, with particular emphasis on the Transformer-based masking strategies proposed, is available in Figure 1.
This work is organized as follows. Section II introduces the sparse sensing problem and reviews different state-of-the-art sensing methods, such as gappy POD, SDNs, and SHRED. Section III presents different fault-tolerant sparse sensing strategies in the context of SHRED. Specifically, it presents standard imputation techniques, fault-tolerant recurrent temporal encoders, and introduces four different Transformer-based masking mechanisms, namely channel-wise, hidden-space, MHSA, and learned MHSA masking. Moreover, it presents the multi-step decoding training objective, detailing its motivation and formulation within the SHRED training pipeline. Section IV shows the numerical results of the different fault-tolerant sensing strategies on a synthetic benchmark and three real-world problems in the context of hydrodynamic and ocean modeling. Finally, Section V summarizes the main findings, discusses the practical implications of the proposed contributions, and outlines directions for future work.
Let be the high-dimensional state of a dynamical system in the space-time domain , where denotes the spatial coordinate and the temporal variable, with final time . We consider state evolutions described by means of partial differential equations (PDEs) in the form
where is a generic (possibly nonlinear) differential operator modeling the time derivative of the state . The governing PDE in Equation (1) is, in general, spatially discretized through, e.g., finite elements or finite volumes [13, 31], yielding a finite dimensional discrete state vector evolving over time, where denotes the number of degrees of freedom required to capture the state dynamics. Moreover, a finite dimensional time grid spanning is usually employed to discretize the problem over time, thus resulting in the state vectors for .
In many practical scenarios, it is impossible to directly capture the full state due to a remarkably high dimension , or to physical constraints. Instead, the system is often observed through sparse sensors, locally monitoring the state evolution at a few locations within the domain over time . Formally, the state-to-sensor map is represented by the sensing operator , mapping the full state to the corresponding sensor readings. For instance, in the simplest case of pointwise sampling, the sensing operator reduces to a matrix obtained by selecting rows of the identity matrix. Note that, in general, may embody a nonlinear observation process, thus allowing sensors to measure quantities that may differ from those to be reconstructed. The sensor measurements are thus given by
where for denotes measurement noise. The noise components are usually assumed to be independent and identically distributed, as they typically arise independently from each sensor measurement system rather than from correlated physical sources, and are often modeled as Gaussian.
The sparse sensing problem consists of finding a reconstruction mapping that accurately recovers the high-dimensional state from the noisy, low-dimensional observations for . In other words, the sparse sensing problem aims at finding the inverse of the sensing operator . However, this is generally an underdetermined and ill-posed problem, as limited and sparse observations do not uniquely determine the underlying high-dimensional state. To address
this challenge, several strategies have been developed in the literature, as discussed in the following section.
A. From linear to nonlinear sensing strategies
Given the severely underdetermined nature of the state reconstruction problem from limited sensor readings, one may leverage the intrinsic low-rank structure of the data. Let us collect m snapshots of the N-dimensional state vector at different time instances into the so-called snapshot or data matrix
The singular value decomposition (SVD), commonly referred to as proper orthogonal decomposition (POD) [4, 6], provides the optimal (in a least-squares or statistical sense [18]) data-driven low-rank approximation of the matrix , and thus constitutes a valuable option for addressing the reconstruction task. Specifically, the POD factorizes the snapshot matrix as
where is an orthogonal matrix whose columns contain the spatial modes, is a rectangular diagonal matrix containing the non-negative singular values in descending order, and is an orthogonal matrix whose columns contain the temporal modes. Retaining only the first columns of – here denoted as – yields the optimal -rank approximation of the state snapshots, that is
where for are the time-dependent POD coefficients.
Instead of learning the map from sensor to state values, POD is helpful in reducing the sparse sensing problem to the estimation of the POD coefficients from sensor readings for , while exploiting POD to recover the original full-order state. In the case of a linear sensing operator , this is typically solved via the gappy POD approach [22, 49], which considers the least-squares problems
for , where denotes the Euclidean norm. The solution of Equation (6) can be computed via the Moore-Penrose pseudo-inverse of the matrix , thus yielding the high-dimensional state reconstruction
Despite its rigorous formulation, gappy POD is inherently constrained by the low-rank approximation induced by POD, since the reconstructed state is restricted to belong to the linear subspace spanned by the POD modes , with reconstruction error lower bounded by the POD accuracy. Moreover, the quality of the reconstruction strongly depends on sensor placement, as poor sensor configurations may lead to ill-conditioned or rank-deficient sensing operators, significantly amplifying measurement noise and numerical errors [11, 36].
To overcome the limitations of linear methods, more flexible nonlinear strategies for state reconstruction have been proposed in the scientific machine learning community [5, 23, 40]. Among these strategies, shallow decoder networks (SDNs) [8, 19, 34, 42] replace the linear reconstruction map with a shallow, fully connected neural network, whose weights and biases are learned by minimizing the reconstruction error over the training data. Differently from linear approaches, SDNs capture nonlinear dependencies between sparse sensor measurements and the underlying state, leading to improved reconstruction performance over linear methods, particularly in highly sparse sensing regimes [19, 42]. Similarly, the Senseiver [43] reconstructs spatio-temporal fields at arbitrary query locations from sparse observations, leveraging an attention-based architecture inspired by the Perceiver IO [28]. However, similarly to gappy-POD, SDNs and the Senseiver operate on static snapshots, treating each time instant independently and ignoring the temporal correlation in the data, which is a core feature of sequential measurements. As a result, they fail to exploit the information contained in the history of observations, which is often crucial for accurately reconstructing dynamical systems, especially in the presence of limited and noisy data [50].
B. Shallow recurrent decoders
Rather than reconstructing the full state field directly from sensor readings for , shallow recurrent decoders (SHRED) [51] exploit a recurrent temporal encoder to learn a latent representation from a window of past sensor measurements. The architecture is therefore defined as
where is a recurrent temporal encoder parameterized by , which embeds the current value and the past observations of the sensors into a -dimensional latent variable , while is a shallow decoder parameterized by , that spatially reconstructs the spatio-temporal fields of interest. Notably, pre-padding is applied - i.e., for - to avoid any burn-in period.
To model temporal dynamics, i.e. to build the encoder , one may rely on recurrent neural networks such as, e.g., long short-term memory (LSTM) [25, 33] or gated recurrent unit (GRU) [10] networks. Alternatively,
T-SHRED [52] replaces the recurrent temporal encoder with a Transformer [48]. This design choice leverages the self-attention mechanism to directly model pairwise interactions among lagged sensor measurements, enabling the network to capture long-range temporal dependencies more effectively than recurrent architectures. The spatial decoder , instead, maps the latent representation to the full spatial field, reconstructing from the encoded state for , and it is commonly modeled as a SDN with a progressively widening architecture, even though multiple alternatives are possible, such as convolutional neural networks.
The SHRED model is trained end-to-end by minimizing the reconstruction loss
where denotes the time indices in the training set.
To enhance computational efficiency for large-scale problems, SHRED architectures usually exploit a compressive training strategy [32, 47] where high-dimensional state snapshots are projected onto a dimensional subspace through, e.g., POD, so that the decoder estimates only the r POD coefficients rather than the full state, that is
Importantly, as shown in Figure 1, SHRED can be extended to multiple field reconstructions by concatenating the POD coefficient vectors associated with different physical fields into a single reduced-order representation to predict. After projecting the state snapshots, SHRED is trained by minimizing the reconstruction error at the reduced level
where for are the reduced state snapshots - i.e., the POD coefficients - in the training set. Once trained, SHRED generalizes to unseen sensor readings at new time instants, enabling reconstruction of the target field from previously unseen sequences of sensor measurements. Empirically, it has been shown that SHRED outperforms SDNs in reconstruction accuracy [51], as the recurrent temporal encoder is capable of exploiting the temporal correlations in the input sequence, leading to more informative latent representations.
Transformer shallow recurrent decoders
T-SHRED [52] considers a Transformer [48] as temporal encoder within SHRED in order to directly model pairwise interactions among lagged sensor measurements through the self-attention mechanism. Unlike recurrent networks, which progressively aggregate past observations into a hidden representation, Transformers establish direct dependencies between all time steps within the observation window, thus enabling the model to effectively capture long-range temporal dependencies.
Given the input sequence of lagged sensor measurements at time
T-SHRED first considers a projection of the sensor values onto a -dimensional embedding through the learnable matrix , thus obtaining a sequence of tokens over time. Moreover, sinusoidal positional encoding [48] is added to preserve the temporal ordering of the sequence, that is the zero-indexed matrix having entries defined as
for and . The resulting matrix is then sequentially processed through Transformer blocks (with, typically, ). A Transformer block is a fundamental building unit of the Transformer architecture that processes input representations to capture temporal dependencies between elements at different time instants in the input sequence. The core of each block is the multi-head self-attention (MHSA) mechanism, which computes attention operations - i.e., the so-called attention heads - in parallel, each parameterized by its own learnable weights, thus allowing each head to capture different temporal patterns and dependencies. Specifically, for the -th head in the -th block, the learnable projection matrices are used to compute the so-called query, key, and value matrices
from the block input . The attention operation is then defined as
where the softmax function is applied row-wise. Specifically, the product collects the pairwise dot-product scores between all query and
key vectors, which quantify how strongly each pair of time instants is aligned. The softmax function converts these scores into positive attention weights, with each row summing to one. Finally, the attention weights are multiplied by the value matrix , so that the output at each time instant is a weighted combination of the value vectors, with input-dependent weights determined by the learned query and key projections. The outputs of the attention heads are concatenated and linearly projected through a learnable matrix , yielding the MHSA representation
Finally, the Transformer block applies residual connections and layer normalization [2] – i.e., each input feature is standardized to zero mean and unit variance, and learnable per-feature scale and shift parameters are applied to stabilize training – around both the MHSA module and the (position-wise) multi-layer perceptron (MLP), that is
The output of the last Transformer block can be regarded as a collection of latent representations over the observation window. To recover the full state field at time , its last row , where is the -th one-hot selection vector, has to be upscaled by the spatial decoder , which is typically modeled as a SDN or a convolutional neural network.
III. FAULT-TOLERANT SHALLOW RECURRENT DECODERS
In this section, we introduce different fault-tolerant sparse sensing strategies in the context of SHRED. In particular, we consider naive imputation techniques to recover missing sensor values, fault-tolerant recurrent temporal encoders, and we present four different Transformer-based masking mechanisms that enable SHRED to deal with irregular and asynchronous time-series data, such as sensor readings with missing values and different sampling rates.
A. Handling missing sensor measurements
The SHRED framework described in Section IIB assumes that all the n input sensor measurements are available at every time step within the observation window
(a)

SST buoy availability
(b)

FIG. 2. Sea surface temperature. (a) Spatial coverage of moored buoys collecting in situ sea surface temperature (SST) measurements [38]. (b) Sensor data availability over time of different moored buoys [38], covering the period from January 2000 to December 2025, showing availability rates ranging from 97.2% to 53.0% and different data availability patterns. The available sensor readings are depicted by blue dots, while missing values are represented by red bars.
. Under this assumption, the encoder receives a fully populated input sequence at each reconstruction step. This hypothesis is reasonable when testing the model in synthetic settings, although it is not fully attainable in real-world systems. In practice, sensors are subject to a broad spectrum of failure modes: power outages, communication dropouts, hardware degradation, scheduled maintenance, calibration windows, and environmental interference. These events produce time-series that are irregular, asynchronous across sensors, and punctuated by gaps at isolated time instants or contiguous intervals with variable duration. Moreover, when multiple heterogeneous sensors are combined into a single network, their temporal availability patterns are rarely aligned, resulting in a measurement matrix with structured, sensor-dependent patterns of missing entries that reflect the operational history of each individual instrument. For instance, Figure 2 shows the spatial coverage and the sensor data availability of 20 moored buoys collecting in situ sea surface temperature (SST) measurements [38], with availability rates ranging from 97.2% to 53.0% and different data availability patterns. In this work, we aim at considering fault-tolerant sparse sensing strategies capable of dealing with missing and asynchronous sensor values, such as defective sensors with heterogeneous sampling frequencies.
To address incomplete, irregular and asynchronous sensor data, one may consider naive imputation strategies, where the mean, the median or the last-value of the available training data are employed to fill missing entries, with no modification to the SHRED architecture. Specifically, whenever the i-th sensor presents a missing value at time , the mean imputation replaces the i-th entry in the vector with the average of the avail-
able sensor observations over the training set, that is
where is the subset of training time steps at which sensor is observed, with cardinality . Similarly, the median imputation considers the median of the available observations in the training set, that is
Finally, the last observation carried forward (LOCF) imputation replaces missing entries with the most recent available measurement of the same sensor
while mean imputation is employed whenever no past sensor values are available. Thanks to local temporal continuity, LOCF is particularly effective for short, isolated gaps in smooth signals, while its performance degrades for long gaps or rapidly varying signals. All three imputation strategies can be readily combined with any temporal encoder architecture, since they operate entirely as pre-processing steps.
In addition to naive imputation strategies, it is possible to consider SHRED temporal encoders specifically designed to handle missing data in the context of multivariate time-series forecasting, such as GRU-D [9] and its attention-augmented variant attnGRU-D [53]. GRU-D considers learnable temporal decay mechanisms that account for the time elapsed since the last observation of each sensor. In particular, missing input values are imputed by decaying the last observed value toward a feature-specific empirical mean, while the hidden state is simultaneously decayed toward a default state. These decay mechanisms allow the model to learn how rapidly sensor information becomes outdated and enable the elapsed time since the last observation to directly influence the recurrent dynamics. The resulting input and hidden state are then processed by a standard GRU, allowing GRU-D to jointly exploit the observed values, their missingness patterns, and the temporal structure of the data. Instead, attnGRU-D extends GRU-D by incorporating an attention mechanism to selectively weight the recurrent hidden representations across time, thus allowing the model to identify and emphasize the time steps that are most relevant for the prediction task.
B. Transformer-based masking strategies
Rather than relying on naive imputation techniques and fault-tolerant recurrent encoders, which address data missingness through pre-processing operations or via modified recurrence equations, in this section we incorporate data availability information directly into the Transformer encoder of T-SHRED. Specifically, we inject the binary data-availability mask at different levels of the architecture, in order to condition the internal representation of the temporal encoder both on the observed values and on their corresponding availability patterns. Doing so, the model can learn to discount missing entries instead of treating placeholder values as genuine data, which would otherwise bias the reconstruction.
Let the time grid be the collection of the sampling instants of all the available sensors. In the case of missing and asynchronous sensor measurements, the observed data at reconstruction step read as follows
where denotes element-wise multiplication, is the matrix collecting the sequence of sensor values over the past steps until time for , with possibly missing entries, while is the mask matrix encoding the availability of each sensor over the lag window. Specifically, the mask is a binary matrix where each entry indicates the data availability of sensor at time , that is
for and . The pattern of missing entries jointly depends on the sampling rates and the failure processes of the individual sensors, making the mask generally heterogeneous across sensors and non-stationary over time.
Differently from the original SHRED implementation tailored to regular and complete data streams, in this section we propose masked shallow recurrent decoders where
we effectively inform SHRED on missing sensor values through Transformer-based masking strategies. Specifically, we take into account the observed data matrix as input for , and we inject the corresponding binary mask at different levels of the architecture. In the following, we introduce four different masking strategies: channel-wise masking, where the mask is concatenated to the input prior to embedding; hidden-space masking, which gates intermediate hidden representations via a learned projection of the mask; MHSA masking, which enforces hard attention suppression of time steps with no measurements available; and learned MHSA masking, which learns head-specific additive attention biases conditioned on the missingness pattern. The resulting Transformer-based temporal encoders are thus able to return a latent representation for aware of the sensor availability, and allow SHRED to generalize to irregular and asynchronous data streams.
Channel-wise masking The first strategy to make the Transformer encoder aware of missing values is to concatenate the binary mask directly to the observed data as an additional set of feature channels prior to the input embedding layer, that is
This effectively doubles the number of input channels from to , where the first rows correspond to the observed sensor values, while the remaining rows encode the corresponding binary availability indicators. The augmented input is then processed as in the standard T-SHRED framework. Notably, no modification is made to the attention mechanism or any other architectural component, as the mask information is injected exclusively at the input level. As a result, all subsequent layers must implicitly learn how to interpret the additional input information and how to propagate it through the encoder. The channel-wise strategy is therefore simple and architecture-agnostic, but it does not provide an explicit mechanism to prevent missing entries from influencing the attention scores, so that the model must learn to discount them implicitly during training.
Hidden-space masking Instead of providing the binary data-availability mask as additional input, the second masking strategy operates at the level of the hidden representation. We recall that the masked sensor measurements are embedded through the projection matrix , while positional encoding is added, thus yielding the matrix . At the beginning of each Transformer block, the hidden representation for is modulated element-wise by a continuous gating signal, that is
where is a learnable projection matrix shared across different blocks, while is the sigmoid function. The gated input is then fed to the Transformer block.
This masking mechanism explicitly amplifies or attenuates each hidden dimension at each time step according to which sensors are available, so that the model can learn to down-weight the hidden features that mainly depend on missing measurements. Moreover, since the mask directly influences the intermediate representations at every Transformer block, it ensures that the data availability information is propagated throughout the depth of the network rather than being confined to the input embedding stage, thus effectively controlling the information flow as it propagates through the model. Note that, since is learned jointly with all the other model parameters, the resulting gating signal is not a fixed binary mask, but a continuous, data-dependent weighting. This allows the model to adaptively determine how much each hidden dimension should be suppressed or preserved at every time step, depending on the observed missingness pattern and its interaction with the hidden state.
MHSA Masking The third masking strategy operates directly within the scaled dot-product attention mechanism, analogously to the masking mechanism considered in the standard Transformer [48], preventing missing values from contributing to the attention computation. Rather than modifying the input or the hidden representations, this approach introduces an additive bias to the attention scores that explicitly excludes time steps with no sensor values available from the softmax computation. Specifically, we consider the modified self-attention operation
where the attention bias matrix at the k-th reconstruction step is defined as
for . Note that the attention bias matrix is shared across Transformer blocks and attention heads. After softmax normalization, this ensures that the attention weights assigned to time steps with no sensor values available (i.e., ) are exactly zero, independently of the learned projections. Note that one may additionally require that for all , thereby recovering the autoregressive structure of standard Transformer models [48].
Importantly, since the mask is derived directly from the binary availability pattern and applied uniformly across all attention heads and Transformer blocks, this strategy imposes a hard structural constraint on information flow within the model. Note that, while time steps with no sensor values available are completely excluded from the attention computation, time instants with par-
tial missingness are not explicitly modeled in this formulation. The MHSA masking thus yields a strict and interpretable mechanism for filtering missing information, but it does not capture finer-grained patterns of partial observability within a timestep.
Learned MHSA Masking The fourth masking strategy extends the MHSA masking by replacing the fixed, rule-based mechanism for filtering missing information with a learnable data-dependent attention bias. Specifically, we consider the attention operation
where the attention bias for the -th Transformer block and the -th attention head is given by a lightweight two-layer MLP with ReLU activation function. In particular, the block-specific feedforward neural network returns, after a suitable reshape, the attention biases for , that is
where is a learnable embedding matrix, shared across different Transformer blocks.
In contrast to the previous masking strategies, the learned MHSA masking allows each Transformer block and attention head to adjust the attention between pairs of time instants according to the data-availability pattern. This gives the model the flexibility to handle partially observed time steps, and lets different heads specialize in different missingness patterns, at the price of a soft rather than guaranteed exclusion of missing entries from the attention computation. It is important to note that the different masking mechanisms proposed are not mutually exclusive, and they can be readily combined in hybrid configurations, thus allowing the model to jointly exploit explicit availability information and more flexible, layer-wise adaptations to missing-data patterns.
C. Multi-step decoding training strategy
This section introduces the multi-step decoding training strategy designed to enhance latent trajectories and SHRED predictions. The original SHRED implementation, as well as its extensions such as T-SHRED, embeds a sequence of lagged sensor measurements into a single latent representation , which is spatially decoded into the full state variable. However, temporal encoders internally produce a sequence of -dimensional latent representations over time. Note that, while recurrent temporal encoders such as, e.g., LSTM and GRU recursively update the hidden state over time, Transformer-based encoders aggregate the latent representations in the rows of the output matrix . Discarding all the hidden states but the last one may be a limiting factor when dealing with heterogeneous missing data, as temporal context accumulated across the lookback window may compensate for the missing information. Instead, supervising the decoding of intermediate latent states provides a training signal at every time step of the lookback window, which encourages the encoder to retain state information over time and makes the latent trajectory less sensitive to missing measurements at individual steps, which may be helpful in improving reconstruction accuracy and forecasting capabilities.
To mitigate this limitation, we introduce a multi-step decoding training strategy, inspired by the auxiliary classifier mechanism introduced in GoogLeNet [45], where auxiliary branches are attached at intermediate depths of the network and produce additional classification predictions during training. Specifically, while training SHRED, we apply the same spatial decoder to the latent variables , thus obtaining multiple lagged state reconstructions. The encoder and decoder parameters and can then be determined by minimizing the training loss
where the coefficients for balance the contribution of each prediction horizon. In the following, we consider weights in the form for and for , with and , so as to prioritize accuracy on more recent time instants.
Whenever a compressive training strategy is employed through, e.g., a POD-based projection of the full state fields in the training set, the multi-step decoding loss reads as follows
where the spatial decoder aims at reconstructing the lagged POD coefficients starting from the corresponding latent representations, rather than predicting the full state.
It is worth noting that, after training, only the last latent representation is decoded to obtain the state reconstruction , thus recovering the standard SHRED pipeline at inference time with no additional computational overhead.
IV. NUMERICAL RESULTS
This section presents the experimental validation of the proposed fault-tolerant shallow recurrent decoder strategies for handling heterogeneous missing sensor data in
four different scenarios. In particular, we consider a first synthetic benchmark dealing with shallow water equations solution data, in which sensor malfunctions are artificially introduced. Moreover, we take into account three real-world sparse sensing problems in the context of hydrodynamic and ocean modeling with missing and asynchronous sensor measurements.
Throughout the test cases, we split the temporal snapshots into training, validation and test set, so that we test the performance of fault-tolerant sensing strategies on sensor measurements unseen during training. The test set includes both data within the temporal range covered by the training data, to assess interpolation performance, and beyond the training period, to evaluate extrapolation to future time instants. Moreover, we quantitatively assess the quality of the reconstruction on test snapshots through two standard metrics: the root mean squared error (RMSE)
and the range-normalized mean absolute error (NMAE)
where denotes the (Manhattan) norm, while and are the maximum and minimum state components over the test set, respectively. Note that, when reconstructing multiple physical fields, the error metrics are computed separately for each field and then averaged to obtain the final score. Finally, we consider the same training configuration for all the models and test cases, which takes into account 200 epochs, batch size equal to 32, AdamW optimizer with cosine annealing learning rate scheduler, and multi-step decoding training strategy with and .
A. Shallow water equations
The first test case serves as a numerical benchmark to test the different fault-tolerant strategies proposed in Section III. Specifically, we focus on high-dimensional temporal data provided by The Well dataset [39] corresponding to the solution of shallow water equations on a sphere with earth-like topography and daily/annual periodic external forces. The dataset collects 1008 observations over a year of three high-dimensional fields (N = 131072), namely the height deviation of pressure surface from its mean height, and the velocity components with respect to the polar and azimuthal angles. We consider 10 in situ measurement stations placed randomly in the domain, where the sensor readings are directly extracted from the numerical simulation as pointwise evaluations. To simulate different sensor behaviors, we consider 2 always-available sensors, 4 sensors with

FIG. 3. Shallow water equations. (a) Spatial coverage of simulated water level stations. (b) Sensor data availability over one year of different water level stations, showing availability rates ranging from 100% to 70.1% and different data availability patterns. The available sensor readings are depicted by blue dots, while missing values are represented by red bars.
| Type | Configuration | RMSE | NMAE | Improvement vs. Baseline | |||||
|---|---|---|---|---|---|---|---|---|---|
| Train | Val | Test | Train | Val | Test | Test NMAE (%) | |||
| M | Channel-wise masking | 17.29 | 22.00 | 22.39 | 0.0177 | 0.0263 | 0.0251 | 45.51% | |
| M | Channel-wise and MHSA masking | 18.76 | 22.76 | 25.67 | 0.0192 | 0.0262 | 0.0286 | 37.85% | |
| M | MHSA masking | 19.55 | 23.14 | 25.28 | 0.0197 | 0.0265 | 0.0287 | 37.58% | |
| M | Learned MHSA masking | 18.66 | 23.42 | 25.45 | 0.0193 | 0.0271 | 0.0289 | 37.27% | |
| M | Input masking | 18.51 | 24.38 | 25.18 | 0.0190 | 0.0281 | 0.0296 | 35.60% | |
| M | Hidden-space masking | 19.28 | 25.32 | 24.80 | 0.0197 | 0.0292 | 0.0296 | 35.57% | |
| M | Channel-wise and learned MHSA masking | 19.92 | 26.41 | 26.42 | 0.0203 | 0.0308 | 0.0310 | 32.57% | |
| G | GRUD | 23.85 | 31.74 | 27.41 | 0.0243 | 0.0349 | 0.0314 | 31.73% | |
| G | Attn-GRUD | 26.88 | 36.18 | 29.75 | 0.0273 | 0.0379 | 0.0330 | 28.25% | |
| I | Mean imputation + T-SHRED | 24.39 | 29.25 | 32.54 | 0.0248 | 0.0338 | 0.0377 | 18.06% | |
| I | LOCF + T-SHRED | 26.64 | 35.38 | 34.21 | 0.0270 | 0.0386 | 0.0390 | 15.29% | |
| I | Median imputation + T-SHRED | 26.35 | 35.18 | 35.54 | 0.0266 | 0.0397 | 0.0398 | 13.52% | |
| B | Always-available sensors + SHRED | 37.41 | 43.32 | 39.72 | 0.0360 | 0.0463 | 0.0437 | 4.91% | |
| B | Always-available sensors + T-SHRED | 42.55 | 42.69 | 42.03 | 0.0419 | 0.0466 | 0.0460 | 0.00% | |
■ B: Baselines ■ I: Imputation ■ G: GRU-D ■ M: Masking
FIG. 4. Shallow water equations. Root mean squared errors and normalized mean absolute errors on training, validation and test data achieved by the different competing models.
missing values at random time instants, and 4 sensors with gaps over contiguous intervals with variable duration, as visible in Figure 3.
We split the data into training, validation and test set with ratio 80 : 10 : 10, so that the test set includes both months within the temporal range covered by the training data and months beyond the training period. We then employ POD to reduce the dimensions of the fields to reconstruct: 100 POD modes are enough to compress each field, namely the surface elevation and the velocity components, with a residual energy below 0.1%. Moreover, we consider a lag equal to 100 time steps to capture the history of the system and the temporal pattern of the sensor readings.
To solve the reconstruction problem, we consider the different fault-tolerant sensing strategies introduced in Section III, such as imputation-based and GRU-D-based strategies, as well as different masking strategies in the context of T-SHRED. Moreover, we also take into account SHRED with LSTM-based recurrent temporal encoder and T-SHRED trained exclusively on the 2 always-available sensor stations. To fairly evaluate the performance of the competing models, we consider the same training setup and architectures for all the competing models. Specifically, we employ recurrent temporal encoders with a single hidden layer having 32 neurons, Transformer-based encoders with 1 block, 4 attention heads, embedding dimension equal to 32, and a MLP

FIG. 5. Shallow water equations. Ground truth, reconstruction provided by masked SHRED with channel-wise masking and reconstruction error on surface elevation (first column), polar velocity (second column) and azimuthal velocity (third column) at four different time instants in the test set.
with a single hidden layer of size 48. The spatial decoder is instead modeled via a SDN with a single hidden layer having 64 neurons, while dropout with rate 0.1 is applied to prevent overfitting.
Figure 4 quantitatively assesses the performance of the different baselines and fault-tolerant sensing strategies considered through the RMSE and the NMAE on training, validation and test data, with Transformer-based masking strategies providing the most accurate results. In particular, the best-performing configuration employs channel-wise masking to obtain a NMAE on test data equal to 2.51%, with a relative improvement compared to the T-SHRED baseline fitted on always-available sensors only equal to 45.51%. Imputation- and GRU-D-based methods, instead, yield higher errors, although they still outperform the baselines. Notably, hyperparameter tuning and repeated training runs with different random initializations may lead to slight changes in the ranking of the top-performing models. Nevertheless, masked SHRED strategies systematically outperform imputation- and GRU-D-based methods, although no single masking configuration consistently dominates across all runs. Figure 5, instead, qualitatively compares the reconstructed fields provided by the best-performing model with the ground truth at four different time instants in the test set, showing the accuracy of the proposed strategy to predict the spatio-temporal patterns of the three high-dimensional fields of interest, despite the limited and irregular input information.
B. Southern North Sea hydrodynamics
This section delves into a first real-world application in the context of hydrodynamic modeling. Specifically, we aim at reconstructing the water level and velocity in the Southern North Sea relying solely on sensor readings provided by sparse water level stations within the region of interest. This challenging setting is characterized by spatial heterogeneity, complex coastal geometries, and strong temporal variability driven by tides, wind forcing, and boundary conditions, making it a suitable test case for assessing the robustness of the proposed strategies under heterogeneous sensor coverage. The high-dimensional surface elevation and current velocity fields () from January 2022 to October 2023 are generated by numerically solving the two-dimensional shallow water equations with a 30-minute resolution through the MIKE 21 Flow Model FM [17], a two-dimensional, depth-averaged finite element model widely used in coastal and shelf-sea applications. The model employs observational water levels and current velocities data as boundary conditions, as well as wind velocities and air pressure data within the domain for calibration. Sensor measurements, instead, are provided by 16 in situ measurement stations in the Southern North Sea [17, 20]. The spatial coverage of water level stations is available in panel (a) of Figure 6, while the corresponding data streams are available in panel (b) of the same figure. In particular, some stations exhibit intermittent gaps due to communication failures or acquisition issues, while others experience extended inactivity caused by hardware malfunctions or maintenance. Moreover, sensor readings are affected by missing values and uncertainties typical of operational ocean observing sys-
Water level station availability
(a)
(b)

FIG. 6. Southern North Sea hydrodynamics. (a) Spatial coverage of in situ water level stations in the Southern North Sea. (b) Sensor data availability over time of different in situ water level stations in the Southern North Sea, covering the period from January 2022 to October 2023, showing availability rates ranging from 100% to 28.2% and different data availability patterns. The available sensor readings are depicted by blue dots, while missing values are represented by red bars.
| Type | Configuration | RMSE | NMAE | Improvement vs. Baseline | |||||
|---|---|---|---|---|---|---|---|---|---|
| Train | Val | Test | Train | Val | Test | Test NMAE (%) | |||
| M | Channel-wise and MHSA masking | 0.0895 | 0.0969 | 0.0783 | 0.0089 | 0.0102 | 0.0086 | 15.59% | |
| M | Learned MHSA masking | 0.0883 | 0.1018 | 0.0777 | 0.0088 | 0.0105 | 0.0086 | 15.51% | |
| M | Channel-wise and learned MHSA masking | 0.0899 | 0.1003 | 0.0786 | 0.0089 | 0.0105 | 0.0087 | 14.36% | |
| M | Hidden-space masking | 0.0937 | 0.1012 | 0.0796 | 0.0093 | 0.0105 | 0.0088 | 14.10% | |
| G | GRUD | 0.0944 | 0.1019 | 0.0819 | 0.0091 | 0.0104 | 0.0088 | 13.98% | |
| I | LOCF + T-SHRED | 0.0892 | 0.0982 | 0.0788 | 0.0090 | 0.0104 | 0.0088 | 13.87% | |
| M | Channel-wise masking | 0.0934 | 0.1004 | 0.0809 | 0.0093 | 0.0106 | 0.0088 | 13.32% | |
| M | MHSA masking | 0.0927 | 0.0964 | 0.0804 | 0.0093 | 0.0101 | 0.0089 | 12.57% | |
| I | Median imputation + T-SHRED | 0.0947 | 0.0993 | 0.0827 | 0.0094 | 0.0105 | 0.0090 | 12.01% | |
| G | Attn-GRUD | 0.0962 | 0.1017 | 0.0830 | 0.0095 | 0.0107 | 0.0090 | 12.00% | |
| M | Input masking | 0.0945 | 0.0996 | 0.0806 | 0.0095 | 0.0106 | 0.0091 | 10.91% | |
| I | Mean imputation + T-SHRED | 0.0980 | 0.0996 | 0.0853 | 0.0099 | 0.0107 | 0.0094 | 7.33% | |
| B | Always-available sensors + T-SHRED | 0.1112 | 0.1188 | 0.0918 | 0.0102 | 0.0110 | 0.0096 | 5.75% | |
| B | Always-available sensors + SHRED | 0.1160 | 0.1264 | 0.0950 | 0.0110 | 0.0121 | 0.0102 | 0.00% | |
■ B: Baselines ■ I: Imputation ■ G: GRU-D ■ M: Masking
FIG. 7. Southern North Sea hydrodynamics. Root mean squared errors and normalized mean absolute errors on training, validation and test data achieved by the different competing models.
tems, including measurement noise, irregular sampling, communication delays, sensor outages, calibration errors, and local disturbances. It is worth noting that the sensor measurements do not exactly match the simulated field values at the corresponding station locations, although they exhibit a strong correlation [17].
We here investigate the performance of the different competing methods in the ultra-sparse sensing regime where we challenge the models to reconstruct the water level and velocity in the Southern North Sea over time relying solely on 4 in situ measurement stations, namely
ZeebruggeWielingendok, K141, NWA, Dover, showing temporal coverage between 100% and 48.6%, and coefficient of determination between sensor and pointwise simulation values between 0.934 and 0.911. After splitting the available data into training, validation and test with ratio 80 : 10 : 10, so that the test set includes both months within and beyond the temporal range considered during training, we compress the surface elevation and velocity components through POD with, respectively, reduced dimensions equal to 12, 40 and 68 POD modes, ensuring that the residual energy remains below 0.2%.

FIG. 8. Southern North Sea hydrodynamics. Ground truth, reconstruction provided by masked SHRED with channel-wise and MHSA masking and reconstruction error on surface elevation (first column), horizontal velocity (second column) and vertical velocity (third column) at four different time instants in the test set.

FIG. 9. Southern North Sea hydrodynamics. Cumulative root mean squared error (first row) and normalized mean absolute error (second row) for the three output fields over the last two months in the test set, predicted by masked SHRED with channel-wise and MHSA masking and by the T-SHRED baseline trained exclusively on always-available sensors.

FIG. 10. Southern North Sea hydrodynamics. Mean and one-standard-deviation intervals of the first four components of the latent variable over time of masked SHRED with channel-wise and MHSA masking, evaluated using the different lagged sensor measurements in the test set and the last- and multi-step decoding training strategies.
Moreover, we consider sensor values lagged by 24 time steps, which corresponds to a half-day delay.
In addition to GRU-D-based models, classical imputation methods and masking strategies in the context of T-SHRED, we benchmark the performance against SHRED with LSTM as recurrent temporal encoder and T-SHRED trained exclusively on the always-available sensor station, i.e. ZeebruggeWielingendok. To fairly compare the different fault-tolerant strategies, we consider the same training setup and architecture for all the methods. In particular, we take into account recurrent temporal encoders with 3 layers and hidden size 32, while Transformer-based encoders consider 3 blocks, 4 attention heads, embedding dimension 32, and a MLP with a single hidden layer with 48 neurons. The spatial decoder is instead modeled via a SDN with two hidden layers having 64 and 96 neurons, respectively.
Figure 7 displays the RMSE and the NMAE on training, validation and test data of the different baselines and fault-tolerant sensing strategies considered. Overall, the Transformer-based masking strategies proposed in Section IIIB are able to provide the most accurate results on test data, i.e. when predicting the solution on time instants unseen during training, both within the training range and when extrapolating in time. The best-performing configuration, that is masked SHRED with channel-wise and MHSA masking, achieves a NMAE on test data equal to 0.86%, with a relative improvement of 15.59% with respect to the SHRED baseline fitted on the always-available water level station only. Importantly, the limited margin of improvement in the real-world setting is consistent with the higher intrinsic difficulty of the task, the limited number of retained sensors, and the noise inherent in operational measurements, all of which compress the achievable performance range across competing methods. Figure 8 displays, instead, the ground truth and the reconstructed fields at four different time instants in the test set provided by the best-performing fault-tolerant strategy when extrapolating in time with respect to the training data. Masked SHRED is able to provide accurate reconstructions of the different fields of interest when dealing with sensor values unseen during training. Moreover, by leveraging all the water level stations available, masked SHRED accumulates substantially less error in long-horizon prediction regimes, i.e. over the last two months in the test set, with respect to the T-SHRED baseline, as visible in Figure 9.
The multi-step decoding training strategy proposed in Section III C provides comparable results compared to the classical last-step decoding objective when applied to the different sensing strategies. Moreover, it yields smoother and temporally consistent latent trajectories for compared to the ones produced by last-step training, as demonstrated by Figure 10 through the mean and standard deviation of the first four components of computed across different lagged sensor values in the test set, with reference to masked SHRED with channel-wise and MHSA masking, thus potentially making latent fore-
casting more tractable and stable under distributional shift. To quantitatively support this finding, Figure 10 also reports the mean and the standard deviation of the total variation (TV) for . In particular, we observe a 49.6% reduction of the TV between the two training strategies, and a 25.1% reduction when considering the TV computed on the last-step embeddings for only.
C. Øresund Strait hydrodynamics
This section presents another real-world application where, similarly to the test case detailed in Section IV B, we aim at reconstructing the water level and velocity in the Øresund Strait, an area of approximately 2000km between Denmark and Sweden, while relying solely on observational data provided by 12 measurement stations [16, 21]. The high-dimensional target fields () from January 2020 to October 2023, that are the surface elevation and the current velocity solving the two-dimensional shallow water equations with a 30-minute resolution, are provided by the MIKE 21 Flow Model FM [16]. The panel (a) of Figure 11 shows the spatial coverage of the available in situ measurements stations, while panel (b) of the same figure displays the data availability patterns of the different stations. For instance, Koege station does not provide measurements for about one month at the beginning of 2022, while the six stations with the lowest temporal coverage are characterized by a halved sampling rate with respect to those with higher temporal coverage. Notably, since no water level station provides a temporal coverage equal to 100%, it is not possible to consider naive SHRED baselines fitted on always-available sensors only. Similarly to the previous test case, the sensor values are not directly extracted from the simulated high-dimensional water level data, although they exhibit a strong correlation [16].
After splitting the available data into training, validation and test with ratio 70 : 15 : 15, we employ POD to compress the surface elevation and velocity components with reduced dimensions equal to, respectively, 15, 100 and 100, so that the residual energy remains below 0.1%. Moreover, we consider a lag equal to 24, which corresponds to a half-day delay. As far as the different competing models are concerned, we consider recurrent temporal encoders with 3 hidden layers and hidden size equal to 32, while Transformer-based encoders consider 3 blocks, 4 attention heads, embedding dimension 32, and a MLP with a single hidden layer of dimension 48. The spatial decoder is instead modeled via a SDN with two hidden layers having 64 and 96 neurons, where dropout with rate 0.1 is employed to prevent overfitting.
The error metrics, namely RMSE and NMAE, on training, validation and test set of the different competing methods are available in Figure 12. In particular, it is possible to assess the superiority of Transformer-based masking strategies with respect to imputation- and
Water level station availability

FIG. 11. Øresund Strait hydrodynamics. (a) spatial coverage of in situ water level stations in the Øresund Strait [16]. (b) Sensor data availability over time of different in situ water level stations in the Øresund Strait [16], covering the period from January 2020 to October 2023, showing availability rates ranging from 99.2% to 41.7% and different data availability patterns. The available sensor readings are depicted by blue dots, while missing values are represented by red bars.
| Type | Configuration | RMSE | NMAE | Improvement vs. Worst | ||||
|---|---|---|---|---|---|---|---|---|
| Train | Val | Test | Train | Val | Test | Test NMAE (%) | ||
| M | Learned MHSA masking | 0.0410 | 0.0508 | 0.0511 | 0.0090 | 0.0143 | 0.0119 | 7.21% |
| M | Hidden-space masking | 0.0413 | 0.0527 | 0.0522 | 0.0091 | 0.0147 | 0.0120 | 6.83% |
| M | Channel-wise and learned MHSA masking | 0.0420 | 0.0556 | 0.0542 | 0.0092 | 0.0148 | 0.0121 | 6.21% |
| I | Median imputation + T-SHRED | 0.0419 | 0.0465 | 0.0580 | 0.0099 | 0.0147 | 0.0121 | 5.68% |
| M | Input masking | 0.0418 | 0.0540 | 0.0545 | 0.0092 | 0.0145 | 0.0122 | 5.24% |
| M | Channel-wise masking | 0.0411 | 0.0553 | 0.0535 | 0.0090 | 0.0149 | 0.0122 | 4.88% |
| G | Attn-GRUD | 0.0420 | 0.0465 | 0.0582 | 0.0099 | 0.0149 | 0.0123 | 4.52% |
| M | Channel-wise and MHSA masking | 0.0414 | 0.0530 | 0.0536 | 0.0091 | 0.0146 | 0.0123 | 4.45% |
| M | MHSA masking | 0.0423 | 0.0567 | 0.0542 | 0.0093 | 0.0154 | 0.0124 | 3.83% |
| G | GRUD | 0.0409 | 0.0469 | 0.0596 | 0.0097 | 0.0150 | 0.0125 | 3.09% |
| I | Mean imputation + T-SHRED | 0.0423 | 0.0488 | 0.0608 | 0.0100 | 0.0153 | 0.0126 | 1.60% |
| I | LOCF + T-SHRED | 0.0411 | 0.0455 | 0.0665 | 0.0097 | 0.0146 | 0.0129 | 0.00% |
■ B: Baselines
I: Imputation
G: GRU-D
M: Masking
FIG. 12. Øresund Strait hydrodynamics. Root mean squared errors and normalized mean absolute errors on training, validation and test data achieved by the different competing models.
GRU-D-based techniques, although all strategies achieve comparable and acceptable performance. For example, the best-performing model, that is masked SHRED with learned MHSA masking, provides a NMAE on test data equal to 1.19%. To qualitatively assess the goodness of the predictions provided by the best-performing model, Figure 13 displays the ground truth and the corresponding reconstruction at three different time instants in the test set when extrapolating with respect to the training time range.
D. Sea surface temperature
The last real-world application deals with sea surface temperature data, where the high-resolution snapshots () from January 2000 to December 2025 are obtained by combining daily satellite observations on a regular grid with in situ measurements from different ocean-observing platforms, such as ships and buoys, to fill possible gaps in observational coverage and correct systematic biases [27]. The goal of this test case is to predict the spatio-temporal high-resolution SST field over the entire globe relying solely on a limited amount of

FIG. 13. Øresund Strait hydrodynamics. Ground truth, reconstruction provided by masked SHRED with learned MHSA masking and reconstruction error on surface elevation (first column), horizontal velocity (second column) and vertical velocity (third column) at three different time instants in the test set.
observational data provided by 20 moored buoys monitoring SST within the domain and over the same time horizon. Figure 2, panel (a), shows the spatial coverage of the considered moored buoys, while the panel (b) of the same figure displays the patterns of missing values of the SST buoy data.
After splitting the available data into training, validation and test with ratio 70 : 15 : 15, we reduced the dimensionality of the high-resolution SST snapshots through POD by considering a reduced dimension equal to 500. Moreover, we employ a lag equal to 40, which corresponds to 40 days of historical data, and we consider 400 epochs for training. Regarding the model architectures, the recurrent temporal encoders are made of one single hidden layer of size 32, while Transformer-based encoders employ 1 block, 4 attention heads, embedding dimension 32, and a MLP with a single hidden layer of dimension 48. The spatial decoder is instead modeled via a SDN with a single hidden layer of size 256, where dropout with rate 0.1 is employed to prevent overfitting.
Figure 14 shows the ground truth and the reconstructed SST fields provided by masked SHRED with channel-wise and learned MHSA masking at four different time instants in the test set when extrapolating over time with respect to the training data. Figure 15, instead, compares the proposed masked SHRED strategy with CS-SHRED [15]: while both solutions are able to cope with missing sensor measurements and achieve acceptable results on the test set, masked SHRED is far more efficient both in training (15× of speed up) and during evaluation (16× of speed up), since it does not
require computationally expensive convex minimization problems to recover missing values and incurs no additional computational overhead with respect to standard SHRED implementation.
While all competing methods are evaluated using the same hyperparameter values throughout the test cases discussed in Section IV, it is worth noting that additional experiments involving hyperparameter tuning yield similar results and support the same overall conclusions. In particular, masked SHRED systematically outperforms imputation- and GRU-D-based methods, with only minor variations in the ranking of the different masking strategies. Indeed, the proposed Transformer-based masking strategies exhibit limited sensitivity to hyperparameter variations, with their effectiveness largely preserved across different hyperparameter values.
V. CONCLUSIONS
This work addresses one of the main challenges in the context of sparse sensing, namely the ability to handle incomplete, heterogeneous, and noisy sensor measurements that characterize operational sensing environments. Indeed, state-of-the-art sparse sensing techniques such as, e.g., shallow recurrent decoders (SHRED), typically consider continuously active sensors with the same sampling rates, that are often directly extracted as pointwise values of the corresponding full-order state. To move toward practical settings, we first introduce a hierarchy of increasingly expressive strategies, ranging from standard

FIG. 14. Sea surface temperature. Ground truth, reconstruction provided by masked SHRED with channel-wise and learned MHSA masking and reconstruction error on sea surface temperature at four different time instants in the test set.
| Type | Configuration | NMAE | Time | Time improvement | ||||
|---|---|---|---|---|---|---|---|---|
| Train | Val | Test | Train (min) | Inference (s) | Train | Inference | ||
| M | Channel-wise and learned MHSA masking | 0.018 | 0.018 | 0.018 | 37 | 4 | x15 | x16 |
| C | CS-SHRED | 0.018 | 0.019 | 0.018 | 540 | 63 | ||
M: Masking
C: CS-SHRED
FIG. 15. Sea surface temperature. Normalized mean absolute errors on training, validation and test data (first column) and training and inference times (second column) of the different competing models.
imputation baselines to recurrent architectures specifically designed for irregular time-series forecasting. We then propose four Transformer-based masking strategies in order to make the SHRED temporal encoder explicitly aware of sensor availability patterns. Specifically, these strategies inject the binary data-availability mask into the Transformer-based encoder at different levels of the architecture, including input concatenation (channel-wise masking), hidden-state gating (hidden-space masking), and additive attention biases within the multi-head self-attention mechanism, either fixed or learned (MHSA and learned MHSA masking). Finally, we introduce a multi-step decoding training strategy that enforces structured latent representations throughout the full observation window.
The different state-of-the-art imputation methods and the proposed masked shallow recurrent decoders have been employed on four different test cases to assess their performance. In particular, we consider a synthetic benchmark on shallow water equation solution data, where sensors are directly extracted from the corresponding full-order state and sensor malfunctions are simulated for the sake of the analysis. Moreover, we take into account three real-world operational datasets in the context of hydrodynamic and ocean modeling, thus assessing the performance of the different proposed strategies on realistic, intermittent and asynchronous sensor values. Across all the test cases considered, the fault-tolerant techniques considered improve the naive SHRED baseline relying solely on the always active sensors. Moreover, masked shallow recurrent decoders consistently provide
accurate state reconstructions on new time steps never seen during training, in both interpolation and extrapolation regimes, yielding lower errors than both imputation baselines and GRU-D-based approaches, with no additional inference-time computational cost. Moreover, the multi-step decoding training scheme improves upon the last-step training baseline in terms of predictive accuracy, and results in substantially smoother latent trajectories, thus potentially making latent forecasting more tractable and stable under distributional shift. Note that, in general, the different masking strategies proposed may be combined and there is no universally superior masking solution. However, the hybrid combinations are often ranked among the top-performing configurations across the different test cases, suggesting that the injection of the binary data-availability mask at multiple levels of the architecture may be beneficial.
The fault-tolerant shallow recurrent decoders introduced in this work may be extended in multiple directions in future works. For instance, one may consider an ensemble of masked SHRED models to provide robust estimates under noisy and intermittent sensor measurements, similarly to [41]. Moreover, it is possible to consider parametric problems where fault-tolerant SHRED must generalize across varying physical and geometrical parameters, in the direction of SHRED-ROM [47]. In this setting, the fault-tolerant SHRED architecture could additionally support parameter estimation and uncertainty propagation from incomplete sensor measurements to reconstructed fields. Finally, the smoother embeddings produced by the multi-step decoding training strategy may be exploited to accurately forecast the system evolution at the latent level, thus enabling masked SHRED to effectively predict full-order states in advance even when the sensors are not yet available.
CODE AVAILABILITY
The code can be found in our repository https://github.com/matteopasqual02/Masked-SHRED.
ACKNOWLEDGEMENTS
MT thanks Jesper Sandvig Mariegaard and Freja Høgholm Petersen for the fruitful discussions and valuable insights on hydrodynamic modeling and real-world sensing. AM acknowledges the Project "Reduced Order Modeling and Deep Learning for the real-time approximation of PDEs (DREAM)" (Starting Grant No. FIS00003154), funded by the Italian Science Fund (FIS) - Ministero dell'Università e della Ricerca and the project FAIR (Future Artificial Intelligence Research), funded by the NextGenerationEU program within the PNRR-PEAI scheme (M4C2, Investment 1.3, Line on Artificial Intelligence).
[1] A. C. Antoulas. Approximation of Large-Scale Dynamical Systems. SIAM, Philadelphia, PA, 2005.
[2] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
[3] Y. Bao, X. Zhang, and J. N. Kutz. LAtent Phase Inference from Short time sequences using SHallow REcurrent Decoders (LAPIS-SHRED). arXiv preprint arXiv:2604.01216, 2026.
[4] P. Benner, S. Gugercin, and K. Willcox. A survey of projection-based model reduction methods for parametric dynamical systems. SIAM review, 57(4):483–531, 2015.
[5] S. L. Brunton et al. Data-driven aerospace engineering: Reframing the industry with machine learning. AIAA Journal, 59:2820–2847, 2021.
[6] S. L. Brunton and J. N. Kutz. Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control. Cambridge University Press, 2019.
[7] S. L. Brunton, J. L. Proctor, and J. N. Kutz. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15):3932–3937, 2016.
[8] D. W. Carter, F. De Voogt, R. Soares, and B. Ganapathisubramani. Data-driven sparse reconstruction of flow over a stalled aerofoil using experimental data. Data-Centric Engineering, 2:e5, 2021.
[9] Z. Che, S. Purushotham, K. Cho, D. Sontag, and Y. Liu. Recurrent neural networks for multivariate time series with missing values. Scientific reports, 8(1):6085, 2018.
[10] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
[11] E. Clark, T. Askham, S. L. Brunton, and J. N. Kutz. Greedy sensor placement with cost constraints. IEEE Sensors Journal, 19(7):2642–2656, 2019.
[12] K. Cohen, S. Siegel, and T. McLaughlin. Sensor placement based on proper orthogonal decomposition modeling of a cylinder wake. In 33rd AIAA Fluid Dynamics Conference and Exhibit. American Institute of Aeronautics and Astronautics, 2003.
[13] R. Courant and D. Hilbert. Methods of mathematical physics: partial differential equations. John Wiley & Sons, 2008.
[14] G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems, 2:303–314, 1989.
[15] R. B. da Silva, D. Passos, C. M. Oishi, and J. N. Kutz. CS-SHRED: enhancing SHRED for robust recovery of spatiotemporal dynamics. Proceedings of the Royal Society A Mathematical Physical and Engineering Science, 482(2344), 2026.
[16] DHI. Hydrodynamic model of Øresund: Mike21 model setup, outputs and observation data, Dec. 2024.
[17] DHI. Hydrodynamic model of the southern north sea: Mike21 model setup, outputs and observation data, Mar. 2025.
[18] C. Eckart and G. Young. The approximation of one matrix by another of lower rank. Psychometrika, 1(3):211–218, sep 1936.
[19] N. B. Erichson, L. Mathelin, Z. Yao, S. L. Brunton, M. W. Mahoney, and J. N. Kutz. Shallow neural networks for fluid flow reconstruction with limited sensors. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 476(2238):20200097, 06 2020.
[20] European Union-Copernicus Marine Service. Atlantic-european north west shelf- ocean in-situ near real time observations, 2015.
[21] European Union-Copernicus Marine Service. Baltic sea-in situ near real time observations, 2015.
[22] R. Everson and L. Sirovich. Karhunen-loève procedure for gappy data. J. Opt. Soc. Am. A, 12(8):1657–1664, Aug 1995.
[23] T. Freiesleben and C. Molnar. Supervised Machine Learning for Science. 2024.
[24] M. L. Gao, J. P. Williams, and J. N. Kutz. Sparse identification of nonlinear dynamics and koopman operators with shallow recurrent decoder networks. Proceedings of the National Academy of Sciences, 123(16):e2508144123, 2026.
[25] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997.
[26] P. Holmes, J. L. Lumley, G. Berkooz, and C. W. Rowley. Turbulence, coherent structures, dynamical systems and symmetry. Cambridge university press, 2012.
[27] B. Huang, C. Liu, V. Banzon, E. Freeman, G. Graham, B. Hankins, T. Smith, and H.-M. Zhang. Improvements of the daily optimum interpolation sea surface temperature (doisst) version 2.1. Journal of Climate, 34(8):2923–2939, 2021.
[28] A. Jaegle, S. Borgeaud, J.-B. Alayrac, C. Doersch, C. Ionescu, D. Ding, S. Koppula, D. Zoran, A. Brock, E. Shelhamer, O. Hénaff, M. M. Botvinick, A. Zisser man, O. Vinyals, and J. Carreira. Perceiver IO: A General Architecture for Structured Inputs & Outputs. arXiv preprint arXiv:2107.14795, 2022.
[29] S. Joshi and S. Boyd. Sensor selection via convex optimization. IEEE Transactions on Signal Processing, 57(2):451–462, 2009.
[30] A. Krause, A. Singh, and C. Guestrin. Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies. Journal of Machine Learning Research, 9:235–284, 2008.
[31] J. N. Kutz. Data-driven modeling & scientific computation: methods for complex systems & big data. Oxford University Press, 2013.
[32] J. N. Kutz, M. Reza, F. Faraji, and A. Knoll. Shallow recurrent decoder for reduced order modeling of plasma dynamics. arXiv preprint arXiv:2405.11955, 2024.
[33] B. Lindemann, T. Müller, H. Vietz, N. Jazdi, and M. Weyrich. A survey on long short-term memory networks for time series prediction. Procedia CIRP, 99:650–655, 2021.
[34] Z. Luo, L. Wang, J. Xu, M. Chen, J. Yuan, and A. C. C. Tan. Flow reconstruction from sparse sensors based on reduced-order autoencoder state estimation. Physics of Fluids, 35(7):075127, 2023.
[35] K. Manohar, B. Brunton, J. Kutz, and S. Brunton. Data-driven sparse sensor placement for reconstruction. IEEE control systems, 38:63-, 05 2018.
[36] K. Manohar, E. Kaiser, S. L. Brunton, and J. N. Kutz. Optimized sampling for multiscale dynamics. Multiscale Modeling & Simulation, 17(1):117–136, 2019.
[37] R. Mitra, S. F. McGough, T. Chakraborti, C. Holmes, R. Copping, N. Hagenbuch, S. Biedermann, J. Noonan, B. Lehmann, A. Shenvi, et al. Learning from data with structured missingness. Nature Machine Intelligence, 5(1):13–23, 2023.
[38] National Data Buoy Center. Historical standard meteorological data. https://www.ndbc.noaa.gov/data/historical/stdmet/, 2026. Accessed September 2026.
[39] R. Ohana, M. McCabe, L. T. Meyer, R. Morel, F. J. Agocs, M. Beneitez, M. Berger, B. Burkhart, S. B. Dalziel, D. B. Fielding, D. Fortunato, J. A. Goldberg, K. Hirashima, Y.-F. Jiang, R. Kerswell, S. Maddu, J. M. Miller, P. Mukhopadhyay, S. S. Nixon, J. Shen, R. Watteaux, B. R.-S. Blancard, F. Rozet, L. H. Parker, M. Cranmer, and S. Ho. The well: a large-scale collection of diverse physics simulations for machine learning. In The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024.
[40] A. Quarteroni, P. Gervasio, and F. Regazzoni. Combining physics-based and data-driven models: advancing the frontiers of research with scientific machine learning. Mathematical Models and Methods in Applied Sciences, 35(04):905–1071, 2025.
[41] S. Riva, C. Introini, A. Cammi, and J. N. Kutz. Robust state estimation from partial out-core measurements with shallow recurrent decoder for nuclear reactors. Progress
in Nuclear Energy, 189:105928, 2025.
[42] S. Sahba, C. C. Wilcox, A. McDaniel, B. D. Shaffer, S. L. Brunton, and J. N. Kutz. Wavefront sensor fusion via shallow decoder neural networks for aero-optical predictive control. In M. B. North-Morris, K. Creath, and R. Porras-Aguilar, editors, Interferometry XXI, volume 12223, page 1222303. International Society for Optics and Photonics, SPIE, 2022.
[43] J. E. Santos, Z. R. Fox, A. Mohan, D. O'Malley, H. Viswanathan, and N. Lubbers. Development of the senseiver for efficient field reconstruction from sparse observations. Nature Machine Intelligence, 5(11):1317–1325, 2023.
[44] A. B. Sharma, L. Golubchik, and R. Govindan. Sensor faults: Detection methods and prevalence in real-world datasets. ACM Transactions on Sensor Networks, 6(3):23, 2010.
[45] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–9, 2015.
[46] M. Tomasetto, F. Braghin, J. N. Kutz, and A. Manzoni. Real-time optimal control with shallow recurrent decoder networks. arXiv preprint arXiv:2607.19302, 2026.
[47] M. Tomasetto, J. P. Williams, F. Braghin, A. Manzoni, and J. N. Kutz. Reduced order modeling with shallow recurrent decoder networks. Nature Communications, 16(1):10260, 2025.
[48] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
[49] K. Wilcox. Unsteady flow sensing and estimation via the gappy proper orthogonal decomposition. Computers & Fluids, 35(2):208–226, 2006.
[50] J. Williams, O. Zahn, and J. N. Kutz. Data-driven sensor placement with shallow decoder networks. arXiv preprint arXiv:2202.05330, 2022.
[51] J. P. Williams, O. Zahn, and J. N. Kutz. Sensing with shallow recurrent decoder networks. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 480(2298):20240054, 09 2024.
[52] A. Yermakov, D. Zoro, L. M. Gao, and J. N. Kutz. T-SHRED: symbolic regression for regularization and model discovery with transformer shallow recurrent decoders. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, 384(2317), 2026.
[53] X. Zhang, X. Liang, A. Zhiyuli, S. Zhang, R. Xu, and B. Wu. AT-LSTM: An Attention-based LSTM Model for Financial Time Series Prediction. IOP Conference Series: Materials Science and Engineering, 569(5):052037, jul 2019.