Manuscript Offprint

arXiv:2610.41506

PCD: Predictive Coding Dynamics for Irregularly Sampled Time Series

Tianrui Gou, Jiayangmei Xu, Xingzhou Zhang, Lei Sha

Tianrui Gou, Jiayangmei Xu, Xingzhou Zhang, and Lei Sha

Abstract—Dynamic systems evolve continuously over time, whereas observations in real scenarios are often sparse, irregular, and asynchronous. Accurate prediction therefore requires inferring latent state evolution between observations, as future values depend on partially observed trajectories. We propose Predictive Coding Dynamics (PCD), a residual feedback mechanism for irregular continuous dynamic models. PCD maintains previous reconstructions, predicts observed entries from them, and incorporates masked signed residuals into state recognition through an energy penalty. The mechanism is implemented with ODE-RNN and Latent ODE, supporting event-based hidden updates and latent state recognition. Experiments on forecasting and trajectory recovery tasks show that PCD improves continuous dynamic backbones under sparse and irregular sampling. The results further indicate that predictive error feedback improves latent state estimation when observations constrain the current trajectory. These results suggest that PCD provides a residual feedback framework that jointly supports trajectory generation, observation consistency checking, and state refinement in continuous-time series modeling. The source code is available at https://anonymous.4open.science/r/PCD-for-paper-92F1/.

Index Terms—predictive coding, time series forecasting, supervised learning, learning algorithm

1 INTRODUCTION

DYNAMIC systems evolve continuously, while real-world measurements are typically collected at finite and irregular time points. Such irregular observations arise in clinical monitoring, physical simulation, weather sensing, industrial control, and human activity analysis. Between observations, the system evolves through unobserved states, and models must infer the corresponding latent transitions. Pointwise prediction ignores this evolution and provides incomplete representations of latent states.

Irregular sampling complicates inference because elapsed time provides constraints but is insufficient to determine state transitions. Short intervals often imply local smoothness, while long intervals may contain nonlinear changes, abrupt variations, or multiple hidden phases. In multivariate series, variables are often observed asynchronously, requiring models to infer dependencies from incomplete temporal evidence. Values, timestamps, masks,

and sampling density jointly provide evidence for latent trajectory reconstruction.

Existing irregular time-series methods mainly address missing observations and continuous latent dynamics. GRU-D introduces temporal decay to capture missing measurement effects on recurrent states [1]. Li and Marlin analyze irregular sampling from the perspective of missing data and show that timestamps and observation masks provide information beyond observed values [2]. These studies highlight the role of explicitly modeling observation patterns.

Continuous-time neural models directly describe latent trajectory evolution. Neural ODE models latent dynamics using differential equations and estimates states at arbitrary query times [3]. Latent ODE extends this approach to irregular sequences by learning latent initial states and continuous trajectories [4]. GRU-ODE-Bayes applies observation-driven Bayesian updates for sparse observations [5], whereas Neural CDE represents irregular observations as continuous control signals [6]. Recent studies explore continuous-time attention, reconstruction-based representation learning, and recurrent continuous units for irregular prediction [7], [8], [9].

Despite architectural differences, most methods follow a similar inference paradigm. Observations are encoded into latent states or distributions, propagated through continuous dynamics, and subsequently decoded into trajectories. Training minimizes reconstruction discrepancies between trajectories and observations. However, prediction errors are typically used as optimization signals rather than feedback for state estimation.

Prediction residuals can therefore be exploited as additional inference signals. A reconstructed trajectory provides a temporary estimate of system evolution. When it disagrees with observations, signed residuals indicate both correction magnitude and direction. Such feedback is valuable under

This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.

This work was supported by the National Science Fund for Excellent Young Scholars (Overseas) under Grant KZ37117501; the National Natural Science Foundation of China under Grant 62306024; the National Cyber Security-National Science and Technology Major Project under Grant 2025ZD1503602; the New Generation Artificial Intelligence-National Science and Technology Major Project under Grants 2026ZD0128000 and 2026ZD0128003; the Fundamental Research Funds for the Central Universities; and the Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing. (Corresponding author: Lei Sha.)

