https://aeon.co/essays/consciousness-is-not-a-thing-but-a-process-of-inference
I'm compelled to treat consciousness as a process to be understood, not as a thing to be defined. Simply put, my argument is that consciousness is nothing more and nothing less than a natural process such as evolution or the weather. My favourite trick to illustrate the notion of consciousness as a process is to replace the word 'consciousness' with 'evolution' - and see if the question still makes sense. For example, the question What is consciousness for? becomes What is evolution for? Scientifically speaking, of course, we know that evolution is not for anything. It doesn't perform a function or have reasons for doing what it does - it's an unfolding process that can be understood only on its own terms. Since we are all the product of evolution, the same would seem to hold for consciousness and the self.
It turns out that the Lyapunov function has two revealing interpretations. The first comes from information theory, which says that the Lyapunov function is surprise - that is, the improbability of being in a particular state. The second comes from statistics, which says that the Lyapunov function is (negative) evidence - that is, marginal likelihood, or the probability that a given explanation or model accounting for that state is correct. Put simply, this means that if we exist, we must be increasing our model evidence of self-evidencing in virtue of minimising surprise. Equipped with these interpretations, we can now endow existential dynamics with a purpose an teleology.
Now we can see why attractors are so crucial. An attracting state has a low surprise and high evidence. Complex systems therefore fall into familiar, reliable cycles because these processes are necessarily engaged in validating the principle that underpins their own existence. Attractors push systems to fall into predictable states and thereby reinforce the model that the system has generated of its world. A failure of this surprise minimising, self-evidencing, inferential behaviour means the system will decay into surprising, unfamiliar states - until it no longer exists in any meaningful way. Attractors are the product of processes engaging in inference to summon themselves into being. In other words, attractors are the foundation of what it means to be alive.
Nearly all our behaviour can be understood in terms of such uncertainty-minimising drives - from the reflexive withdrawal from noxious stimuli (such as dropping a hot plate) to epistemic foraging for salient visual information when watching television or driving. Second, the actions of such systems upon the world appear to be endowed with a purpose, which is the purpose of minimising not-yet-actual, but possible, surprises.