In the zip file, see the files toolbox/DEM/spm_COVID*
What follows is my understanding.
> what exactly is the brain doing?
This is outside my area of expertise, but it is updating brain states (whatever that turns out to mean, neural mass activity, individual neural activity), and parameters, likely candidates being neurotransmitters. The mechanism has been proposed to be message passing among hierarchical regions of the cortex.
> Where exactly is the brain minimising 'free energy'?
It is a global effect, but whenever a state or parameter are updated (again whatever those are found to be) the free energy decreases. If these turn out to be localized then that would be the (context dependent) "where".
> Can I have a testable prediction please?
The one I am most interested in is, since generative models are the core of active inference, if active inference is true then we should expect to be able to identify such models and setup conditions under which they update according to the FEP, including actions.
This is a difficult task and I suspect it will be shown in a simple biological system like C-elegans first. My own interest is in cyber-physical systems.
> If read literally, the core intuition is also false because people regularly and deliberately expose themselves to surprise, e.g. gambling, watching sports. Now there are various ad-hoc fixes to save free-energy-minimisation, but then which of them many conflicting ad-hoc fixes?
This is the dark-room argument, which as you suggest has been beat to death. I admit to not understanding what the problem is. If a system has an internal model that keeps it from exploring then it would die (of starvation). What states are surprising is all about the priors (that are designed by evolution presumably) and experience. I think it is also important to be clear that surprise is used in a very technical statistical sense.
"The figures in these manuscripts can be reproduced using annotated (MATLAB/Octave) code that is available as part of the free and open source academic software SPM. The routines are called by a demonstration script that can be invoked by typing DEM_COVID or DEM_COVID_X at the MATLAB prompt. At the time of writing, these routines are available in the development version of the next SPM release."
In my view Friston's ideas are hardly vague. Hard to understand sometimes, yes, but when I have put in the effort to understand them I have always been rewarded.
I think it is pretty clear from the paper that the average is over time.
The most detailed (and certainly not vague) description is given in "A Free Energy Principle for Biological Systems", Entropy 2012
> How for example do the 302 neurons of C elegans average?
They don't. An agent can optimize an objective without computing it explicitly.
> Free Energy does not make interesting predictions for neuroscience
What is your objection to my proposed prediction above, that we will find brain models with observable activity that follows the FEP?
Friston also has many papers that explain known facts in terms of FEP. I will grant you those are not predictions but they are consistency arguments.
> none of the progress in AI/ML has come from the Free Energy millieu either
Free energy is a dynamical version of variational Bayes, which has had enormous impact in ML/AI.