Tianrui Gou is with the School of Artificial Intelligence, Beihang University, Beijing 100191, China.

Jiayangmei Xu is with the Department of Foreign Languages, Beihang University, Beijing 100191, China.

Xingzhou Zhang is with the School of Artificial Intelligence, Beihang University, Beijing 100191, China.

Lei Sha is with the School of Artificial Intelligence, Beihang University, Beijing 100191, China (e-mail: shalei@buaa.edu.cn).

sparse sampling, where multiple latent trajectories may explain the observations while leading to different future predictions.

Predictive coding provides a theoretical basis for residual-based refinement. Rao and Ballard introduced predictive coding as a hierarchical framework in which prediction errors update internal representations [10]. Friston connected prediction errors with hierarchical generative inference and free energy minimization, in which internal states are revised according to prediction-observation discrepancies [11]. Thus, prediction error provides a mechanism for refining latent representations beyond measuring model discrepancy.

Recent studies explore predictive coding as trainable neural architectures. PredNet uses recurrent prediction-error propagation for video prediction and representation learning [12]. Deep predictive coding networks combine top-down predictions and bottom-up errors for object recognition [13], while local recurrent predictive coding explicitly models prediction and error units [14]. Predictive coding has also been linked to optimization and learning dynamics. Song et al. show that predictive coding networks can implement backpropagation through activity inference [15], and Salvatori et al. extend this connection to reverse differentiation over computation graphs [16].

Predictive coding has been studied in sequential and structured learning. Temporal predictive coding improves sequential memory through recurrent prediction and error correction [17]. Incremental predictive coding develops stable learning procedures [18], while divide-and-conquer predictive coding formulates predictive coding as structured Bayesian inference [19]. Recent predictive feedback methods apply future-oriented discrepancies to time-series forecasting [20]. These studies demonstrate that prediction errors can facilitate representation refinement, temporal learning, and adaptive inference.

However, existing predictive coding methods mainly target representation learning, biological modeling, or task-specific prediction. They do not directly refine latent continuous trajectories under irregular observations. For irregular dynamics, reconstructed trajectories can be evaluated at observed timestamps. Residuals between reconstructed states and observations provide sample-specific signals for continuous state recognition.

We propose Predictive Coding Dynamics (PCD), a residual feedback mechanism for irregular continuous dynamic models. PCD first reconstructs trajectories using a continuous dynamic backbone, stores previous reconstructions in a cache, and forms internal predictions at observed times. It computes signed residuals between predictions and observations, removes missing entries with observation masks, and applies variable weights to control feedback across dimensions. The residual channel is incorporated into the recognition process, enabling latent state inference from both observations and reconstruction errors.

We implement PCD with ODE-RNN and Latent ODE. ODE-RNN propagates hidden states between observation events and updates them when events arrive; PCD injects residuals into this update. Latent ODE infers an initial latent distribution from observations and generates trajectories with an ODE solver; PCD injects residuals into its

recognition network. Both implementations follow the same refinement procedure: reconstruction, cached prediction, masked signed residual computation, state recognition, and reconstruction update.

This work makes three contributions.

  1. We formulate irregular continuous-time modeling as an iterative error-feedback inference process, in which discrepancies between internally reconstructed trajectories and asynchronous observations are explicitly reused to revise latent states, rather than serving only as optimization losses.

  2. We develop a backbone-agnostic predictive coding mechanism that constructs masked signed residuals from cached trajectories and injects them into continuous-time state recognition. We instantiate this mechanism in both event-driven ODE-RNN and latent-variable Latent ODE, demonstrating its applicability to distinct continuous-time inference paradigms.

  3. We evaluate PCD on forecasting and trajectory recovery tasks across simulated, clinical, motion, meteorological, and regular forecasting benchmarks, showing that error feedback provides additional benefits when observations impose strong constraints on latent dynamics.

The rest of this paper is organized as follows. Section 2 reviews irregular time-series models and predictive coding methods. Section 3 presents PCD, including residual construction, backbone integration, optimization, and cache update. Section 4 reports experiments and ablation analysis. Section 5 concludes and discusses limitations.

References (75)