Manuscript Offprint
arXiv:2609.00686A Study of Hidden-State Optimization Order in Predictive Coding Networks
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Abstract
Local learning methods offer an alternative to end-to-end backpropagation, but their unstructured local objectives can produce weak feature learning in deep networks. We study whether the order of hidden-state optimization can address this limitation. We propose a boundary-first inference schedule that partitions a model into chunks, first coordinates hidden states at chunk boundaries, and then refines representations within each chunk. We instantiate this schedule in predictive coding networks (PCNs), a local-learning framework in which hidden activities and prediction errors are explicitly exposed during inference. On CIFAR-10, the resulting boundary-first predictive-coding instantiation improves accuracy over standard predictive coding by 9.77% under a standard parametrization and by 5.51% under a -parametrization. Diagnostic analyses further show more non-trivial early-layer updates, lower initial-to-final CKA, and more diverse layerwise gradients, consistent with stronger feature learning. These results support boundary-first, chunk-based inference as a practical design principle for predictive-coding training and motivate its study in broader local-learning systems.
Keywords: local learning, predictive coding, optimization schedule, feature learning
1 Introduction
Deep networks learn useful representations when error signals produce informative updates throughout the model. End-to-end backpropagation achieves this by propagating a global supervised objective through all layers, while many alternative learning systems try to replace this global dependency with local objectives and local state updates. Their properties, including biological plausibility, modular computation, cortical-like inference, and local error minimization, are attracting the attention of both neuroscientists and machine learning researchers [1–6].
The same locality can also become a bottleneck. When learning signals are transmitted only through adjacent objectives, early and intermediate layers may receive weak or degenerate updates. Predictive Coding Networks (PCNs) provide a clear example of this failure mode (Fig. 5). Although PCNs can be trained by minimizing local prediction errors, recent work has reported imbalanced error propagation, weak early-layer updates, and unstable inference dynamics [7–11]. Stabilization methods such as residual connections, layerwise normalization, and Maximal Update Parametrization improve optimization in deep PCNs [12, 13];

