\chapter{Discussion}

\section{Summary of results}
This thesis has extended the theory of predictive coding to three crucial aspects of computations in the brain: space, time and memory. It has been shown that the classical, hierarchically organized predictive coding models can be extended to account for associative memory through a recurrent formulation of the free energy (Chapter \ref{chap:am}), and can also be extended to describe temporally varying stimuli by incorporating temporal predictions (Chapter \ref{chap:time}). This temporal version of predictive coding can then be applied to model sequential memory (Chapter \ref{chap:seqmem}) and to learn grid cells (Chapter \ref{chap:grid}), two important properties of the hippocampal formation. This chapter discusses topics relevant to multiple chapters of this thesis.

\section{Biological plausibility}

\subsection{Error neurons}
The biological plausibility of predictive coding, which mainly refers to its local inferential computations and Hebbian plasticity, is based on the inclusion of error neurons in its network implementation. Despite the convenience, the general existence of error neurons per se in the brain is controversial. Unlike the dopaminergic reward prediction error neurons that are well-documented \citep{schultz1997neural,schultz1998predictive}, there is limited evidence for the general presence of error neurons in the cortex \citep{walsh2020evaluating}. In the neocortex, recent theories and computational models have suggested that layer L5 could serve as a temporal mismatch detector as it receives direct inputs from thalamus while indirect and delayed inputs from L2/3 \citep{PPR:PPR843203}. This could provide a possible mechanism for the temporal error in the modeling of the visual cortex using tPC (Chapter \ref{chap:time}). Similarly, for the hippocampal formation, the CA1 region receives inputs directly from the entorhinal cortex and also indirect inputs from the dentate-gyrus and CA3. This anatomical property has led to theories of CA1 being a (temporal) error detector \citep{lisman1999relating} and recent models for hippocampal place cells leveraging this theory \citep{chen2022hippocampus}. This property could provide a possible mechanism of error computation in the hippocampal formation modelled in Chapters \ref{chap:am}, \ref{chap:seqmem} and \ref{chap:grid}. However, error neurons in all models discussed in this thesis have the special one-to-one connections to their corresponding value neurons, which is unlikely to exist in the brain. Future works could focus on how this constraint can be relaxed to better match the connectivities in the neocortex and the hippocampal formation.

In the dendritic rPCN proposed in Chapter \ref{chap:am} and tPCN in Chapter \ref{chap:time}, we circumvented this problem by computing error signals from recurrent connections within apical dendrites, rather than within explicit error nodes in the original implementation. Such an architecture can reconcile predictive coding networks with the lack of strong evidence for explicit prediction error neurons in the cortex, and aligns well with experimental findings. For example, a recent study in rat cortex found little evidence for prediction-related signals in spikes, but found strong evidence for it in local field potentials, which are thought to be driven by somatic and dendritic potentials \citep{auksztulewicz2023omission}. Although in Fig~\ref{fig:recurrent_multistep}B and \ref{fig:recurrent_multistep}C we still use error neurons in the hierarchical part of the network, they can also be circumvented following the dendritic implementations in \citet{mikulasch2023error} or \citet{sacramento2018dendritic}. In both studies, the dendritic computations naturally arise by rearranging the dynamical equations of predictive coding \citep{whittington2019theories}, which are then used to extend predictive coding in spiking networks \citep{mikulasch2022dendritic} and to approximate backpropagation \citep{sacramento2018dendritic}. Broadly speaking, recent studies have shown that incorporating dendritic architectures into artificial neural networks may benefit transfer and continual learning, and help the design of neuromorphic hardware with lower energy consumption \citep{chavlis2021drawing,richards2019dendritic,guerguiev2017towards}. It is thus an interesting future avenue to explore fully dendritic implementations of models studied in this thesis, and whether they can match neurophysiological data.

\subsection{Weight symmetry}
All predictive coding models presented in this thesis still inherit the weight symmetry problem i.e., the same weight that was used to propagate top-down predictions is also used to propagate bottom-up error signals (see for example $\bfF$ in Eq.~\ref{eq:dynamics_x} and Eq.~\ref{eq:err-y}). Such symmetric synaptic connections does not exist in the brain. Multiple studies have investigated this issue with backpropagation \citep{lillicrap2016random,akrout2019deep,amit2019deep}, and preliminary results with hierarchical predictive coding have demonstrated that this symmetry is not necessary for successful performance in various tasks \citep{millidge2020relaxing}. It is therefore important to investigate whether relaxing the weight symmetry on rPCN and tPCN can equally retain their performance, while achieving a higher level of biological plausibility.

