Recognition Dynamics of the Brian in the Free Energy Principle

We formulate the computational processes of perception in the framework of the principle of least action by postulating the theoretical action being time-integral of the free energy in the brain sciences. The free energy principle is accordingly rephrased as that for autopoietic reasons all viable organisms attempt to minimize the sensory uncertainty about the unpredictable environment over a temporal horizon. By varying the informational action, we derive the brain's recognition dynamics which conducts the adaptive inference of the external causes of sensory data with addressing only canonical positions and momenta of the brain's representations of the dynamical world. To manifest the utility of our theory, we provide how the neural computation may be implemented biophysically at a single-cell level and subsequently be scaled up to a large-scale functional architecture of the brain. We also present formal solutions to the recognition dynamics for a model brain in linear regime and analyze the perceptual trajectories about fixed points in state space.


Introduction
The quest for a universal principle that may explain the cognitive and behavioral opeation of the brain is of a great scientific interest. The obvious difficulty in addressing the quest is the gap between the information processing and the biophysics that governs neurophysiology in the brain. However, it is evident that the matter, which is the ground-stuff upon which the brain functions emerge, comprises neurons obeying the laws guided by the physics principles. Thus, any biological principles that attempt to explain the brain's large-scale workings must cope with our accepted physical reality [1]. It appears that on the current approaches still prevails the classical, effective epistemology of regrading perceptions as constructing hypotheses which may hit upon truth by producing symbolic structures matching physical reality [2,3,4].
One influential candidate at present that seeks for such a rubric in neuroscience is the free energy principle (FEP) [5,6,7]. For a technical appraisal of the FEP we refer to [8] where the theoretical assumptions and the mathematical structure involved in the FEP are reviewed in detail, and also the extended references are presented. In layman's terms the FEP states that all viable organisms perceive and act on their external world by manipulating their internal states in a way to ensure their adaptive fitness or autopoiesis [9]. The biological mechanism that endows the brain with the operation is theoretically framed into an information-theoretic measure, called the 'informational free energy (IFE)'. According to the FEP, a living system tries to minimize the sensory surprisal when it faces with an external cause that perturbs its spontaneous equilibrium within its physiological boundary by pursuing perceptive as well as active inferences. However, the brain does not preside over instreaming sensory distribution; accordingly the brain cannot directly minimize the sensory surprisal but, instead, minimize its upper bound, the IFE. The probabilistic rationale of the FEP argues that the brain's representations of the uncertain external world are the sufficient statistics, e.g. means or variances, of an arbitrary probability density encoded in the brain. The variational parameters are supposed to be encoded as physical variables in the brain. The brain statistically infers the external causes of sensory input by Bayesian inversion using its internal top-down model about predicting, or generating, the sensory data. There are growing experimental support of the brain's maintaining internal models of the environment in oder to predict sensory inputs and to prepare actions [10]. The computational operation of the adaptive inference is subserved by the brain variables and the resulting perceptual mechanics is termed as the 'recognition dynamics (RD)'.
Although the suggestion of the FEP has been promising to account for the brain's inferring mechanism of and acting upon sensory causes, we find certain theoretical as well as mathematical subtleties in the conventional formulation: First, the FEP minimizes the IFE at each point in time for all successive sensory inputs [11]. However, precisely the objective function to be minimized is the continuously accumulated IFE over a finite time ;. The minimization must be performed with respect to trajectories over a temporal horizon across which an organism encounters with atypical events to the organism's natural habitat and its own biology.
Second, the FEP utilizes the gradient-descent scheme in practically implementing the minimization of the IFE, which provides with an efficient method of finding optimal solutions in machine learning theory [13].
However, the engaged mathematical device is not based on an appropriate scientific principle, making up only a heuristic approach to solve engineering optimization problems.
Third, the FEP employs the 'generalized motions' of an infinite number of the so called 'generalized coordinates' to account for the dynamical nature of the environment [14]. However, the ensuing theoretical construct is not compatible with the standard Newtonian mechanics. § With the hired theory, it is obscure to decide the number of independent dynamical variables for a complete description.
Fourth, the FEP introduces the hydrodynamic concepts of 'path of mode (motion of expectation)' and 'mode of path (expected motion)', which are not properly derived quantities and, again, are extra-theoretical [15]. However, they are essential to ensure an equilibrium solution to the RD in perceptual as well as active inference of the dynamical external states.
Fifth, the FEP considers the states of the external world 'hidden' because what the brain faces is only a probabilistic sensory mapping. The distinction made between the hidden-state representations, responsible for intra-level dynamics, and causalstate representations, responsible for inter-level dynamics, in the hierarchical brain is conjectural [16]. A proper biophysical formulation that supports the top-down idea is further required.
In this paper we present a mechanistic formulation of the RD of the brain in the framework of Hamilton's principle of least action [18]. Motivated by the aforementioned observations, we try to resolve some of the technical pitfalls in the FEP framework. To be specific, the goal is to recast the gradient descent strategy of minimizing the IFE into the mathematical framework that appeals to the normative physics rules. Consequently, we reformulate the RD in terms of only the canonical, physical realities to dispense with the generalized coordinates of infinitely recursive time-derivatives of the brain variables. We shall focus our attention in this paper on the brain's perceptual mechanics of inferring of the external world, given sensory data. The problem of learning of the external world on a longer time scale than that associated with perceptual inference. To derive the RD of the slow variables for synaptic efficacy and gain, the time-integral of the IFE is taken as an objective function; however, again the gradient descent method is executed in a pointwise way in time [12]. § The mechanical state of a particle is specified only by position and velocity in the Newtonian mechanics, and no physical observables are assigned to the dynamical orders beyond the second-order. In some literature [17], the concept of 'jerk' is assigned to the third-order time-derivative of position as a physical reality. From the mathematical perspective such a generalization is not forbidden. However, not only higher-orders are difficult to measure but more seriously it raises the question of what the corresponding cause to jerk as the force to acceleration. And, same impasse in all next orders.
via updating the internal model of the world and of active inference of changing sensory input via action on the external world, see for instance [19], are deferred to an upcoming paper.
Supported by the present day evidences [20,21], we admit that the bi-directional facets in informational flow in the brain. The nonstationary states of the external world incite sensory data at the brain-environment interface such as sensory receptors or interoceptors within an organism. While the incited electro-opto-chemical interaction in sensory neurons must transduce forward in the anatomical structure of the brain, complying with the idea of perception as constructing hypotheses there must be backward pathway as well in information processing in the functional hierarchy of the brain. To understand how the functional architecture is emergent from the electrophysiology of biophysics and anatomical organization of the brain is a forefront research interest (see, for instance, [22] and references therein). In this work we consider a simple model that effectively incorporates the functional hierarchy in sensory inference.
Here, we synopsize how we translate the information-theoretic constructs in the FEP into the standard physics formulation in this work: (i) According to the FEP, the brain represents the environmental features statistically efficiently, using the sufficient statistics µ. We assume that µ specifies the basic computational unit of the neural attributes of perception in the brain. Such a basic unit is considered a 'perceptual particle' which may be a single neuron or physically coarse-grained multiple neurons forming a small particle; (ii) We postulate that the Laplace-encoded IFE in the FEP, denoted as F (Sec. 2.1), serves as an effective, informational Lagrangian (IL) of the brain, denoted as L. Accordingly, the informational action (IA), which we denote by S, is defined to be time-integral of the approximate IFE (Sec. 3.1); (iii) Then, conforming to the Hamilton principle of least action, the equations of motion of the perceptual particles are derived by mathematically varying the IA with respect to both µ and 9 µ. The resulting Lagrange equations constitute the perceptual mechanics, i.e. the RD of the brain's inferring of the external causes of the sensory stimuli (Sec. 3.1); (iv) In turn, we obtain the brain's informational Hamiltonian H from the Lagrangian via a Legendre transformation. Consequently, we derive a set of coupled, first-order differential equations for µ and its conjugate p µ , which are equivalent to the perceptual mechanics derived from the Lagrange formalism. Accordingly, we interpret that the perceptual state-space of the brain is spanned by the position µ and momentum p µ variables of the constituting neural particles. (Sec. 3.2); (v) We adopt the Hodgkin-Huxley (H-H) neurons as biophysical neural correlates which form the basic perceptual unit in the brain. We first derive the RD of sensory perception at a single-neuron level where the membrane potential, ionic transport, and gating are the relevant physical attributes. Subsequently, we scale up the cellular formulation to furnish a functional hierarchical-architecture of the brain. On this coarse-grained scale the perceptual states are the averaged properties of many interacting neurons. We simplify the hierarchical picture with two averaged, activation and connection variables, mediating the intraand inter-level dynamics and formulate the hierarchical RD in the brain. As sensory perturbation comes in at the lowest level, i.e. sensory interface, the brain carries out the RD in its functional network and finds an optimal trajectory which minimizes the IA.
To summarize, we have adopted the IFE as an informational Lagrangian of the brain and subsequently defined the informational Hamiltonian. Then, the principle of least action has guided us to construct a process theory of the perceptual mechanics with reference only to positions and momenta; positions and momenta being metaphorical for the perceptual states and the brain's prediction errors, respectively. The distinction between the causal (autonomous-hidden) and hidden states was dispensed with, both of which are biophysical neuronal activities on different time scales. The resulting RD is statistically deterministic, arising from indeterministic motions of the environmental states and stochastic sensory mappings. The successful solutions of the RD are stable equilibrium trajectories in the neural state space, specifying the tightest upper bound of the sensory uncertainty, conforming to the rephrased FEP. Our formulation allows solutions in an analytical form in linear regimes near limit cycles, expanded in terms of the eigenvalues and the eigenvectors of the Jacobian and, thus, provides with tractability of a real time analysis. We hope that our theory will motivate further investigations on the active inference and learning problems by employing detailed numerical simulations of some model brains.
This paper is organized as follows. We first recapitulate the FEP in Sec. 2 to support our motivation for recasting the gradient descent scheme into the standard mechanics formulation. In the followed Sec. 3 we present the RD reformulated in the Lagrangian and Hamiltonian formalisms. Then, in Sec. 4 biophysical implementations of our theory at the cellular level and in the scaled-up hierarchical brain are formulated, where nonlinear as well as linear dynamical analyses are carried out. Finally, a discussion is provided in Sec. 5.