Figure 1: Illustration of global backpropagation, standard predictive coding, and boundary-first predictive coding with feedforward initialization. (A) Global backpropagation computes a supervised loss at the output and propagates gradients through the full network. (B) Standard predictive coding minimizes local prediction errors between adjacent layers, with the inferred activity set expanding from and then to . (C) Boundary-first predictive coding uses inter-chunk inference to coordinate boundary states before intra-chunk inference refines activities within each chunk; the inferred activity set expands from to .
however, how local objectives should be organized to encourage feature learning remains an open question.
Our work studies a different route: changing the order in which hidden activities are optimized rather than only changing the objective parametrization. We propose a boundary-first inference schedule that first coordinates hidden states at chunk boundaries and then refines the remaining states within each chunk. Chunking defines the boundary and interior variable sets that make this optimization order operational (Fig. 1).
We instantiate this schedule in predictive coding because PCNs already maintain hidden activities and prediction errors during inference. The instantiation first performs inter-chunk inference to align boundary activities, then performs intra-chunk inference to refine local representations. We refer to the fully predictive-coding version as PC-PC. We also evaluate PC-BP as a hybrid control, where chunk boundaries are coordinated by predictive-coding inference but intra-chunk learning uses backpropagation. This control tests whether the gains of the boundary-first, chunk-based schedule persist when the within-chunk learning rule changes.
Our contributions center on inference expansion order in local learning systems:
-
We formulate a boundary-first hidden-state optimization schedule for local-error training systems. We instantiate this schedule in predictive coding by using chunks to define boundary and interior states, first aligning the boundary states through inter-chunk inference and then refining the remaining activities through intra-chunk inference.
-
We show that the boundary-first predictive-coding instantiation enables all layers (20/20) to receive non-trivial updates, whereas standard PC updates only 4/20 layers in a standard Multilayer Perceptron (MLP) and 5/20 layers in a μMLP. The same schedule improves standard PC on CIFAR-10 by 9.77% under a standard parametrization and by 5.51% under a μ-parametrization.
-
We analyze representation learning with initial-to-final CKA and feature diversity with layerwise gradient similarity. The results show that PC-PC and PC-BP reduce CKA relative to standard PC and produce lower gradient similarity than global backpropagation in the measured settings.
We study this optimization schedule in predictive coding networks. Extending boundary-first inference to other local-learning frameworks is left for future work.
Chunking and modular training. Chunking groups low-level elements into higher-level units. In cognition, chunking explains how structured units can expand effective working-memory capacity [17]. In machine learning, related ideas appear in feedforward training, including blockwise learning, modular training, and greedy layerwise optimization. Greedy layerwise learning showed that auxiliary local subproblems can train deep networks, and that multi-layer blocks can scale better than single-layer objectives [5]. These results motivate chunking as a way to define groups of variables. Our work uses these groups to impose a boundary-first optimization order during iterative inference in local learning systems.
Feature learning and kernel learning. Prior work distinguishes feature learning from kernel-like regimes in which the effective neural tangent kernel changes little during training [18,19]. The learning dynamics can be written as
where is the model at training step , is a training sample pair, is the learning rate, is the loss derivative, and is the neural tangent kernel
If remains close to , learning behaves like kernel learning with a nearly fixed representation. If changes during training, the model is regarded as learning features. We use Centered Kernel Alignment (CKA) to measure the similarity between initial and final representations [20]:
where and are representations at initialization and at training step . Lower CKA indicates greater representation change.
Feature diversity. Feature diversity also depends on whether layers receive distinct update directions. Previous work has noted that gradient diversity can support feature diversity [21]. If adjacent layers have similar backward gradients and similar forward activations, their parameter updates can become redundant. We measure layerwise update diversity using the cosine similarity between weight gradients:
where and are the gradients of layers and . Lower similarity indicates more diverse layerwise updates.
3 Methodology
3.1 Standard Predictive Coding Training
Predictive coding is a natural testbed for hidden-state optimization order because it represents hidden activities explicitly and updates them through local prediction errors. Consider an -layer network with activities , where is the input and is the output. For each layer , define the forward mapping
where are weights, are biases, and is a nonlinearity. The value is the prediction of the -th layer activity.
A discriminative PCN minimizes local prediction errors together with a supervised output loss during inference:
where measures the mismatch between activity and prediction . A common choice is . With weights fixed, hidden activities are updated by gradient descent on Eq. (6). Each activity update depends on neighboring layers through local error terms.
After inference, PCN training updates weights using the inferred activities:
Here is the learning rate and denotes the gradient with respect to . Before inference begins, activities are initialized with a feedforward pass, following common PCN practice [22–26].
3.2 Chunk-Based Boundary-First Predictive-Coding Inference
Instead of standard PC inference that optimizes all hidden activities sequentially under a single flat set of adjacent-layer errors, the proposed schedule changes their optimization order by splitting the network into consecutive chunks. Chunking defines two sets of variables: boundary states and non-boundary states. The procedure then has two stages. First, inter-chunk inference coordinates boundary states between chunks. Second, intra-chunk inference refines the remaining hidden activities inside each chunk (Fig. 2).
Let denote the set of boundary states between chunks in Fig. 2). The boundary states are updated by solving
Inter-chunk Inference:
where is the prediction of the boundary state from the adjacent chunk. is the prediction of the last boundary state, and it is also the prediction of the PCN. This stage implements the boundary-first part of the schedule by asking the chunks to agree on their boundaries before all internal activities are refined.
For the fully predictive-coding instantiation, intra-chunk refinement updates non-boundary activities ( and in Fig. 2) by
Intra-chunk PC Inference