\section{Scaling up predictive coding}
In this thesis, the predictive coding models have mostly been trained to perform biologically relevant tasks, such as memory and navigation. It is known that hierarchical predictive coding can perform machine learning tasks as well as, or even better than backpropagation-trained neural networks \citep{whittington2017approximation,song2024inferring}, and can also be scaled up to have complex architectures (e.g., convolutional layers) and to process large-scale datasets that are usually encountered in machine learning scenarios \citep{pinchetti2025benchmarkingpredictivecodingnetworks}. However, all these studies focused on the classical, hierarchical predictive coding models. It is thus an important future avenue to investigate whether models discussed in this thesis, especially tPCN, can also be scaled up to tasks for RNNs, such as language \citep{graves2013speech} or sequence generation \citep{graves2013generating}.


\section{Modeling the hippocampal formation} 
A main theme of this thesis is to model the hippocampal formation with predictive coding. Experimental evidences have suggested mechanisms of general predictive processing within the hippocampus and related areas. It has long been postulated that the hippocampus predicts upcoming sensory inputs, in both spatial and non-spatial experimental setups \citep{lisman2009prediction,mehta2000experience,stachenfeld2017hippocampus,gray2003neuropsychology}. The special feedforward circuitry of the hippocampus may also be an evidence for predictive processing: \citet{lisman1999relating} suggested that the CA1 region of the hippocampus serves as a ``mismatch" detector, encoding the error between sensory reality and the internally generated prediction based on past events communicated through the feedforward pathway from CA3 to CA1. Our findings in Chapters \ref{chap:seqmem} and \ref{chap:grid} suggest that this mismatch signal can be used to memorize sequences or learn grid cells. However, although hippocampal cell populations that fire exclusively following erroneous trials in associative learning tasks have been found in animals \citep{wirth2009trial,ku2021contributions}, it is unclear, at the single-cell level, whether prediction error representations exist in the hippocampus, and in what form they exist: are there neurons encoding them, or are they encoded in specific neuronal structures such as apical dendrites? Our models inform future experimental works to answer these questions by making the prediction that hippocampal neurons can representation prediction errors, via somatic or dendritic activities. In Chapter \ref{chap:grid}, grid cells in the MEC layer are recurrently connected through a specialized circuit involving interneurons $\hat{\bfg}_{t-1}$ that inhibit the output signal from the grid cells, allowing the error neurons $\bm{\epsilon}^\bfg_t$ to compute the temporal prediction errors. Experimental evidence suggests that lateral interactions in layer II of the MEC are predominantly inhibitory \citep{witter2006spatial} and are mediated by interneurons such as basket cells \citep{jones1993basket}. Our model also predicts that these interneurons encode an eligibility trace $\hat{\bfg}_{t-1}$ from the immediate past. While recent studies have reported grid cells representing prospective locations \citep{ouchi2024predictive}, it remains to be verified whether these cells are mechanistically supported by such ``past'' cells. Additionally, neurons in the entorhinal cortex are known to encode errors \citep{ku2021contributions}, suggesting a possible error-driven learning mechanism similar to that in tPCN.


Two important aspects of hippocampal formation have not been extensively addressed within this thesis. Firstly, although predictive coding frameworks have been employed to model hippocampal networks, the predictive nature of hippocampal neuronal activity itself affords deeper exploration. For example, hippocampal place cells are known to encode an animal's anticipated future positions during movement along linear tracks or in two-dimensional environments \citep{lisman2009prediction}, through phenomena like phase precession \citep{o1993phase} and temporally skewed place fields \citep{huxter2008theta}. Investigating this predictive encoding of future events, potentially by training a tPCN model with visual movement cues (akin to \citet{banino2018vector}), or integrating these insights into the path integration tasks discussed in Chapter \ref{chap:grid}, provides a valuable research opportunity.

