Precision-Weighted Predictive Coding with Adaptive Re-entrant Inference in Neural Networks
Capabilities
- 01 / 06
Content-Dependent Precision Estimation Module
Per-token computed in each processing unit.
- 02 / 06
Re-entrant Predictive Coding Inference Loop
After a bottom-up pass, iterates top-down prediction and error correction with convergence test (, , ).
- 03 / 06
Analytical Precision Learning
Closed-form gradient , clamped to , giving without autodiff.
- 04 / 06
Conflict-Driven Adaptive Depth
Conflict = variance of unit mean outputs; if above , .
- 05 / 06
Precision-Weighted Prediction Error Loss
, the Gaussian negative log-likelihood; optimal equals mean squared error.
- 06 / 06
Non-Zero Initialisation
sampled from so precision varies with content from the first forward pass.
Abstract
This document describes a system and method for precision-weighted predictive coding in hierarchical neural networks, wherein each processing unit in a multi-level hierarchy generates both a prediction of its input and a content-dependent precision estimate () quantifying the certainty of said prediction. The precision estimate is computed by a learned linear transformation () applied to the normalised hidden state, passed through a positivity-preserving softplus activation, yielding a per-token, per-level scalar that varies with input content. The system implements depth-scaled initialisation of precision parameters following cortical maturation gradients, wherein shallow processing units begin with lower initial uncertainty than deep processing units. A multi-scale precision band architecture partitions the processing hierarchy into token-level, phrase-level, sentence-level, and discourse-level bands, each feeding distinct downstream subsystems. The system further comprises a re-entrant predictive coding inference loop that iteratively refines representations through top-down prediction and bottom-up error correction under a gradient-free regime, with conflict-driven adaptive depth control that allocates additional inference iterations when inter-unit disagreement exceeds a threshold. All precision parameters are learned via analytical derivative computation without automatic differentiation, using closed-form expressions for the gradient of a precision-weighted prediction error loss through the softplus nonlinearity.
Status
Open research. This document was first drafted in the form of a patent specification, which is why it speaks of an invention and of claims. No patent application was filed and the lab does not intend to file one: where the text mentions a related or co-pending patent application, it means a companion document in this set, and none of them was filed. The work is published here as open research.
1. Field
The present invention relates generally to the field of artificial neural networks and machine learning systems. More particularly, the invention relates to systems and methods for uncertainty estimation and predictive coding in hierarchical neural network architectures, including methods for computing content-dependent precision weights, depth-scaled initialisation thereof, multi-scale precision band organisation, iterative re-entrant inference with adaptive computational depth, and analytical learning rules for precision parameters without automatic differentiation.
2. Background
Prior Art in Neural Network Uncertainty
Contemporary deep neural networks, including transformer-based language models as described by Vaswani et al. (2017), produce point estimates without any measure of certainty or uncertainty associated with their predictions. When a transformer model produces a next-token probability distribution, there is no mechanism by which the model internally represents how confident it is in that distribution, nor can different layers of the model communicate their respective levels of certainty to one another.
This absence of uncertainty estimation creates several fundamental limitations:
Uniform treatment of predictions. All predictions from all layers are treated with equal weight regardless of whether the model is processing familiar or novel content. A layer processing a common grammatical pattern and a layer processing a rare technical term contribute identically to downstream computation.
Fixed computational depth. Standard neural networks apply the same number of processing steps to every input regardless of difficulty. An unambiguous sentence and a deeply ambiguous sentence receive identical computational resources.
No per-token precision. Existing approaches that attempt uncertainty estimation, such as Monte Carlo dropout (Gal & Ghahramani, 2016) or deep ensembles (Lakshminarayanan et al., 2017), compute uncertainty as a post-hoc aggregate over the entire model output rather than as an intrinsic per-token, per-layer signal available during forward computation.
No depth-dependent initialisation. In all known neural network architectures, uncertainty parameters (when present) are initialised uniformly across all layers. There is no mechanism by which shallow layers, which process lower-level features, begin with different uncertainty characteristics than deep layers, which process higher-level abstractions.
Prior Art in Predictive Coding
Rao and Ballard (1999) introduced predictive coding as a computational theory of visual cortex processing, wherein each cortical area generates predictions of the activity in the area below and computes prediction errors. Friston (2005) generalised this into the free energy principle, proposing that the brain minimises a variational free energy bound.
However, existing computational implementations of predictive coding for artificial neural networks suffer from several deficiencies:
Constant precision. Prior implementations of predictive coding in neural networks use a fixed, scalar precision term that does not vary with input content. The precision is either a global hyperparameter or a per-layer constant that is the same for every token in a sequence.
No multi-scale organisation. Prior predictive coding implementations treat all levels of the hierarchy identically with respect to temporal scale. There is no mechanism by which different bands of the hierarchy specialise for different temporal receptive fields (token-level versus discourse-level).
Fixed inference depth. Prior predictive coding implementations run a fixed number of inference iterations regardless of the difficulty or ambiguity of the input, wasting computation on easy inputs and under-allocating on difficult inputs.
Reliance on automatic differentiation. Prior implementations of learned precision parameters require backpropagation through the computational graph, which conflicts with the local learning principle of predictive coding and incurs substantial memory overhead from storing activations for the backward pass.
Need for the Present Invention
There exists a need for a neural network architecture that:
computes content-dependent precision estimates that vary with input;
initialises precision parameters with a depth-dependent gradient reflecting the principle that shallow processing units should start less uncertain than deep ones;
organises precision into multi-scale bands aligned with different temporal receptive fields;
employs iterative re-entrant inference whose depth adapts to input difficulty;
learns all precision parameters via analytical derivatives without automatic differentiation.
The present invention addresses all of the foregoing limitations.
3. Summary
The present invention provides a system and method for precision-weighted predictive coding with adaptive re-entrant inference in hierarchical neural networks. The invention comprises six interrelated innovations that collectively enable content-dependent uncertainty estimation, biologically-informed initialisation, multi-scale precision organisation, adaptive inference depth, and autograd-free precision learning.
Content-Dependent Precision Estimation
A first aspect of the invention provides a precision estimation module within each processing unit of a hierarchical neural network. Unlike prior art systems that employ a fixed or constant precision value, the present invention computes a content-dependent precision estimate for each token at each hierarchical level by applying a learned linear transformation to the normalised hidden state:
where is the hidden state of the processing unit, is root-mean-square layer normalisation, is a bias term, is a positivity-preserving activation function, and is a small constant (e.g., ) preventing numerical degeneracy. The weight matrix is initialised with small non-zero random values (standard deviation ), ensuring that is content-dependent from the first forward pass. A zero-initialised would render equal to for all inputs, a constant precision, analogous to the neurological condition of anosognosia wherein a patient cannot distinguish between states of certainty and uncertainty.
Depth-Scaled Precision Initialisation
A second aspect of the invention provides a depth-dependent initialisation scheme for the precision bias term . For a hierarchy of processing units indexed , the initial precision value for unit is:
where is a base initial precision (e.g., 1.0) and is a depth scaling factor (e.g., 1.0). The bias is then set to . This produces a monotonically increasing initial uncertainty from shallow to deep units, reflecting the empirically observed cortical maturation gradient (Huttenlocher, 1990): primary sensory areas mature earlier and operate with lower initial uncertainty, while associative areas mature later and begin with greater uncertainty.
Multi-Scale Precision Bands
A third aspect of the invention organises the processing units into four precision bands, each specialising for a different temporal receptive field:
Token band (units to ): , precision over individual tokens.
Phrase band (units to ): , precision over local phrases.
Sentence band (units to ): , precision over sentence-level context.
Discourse band (units to ): , precision over discourse-level coherence.
where . Each band’s aggregate precision feeds a distinct downstream subsystem: the token band informs local prediction, the sentence band modulates episodic memory encoding, and the discourse band guides global workspace broadcasting. This multi-scale organisation mirrors the hierarchy of temporal receptive fields observed in the human cortex (Hasson et al., 2008).
Re-entrant Predictive Coding Inference
A fourth aspect of the invention provides an iterative re-entrant inference loop that refines representations through top-down prediction and bottom-up error correction. After an initial bottom-up pass through the hierarchy, the system performs additional inference iterations (where ranges from a configurable minimum to a configurable maximum), each comprising:
top-down prediction generation from each unit to the unit below;
bottom-up error computation: ;
re-computation of lateral and global workspace signals;
convergence testing: .
All inference iterations execute under a gradient-free regime (no computational graph is constructed), consistent with the biological principle that inference (perception) and learning (synaptic modification) are separate processes.
Conflict-Driven Adaptive Depth
A fifth aspect of the invention provides an adaptive depth mechanism that allocates additional inference iterations based on inter-unit conflict. A metacognitive monitoring module computes the variance across the output representations of all processing units:
where is the mean output of unit across the batch and sequence dimensions. When exceeds a conflict threshold , additional inference steps are allocated:
This implements a form of metacognitive resource allocation: the system “thinks harder” when its processing units disagree, analogous to the function of the anterior cingulate cortex in conflict monitoring (Botvinick et al., 2001). Removal of this mechanism yields a system that applies uniform computation to all inputs regardless of difficulty, analogous to the neurological condition of anosognosia.
Analytical Precision Learning
A sixth aspect of the invention provides a method for updating the precision parameters and using analytically derived gradients, without invoking automatic differentiation. The precision-weighted prediction error loss for a single level is:
The derivative with respect to is:
The chain rule through the softplus activation yields the derivative with respect to the pre-activation :
where is the derivative of softplus. The weight update is then:
All computations are performed under a no-gradient regime, eliminating the memory overhead of storing activations for backpropagation and reducing the computational cost of the learning step.
4. Detailed Description
The following detailed description, taken in conjunction with the accompanying drawings, describes preferred embodiments of the present invention. It is to be understood that the invention is not limited to these specific embodiments but extends to all alternatives, modifications, and equivalents as defined by the appended claims.
System Overview
Referring to Figure 1, the system of the present invention comprises a hierarchical neural network (100) having a plurality of processing units (110-1, 110-2, …, 110-N) arranged in a feedforward hierarchy. Each processing unit receives input from the unit below and produces output for the unit above. In a preferred embodiment, the processing units are cortical column modules as described in a co-pending patent application by the same applicant. However, the precision-weighted predictive coding system described herein is applicable to any hierarchical neural network architecture, including transformer layers, recurrent modules, or convolutional stages.
The system further comprises:
a precision estimation module (120) within each processing unit;
a prediction generation module (130) within each processing unit;
a re-entrant inference controller (140) that orchestrates iterative refinement;
a conflict detection module (150) that monitors inter-unit agreement;
an analytical precision learning module (160) that updates precision parameters.
Precision Estimation Module
Referring to Figure 2, the precision estimation module (120) resides within each processing unit (110-) and computes a per-token precision estimate for each position in the input sequence.
Architecture
The precision estimation module comprises:
A normalisation layer (121), specifically a root-mean-square normalisation (RMSNorm) operation, that normalises the hidden state to produce .
A learned linear projection (122), denoted with bias , that maps the normalised hidden state to a scalar pre-activation:
A positivity-preserving activation (123), specifically the softplus function , that ensures the output is strictly positive:
where prevents numerical degeneracy.
Initialisation of the Weight Matrix
The weight matrix is initialised by sampling from a zero-mean Gaussian distribution with standard deviation :
This non-zero initialisation is critical. If were initialised to zero, the precision estimate would reduce to for all inputs, rendering precision content-independent. The small but non-zero initialisation ensures that different hidden states produce different precision values from the first forward pass, enabling the system to distinguish between inputs it finds familiar (low ) and inputs it finds novel (high ).
Depth-Scaled Bias Initialisation
The bias term is initialised differently for each processing unit in the hierarchy. For unit in a hierarchy of units:
In a preferred embodiment, and , yielding:
Unit 0 (shallowest): ,
Unit (deepest): ,
This depth-dependent initialisation reflects the principle that shallow processing units, which operate on lower-level features (analogous to primary sensory cortex), should begin with lower uncertainty, while deep processing units, which operate on higher-level abstractions (analogous to prefrontal cortex), should begin with higher uncertainty. This mirrors the empirically observed cortical maturation timeline described by Huttenlocher (1990), wherein primary sensory areas achieve adult-level synaptic density before associative areas.
Sigma-Squared Adaptive Dendritic Modulation
In a preferred embodiment, the precision estimate from a preceding processing unit is used to modulate the dendritic computation of the current processing unit. A linear projection maps the preceding unit’s into the feedforward dimension, where it additively modulates the dendritic gate logit:
This enables a processing unit to adjust its computation based on how certain the preceding unit is, high preceding uncertainty loosens the dendritic gate, allowing more information through; low preceding uncertainty tightens it.
Multi-Scale Precision Bands
Referring to Figure 3, the processing units of the hierarchy are organised into four precision bands, each corresponding to a different temporal receptive field:
| Band | Units | Temporal Scale |
|---|---|---|
| Token | to | Individual token features |
| Phrase | to | Local phrase structure |
| Sentence | to | Sentence-level context |
| Discourse | to | Discourse-level coherence |
The aggregate precision for each band is the mean across all units in that band:
Each band’s aggregate precision feeds a distinct downstream subsystem:
The token band precision modulates local next-token prediction confidence, influencing how strongly the model’s immediate prediction is weighted.
The phrase band precision modulates lateral column communication, controlling the strength of horizontal information flow between processing units.
The sentence band precision modulates episodic memory encoding thresholds, determining which representations are sufficiently surprising (high ) or sufficiently certain (low ) to be committed to episodic memory.
The discourse band precision modulates global workspace broadcasting, controlling which processing units gain access to the shared global workspace based on their discourse-level certainty.
In a preferred embodiment with processing units, , yielding bands of 3 units each.
Prediction Generation Module
Each processing unit (110-) contains a prediction generation module (130) comprising a learned linear projection:
where maps the normalised hidden state to the inter-unit dimension. This prediction represents unit ’s expectation of the input it will receive from unit (or from the embedding layer for unit 0).
is initialised to zero, meaning that at initialisation no unit generates any prediction. This ensures that prediction errors are maximal at the start of training, driving rapid initial learning.
The prediction error at each level is:
where is the actual output of unit (detached from the computational graph) for , or the embedding output for .
Precision-Weighted Prediction Error Loss
The precision-weighted prediction error loss for a single level is:
This loss has a natural Bayesian interpretation as the negative log-likelihood of a Gaussian distribution with mean equal to the prediction and variance equal to . The first term penalises large prediction errors, weighted inversely by precision. The second term penalises over-confidence (low when errors are large), preventing the trivial solution of setting to minimise the first term.
The total predictive coding loss across all levels is:
At equilibrium, the optimal for each level equals the mean squared prediction error at that level:
This means the precision naturally calibrates itself: levels with large errors develop high (low precision, low influence), while levels with small errors develop low (high precision, high influence).
Re-entrant Predictive Coding Inference Loop
Referring to Figure 4, the re-entrant inference controller (140) orchestrates an iterative refinement process after the initial bottom-up forward pass.
Initial Bottom-Up Pass
The initial bottom-up pass propagates input through all processing units sequentially:
where denotes the forward function of unit . During this pass, each unit produces:
an output for the next unit;
a prediction of its input from the unit below;
a precision estimate of its prediction certainty.
Prediction Error Computation
After the bottom-up pass, prediction errors are computed for all levels:
Re-entrant Iterations
The system then performs up to additional inference iterations (one pass having already been completed). Each iteration proceeds as follows:
Top-down context assembly. For each unit , a top-down context signal is assembled from:
the global workspace modulation signal;
the lateral inter-unit communication signal;
the prediction from unit (for ).
Forward pass with top-down context. Each unit re-processes its input with both the bottom-up input (routed through a thalamic relay module) and the assembled top-down context:
Error recomputation. Prediction errors are recomputed with the updated representations.
Lateral and workspace recomputation. Lateral inter-unit signals and global workspace broadcast signals are recomputed from the updated outputs and errors.
Convergence test. The total squared error is compared to the previous iteration:
If and , the iteration terminates.
In a preferred embodiment, , , and .
Gradient-Free Inference
A critical aspect of the re-entrant inference loop is that all iterations after the initial bottom-up pass execute under a gradient-free regime (e.g., torch.no_grad() in PyTorch). No computational graph is constructed during inference iterations. This has two important consequences:
Memory efficiency. No intermediate activations are stored for backpropagation, reducing memory consumption by approximately the factor of inference iterations.
Biological plausibility. Inference (representation settling) and learning (synaptic modification) are separated, consistent with the biological principle that neural computation and synaptic plasticity operate on different timescales.
Conflict-Driven Adaptive Depth
Referring to Figure 5, the conflict detection module (150) implements a metacognitive monitoring function that adjusts the number of inference iterations based on the degree of inter-unit disagreement.
Conflict Computation
The conflict score is computed as the variance of the mean output representations across all processing units:
where is the batch size, is the sequence length, is the representation dimension, and denotes variance across the processing units.
Adaptive Step Allocation
The number of extra inference steps is computed as:
The total maximum inference steps becomes .
In a preferred embodiment, and , meaning the system can allocate up to 2 additional inference iterations (for a total of 7) when processing highly ambiguous or conflicting inputs.
Health Monitoring
The conflict detection module further maintains exponential moving averages of per-unit and convergence rates:
where is a slow averaging coefficient. The module monitors for:
Precision divergence: (e.g., 100.0), indicating the unit’s uncertainty is growing without bound. Corrective action: scale down the unit’s output weights.
Precision collapse: (e.g., 0.001), indicating the unit has become pathologically overconfident. Corrective action: increase the bias .
Persistent non-convergence: convergence rate exceeding 0.8, indicating the inference loop consistently hits the maximum step count.
Analytical Precision Learning
Referring to Figure 6, the analytical precision learning module (160) updates the precision parameters and using closed-form gradient expressions, without invoking automatic differentiation.
Derivation of the Analytical Gradient
Starting from the precision-weighted loss (Equation 22):
Step 1: Derivative with respect to .
Note that the error norm is computed as the mean squared error across the model dimension (i.e., ) to ensure the gradient magnitude is independent of the dimensionality .
Step 2: Chain rule through softplus.
Since and :
The sigmoid value is clamped to to prevent numerical instability at extreme pre-activations.
Step 3: Outer product for weight gradient.
Since :
where is the total number of tokens.
Computational Form
In matrix notation, let denote the flattened pre-activations and denote the flattened normalised hidden states. The updates are:
where is the vector of per-token gradient scalars .
The gradient norm is clipped to a maximum value (e.g., 1.0) to prevent destabilising updates. The weight update is then:
where is the learning rate, optionally modulated by a neuromodulatory plasticity gate.
Advantages Over Automatic Differentiation
The analytical gradient computation offers the following advantages:
No activation storage. Automatic differentiation requires storing all intermediate activations for the backward pass. The analytical method requires only the pre-activation (cached from the forward pass), the hidden state (already available), the prediction error , and the current value.
Reduced computational cost. The gradient computation requires two matrix multiplications (one for the weight gradient, one for the bias gradient) and element-wise operations on vectors of length , versus the full backward pass through the softplus, linear projection, and normalisation layers.
Compatibility with no-gradient inference. Since the inference loop runs without gradient tracking, the precision parameters can be updated immediately after inference settles, without requiring a separate backward pass.
Numerical stability. The analytical form allows explicit clamping of intermediate quantities (sigmoid clamping, precision floor) at precise points in the computation, providing finer control over numerical stability than automatic differentiation.
Prediction Weight Update
The prediction generation weights are updated via a similar analytical rule. The gradient of the precision-weighted loss with respect to is:
where denotes element-wise division of the prediction error by the precision, broadcasting the scalar across the model dimension. This is a precision-weighted outer product: predictions from high-precision (low ) units receive larger gradient updates, accelerating learning where the unit is confident, and smaller updates where the unit is uncertain.
Integration with Hierarchical Neural Network
In a preferred embodiment, the precision-weighted predictive coding system is integrated into a hierarchical neural network as follows:
Embedding. Input tokens are converted to continuous representations via an embedding module.
Bottom-up pass. The embedded input propagates through all processing units. Each unit produces an output, a prediction, and a precision estimate. The precision from unit is passed to unit ’s dendritic modulation.
Prediction error computation. Top-down predictions are compared against bottom-up targets at each level.
Conflict assessment. The metacognitive module computes inter-unit conflict and determines the number of additional inference steps.
Re-entrant inference. The system iterates, refining representations through top-down predictions and bottom-up error correction, until convergence or the maximum step count.
Output generation. The final representation from the top of the hierarchy is passed through a language model head to produce a probability distribution over the vocabulary.
Precision learning. After the forward pass, the analytical precision learning module updates , , and for each processing unit using the cached errors, precisions, and hidden states.
The precision estimates from different bands feed into downstream subsystems:
The sentence-band modulates the episodic memory encoding threshold, controlling which experiences are stored.
The discourse-band modulates global workspace access, controlling which units broadcast to the shared workspace.
The aggregate across all units feeds into the neuromodulatory brainstem module, where it influences dopamine, norepinephrine, serotonin, and acetylcholine production levels.
Embodiment Parameters
Table 1 lists the configurable parameters of a preferred embodiment.
| Parameter | Value | Description |
|---|---|---|
| 1.0 | Base initial precision | |
| 1.0 | Depth scaling factor | |
| 0.01 | Weight init standard deviation | |
| 2 | Minimum inference steps | |
| 5 | Maximum inference steps (before adaptive) | |
| 0.01 | Convergence threshold | |
| 0.5 | Conflict threshold | |
| 2 | Maximum additional adaptive steps | |
| PC learning rate | ||
| 100.0 | Precision divergence threshold | |
| 0.001 | Precision collapse threshold | |
| Numerical stability constant |
5. Description of the Figures
The accompanying drawings, which are incorporated herein and constitute a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
is a system block diagram showing the overall architecture of the precision-weighted predictive coding system (Claim 1), including the hierarchical arrangement of processing units with precision estimation modules, prediction generation modules, the re-entrant inference controller, the conflict detection module, and the analytical precision learning module.
is a diagram showing the multi-scale precision band organisation, with the processing units divided into four bands (token, phrase, sentence, discourse) and arrows showing how each band’s aggregate precision feeds a distinct downstream subsystem.
is a computational graph of the analytical precision learning module, showing the step-by-step derivation from the precision-weighted loss through the derivative with respect to , the chain rule through softplus (yielding the sigmoid factor), and the outer product with the normalised hidden state to produce the weight gradient and bias gradient .
is a detailed system block diagram of the complete precision-weighted predictive coding system (Claim 1), showing (a) hierarchical processing units, (b) precision estimation pipeline, (c) prediction generation, (d) re-entrant inference controller, (e) conflict detection module, and (f) analytical precision learning module.
is a detailed block diagram of the depth-dependent bias initialisation (Claim 2), showing the initialisation formula and resulting bias values across the hierarchy.
is a diagram of the multi-scale precision band organisation (Claim 3), showing four bands (token, phrase, sentence, discourse) with downstream routing.
is a timeline diagram of the re-entrant inference iteration control (Claim 4), showing mandatory iterations, convergence testing, and extra conflict-allocated iterations.
is a diagram of the conflict score computation and adaptive step allocation (Claim 5), showing inter-unit variance computation and determination.
is a computational graph of the analytical precision learning (Claim 6), showing the four-step closed-form gradient derivation.
is a diagram of the dendritic modulation mechanism (Claim 7), showing how from a preceding unit modulates the dendritic gate of the current unit.
is a diagram of the precision health monitoring system (Claim 8), showing EMA tracking, divergence detection, collapse detection, and persistent non-convergence monitoring.
is a complete method flowchart of the PWPC inference method (Claim 9), showing all steps from bottom-up pass through analytical gradient update.
is a bar chart of the depth-dependent bias initialisation (Claim 10), showing values across a hierarchy of processing units.
is a diagram of precision band routing to downstream subsystems (Claim 11), showing sentence-band routing to episodic memory and discourse-band routing to global workspace.
is a state machine diagram of the re-entrant iteration control (Claim 12), showing the MANDATORY, TEST, EXTRA, and SETTLED states.
is a detailed four-step pipeline of the analytical gradient computation (Claim 13), showing mean squared error, derivative w.r.t. , sigmoid clamping, and outer product averaging.
is a diagram of the precision-weighted prediction update (Claim 14), contrasting high-precision and low-precision units to illustrate how acts as a per-unit adaptive learning rate.
is a chain diagram of inter-unit precision propagation (Claim 15), showing how propagates through the hierarchy modulating dendritic gates.
is a block diagram of the complete PWPC computer-readable medium instruction set (Claim 16), showing all stored instructions from instantiation through band routing.
is a diagram of the four precision bands with mean aggregation (Claim 17), showing example values and aggregates for units.
is a diagram of the EMA precision monitoring and corrective actions (Claim 18), showing divergence and collapse detection with time-series graphs.
is a side-by-side comparison diagram of the gradient-free inference regime (Claim 19), contrasting standard autodiff memory usage with the gradient-free approach.
is a diagram of the depth-dependent initialisation boundary values (Claim 20), showing the linear interpolation from at the shallowest unit to at the deepest unit.
Note: The drawings described above are schematic representations of the system architecture and data flow. Actual implementation may vary in specific arrangement and connectivity without departing from the scope of the invention.
6. Figures
7. Claim Illustration Sheets
Note: In the actual patent filing, each figure described above shall be provided as a separate drawing sheet conforming to Rule 15 of the Patents Rules, 2003. The drawings are schematic representations of the system architecture, data flow, and computational methods. Actual implementation may vary in specific arrangement and connectivity without departing from the scope of the invention.
8. Claims
We claim:
Claim 1
A precision-weighted predictive coding system for a hierarchical neural network, the system comprising:
a plurality of processing units arranged in a feedforward hierarchy, each processing unit configured to receive an input representation and produce an output representation;
a precision estimation module within each processing unit, comprising:
a normalisation layer configured to normalise the hidden state of the processing unit;
a learned linear projection having a weight matrix and a bias term , configured to map the normalised hidden state to a scalar pre-activation value; and
a positivity-preserving activation function, specifically a softplus function, configured to transform the scalar pre-activation into a per-token precision estimate that is strictly positive
wherein the weight matrix is initialised with non-zero random values such that the precision estimate varies with input content from the first forward pass;
a prediction generation module within each processing unit, comprising a learned linear projection configured to generate a top-down prediction of the input to the next lower processing unit in the hierarchy;
a re-entrant inference controller configured to iteratively refine the representations of the processing units by:
assembling a top-down context signal for each processing unit from predictions of higher units;
re-processing each processing unit with the assembled top-down context under a gradient-free computational regime; and
testing for convergence by computing a relative change in total prediction error across the hierarchy;
a conflict detection module configured to compute a conflict score as the variance of mean output representations across the processing units, and to allocate additional inference iterations to the re-entrant inference controller when the conflict score exceeds a predetermined threshold; and
an analytical precision learning module configured to update the weight matrix and bias of each precision estimation module using closed-form gradient expressions derived from a precision-weighted prediction error loss, without invoking automatic differentiation.
Claim 2
The system of Claim 1, wherein the bias term of each precision estimation module is initialised according to a depth-dependent initialisation scheme, such that for a processing unit at index in a hierarchy of units:
wherein is a base initial precision value and is a depth scaling factor, such that shallow processing units are initialised with lower uncertainty than deep processing units.
Claim 3
The system of Claim 1, wherein the plurality of processing units are organised into a plurality of precision bands, each precision band corresponding to a different temporal receptive field scale, comprising:
a token band comprising shallow processing units, whose aggregate precision modulates local next-token prediction;
a phrase band comprising intermediate-shallow processing units, whose aggregate precision modulates lateral inter-unit communication;
a sentence band comprising intermediate-deep processing units, whose aggregate precision modulates episodic memory encoding thresholds; and
a discourse band comprising deep processing units, whose aggregate precision modulates global workspace broadcasting access.
Claim 4
The system of Claim 1, wherein the re-entrant inference controller is configured to:
perform a minimum of inference iterations before testing for convergence;
terminate inference iterations when a relative change in total prediction error falls below a convergence threshold ; and
enforce a maximum of inference iterations, where is determined by the conflict detection module.
Claim 5
The system of Claim 1, wherein the conflict detection module computes the conflict score as:
where is the mean output of processing unit across batch and sequence dimensions, and allocates extra inference steps according to:
where is the conflict threshold and is the maximum number of additional steps.
Claim 6
The system of Claim 1, wherein the analytical precision learning module computes the gradient of the precision-weighted prediction error loss with respect to the pre-activation as:
and updates the weight matrix as:
where is the matrix of normalised hidden states, is the prediction error, is the current precision estimate, and is the derivative of the softplus function.
Claim 7
The system of Claim 1, further comprising a dendritic modulation mechanism within each processing unit, wherein the precision estimate from a preceding processing unit modulates the dendritic gate logit of the current processing unit via a learned linear projection, such that high preceding uncertainty loosens the dendritic gate and low preceding uncertainty tightens it.
Claim 8
The system of Claim 1, wherein the conflict detection module further maintains exponential moving averages of per-unit precision estimates and monitors for:
precision divergence, wherein a unit’s exponential moving average of exceeds an upper threshold, triggering scaling of the unit’s output weights;
precision collapse, wherein a unit’s exponential moving average of falls below a lower threshold, triggering an increase in the unit’s bias term ; and
persistent non-convergence, wherein the inference loop consistently reaches the maximum step count.
Claim 9
A method for performing precision-weighted predictive coding inference in a hierarchical neural network comprising a plurality of processing units, the method comprising:
performing an initial bottom-up pass through the plurality of processing units, wherein each processing unit:
computes an output representation from its input;
generates a top-down prediction of the input to the next lower processing unit via a learned linear projection ; and
computes a content-dependent precision estimate by applying a learned linear projection to a normalised hidden state and passing the result through a softplus activation function, wherein the weight matrix is initialised with non-zero random values;
computing prediction errors at each level of the hierarchy as the difference between actual inputs and generated predictions;
computing a conflict score as the variance of mean output representations across the processing units;
determining a number of additional inference iterations based on whether the conflict score exceeds a predetermined threshold;
performing a plurality of re-entrant inference iterations under a gradient-free computational regime, each iteration comprising:
assembling a top-down context signal for each processing unit;
re-processing each processing unit with both bottom-up input and the top-down context signal;
recomputing prediction errors; and
testing for convergence based on relative change in total prediction error;
computing analytical gradients of a precision-weighted prediction error loss with respect to the parameters and without invoking automatic differentiation, using the closed-form expression:
where is the pre-activation, is the prediction error, and ; and
updating and using the computed analytical gradients.
Claim 10
The method of Claim 9, further comprising initialising the bias term of each processing unit according to a depth-dependent scheme wherein shallow processing units receive a lower initial bias value corresponding to lower initial uncertainty and deep processing units receive a higher initial bias value corresponding to higher initial uncertainty, according to:
where is the index of the processing unit in the hierarchy and is the total number of processing units.
Claim 11
The method of Claim 9, further comprising organising the plurality of processing units into a plurality of precision bands and routing the aggregate precision of each band to a distinct downstream subsystem, wherein:
a sentence-level precision band modulates a threshold for episodic memory encoding; and
a discourse-level precision band modulates access to a global workspace broadcasting mechanism.
Claim 12
The method of Claim 9, wherein performing the plurality of re-entrant inference iterations comprises:
performing at least iterations before evaluating the convergence criterion;
terminating iterations when the relative change in total prediction error falls below a threshold ; and
limiting the total number of iterations to , where is determined by the conflict score.
Claim 13
The method of Claim 9, wherein computing the analytical gradients comprises:
computing the mean squared prediction error as the mean over the model dimension to ensure gradient scale invariance with respect to model dimensionality;
computing the derivative of the loss with respect to as ;
multiplying by , clamped to the interval , to obtain the derivative with respect to the pre-activation; and
computing the weight gradient as the outer product of the per-token gradient scalars with the normalised hidden states, averaged over all tokens.
Claim 14
The method of Claim 9, further comprising updating the prediction weights of each processing unit via an analytical precision-weighted gradient:
wherein predictions from high-precision units receive proportionally larger gradient updates than predictions from low-precision units.
Claim 15
The method of Claim 9, further comprising passing the precision estimate from each processing unit to the next processing unit in the hierarchy, wherein the precision estimate modulates a dendritic gate of the receiving processing unit via a learned linear projection, enabling computation to adapt based on the certainty of the preceding unit.
Claim 16
A non-transitory computer-readable medium storing instructions that, when executed by one or more processors, cause the one or more processors to:
instantiate a hierarchical neural network comprising a plurality of processing units, each processing unit including:
a precision estimation module comprising a learned linear projection with non-zero initialised weights and a softplus activation, configured to compute a content-dependent per-token precision estimate ; and
a prediction generation module comprising a learned linear projection configured to generate top-down predictions;
wherein the bias term of each precision estimation module is initialised according to a depth-dependent scheme producing monotonically increasing initial uncertainty from shallow to deep processing units;
perform a bottom-up forward pass through the processing units, computing output representations, predictions, and precision estimates;
compute prediction errors at each hierarchical level;
compute a conflict score based on inter-unit output variance and determine additional inference iterations;
perform re-entrant inference iterations under a gradient-free regime, refining representations through top-down prediction and bottom-up error correction, until convergence or a maximum step count;
update the precision parameters and using analytical gradient expressions computed as:
without constructing or traversing an automatic differentiation graph; and
route aggregate precision values from different hierarchical bands to distinct downstream subsystems, including episodic memory encoding and global workspace broadcasting.
Claim 17
The non-transitory computer-readable medium of Claim 16, wherein the instructions further cause the one or more processors to organise the processing units into four precision bands corresponding to token-level, phrase-level, sentence-level, and discourse-level temporal receptive fields, wherein each band’s aggregate precision is computed as the mean across all units in that band.
Claim 18
The non-transitory computer-readable medium of Claim 16, wherein the instructions further cause the one or more processors to maintain exponential moving averages of per-unit precision estimates and to take corrective action when a unit’s precision diverges above an upper threshold or collapses below a lower threshold.
Claim 19
The non-transitory computer-readable medium of Claim 16, wherein the gradient-free regime for re-entrant inference iterations comprises executing all computations within the iterative loop without constructing a computational graph for automatic differentiation, such that no intermediate activations are stored for a backward pass during the inference iterations.
Claim 20
The non-transitory computer-readable medium of Claim 16, wherein the depth-dependent initialisation scheme sets the initial precision value for processing unit in a hierarchy of units to:
such that the shallowest processing unit has initial precision and the deepest processing unit has initial precision .
License
PolyForm Noncommercial License 1.0.0This work is open research. Free for any noncommercial use: research, education, personal projects, evaluation, and nonprofit or public-sector use. Commercial use requires a separate license, available by contacting krrish@verace.in.