Figure 2: Inference organization in standard predictive coding and boundary-first predictive coding. Panel A shows standard predictive coding, where all layers are updated together using adjacent prediction errors. Panel B shows PC-PC, where boundary states are first coordinated by inter-chunk prediction errors and hidden activities are then refined within chunks. Panel C shows PC-BP, a hybrid control in which boundary coordination is retained while learning inside each chunk uses backpropagation.
where is the prediction of the non-boundary state from the adjacent layer in the same chunk. is the prediction of the last non-boundary state, and it is also the prediction of the PCN. This stage refines all internal activities after the boundary states have been aligned. The weights are then updated as in Eq. (7). We call this fully local instantiation PC-PC.
We also evaluate a hybrid control in which the boundary alignment stage is unchanged, but the weights inside each chunk are updated by backpropagation:
Intra-chunk BP Learning
where indexes the chunk that contains layer . We call this hybrid control PC-BP. Its role is to test whether the boundary-first schedule is useful even when intra-chunk learning is not purely predictive coding.
4 Experiments
Following prior PCN evaluations using fully connected architectures [12,27,28], we perform experiments on MNIST and CIFAR-10 using MLP parameteriza-tions. We train standard MLPs and MLPs with four training dynamics: end-to-end global backpropagation, standard predictive coding, PC-PC, and the PC-BP hybrid control. Experiments are run on MNIST and CIFAR-10.
The main experiments are conducted using 20-layer MLPs with 500 hidden units per layer. For PC-PC and PC-BP, the 20 layers are divided into four chunks with five layers per chunk. All predictive-coding methods use 30 inference steps. For PC-PC, these steps are split into 15 inter-chunk inference steps and 15 intra-chunk inference steps. For each training dynamic, we tune the learning rate and the inference rate with 30 trials by using Optuna [29]. Models are trained for 5 epochs with batch size 128. The learning rate is tuned separately for each method, and all experiments are repeated with five random seeds.
We evaluate three aspects of learning. First, we measure test accuracy to assess predictive performance. Second, we record CKA between initial and final representations to estimate the extent of feature learning. Third, we compute gradient similarity between layers to quantify feature diversity. We also vary total depth and chunk size to test whether the effect depends on a particular chunk partition.
5 Results
We first report predictive performance and representation change, then analyze whether the resulting updates resemble backpropagation. We finally examine feature diversity and study how total depth and chunk size affect the performance.
5.1 Boundary-First Inference Improves Feature Learning and Performance
Table 1 reports test accuracy for standard predictive coding, PC-PC, and PC-BP on MNIST and CIFAR-10. The gains on MNIST are small, consistent with the linear separability of the task. On CIFAR-10, the boundary-first schedule improves standard predictive-coding training. PC-PC improves the standard MLP setting from 41.67% to 51.44% by 9.77%, while PC-BP improves the MLP setting from 48.77% to 54.28% by 5.51%.
Table 1: Test accuracy of standard predictive coding, boundary-first PC-PC, and the PC-BP hybrid control on MNIST and CIFAR-10.
| Dataset | Model | Standard BP | Standard PC | Fixed PC-PC (Ours) | Fixed PC-BP (Ours) |
|---|---|---|---|---|---|
| MNIST | standard MLP | 0.9765 | 0.9686 | 0.9723 | 0.9810 |
| MNIST | MLP | 0.9772 | 0.9765 | 0.9776 | 0.9788 |
| CIFAR-10 | standard MLP | 0.5101 | 0.4167 | 0.5144 | 0.5076 |
| CIFAR-10 | MLP | 0.5390 | 0.4877 | 0.5366 | 0.5428 |
We next measure feature learning using initial-to-final CKA, as defined in Eq. (3). The results in Fig. 3 show that PC-PC and PC-BP reduce CKA relative to standard predictive coding training dynamics on both datasets. Lower CKA indicates greater representation change, so these results suggest that the proposed schedule mitigates the near-kernel behavior observed in standard PC.

Figure 3: CKA similarity between initial and final representations for standard predictive coding, PC-PC, and PC-BP on MNIST and CIFAR-10. Lower CKA indicates greater representation change.
5.2 Boundary-First Predictive Coding Does Not Simply Imitate Backpropagation
The performance gains could arise because the boundary-first schedule makes predictive-coding updates more similar to backpropagation. To test this hypothesis, we measure gradient alignment between predictive-coding updates and global backpropagation updates during one epoch of training. The results are shown in Fig. 4. The MLP has higher alignment than the standard MLP, and PC-BP has higher alignment than PC-PC. Nevertheless, all predictive-coding variants remain below 0.7 alignment with global backpropagation. This indicates that the boundary-first methods improve training dynamics without simply reproducing global BP updates.
5.3 Boundary-First Inference Produces More Diverse Layerwise Updates
We then examine whether the boundary-first schedule changes how different layers learn. Figure 5 reports gradient similarity between layers on MNIST, us-

Figure 4: Gradient alignment of predictive-coding updates relative to global back-propagation.
ing the metric in Eq. (4). All predictive coding dynamics yield lower gradient similarity than global backpropagation in the measured settings. This supports the interpretation that the boundary-first schedule does more than increase update magnitude: it also encourages different layers to move in more distinct directions. The CIFAR-10 analysis in the Appendix shows the same qualitative trend (Figure 7).
The more important pattern is that in standard predictive coding, early-layer gradients are close to zero for both standard MLPs and MLPs. These layers largely transmit the input rather than learning distinct features. PC-PC and PC-BP activate these early layers and reduce the similarity between layerwise updates.
MNIST Final-Step Gradient Similarity (Step 468)