Secondly, the concept of cognitive maps within the hippocampal formation \citep{tolman1948cognitive,behrens2018cognitive} remains largely unexplored in predictive coding frameworks. The cognitive map hypothesis posits that spatial representations, such as place cells, grid cells, and border cells, can generalize beyond physical space to encode relationships among various objects and events (e.g., social relationships). Such a generalized cognitive map can facilitate adaptive behaviors, including generalization. Findings presented in this thesis suggest several ways predictive coding models could extend to represent cognitive maps. Firstly, tPCN naturally develops grid-cell representations derived from place-cell activity, which can be extended to encode generalized events. Secondly, tPCN can disambiguate aliased observations via latent representations of different time steps, effectively encoding temporal relationships between events. Thirdly, tPCN generalizes dynamics from linear $1$D sequences, suggesting the potential to generalize similarly across two-dimensional graphs of events. While \citet{whittington2020tolman} have proposed a computational model addressing cognitive maps, their framework depends heavily on ad-hoc components and is trained through backpropagation. Thus, applying predictive coding, rooted in Bayesian inference principles and implemented via local plasticity mechanisms, to cognitive maps presents an intriguing and promising research trajectory.

\section{Relationship to self-supervised models of the brain}
Predictive coding-based models discussed in this thesis are closely to self-supervised learning models i.e., the learning scheme where a model updates its synaptic weights according to self-generated teaching signals rather than external ones, to learn hidden representations of sensory inputs \citep{becker1992self,chen2020simple,zbontar2021barlow}. Predictive coding can be considered as a type of self-supervised learning as it also relies on self-generated predictions to perform synaptic updates, which relates it to studies investigating the biological plausibility of self-supervised learning \citep{tang2022biologically,siddiqui2023blockwise}. An interesting future avenue for predictive coding is to compare its hidden representation to those learned by self-supervised learning methods.

Self-supervised learning has also been used to model the brain. For example, multiple lines of research have used self-supervised objective functions to train neural networks that develop grid cells \citep{xu2022conformal, schaeffer2024self,pettersen2024self}, relating it to Chapter \ref{chap:grid} of this thesis. In Chapters \ref{chap:time} and \ref{chap:seqmem}, the tPC model learns from temporal prediction errors that arise due to two distinct pathways entering the error neuron at different time points. Self-supervised learning through mismatch or error from temporal delays is also a widely explored scheme in computational neuroscience. For example, \citet{PPR:PPR843203} proposed a temporally self-supervised model where neocortex L5 receives delayed inputs from L2/3 and direct inputs from the thalamus, and then computes the temporal difference between them to update synaptic weights. This view has also been adopted in models of the hippocampal formation, where the CA1 subregion is postulated to be a mismatch detector \citep{lisman1999relating} and can thus guide error-driven learning. \citet{chen2022hippocampus} used this principle to train a temporal self-supervised model that explains the place cell dynamics in CA1 and CA3 subregions. \citet{levenstein2024sequential} also employed temporal self-supervision to account for both spatial representations and replay in the hippocampus, providing a unifying view. This (temporally) predictive view of the hippocampal formation has also been discussed in a reinforcement learning framework \citep{stachenfeld2017hippocampus}, which explained hippocampal phenomena such as place cell prospective encoding and grid cell deformation. Despite these extensive studies adopting the temporal self-supervised view of the brain, a common missing theme in them is a mechanistic view of how a circuit of neurons can support the self-supervised learning of brain functions and representations. On the other hand, predictive coding models discussed in this thesis provide both a normative (Bayesian inference) and a mechanistic (local computations) view of the cortex. It would thus be interesting to investigate how predictive coding models, for example tPC, can be adapted to similar experimental set-ups of the studies above.


% \section{Relationship to experimental data}
% This thesis posits that various cortical functions and representations are developed through predictive coding, and demonstrated this via modeling the visual cortex and the hippocampal formation. In general, there is strong evidence for predictive coding in these regions \citep{palmer2015predictive,lisman2009prediction}, which can be implemented within cortical microcircuits that follow the known anatomy of the cortex \citep{bastos2012canonical,kanai2015cerebral,shipp2016neural}. A general direction that follows is modeling other regions, such as the motor cortex and auditory cortex, which have been initially studied via the lens of predictive coding \citep{shipp2013reflections,heilbron2018great}.


















