Hierarchical Gaussian Filtering (HGF) networks allow for efficient updating of posterior distributions (beliefs) about hidden states of an agent's environment. HGF parent nodes can target the mean or variance of their children. New information entering at input nodes leads to a cascade of belief updates across the network according to one-step update equations for each node's mean and precision (inverse variance). However, the original form of the update equations for variance-targeting parents(volatility coupling) can in some regions of parameter space lead to negative posterior precision, a logical impossibility which causes the updating algorithm to terminate with an error. In this report, we introduce a modified quadratic approximation to the variational energy of volatility-coupled nodes that avoids negative posterior precision. The key idea is to interpolate between two quadratic expansions of the variational energy: one at the prior prediction and one at a second mode whose location is obtained in closed form via the Lambert W function. The resulting update equations are robust across the entire parameter space and faithfully track the variational posterior even for large prediction errors.
Predictive processing theories describe perception as a dynamic interplay between top-down predictions and bottom-up prediction errors across hierarchical stages of sensory processing. However, it remains unclear how neural connectivity flexibly adapts to changing sensory environments over time, and how these dynamics are influenced by aging. This study investigated how temporal factors on three distinct timescales, as well as age, shape neural responses and connectivity to dynamically changing auditory stimuli. Electroencephalography (EEG) data were recorded from 63 participants aged 18-75 as they listened to sequences of tones, where rare and unexpected "original deviants" became standards over time, and previously standard tones became "reverse deviants." Event-related potentials (ERPs) were more pronounced for original deviants than reverse deviants. Amplitudes increased on short timescales (seconds) but declined over longer timescales (minutes) and with advancing age. To infer the neural mechanisms underlying these effects, dynamic causal modelling (DCM) was used to analyze effective connectivity. DCM revealed increased descending (top-down) connectivity for original deviants, consistent with a stronger reliance on predictions. Additionally, intrinsic (within-region) connectivity increased over seconds but decreased over minutes, reflecting timescale-dependent neural adaptation. Aging was associated with stronger modulation of descending connectivity by deviant type but weaker modulation by slow dynamics. These results underscore the brain's ability to dynamically adapt to changing sensory environments at multiple timescales and for the first time reveal age-related changes in the dynamics of this adaptation.
Bayesian models of cognition have gained considerable traction in computational neuroscience and psychiatry. Their scope is now expected to expand rapidly to artificial intelligence, providing general inference frameworks to support embodied, adaptable, and energy-efficient autonomous agents. A central theory in this domain is predictive coding, which posits that learning and behaviour are driven by hierarchical probabilistic inferences about the causes of sensory inputs. Biological realism constrains these networks to rely on simple local computations in the form of precision-weighted predictions and prediction errors. This can make this framework highly efficient, but its implementation comes with unique challenges on the software development side. Embedding such models in standard neural network libraries often becomes limiting, as these libraries' compilation and differentiation backends can force a conceptual separation between optimisation algorithms and the systems being optimised. This critically departs from other biological principles such as self-monitoring, self-organisation, cellular growth, and functional plasticity. In this paper, we introduce pyhgf: a Python package backed by JAX and Rust for creating, manipulating, and sampling dynamic networks for predictive coding. We improve over other frameworks by enclosing the network components as transparent, modular, and malleable variables in the message-passing steps. The resulting graphs can implement arbitrary algorithms as belief propagation. Moreover, the transparency of core variables can also translate into inference processes that leverage self-organisation principles and express structure learning, meta-learning, or causal discovery as the consequence of network structural adaptation to surprising inputs. The main functions of the library are differentiable and seamlessly integrate into sampling or optimisation workflows. Additionally, we offer generalised Bayesian filtering and the hierarchical Gaussian filter as key examples of dynamic networks implemented in our library. The source code, tutorials, and documentation are hosted under the main repository at https://github.com/ComputationalPsychiatry/pyhgf.
Biological cognition depends on learning-structured representations in ambiguous environments. Computational models of structure learning typically frame this as an inference problem, but often overlook the temporally extended dynamics that shape learning trajectories under ambiguity. In this paper, we reframe structure learning as an emergent consequence of constraint-based dynamics. Informed by the literature on the role of constraints in complex biological systems, we develop a constraint-based approach to computational cognitive modelling and provide a proof-of-concept model. The model consists of an ensemble of components, each comprising an individual learning process, whose internal updates are locally constrained by both external observations and system-level relational constraints. This is formalised using Bayesian probability as a description of constraint satisfaction rather than epistemic inference. Representational structure is not encoded directly in the model equations, but emerges over time through the interaction, stabilisation, and elimination of components under these constraints. Through a series of simulations in environments with varying degrees of ambiguity, we demonstrate that the model reliably differentiates the observation space into stable representational categories. We further analyse how global parameters controlling internal constraint and initial component precision shape learning trajectories and long-term behavioural alignment with the environment. We discuss the formal relationship between the present approach and Bayesian inference accounts, and argue that a constraint-based approach offers a conceptually distinct foundation for relating computational models to biological systems.
Predictive processing has been proposed as an explanatory framework for symptom development in both autism (ASD) and schizophrenia (SSD) spectrum disorders, with ASD being associated with an overweighting of (low-level) sensory evidence whereas SSD is characterized by an overweighting of (high-level) prior beliefs. The goal of the present study was to investigate these hypotheses in subclinical expressions of ASD and SSD in the domain of language processing. To test this, we used an auditory comprehension task designed to directly manipulate the precision of high-level semantic prior beliefs and low-level sensory evidence. We applied hierarchical Bayesian belief updating modeling to quantify this effect and used EEG to examine whether an imbalance in the weighting of prior beliefs and sensory evidence would be characterized by altered processing of semantic precision-weighted prediction errors as indexed by alterations in mean N400 amplitudes. Computational modeling revealed that increasing schizotypal traits were associated with a significant overweighting of prior beliefs, while autistic traits did not show a significant shift. Linear mixed models on the mean N400 amplitudes further indicated that this schizotypy-related overweighting of semantic prior beliefs was reflected in a reduced semantic prediction error signal, indexed by smaller N400 differences between low entropy sentences and both high and low-mismatch sentences. A similar pattern emerged for increasing autistic traits, though the effect was weaker and less distinct, pointing to a subtle overweighting of semantic prior beliefs, only. Overall, our findings provide converging computational and electrophysiological support for an overweighting of semantic prior beliefs with increasing subclinical schizotypy, consistent with predictive processing accounts of SSD, whereas we did not find evidence for an overweighting of sensory evidence with increasing autistic traits, with electrophysiological results instead pointing toward subtle alterations in the weighting of semantic prior beliefs.
Abstract Interoception and homeostatic/allostatic control are not only fundamental for survival but play a key role for maintaining somatic and mental health. Furthermore, metacognitive evaluations of these processes, such as perceived failure of allostatic regulation, have been proposed to underlie the experience of chronic symptoms, such as chronic fatigue. A central question in this regard is what mechanisms the brain uses to evaluate control over bodily states. A prominent computational proposal posits that this is achieved by monitoring of interoceptive prediction errors (PEs). However, to date, this proposal has not been tested experimentally. Here, we tested this hypothesis by applying computational process models of perceived control to data from a novel behavioural paradigm, the Respiratory Metacognition of Control Task (RMCT). The RMCT manipulates control over breathing by changing inspiratory resistive loads as a function of control achieved in a gamified prediction task. We developed and compared trial-by-trial generative models of perceived explicit control in the RMCT, using data from 50 volunteers in a pre-registered analysis. Bayesian model selection suggested that perceived control over breathing is best explained as a function of both trial-wise interoceptive outcomes (breathing with or without an inspiratory resistive load) and trial-wise PEs about respiratory resistance. These results support a longstanding computational proposal of how the brain detects failures of bodily regulation and provide a mechanistic model for understanding inter-individual differences in perceived control over bodily states.
Computational (generative) modelling of behaviour has considerable potential for clinical applications. In order to unlock the potential of generative models, reliable statistical inference is crucial. For this, Bayesian workflow has been suggested which, however, has rarely been applied in Translational Neuromodeling and Computational Psychiatry (TN/CP) so far. Here, we present a worked example of Bayesian workflow in the context of a typical application scenario for TN/CP. This application example uses Hierarchical Gaussian Filter (HGF) models, a family of computational models for hierarchical Bayesian belief updating. When equipped with a suitable response model, HGF models can be fit to behavioural data from cognitive tasks; these data frequently consist of binary responses and are typically univariate. This poses challenges for statistical inference due to the limited information contained in such data. We present a novel set of response models that allow for simultaneous inference from multivariate (here: two) behavioural data types. Using both simulations and empirical data from a speed-incentivised associative reward learning (SPIRL) task, we show that models harnessing information from two different data streams (binary responses and continuous response times) ensure robust inference (specifically, identifiability of parameters and models). Moreover, we find a linear relationship between log-transformed response times in the SPIRL task and participants' uncertainty about the outcome. Our analysis illustrates the benefits of Bayesian workflow for a typical use case in TN/CP. We argue that adopting Bayesian workflow for generative modelling helps increase the transparency and robustness of results, which in turn is of fundamental importance for the long-term success of TN/CP.
BACKGROUND:Autism spectrum disorder (ASD) is a neurodevelopmental disorder characterized by impairments of social interaction and communication as well as repetitive, stereotyped behaviour. Previous research indicates that ASD without intellectual impairment is associated with underactivity and reduced functional connectivity of the brain's mentalizing pathway, to which the right temporo-parietal junction (rTPJ) serves as an important entry point and hub. In this study, we aim to utilize functional magnetic resonance imaging (fMRI) to localize activation maxima in the rTPJ and other regions involved in social cognition to generate individualized targets for neuro-navigated, intermittent theta burst stimulation (iTBS) in order to modulate brain activity in a region centrally engaged in social information processing. METHODS:In this single-blind, randomized, between-subject neuroimaging-guided brain stimulation study we plan to recruit 52 participants with prediagnosed ASD and 52 controls without ASD aged between 18 and 65 years. Participants will be classified into two groups and will randomly receive one session of either verum- or sham-iTBS. Effects will be assessed by using well-established experimental tasks that interrogate social behaviour, but also use computational modelling to investigate brain stimulation effects at this level. DISCUSSION:This study aims to use personalized, non-invasive brain stimulation to alter social information processing in adults with and without high-functioning ASD, which has not been studied before with a similar protocol or a sample size of this magnitude. By doing so in combination with behavioural and computational tasks, this study has the potential to provide new mechanistic insights into the workings of the social brain. TRIAL REGISTRATION:German Clinical Trial Register, DRKS-ID: DRKS00028819. Registered 14 June 2022.
Auditory event-related potential (ERP) analysis typically involves extraction of responses time-locked to each sound averaged together by auditory event type. In oddball sequences, a repetitious standard sound is occasionally interrupted by a low probability deviant. ERP component differences between standard and deviant ("oddball") events support the inference that humans rapidly and automatically extrapolate from patterns to predict the most likely structure and properties of upcoming sounds. A sound sequence composed of repeating patterns at multiple timescales was used to determine whether there is evidence of response normalization over long timescales, that is, reduced differences between standard and deviant responses over time. Two sounds (30 and 60 ms pure tones) were organized into four blocks in which the two sounds alternated in tone probability as rare deviants (p = 0.125) or common standards (p = 0.875). Continuous EEG was collected from 32 participants who heard four occurrences of this four-block alternating-oddball sequence. We extracted five-tone epochs centered on the deviant, exploiting a design principle of oddball sequences used in ERP studies that deviants are always separated by occurrences of the repeating standard, thus ensuring in this case that every deviant was preceded and followed by a minimum of three standards. The five-tone epoch analysis revealed that the occurrence of a deviant triggered a prolonged negative shift in the ERP that extended across the whole response of the deviant and the subsequent standard. The amplitude of this "deviant complex" (over 120-600 ms post deviant) and a mean "standard complex" amplitude (480-0 ms pre-deviant) were analyzed alongside conventional ERP components, assessing them for change over time. Results revealed convergence of the standard and deviant responses, such that differences reduced over long timescales. Findings are discussed with respect to being potential indices of excitatory/inhibitory homeostasis and evidence of pattern prediction over several 10s of minutes.
The human brain has a remarkable ability to learn and update its beliefs about the world. Here, we investigate how thermosensory learning shapes our subjective experience of temperature and the misperception of pain in response to harmless thermal stimuli. Through computational modeling, we demonstrate that the brain uses a probabilistic predictive coding scheme to update beliefs about temperature changes based on their uncertainty. We find that these expectations directly modulate the perception of pain in the thermal grill illusion. Quantitative microstructural brain imaging further revealed that individual variability in computational parameters related to uncertainty-driven learning and decision-making is reflected in the microstructure of brain regions such as the precuneus, posterior cingulate gyrus, cerebellum, as well as basal ganglia and brainstem. These findings provide a framework to understand how the brain infers pain from innocuous thermal inputs, with important implications for the etiology of thermosensory symptoms under chronic pain conditions.
BACKGROUND:An imbalance in the weighting of prior beliefs and sensory evidence is thought to contribute to the development of psychotic symptoms, such as hallucinations and delusions. We investigated 1) how much individuals with schizotypal traits, a subclinical expression of psychosis proneness, use high-level semantic priors and sensory evidence to understand noise-degraded language; 2) whether an imbalance would potentially result in task-based hallucinations-perceptions that match expectations but not the input; and finally, 3) whether a potential imbalance was linked to altered levels of cortical glutamate. METHODS:In a language comprehension task, we simultaneously manipulated semantic predictability, sensory degradation, and surprisal to estimate the prior weight using a Bayesian belief updating model. We conducted 2 studies. Study 1 (N = 109) tested the language comprehension task behaviorally; study 2 (N = 55) was used to replicate the findings of study 1, but was also combined with proton magnetic resonance spectroscopy to assess cortical levels of glutamate. RESULTS:Study 1 showed that high-level priors were overweighted, with increasing schizotypy providing a potential explanation for the increased number of task-based hallucinations observed in the same individuals. Importantly, replicating the results of study 1, study 2 revealed that an overweighting of priors was associated with increased cingulate glutamate, providing a neurobiological basis for overreliance on top-down predictions. CONCLUSIONS:These results offer a mechanistic and neurobiological understanding of how predictive coding alterations contribute to symptom development along the psychosis spectrum.
Impairments in reinforcement learning (RL) might underlie the tendency of individuals with elevated psychopathic traits to behave exploitatively, as they fail to learn from their mistakes. Most studies on the topic have focused on binary choices, while everyday functioning requires us to learn the value of multiple options. In this study, we evaluated the cognitive correlates of naturalistic foraging-type decision-making and their electrophysiological signatures in a community sample (n = 108) with varying degrees of psychopathic traits. Reinforcers with different salience were included in a foraging-type decision-making task. Recruitment of various cognitive processes was estimated with a computational model and electrophysiology, and the relationships to psychopathic traits were assessed. Higher Antisocial traits were associated with a bias towards expecting more volatility in the environment when high-salience reinforcers were used. Additionally, higher levels of Interpersonal traits were associated with reduced learning from personalized rewards, as evidenced by reductions in the prediction errors (PEs) about rate of change. Higher Affective traits were associated with lower PEs and aberrant learning from painful punishments. Lastly, the PEs about rate of change were reflected in the trial-wise trajectories of Feedback-Related Negativity event-related potentials. Together, our results point to the importance of volatility processing in understanding aberrant decision-making in relation to psychopathy, demonstrate the relationships between psychopathic traits and learning through reward and punishment, and emphasise the potentially more beneficial effect of personalized rewards and punishment for improving reinforcement-based decision-making in individuals with elevated psychopathic traits.
Active inference under the Free Energy Principle has been proposed as an across-scales compatible framework for understanding and modelling behaviour and self-maintenance. Crucially, a collective of active inference agents can, if they maintain a group-level Markov blanket, constitute a larger group-level active inference agent with a generative model of its own. This potential for computational scale-free structures speaks to the application of active inference to self-organizing systems across spatiotemporal scales, from cells to human collectives. Due to the difficulty of reconstructing the generative model that explains the behaviour of emergent group-level agents, there has been little research on this kind of multi-scale active inference. Here, we propose a data-driven methodology for characterising the relation between the generative model of a group-level agent and the dynamics of its constituent individual agents. We apply methods from computational cognitive modelling and computational psychiatry, applicable for active inference as well as other types of modelling approaches. Using a simple Multi-Armed Bandit task as an example, we employ the new ActiveInference.jl library for Julia to simulate a collective of agents who are equipped with a Markov blanket. We use sampling-based parameter estimation to make inferences about the generative model of the group-level agent, and we show that there is a non-trivial relationship between the generative models of individual agents and the group-level agent they constitute, even in this simple setting. Finally, we point to a number of ways in which this methodology might be applied to better understand the relations between nested active inference agents across scales.
How individuals process and respond to uncertainty has important implications for cognition and mental health. Here we use computational phenotyping to examine individualised 'uncertainty fingerprints' in relation to neurometabolites and trait anxiety in humans. We introduce a novel categorical state-transition extension of the Hierarchical Gaussian Filter (HGF) to capture implicit learning in a four-choice probabilistic sensorimotor reversal learning task by tracking beliefs about stimulus transitions. Using 7-Tesla Magnetic Resonance Spectroscopy, we measured baseline neurotransmitter levels in the primary motor cortex (M1). Model-based results revealed dynamic belief updating in response to environmental changes. We further found region-specific relationships between M1 glutamate+ glutamine levels and prediction errors and volatility beliefs, revealing an important neural marker of probabilistic reversal learning in humans. High trait anxiety was associated with faster post-reversal responses. By integrating computational modelling with neurochemical assessments, this study provides novel insights into the neurocomputations that drive individual differences in processing uncertainty. ### Competing Interest Statement The authors have declared no competing interest.
How individuals process and respond to uncertainty has important implications for cognition and mental health. Here, we use computational phenotyping to examine inter-individual differences in uncertainty processing in relation to neurometabolites and trait anxiety in humans. We introduce a categorical state-transition extension of the Hierarchical Gaussian Filter to model individuals' evolving beliefs about transition probabilities in a four-choice probabilistic sensorimotor learning task with a reversal. Using 7-Tesla Magnetic Resonance Spectroscopy, we measure neurotransmitter levels in the primary motor cortex. Model-based results reveal dynamic belief updating in response to environmental changes. We further find region-specific relationships between baseline primary motor cortex glutamate+ glutamine levels and prediction errors and volatility beliefs. High trait anxiety is associated with faster post-reversal responses. This study establishes a direct neurochemical correlate of hierarchical belief updating, identifying motor cortex glutamate + glutamine as an important neural marker of inter-individual differences in uncertainty processing.
BackgroundHealthy social functioning relies on an ability to form accurate representations of others’ character and to utilize the representations to guide decisions. Here, we take a transdiagnostic longitudinal approach to investigate disrupted social decision-making in psychopathology. MethodsWe obtained transdiagnostic antagonism symptom scores from a battery of standardized questionnaires in an online US sample nationally representative for age, sex, and ethnicity. Participants completed a Moral Inference Task where they made a series of predictions about the moral decisions of both a selfish and a generous agent, and periodically reported their beliefs about the agents’ moral character. Participants were incentivized to form accurate representations of the agents’ tendencies as they later played an economic game where they could entrust money to the agents. We characterized the behavioral phenotypes of antagonism in forming social representations and using the representations to make adaptive social decisions.ResultsParticipants with high antagonism (1) held strong, pessimistic prior expectations, (2) were less accurate in predicting others’ moral decisions, (3) were more confident about their subjective impressions, and (4) made maladaptive trust decisions.ConclusionsWe found that disrupted social representations are specific to the latent dimension of antagonism and stable over time. The findings emphasize the role of social representations in adaptive social decisions in antagonism, providing a potential target for interventions.
Beliefs-attitudes toward some state of the environment-guide action selection and should be robust to variability but sensitive to meaningful change. Beliefs about volatility (expectation of change) are associated with paranoia in humans, but the brain regions responsible for volatility beliefs remain unknown. The orbitofrontal cortex (OFC) is central to adaptive behavior, whereas the magnocellular mediodorsal thalamus (MDmc) is essential for arbitrating between perceptions and action policies. We assessed belief updating in a three -choice probabilistic reversal learning task following excitotoxic lesions of the MDmc ( n = 3) or OFC ( n = 3) and compared performance with that of unoperated monkeys ( n = 14). Computational analyses indicated a double dissociation: MDmc, but not OFC, lesions were associated with erratic switching behavior and heightened volatility belief (as in paranoia in humans), whereas OFC, but not MDmc, lesions were associated with increased lose -stay behavior and reward learning rates. Given the consilience across species and models, these results have implications for understanding paranoia.
Successful interaction with complex, changing environments requires discriminating between levels (or sources) of uncertainty to tune the balance between reliance on previous beliefs and incoming sensory information. A critical aspect of cognition is adaptive learning, whereby learning rate increases in volatile scenarios to promote adaptation to the new context. Evidence indicates that the hippocampus plays a central role in processing uncertainty and predictability. This study employs recordings with optically pumped magnetometer magnetoencephalography to track the involvement of the hippocampus, as well as sensory and prefrontal areas on a probabilistic task with volatile contingencies. Learning through different levels of uncertainty was modelled with a hierarchical Gaussian filter, from which trial-by-trial estimates of inference and uncertainty could be obtained. Increased gamma activity was observed in relation to phasic and tonic volatility in hippocampus and other regions of interest (with differences in pattern), suggesting enhancement of bottom-up processing to promote learning in dynamic contexts. Conversely, estimation uncertainty drove gamma suppression in several areas, whereas conditional entropy (largely determining expected uncertainty about the environment's probabilistic structure) showed no modulatory effect except in the anterior cingulate cortex. A possible role of pre-stimulus hippocampal ripples was suggested in increasing bottom-up sensory transmission of stimuli with high informational gain. All in all, results are consistent with predictive processing accounts of adaptation to different levels of uncertainty.