The free energy principle
To unveil our motivation for this paper, we shall compactly digest here the IFE and the FEP, that are currently practiced in the brain sciences. The RD is the brain's machinery to minimize the IFE under the FEP. For a detailed technical appraisal of the FEP we refer to [8] from which we borrow the mathematical notations.

The informational free energy
A living organism occupies a finite space and time in the unbounded, changing world while interacting with the rest of the world, namely its environment. The states of the environment are denoted as ϑ collectively. The signals from the environment are registered in organism's sensory interface as sensory data ϕ which are physically encoded in the brain as a probability density ppϕq.
Then, the sensory uncertainty H associated with input data ϕ is the average of the self-information,´ln ppϕq, over the sensory distribution ppϕq, The self-information, which is also termed as the sensory 'surprise' or surprisal in the FEP, quantifies the survival tendency of living organisms in the unpredictable environment. Assuming that the sensory density describes an ergodic ensemble of sensory streaming, the sensory uncertainty may be converted into a time-average as where T is the temporal window over which a biological event takes places, i.e. a temporal horizon. Next, by adding ş dϑqpϑq lnrqpϑq{ppϑ|ϕqs to the integrand on the right-hand side (RHS) of the preceding equation, which is the positive-definite Kullback-Leibler divergence, we get ż dt r´ln ppϕqs ď ż dtF rϑ, ϕs, where F is the IFE that is defined to be a functional of the two probability densities, qpϑq and ppϑ, ϕq: where qpϑq and ppϑ, ϕq are termed the R-density and the G-density, respectively. The R-density is the brain's probabilistic representation of the external world which must be encoded physically in the brain. The G-density, a joint probability between ϑ and ϕ, underlies the brain's top-down model of Bayesian belief of the external causes of the sensory data. Note that the sensory uncertainty on the left hand side (LHS) of Eq. (2) specifies the accumulated surprisal over the time interval involved in an environmental event.
Equation (2) is the mathematical statement of the FEP, implying that "any viable organisms try to avoid being placed in an atypical situation in their environmental habitats by minimizing the sensory uncertainty". However, organisms do not possess control over the sensory distribution ppϕq; accordingly they are not able to minimize directly the sensory uncertainty. Instead, they are to minimize the upper bound of Eq. (2), ş dtF as a proxy for the sensory uncertainty. The brain conducts the minimization probabilistically by updating the R-density to approximate the posterior density ppϑ|ϕq, i.e. carrying out a Bayesian inference of the causes ϑ of the inputs ϕ. In the conventional application of the FEP the following approximate inequality is always exercised [23,24], However, we note here that the inequality, Eq. (4) is not equivalent, in general, to Eq. (2). It is only a point approximation piecewise in time.
The functional shape of the R-density is not given a priori. It would be fixed mathematically after providing all orders of its moments, but not tractable. To circumvent the difficulty, usually one invokes an approximate Bayesian inference for formulation by assuming a Gaussian fixed-form for the R-density, the 'Laplace approximation', which is fully characterized simply by its mean µ and variance ζ, first and second order sufficient statistics, respectively. Then, by substituting Eq. (5) into Eq. (3) and after some technical approximations, see [8], one can convert the IFE functional F into F rµ, ϕs Ñ´ln ppµ, ϕq " F pµ, ϕq.
In the end of manipulation the outcome becomes a function of only the first order sufficient statistics µ, given the sensory input ϕ. The resulting IFE function F in Eq. (6) is termed the 'Laplace-encoded' IFE in which the parameter µ is the brain's effective representation of the external world, physically encoded as the brain variables.
To proceed with minimization by means of the Laplace-encoded F , the joint probability density ppµ, ϕq must be supplied. In view of the factorization, ppϕ, µq " ppϕ|µqppµq, the brain must possess internally its generative model ppϕ|µq about the sensory data and also the prior belief ppµq of its expectation about their causes. It is hypothesized that the brain predicts the registered sensa ϕ in a feedback manner, where gpµq is a generative model of the brain. The random fluctuation involved in the sensory observation process has been characterized by z. Also, it is assumed that the brain variable µ obeys the stochastic equation of motion, where f pµq is a generating function of brain dynamics and w is the associated random fluctuation. Assuming the Gaussian noises for both fluctuations about zero means with variance σ z and σ w , respectively, the likelihood density ppϕ|µq and the prior ppµq are written, using the notation introduced in Eq. (5), as ppµq " N p 9 µ´f pµq; 0, σ w q, where we have set 9 µ " dµ{dt. Next, utilizing Eqs. (10) and (11), one can convert the Laplace-encoded IFE Eq. (6), up to a constant, into where the new variables have been defined as ε z " ϕ´gpµq and ε w " 9 µ´f pµq.
The auxiliary variables ε z and ε w specify the discrepancies between the brain's prediction of sensory data and of change in the brain states, respectively.

Gradient descent scheme of the RD
With the Laplace-encoded IFE as an instrumental tool the brain searches for the tightest bound for the surprisal, complying with Eq. (4), by varying its internal states µ. Here the key question is what machinery the brain actually hires for the minimization procedure. Typically the gradient descent method in machine learning theory is employed in the conventional FEP.
By regarding the IFE function F as an objective function, one sets up the gradient descent equation in the form, In the above 9 µ implies a temporal or parametric update of the brain variable µ and ∇ µ is the gradient operator with respect to µ, and κ is the learning rate that controls the speed of optimization. The gradient operation on the RHS of Eq. (13) can be performed explicitly for given F , Eq. (12) to givê In steady state, defined by 9 µ " 0, the solution µ p0q to the relaxation equation, Eq. (13) must satisfy ∇ µ F " 0. Subsequently, it is interpreted that such a solution corresponds to an equilibrium (or fixed) point of the IFE function F , specifying a local minimum.
By inspection, however, we find that the gradient-descent construct in the above form requires a technicality in finding an optimal solution. This is because imposing the condition, 9 µ " 0 on the LHS of Eq. (13), does not guarantee a desired fixed point. The reason is that 9 µ also appears on the RHS of Eq. (13) via F , which reflects the nonstationary world prescribed by the equation of motion Eq. (9). This difficulty is remedied in the conventional theory of the FEP by proposing some extra theoretical constructs. First, in an attempt to incorporate the continually changing external states into formulation, the mathematical construct of infinitely recursive, higher-order motion of the generalized coordinates is introduced.} The generalized coordinates are defined to be a vector in the state space spanned by all dynamical orders of µ, µ " pµ, µ 1 , µ 2 ,¨¨¨q " pµ r0s , µ r1s , µ r2s ,¨¨¨q (14) where vector components are defined, with understanding µ r0s " µ, as µ rn`1s " µ 1 rns " Dµ rns .
} The terminology of the generalized coordinates causes confusion. In classical mechanics, the generalized coordinates are the independent, dynamical variables which are required to specify the configuration of a system completely. The number of generalized coordinates determines the degree of freedom in the system [18].
Each component in the vectors,μ andφ, is to be considered as an independent dynamical variable. Then, the generalization of Eqs. (8) and (9) follows after some technical approximations as (for details, see [8]) Dμ "f`w; (17) where Dμ " pµ 1 , µ 2 , µ 3 ,¨¨¨q. At dynamical order n, Eqs. (16) and (17) are explicitly spelled out as Then, furnished with the extra theoretical constructs, the IFE becomes a function of the generalized coordinatesμ, given sensory dataφ, F " F pμ,φq. Next, the gradient descent scheme is extended to embody the generalized coordinates. To this end, one first assumes that the dynamical update Dμ is distinctive from the temporal update 9 µ and then recasts Eq. (13) into the form, 9 µ´Dμ "´κ∇μF pμ,φq.
With this form of the gradient descent equation, the conventional FEP claims that a desired fixed pointμ˚"μpt Ñ 8q reaches in the minimization scheme when the two rates of the brain variables, 9 µ and Dμ become coincident, i.e. when 9 µ rns " Dµ rns at every dynamic order n. Note the extra theoretical construct of Dμ was installed on the LHS in Eq. (18) without a rigorous basis. The entire minimization procedure is compactly expressed in the literature as In brief, the brain performs the RD of perceptual inference by biophysically implementing Eq. (18) in the gray matter. The steady-state solutionμ˚specifies minimum value of the IFE, say F min " F pμ˚,φq, giving the tightest bound of the surprisal [see Eq. (4)] associated with a given sensory experienceφ. Despite its frequent employment in practicing the FEP, we have disclosed some theoretical subtleties involved in the customary formulation of the gradient descent scheme, that has motivated our reformulation.

The informational action principle
The RD condensed in the preceding Sec. 2.2 is based on the mathematical statement Eq. (4) of the FEP, which is a point approximation of Eq. (2). Here we reformulate the perceptual mechanics by complying with the full mathematical statement of FEP given in Eq. (2). Accordingly, we need a formalism that allows minimization of the time-integral of the IFE, not at each point in time. We have come to assimilate that the theoretical 'action' in the principle of least action in physics naturally serves for the goal [18]. This formalism allows us to dispense with the generalized motions of a dynamical state comprising an infinite number of discrete time-derivatives. We do not need the ad hoc classification of the parametric update ( 9 µ) and the dynamical update (Dµ) of the state variables. In what follows, we shall consistently use the dot symbol to denote time-derivative of a dynamical variable.

Lagrangian formalism
To address the principle of least action, the 'Lagrangian' of the system must be supplied. We define the informational Lagrangian (IL) of the brain, denoted by L, as the Laplace-encoded IFE function, where we have placed the semicolon in L to indicate that µ and 9 µ are the two brain's dynamical variables, given sensory input ϕ. The sensory inputs are time-dependent, in general; ϕ " ϕptq, reflecting the changing external states. Note the IL proposed is not a physical quantity but an information-theoretic object. When we take Eq. (12) as an explicit expression for F , the IL is written up where we have dropped out the constant term, 1 2 ln pσ z σ w q, which does not affect the dynamics of µ and 9 µ. Next, we postulate that the perceptual dynamics of the neural particles conforms to the principle of least action [18]. Accordingly, we suppose that the brain's perceptual operation corresponds to searching for an optimal dynamical path that minimizes the informational action (IA), denoted by S, where t f´ti " T is the temporal horizon over which a living organism encounters an environmental event. When functional derivative of S is carried out with respect to µ and 9 µ, it gives By imposing δS " 0 under the condition that initial and final states are fixed, we derive the Lagrangian equation as Using the specified Lagrangian, Eq. (19), in Eq. (21), we obtain a Newtonian equation of motion for the brain variable µ, where we have defined Equation (22) entails the RD of the brain in the Lagrangian formulation. We interpret that the inverse of the variance σ´1 w plays, as a metaphor, a role of inertial mass of the neural particles. Accordingly, the LHS of Eq. (22) represents an inertial force, i.e. the product of 'inertial mass' and 'acceleration', : µ. Note that the inverse of variance is interpreted as precision in the Friston formulation [8], which gives a measure for the accuracy of the brain's expectation or prediction of sensory data. So, the precision is the 'informational mass' of the neural particle metaphorically. Also, the terms on the RHS are interpreted as the 'forces' that drive the internal F 1 as well as sensory F 2 excitations in the brain. The acceleration can be evaluated from : µ " ř Λ i {σ´1 w when the net force is known.
While the brain integrates the RD for a given sensory input, an optimal trajectory µ˚ptq is achieved in µ-space. The steady-state condition is given by in the long-time limit t Ñ 8 where the net force vanishes. Note that equation (24) defining the fixed-point, µ eq " µ˚p8q, differs from and is more general than that of the gradient descent scheme, 9 µ " 0 [see Sec. (2. 2)]. In contrast to the gradient descent equation, Eq. (13), the RD Eq. (22) from our Lagrangian formulation causes no ambiguity to ensure a fixed point.

Hamiltonian formalism
The mechanical formulation can be made more formal in terms of Hamiltonian language which admits position and momentum as independent brain variables, instead of position and velocity as in the Lagrangian formulation.
The 'canonical momentum' p, which is conjugate to the position µ, is defined via Lagrangian L as [18] p " which evidently differs from the 'kinematic' momentum σ´1 w 9 µ. Then, the informational 'Hamiltonian' H may be constructed from the Lagrangian using Legendre's transformation [18], The first term on the RHS of Eq. (26) can be further manipulated to give ÿ BL B 9 µ 9 µ " σ´1 w 9 µ 2´σ´1 w 9 µf.
By plugging the outcome and also the Lagrangian L given in Eq. (19) into Eq. (26), we obtain the Hamiltonian as a function of µ and p as desired, given ϕ, where Eq. (25) has been used to replace 9 µ with p. The first term on the RHS of Eq. (27) is the 'kinetic energy' which depends only on momentum, Also, the second term on the RHS of Eq. (27) is the 'potential energy' which depends on both position and momentum, where we have defined the momentum-independent term separately as V , We remark that the sensory stimuli ϕ enter the Hamiltonian only through the potentialenergy part V which becomes 'conservative' when ϕ is static. For time-varying sensory inputs, in general, the Hamiltonian is nonautonomous. In Fig. 1 we depict the conservative potential energy, using three term approximations for the generative function, We have observed numerically that the static sensory signal ϕ changes the distance bewteen two unstable fixed points, but do not affect the location of the stable equilibrium point. In addition, the depth of the stable equilibrium valley gets deeper as the magnitude of ϕ increases. Next, we take the total derivative of the Hamiltonian given in Eq. (26) with respect to µ and 9 µ to get dHpµ, p; ϕq " ÿ d pp 9 µq´dLpµ, 9 µ; ϕq " 9 µdp`pd 9 µ´ˆB L Bµ dµ`B L B 9 µ d 9 µ"´9 p µ dµ`9 µdp. By comparing the last expression with the formal expansion, we identify the Hamilton equations of motion for independent variables µ and p of a neural particle, For given H in Eq. (27), we spell out the RHS of Eq. (31) to get which is identical to Eq. (25). Similarly, the second equation, Eq. (32) is spelled out The first term on the RHS of Eq. (34) specifies the conservative force, Whereas, the second term on the RHS of Eq. (34) specifies the dissipative force, where Bf {Bµ plays the role of damping coefficient. The derived set of coupled equations for the variables µ and p furnish the RD of the brain in phase space spanned by µ and p, which involve only first order timederivatives. When time-derivative is taken once more for both sides of Eq. (33) with followed substitution of Eq. (34) for 9 p, the outcome becomes identical to the Lagrangian equation of motion, Eq. (22). This confirms that two mechanical formulations, one from the lagrangian and the other from the Hamiltonian, are in fact equivalent. In the Hamiltonian formulation the brain's fulfilling of the RD is equivalent to finding an optimal trajectory pµ˚ptq, p˚ptqq in phase space. For a static sensory input, Eqs. (33) and (34) are autonomous and for time-dependent sensory input they become non-autonomous. The RD can be integrated, provided appropriate models for the generating functions f and g are given. The fixed point pµ˚p8q, p˚p8qq would be limit cycles, in general, in phase space, which can be calculated by imposing that both LHSs of Eqs. (33) and (34) vanish at the same time, µ " 0 and 9 p " 0.
One can readily confirm that these fixed point conditions match with the Newtonian equilibrium condition, ř i F i " 0. The situation corresponds to the brain's resting state which is not simply a local minimum in the conservative energy because of the non-potential terms in the Hamiltonian.

Multivariate formulation
Having established the informational action principle with a single brain variable µ, we now extend our formulation to the general case of the multivariate brain. We denoteμ as a N-dimensional brain variable, µ " pµ 1 , µ 2 ,¨¨¨, µ N q, that respond to the multiple of sensory inputsφ, in general, ϕ " pϕ 1 , ϕ 2 ,¨¨¨, ϕ N q.
For simplicity, we neglect the statistical correlation among the different noises both in the equations of motion of the brain variables and the observation equations of the sensory data. Then, within the independent-particle approximation the informational Lagrangian Eq. (19) is generalized as where we have dropped out the terms which contain only static parameters, σ zα and σ wα . One may extend Eq. (36) to interacting neural nodes in terms of covariance matrix formulation [8], which is not our concern here. Subsequently, the conjugate momentum to the generalized coordinate µ α is determined by an explicit evaluation of p α " BL B 9 µ α " σ´1 wα p 9 µ α´fα q .
In turn, the Hamiltonian of the multivariate brain can be constructed from Eq. (27) as Hpμ,p;φq " T pμ,p;φq`Vpμ,p;φq (38) where first term on the RHS is the kinetic energy, T pp;φq " ÿ α p α 2 2σ´1 wα (39) and the potential energy V is identified as Then, it is straightforward to derive the RD of the variables µ α and p α , given sensory data ϕ α , as and for their conjugate momenta, Equations (41) and (42) are a couple set of equations for the multivariate coordinates µ α and their conjugate momenta p α of the neural particles in 2N-dimensional phase space. With some working models for f α and g α , they form the RD of the brain in the Hamiltonian prescription. In Fig. 2 we illustrate a schematic of the perceptual circuitry implied by the RD at a neural node. It is admissible to assume that the brain Figure 2. The perceptual circuitry at neural node α in which sensory data ϕ α stream in the independent-particle picture; where it is depicted that the computational units µ α and p α are positively activated by arrows and negatively by lines ended with filled dots. The conjugate moneta p α , defined in Eq. (37), to the brain variables µ α mimic the prediction errors in the predictive coding language [25].
is at the outset in a resting state. As the sensory inputs ϕ α come in, the brain performs the RD, by integrating Eqs. (41) and (42), to attain an optimal trajectory in neural phase space, µ α " µαptq and p α " pαptq, which minimize the IA, see Eq. (20). The entire minimization procedure may be stated abstractly as pµα, pαq " arg min µα,pα where S is the IA.

Biophysical implementation
The aged Hodgkin-Huxley (H-H) model continues to be used in virtually all nerve excitation studies to this day [26,27]. In extracellular electrical recordings the local field potential and multi-unit activity result in as combined signals from a population of neurons, typically thousands in numbers with spatial range of up to hundred micrometers [28]. In this work we regard the coarse-grained H-H neurons as the basic building blocks of encoding and transmitting perceptual message inside the brain. Such averaged neuronal variables subserve the perceptual states and conduct the cognitive computation in the brain. We shall call them 'small' neural particles and envisage that a small neural particle enacts a node that collectively forms the whole neural network on the large scale. Before proceeding, we simply mention that there are much biophysical efforts to describe such average neural properties; for instance, the neural mass models and neural field theories are a few examples [29,30,31,32,33]. Also, we note the bottom-up effort of trying to understand the large-scale brain function at the cortical microcircuit level based on the averaged, spikes and synaptic inputs over a coarse-grained time interval [34,35].

Single cell description
We first present how our formulation may be implemented at a neurocentric single-cell level [36]. A typical neuron receives electrochemical inputs from the sensory periphery via glutamate, which in turn regulates the neuronal states by exciting or inhibiting the membrane potential V , gating variables γ l , and ionic concentrations n l ; where l is the ion channel index. We admit that pV, tn l u, tγ l uq specify the neural states of a neuron as a perceptual particle in the neural configurational space. They serve the 'generalized coordinates' of our neural particle in standard physics terms [18], which we denote as a multi-dimensional row vector, µ " pV, n l , γ l q " pµ 1 , µ 2 , µ 3 ,¨¨¨q.
Note although we use the same notationμ as the one in Eq. (14), the two theoretical constructs are completely different.
The H-H equation for excitation of the membrane voltage V in a spatially homogeneous cell is given by where C is the membrane capacitance, G l is the maximal conductance of ion channel l, γ l is the probability factor associated with opening or closing channel l which in general a product of activation and inactivation gating variables, and I ex is the external driving current. For simplicity, contributions from leakage current as well as synaptic input are assumed to be included in the external currents. The reverse potential E l of l-th ion channel is given, assuming its time-dependence via nonequilibrium ion-concentrations, in general, as where k B is the Boltzmann constant, T is the metabolic temperature of an organism, q l is the ionic charge of channel l, and n li ptq and n lo ptq are the instantaneous ion concentrations inside and outside the membrane, respectively. In the steady state without external current, I ex " 0, V tends to the resting (Nernst) potential V pt Ñ 8q with retaining ionic concentrations in electro-chemical equilibrium. The gating variable γ l of ion channels is assumed to obey the kinetics, different model of that may be preferable, where the relaxation time τ l and steady-state gating variable γ leq depend on the membrane potential, in general, τ l " τ l pV q and γ leq " γ leq pV q, and η l is the noise involved in the process. For ionic concentration dynamics, we suppose that ion concentrations tn l u vary slowly compared to the membrane potential and gating-channel kinetics, and consequently treat them statically in our work. This restriction can be lifted when a more detailed description is required for ion concentration dynamics. Accordingly, the reverse potentials E l are also treated statically in below.
Then, the state equations for the multivariate neural vaiableμ neatly map onto the standard form suggested in the FEP, where α runs 1, 2,¨¨¨with implying µ 1 " V , µ 2 " γ 1 , and µ 3 " γ 2 , etc. Note the static variables tn l u have been separated by the semicolon from the other dynamical variables in the arguments of the generating functions f α , that are specified as f γ l pV, tγ l u; tn l uq "´1 τ l pγ l´γleq q.
The term w α in Eq. (47) describe the noisy current w V flowing into the neural particle, in addition to the deterministic contribution I ex , and the noise w γ l " η l associated with the activation and inactivation of ion channels, respectively. For both noises, we assume the Gaussian distributions N p 9 µ α´fα ; 0, σ wα q with variances σ wα about zero means. Regarding neuronal response to the stimulus ϕ α , we adopt the usual top-down mapping in the FEP [see Eq. (8)] as ϕ α " g α pV, tγ l u, tn l uq`z α , where g α is the generative map that is to be supplied for practical application and z α characterizes the stochastic nature of the sensory reading which we assume the normal distribution N pϕ α´gα ; 0, σ zα q. With the present model, we assume that the on-site neuronal states respond to the sensory data instantly. A more appropriate dynamical model is to be supplied when a detailed biophysical description is required. As a working example, here we consider a H-H neuron which allows fast relaxation, i.e. τ l ! 1, of gating variables to their steady-states, γ l ptq Ñ γ l p8q " γ leq pV q. In this case our neural particle is fully characterized by a single dynamical variable of V . Note the time-dependence of the gating variables occurs only implicitly through the longtime membrane voltages in Eq. (48). Then, the RD of our neural particle is fulfilled in a two-dimensional state space spanned by V p" µq and p V p" pq, prescribed by the Hamiltonian function, While the 'dissipative' function f is explicitly given in the H-H model as the 'conservative' function g must be additionally supplied. Also, one needs to make the voltage-dependence of γ leq available in practice. Note the Hamiltonian is nonautonomous, in general, because it explicitly depends on time through both the sensory input ϕptq and the driving current I ex in f . In Fig. 3 we illustrate the Hamiltonian function Eq. (51) assuming static sensory data and constant driving currents; where we take the algebraic approximations [37] for the conservative map function, gpµq « a 0`a1 µ`a 2 µ 2 , and for the voltage-dependence of the gating variables, The Hamilton's equations of motion, Eqs. (41) and (42), bring about the nonlinear RD as where the 'force' functions Λ 1 and Λ 2 are specified as According to the present model, the brain performs the RD, given the sensory input ϕ in the force function Λ 2 and consequently obtain the optimal trajectory pµ˚, p˚q conforming to Eq. (43). In the steady-state limit the brain reaches a fixed (equilibrium) point pµ eq , p eq q in the state space, that is specified by intersections of the isoclines, To gain an insight into how the system approaches to steady states, we inspect the optimal trajectories near an equilibrium point, µ˚« µ eq`δ µ and p˚« p eq`δ p.
We expand Eqs. (53) and (54) to the linear order in the deviations δµ and δp and, after rearrangement, obtain the normal form, In Eq. (57) the elements of the relaxation (Jacobian) matrix R are specified to be where the partial derivatives are to be evaluated at the equilibrium points. Here, for notational convention we denote the column vector as δψ " p δ q µδp.
Then, the formal solution to Eq. (57) is written as δψptq " e´R t δψp0q.
One may expand the initial state ψp0q in terms of the eigenvectors of R as where the eigenvalues λ α and eigenvectors φ α are determined by the secular equation, Consequently, the solutions to the linear RD at a single node level is completed as where the expansion coefficients c α are fixed by the initial condition. The geometrical interpretation of the equilibrium solutions is possible by inspecting the eigenvalues of the Jacobian matrix R. Considering that the matrix R is not symmetric, we anticipate that the eigenvalues are not real. Furthermore, because the trace of the relaxation matrix equals zero, the sum of the two eigenvalues must be zero. Thus, when the determinant of R is positive, the two eigenvalues λ 1 and λ 2 would be pure imaginary with opposite sign. Consequently, in the present particular model the resulting equilibrium point is likely to be a center.

The hierarchical neural network
Here, we suppose that there are a finite number of levels in the perceptual hierarchy and that for simplicity each level is effectively characterized as a single neural node. Further, we assume that the perceptual state of the neural node at hierarchical level i is specified by the coarse-grained, activation and connection variables, denoted as V piq and S piq , respectively. The activation variable describes action potential at a node and the connection variable describes inter-level synaptic input and output variables. Both variables are derived from a population of neurons and thus vary on a coarse-grained space and time scale. The theoretical details of how one may derive such a coarsegraining description is not our scope, for a reference see [33]. They form the generalized coordinates in brain's configurational space, where the superscript runs i " 1, 2,¨¨¨, M, with M denoting the highest level.
We assume that the activation variables V piq obey the effective dynamics with noise w piq within each hierarchical level i, which is a direct generalization of Eq. (47) with incorporating the hierarchical dependence via S piq . For inter-level dynamics, we propose that the connection variables are subject to the similar stochastic equations, where the brain's top-down prediction function g piq must be supplied in practical implementation, and z piq represents the noise associated with the process. Note there is only spontaneous fluctuation at the top cortical level, i " M, accordingly After some manipulation, the outcome is obtained as where the infromational kinetic energy is defined to be (i ě 1) and the potential energy to be (i ě 2) respectively. The potential energy at the lowest level is specified separately to be Note the equations of motion of momenta p p1q V and p p1q S at level i " 1 obeys different rules compared with those at higher levels due to the sensory measurement terms, the second terms on the RHSs of Eqs. (75) and (77).
According to the derived RD, the sensory inputs ϕ enter the brain and environment interface, see Eqs. (75) and (77), which is predicted by the brain's lowest level generative model g p1q pV p1q , S p1q q. And, the prediction discrepancy, ϕ´g p1q becomes a source of inducing change in the perceptual momenta. The perceptual momenta p p1q V and p p1q S enter Eqs. (74) and (76) as the lateral and hierarchical prediction-errors, respectively, which, in turn, generate a change in the perceptual states V p1q and S p1q , respectively, together with the corresponding generative models f p1q and g p2q . In particular, the topdown prediction g p2q from one higher-level participates in organizing the change of S p1q [see Eq. (76)]. At higher levels i ě 2, the inter-level top-down prediction g pi`1q and on-level prediction errors p piq S determine the change of the current hierarchical state S piq through Eq. (80). And, Eqs. (78), (79), and (81) govern the coupled, lateral dynamics to reorganize on-level perceptual states pV piq , S piq q. In Fig . 4 we draw a diagram that schematically illustrates the perceptual architecture of the hierarchical network implemented by Eqs. (74)-(81). Here, we emphasize that the dynamics of the prediction errors, via canonical momenta, are encapsulated in our formulation on an equal footing with the dynamics of the state variables. This is also in contrast to the conventional minimization algorithm where only differential equation for the brain states are present and consequently the temporal update of the prediction errors themselves are not present. An attempt to incorporate the brain's computation of prediction errors in the FEP can be found in a recent tutorial article [38].
For mathematical compactness, here we rewrite Eqs. (74)-(81) as where the hierarchical index i runs from 1 to M, α runs from 1 to 4, and the force function Λ piq α is the corresponding RHS to each vector component ψ piq α at cortical level i. The obtained hierarchical equations are the highlight of our theory, prescribing the RD of the brain's sensory inference within the FEP framework.
To apply our formulation to an empirical brain, one needs to supply the generating function f piq of lateral dynamics and the hierarchical connecting function g piq , that enter the force functions Λ piq α in the perceptual mechanics, Eq. (82). For the generating function we once again use the H-H model Eq. (48) with an explicit form for the driving current, whereG l are the channel conductances normalized by the capacitance C, and the second term on the RHS accounts for the leakage and/or lateral synaptic currents as an external source I ex withG S being the normalized synaptic conductance. The hierarchical connection function may be modeled in a simplest form as where the function χ specify the voltage-dependent synaptic plasticity from hierarchical level i to level i´1. In addition, as in the single particle case, one must supply approximate models for voltage-dependence of the gating variables γ leq and the connection strength χ. For instance, one may take the quadratic approximations [37], At the end of the RD an optimal trajectory is obtained in multi-dimensional phase space, ψ˚p iq α " ψ˚p iq α ptq, which tends to a fixed point in the steady-state limt, ψ piq α,eq " ψ˚p where the subscript eq indicates that the matrix elements are to be evaluated at the equilibrium (fixed) points. To cast the inhomogeneous term into a more suggestive form we further inspect it in detail within the models specified: We observe first that the matrix elements Φ pijq αβ do not vanish only for α " 3 because only the force function Λ , . -, where δ α3 is the Kronecker delta. Finally, we shall present a formal solution to the linearized perceptual mechanics Eq. (86), that can be obtained by a direct integration with respect to time. The result takes the form δψ piq ptq " e´R piq t δψ piq p0q`ż t 0 dt 1 e´R piq pt´t 1 q δζ pi`1q pt 1 q.
We next solve the eigenvalue problem at each hierarchical level, which is defined to be where λ piq α and φ piq α are the eigenvalues and corresponding eigenvectors at level i, respectively. Then, we expand the initial state δψ piq p0q in terms of the complete eigenvectors: Similarly, we may expand the inhomogeneous vector δζ pi`1q as where note the expansion coefficients b pi`1q α are time-dependent. By substituting the expansions Eqs. (90) and (91) into Eq. (88) we obtain the desired formal solution near equilibrium points, The geometrical approach to a fixed point is again determined by the eigenvalues λ piq α ; however, the details are driven by the time-dependent generative sources b pi`1q α ptq from one-level higher in the hierarchy.
To sum, responding to sensory streaming ϕ " S p0q at the brain-environment interface, the lowest hierarchical level i " 1, the brain in an initially resting state performs the hierarchical RD by integrating Eq. (82) to infer the external causes. The ensuing brain's computation corresponds to minimizing the IA, which is an upper bound of the sensory uncertainty in the FEP whose mathematical statement is repeated compactly as where the sensory uncertainty H is defined in Eq. (1) and the IA S is explicitly given again as SrF ; ϕs " ş dtF ptψ piq α u; ϕq. Conforming to our restated FEP, the minimum value of IA specifies the tightest bound of the sensory uncertainty over a relevant biological time-scale.

Discussion
We have recast the FEP into that all living organisms are evolutionally self-organized to tend to minimize the sensory uncertainty about uninhabitable environmental encounters. The sensory uncertainty is an average of the surprisal over the sensory distribution induced on the brain-environment interface, the sensory surprisal being the self-information of the sensory distribution. The FEP suggests that the organisms implement the minimization by calling forth the IFE in the brain. The timeintegral of the IFE gives an estimate of the upper bound of the sensory uncertainty and defines the theoretical action in the least action principle. In this paper we have enunciated that the minimization of the IFE must continually take place over a finite temporal horizon of an organism's experiencing environmental interaction. Our sheme is in contrast to the conventional theory which approximates minimization of the IFE at each point in time. The sensory uncertainty is an information-theoretical Shannon entropy [39]; however, we have intentionally circumvented the term, ' sensory entropy' in this work to call the sensory uncertainty. The reason is that 'minimization of the sensory entropy' is reminiscent of Erwin Schrödinger's word, 'negative entropy' which carries a disputable connotation in implying how the living organism avoids decay. He subsequently suggested FE instead as a more appropriate notion in the context [1]. Conforming to the second law of thermodynamics, the organism's autopoiesis of minimizing the sensory uncertainty must contribute to increase of the total entropy of the brain and its environment.
We have assumed that the brain employs the Laplace-encoded IFE as an informational Lagrangian in implementing minimization of the IA. And, by admitting only the standard Newtonian position and velocity as relevant dynamical variables, we have reckoned the IFE as a function of the brain variables and their first-order time derivatives. Our approach reveals that the nonstandard physical construct of the generalized motion is not necessary and thus can be dispensed with in formulating the FEP. The features of the continually changing world are recorded in the brain as timedependent sensory data: It is not necessary to introduce the extra-physical dynamical model of the generalized coordinates. Also, in our theory all the parameters in the perceptual mechanics are specified in the Hamiltonian; thus, there requires no extra parameters like learning rates in the gradient descent scheme to control the speed of convergence to a steady state. According to our formulation, the brain's Helmholtzian perception corresponds to finding an optimal trajectory in the hierarchical functional network by minimizing the IA. When the brain completes the perceptual mechanics of reaching a desired fixed-point or a limit cycle, in general, it remains resting, i.e. being spontaneous, until another sensory stimulus will come in.
We have premised the top-down rationale of sensory inference in our formalism, which is an important facet of the FEP: The sensory inputs at the interface, the lowest hierarchical level, were assumed to be instantaneously mapped onto the brain variables with an associated noise, which is not fully biophysical yet. However, differently from the static model at the lowest level, we have assumed that the inter-level filtering in the brain's functional hierarchy obeys the stochastic dynamics. The resulting RD are deterministic and hierarchical: The current-level synaptic states are predicted by the activation and synaptic states at one-higher level built in the internal generative model, top-down prediction of the brain, and are, in turn, updated by on-level prediction error, canonical momentum. The momenta, specifying the prediction errors, also obey their own dynamical equations, which is dissimilar from the conventional formulation where the rates of the prediction errors are not drawn explicitly. The on-level, activation states and momenta are governed by the intra-level dynamics of the perceptual states. The obtained RD tenably underpins the causality: For a specified set of the perceptual positions and corresponding momenta at the outset, responding to sensory inputs that may be slow or fast time-dependent, the RD can be integrated. The arbitrariness, for instance, involved in specifying the number of generalized coordinates and corresponding initial conditions can be removed.
In short, it is still a long way to understanding how the Bayesian FEP in neurosciences may be made congruous with the biophysical reality of the brain at an emergent level. Our theory delivers a hybrid of the biologically plausible informationtheoretic framework of the FEP and the mechanical formulation of the process theory of the RD resorting to the principle of least action. To borrow what Hopfield puts in words, "it lies somewhere between a model of neurobiology and a metaphor for how the brain computes" [40]. We hope that our effort of trying to shorten the distance will guide a step forward to unraveling the challenging problem.