Figure 5: Gradient similarity across layers during training on MNIST. Lower similarity indicates more diverse layer-wise updates. Standard predictive coding (PC) leaves several early layers with weak gradients, whereas boundary-first PCs activate more layers while maintaining a pattern of low gradient similarity.
5.4 Effects of Total Depth and Chunk Size
Finally, we vary the model depth and chunk size on CIFAR-10 for one epoch across five random seeds. Figure 6 summarizes the results for standard and MLPs trained with PC-PC and PC-BP. A chunk size of 1 corresponds to standard PC, while a chunk size equal to the total number of layers corresponds to global backpropagation. These endpoints place standard predictive coding and global backpropagation within a single chunk-based framework as special cases.
The boundary-first schedule improves upon standard predictive coding across most measured network depths and chunk sizes. The main exception is the 5-layer setting, where the benefit of boundary-first inference is limited because the network is too shallow. This pattern suggests that the schedule is most useful when the network is deep enough to learn diverse features. The results also indicate that PC-PC is more effective in smaller networks than in deeper ones, which suggests that signal propagation remains a challenge even under boundary-first optimization.
CIFAR10 Length-Size Valid Accuracy

Figure 6: Comparison of different model depths and chunk sizes on CIFAR-10. A chunk size of 1 corresponds to standard predictive coding, whereas a chunk size equal to the network depth corresponds to global backpropagation. The boundary-first schedule improves over standard predictive coding across most measured depths, with the main exception of the 5-layer setting.
6 Conclusion
This study examines hidden-state optimization order through a boundary-first, chunk-based inference schedule in local learning systems. The schedule partitions a network into chunks, first aligns hidden states at chunk boundaries, and then refines activities within each chunk. We instantiated this schedule in predictive coding networks, where hidden activities and local prediction errors make the optimization order operational. Across MNIST and CIFAR-10 experiments, the boundary-first schedule improved standard predictive coding, increased early-layer update activity, reduced initial-to-final CKA, and produced more diverse layerwise gradients. These findings support boundary-first inference as a useful schedule for predictive-coding training. The evidence is empirical and specific to the PCN instantiations studied here. Extending the same optimization schedule to other local-learning frameworks, such as equilibrium propagation, architectures such as CNNs and Transformers, and other tasks remains an important direction for future work.
References
[1] Rajesh PN Rao and Dana H Ballard. Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects. Nature neuroscience, 2(1):79–87, 1999. 1, 3
[2] James CR Whittington and Rafal Bogacz. An approximation of the error backpropagation algorithm in a predictive coding network with local hebbian synaptic plasticity. Neural computation, 29(5):1229–1262, 2017. 1, 3
[3] Benjamin Scellier and Yoshua Bengio. Equilibrium propagation: Bridging the gap between energy-based models and backpropagation. Frontiers in computational neuroscience, 11:24, 2017. 1
[4] Yoshua Bengio. How auto-encoders could provide credit assignment in deep networks via target propagation. arXiv preprint arXiv:1407.7906, 2014. 1
[5] Eugene Belilovsky, Michael Eickenberg, and Edouard Oyallon. Greedy layer-wise learning can scale to imagenet. In International conference on machine learning, pages 583–593. PMLR, 2019. 1, 3
[6] Yuwen Xiong, Mengye Ren, and Raquel Urtasun. Loco: Local contrastive representation learning. Advances in neural information processing systems, 33:11142–11153, 2020. 1
[7] Myoung Hoon Ha, Hyunjun Kim, Yoondo Sung, Youngha Jo, Min S Kang, and Sang Wan Lee. Stable and scalable deep predictive coding networks with meta-prediction errors. In The Fourteenth International Conference on Learning Representations, 2026. 1
[8] Luca Pinchetti, Chang Qi, Oleh Lokshyn, Cornelius Emde, Amine M'Charrak, Mufeng Tang, Simon Frieder, Bayar Menzat, Gaspard Oliviers, Rafal Bogacz, et al. Benchmarking predictive coding networks-made simple. In The Thirteenth International Conference on Learning Representations, 2025. 1
[9] Nicholas Alonso, Jeffrey Krichmar, and Emre Neftci. Understanding and improving optimization in predictive coding networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 10812–10820, 2024. 1
[10] Tommaso Salvatori, Yuhang Song, Yordan Yordanov, Beren Millidge, Lei Sha, Cornelius Emde, Zhenghua Xu, Rafal Bogacz, and Thomas Lukasiewicz. A stable, fast, and fully automatic learning algorithm for predictive coding networks. In International Conference on Learning Representations, volume 2024, pages 19607–19631, 2024. 1
[11] Simon Frieder and Thomas Lukasiewicz. (non-) convergence results for predictive coding networks. In International Conference on Machine Learning, pages 6793–6810. PMLR, 2022. 1
[12] Francesco Innocenti, El Mehdi Achour, and Christopher L Buckley. upc: Scaling predictive coding to 100+ layer networks. arXiv preprint arXiv:2505.13124, 2025. 1, 3, 6
[13] Greg Yang and Edward J Hu. Feature learning in infinite-width neural networks. arXiv preprint arXiv:2011.14522, 2020. 1, 3
[14] Tommaso Salvatori, Yuhang Song, Yujian Hong, Lei Sha, Simon Frieder, Zhenghua Xu, Rafal Bogacz, and Thomas Lukasiewicz. Associative memories via predictive coding. Advances in neural information processing systems, 34:3874–3886, 2021. 3
[15] Nick Alonso, Beren Millidge, Jeffrey Krichmar, and Emre O Neftci. A theoretical framework for inference learning. Advances in Neural Information Processing Systems, 35:37335–37348, 2022. 3
[16] Jeffrey Seely. Sheaf cohomology of linear predictive coding networks. In NeurIPS 2025 Workshop on Symmetry and Geometry in Neural Representations, 2025. 3
[17] George A Miller. The magical number seven, plus or minus two: Some limits on our capacity for processing information. Psychological review, 63(2):81, 1956. 3
[18] Greg Yang and Edward J Hu. Tensor programs iv: Feature learning in infinite-width neural networks. In International Conference on Machine Learning, pages 11727–11737. PMLR, 2021. 4
[19] Etai Littwin and Greg Yang. Adaptive optimization in the infinity-width limit. In The Eleventh International Conference on Learning Representations, 2023. 4
[20] Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In International conference on machine learning, pages 3519–3529. PMIR, 2019. 4
[21] Greg Yang, Dingli Yu, Chen Zhu, and Soufiane Hayou. Tensor programs vi: Feature learning in infinite depth neural networks. In International Conference on Learning Representations, volume 2024, pages 55099–55150, 2024. 4
[22] Eli Sennesh, Hao Wu, and Tommaso Salvatori. Divide-and-conquer predictive coding: a structured bayesian inference algorithm. Advances in Neural Information Processing Systems, 37:48599–48627, 2024. 5
[23] Alexander Tschantz, Beren Millidge, Anil K Seth, and Christopher L Buckley. Hybrid predictive coding: Inferring, fast and slow. PLoS computational biology, 19(8):e1011280, 2023. 5
[24] Tommaso Salvatori, Luca Pinchetti, Amine M'Charrak, Beren Millidge, and Thomas Lukasiewicz. Predictive coding beyond correlations. In Proceedings of the 41st International Conference on Machine Learning, pages 43142–43179, 2024. 5
[25] Bjorn Zwol. Predictive coding graphs are a superset of feedforward neural networks. In The First Workshop on NeuroAI @ NeurIPS2024, 2024. 5
[26] Beren Millidge, Mufeng Tang, Mahyar Osanlouy, Nicol S Harper, and Rafal Bogacz. Predictive coding networks for temporal prediction. PLOS Computational Biology, 20(4):e1011183, 2024. 5
[27] Yuhang Song, Thomas Lukasiewicz, Zhenghua Xu, and Rafal Bogacz. Can the brain do backpropagation?—exact implementation of backpropagation in predictive coding networks. Advances in neural information processing systems, 33:22566–22579, 2020. 6
[28] Alexander Tschantz, Magnus Koudahl, Hampus Linander, Lancelot Da Costa, Conor Heins, Jeff Beck, and Christopher Buckley. Bayesian predictive coding. arXiv preprint arXiv:2503.24016, 2025. 6
[29] Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In The 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2623–2631, 2019. 7
A Standard Deviations of Accuracies in Table 1
The standard deviations of the test accuracies in Table 1 are shown in Table 2.
Table 2: Standard deviations of the test accuracies in Table 1.
| Dataset | Model | Standard BP | Standard PC | Fixed PC-PC (Ours) | Fixed PC-BP (Ours) |
|---|---|---|---|---|---|
| MNIST | standard MLP | 0.0041 | 0.0020 | 0.0006 | 0.0008 |
| MNIST | μMLP | 0.0029 | 0.0013 | 0.0007 | 0.0011 |
| CIFAR-10 | standard MLP | 0.0049 | 0.0346 | 0.0058 | 0.0074 |
| CIFAR-10 | μMLP | 0.0058 | 0.0197 | 0.0050 | 0.0016 |
B Feature Diversity under Boundary-First Predictive Coding on CIFAR-10
Figure 7 shows gradient similarity between layers during training on CIFAR-10. The pattern is consistent with the MNIST results. Standard predictive coding leaves several early layers with weak gradients, while PC-PC and PC-BP activate more layers and reduce update similarity. The CIFAR-10 setting also shows that stronger input nonlinearity can increase feature learning under standard PC, but the boundary-first schedule still produces more broadly distributed layerwise updates.

Figure 7: Gradient similarity between different layers during training on CIFAR-10. Lower similarity indicates more diverse layerwise updates.