Predictive Coding

Mike's Notes

Alex Shkotin kindly shared two links to websites with me last night. One is the Verses Research Roadmap, which looks close to CAS. Here is an interesting discussion on the Ontolog Forum and a fascinating article from Verses.

It's the same approach I used to successfully build Pipi 9. The main difference is that Pipi is software running on a server containing hundreds of interacting agents causing emergent and adaptive properties. Pipi also sets out to provide a Complex Adaptive System (CAS) as a SAAS platform to host SAAS CAS Applications.

I did this through curiosity-led experimentation inspired by the computer modelling of biological cells. Verses' approach is led by the research-led theory of the brain. So, I found the research reading below a possible insight into why my experiments worked. I need to do some reading to understand the theory better.

Here is a number of extracts from multiple websites covering the discussion and background.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library > Authors > John Sowa
  • Home > Handbook > 

Last Updated

14/05/2025

From the Verses AI website

By: 
Verses AI website: 01/01/2024

"Biological agents are efficient, curious, self-organizing systems that anticipate the effects of their actions on the world while smoothly coping with noise and uncertainty. The human brain, while an essential source of inspiration for AI, is only one manifestation of such capacities, which characterize intelligence in nature at many scales. 

The hypothesis guiding research and development at VERSES AI is that artificial general intelligence (AGI) can be attained by discovering the deeper principles underlying biological intelligence and deploying them as design principles to construct cyber-physical ecosystems of intelligent agents in which humans are integral participants — what we call “shared intelligence”.

We originally laid out this vision for the present and future of AI in our white paper at the end of 2022. ..."


Ontolog Forum

The discussion on the Ontolog Forum was raised by John Sowa and about Dr. Karl Firston, Chief Scientist at Verses AI.

"After a bit of searching, I found more info about Verses AI and their new chief scientist. I like the approach they're taking: putting more emphasis on natural thinking process in neuroscience. And their new chief scientist has publications that would lead them in that direction. The ideas look good, and I would recommend them. But I don't know how far he and his colleagues have gone in implementing them, or how long it will take for anything along those lines to be running in a practical system.

However, it's unlikely that any company would hire somebody as chief scientist without a considerable amount of prior work. And I doubt that any company would make an announcement in a full-page ad in the New York Times unless they already had some kind of prototype. ..." - From the Ontolog Forum


A recent book (2022) from MIT Press with a foreword by Friston covers the field:  "Active Inference: The Free Energy Principle in Mind, Brain, and Behavior."  Chapters of that book can be downloaded for free.  Appendix C has an annotated example of the Mathlab code.


From Wikipedia

Karl John Friston FRS FMedSci FRSB (born 12 July 1959) is a British neuroscientist and theoretician at University College London. He is an authority on brain imaging and theoretical neuroscience, especially the use of physics-inspired statistical methods to model neuroimaging data and other random dynamical systems. 

Friston is a key architect of the free energy principle and active inference. In imaging neuroscience, he is best known for statistical parametric mapping and dynamic causal modelling.

In October 2022, he joined VERSES Inc, a California-based cognitive computing company focusing on artificial intelligence designed using the principles of active inference, as Chief Scientist.


Friston is one of the most highly cited living scientists and in 2016 was ranked No. 1 by Semantic Scholar in the list of top 10 most influential neuroscientists.


In the discussion, Dan Brickley of W3C, Dublin Core, Schema.org and Google Research shared this GIT hub



Repository maintained by Beren Millidge. who is a Postdoctoral Researcher in Machine Learning and Computational Neuroscience at the University of Oxford. Unravelling intelligence in both brains and machines.

Predictive Coding Paper Repository

This repository provides a list of papers that are interesting or influential about Predictive Coding. If you believe I have missed any papers, please contact me at beren@millidge.name or make a pull request with the information about the paper. I will be happy to include it.

Predictive Coding

Predictive Coding is a neurophysiologically-grounded theory of perception and learning in the brain. The core idea is that the brain always maintains a prediction of the expected state of the world, and that this prediction is then compared against the true sensory data. Where this prediction is wrong, prediction errors are generated and propagated throughout the brain. The brain's 'task' then is simply to minimize prediction errors.

The key distinction of this theory is that it proposes that prediction-errors, rather than predictions, or direct representation of sense-data is in some sense the core computational primitive in the brain.

Predictive coding originated in studies of ganglion cells in the retina, in light of theories in signal processing, about how it is much more efficient to send only 'different' or 'unpredicted signals' than repeating the whole signal every time -- see delta-encoding.

Predictive coding has several potential neurobiologically plausible process theories proposed for it -- see 'Process Theories' section, although the empirical evidence for precise prediction error minimization in the brain is mixed.

Predictive coding has also been extended in several ways. It can be understood as a variational inference algorithm under a Gaussian generative model and variational distribution. It can be setup as an autoencoder (predict your input, or next-state), or else in a supervised learning fashion.

Predictive coding can also be extended to a hierarchical model of multiple predictive coding layers -- as in the brain -- as well as using 'generalised coordinates' which explicitly model the higher order derivatives a state in order to be able to explicitly model dynamical systems.

More recent work has also focused on the relationship between predictive coding and the backpropagation of error algorithm in machine learning where under certain assumptions, predictive coding can approximate this fundamental algorithm in a biologically plausible fashion. Although the exact details and conditions still need to be worked out.

There has also been much exciting work trying to merge predictive coding with machine learning to produce highly performant predictive-coding-inspired architectures.

Surveys and Tutorials

This is a great review which introduces the basics of predictive coding and its interpretation as variational inference. It also contains sample MATLAB code that implements a simple predictive coding network. I would start here.

This review walks through the mathematical framework and potential neural implementations in predictive coding, and also covers much recent work on the relationship between predictive coding and machine learning.

This is a fantastic review which presents a complete walkthrough of the mathematical basis of the Free Energy Principle and Variational Inference, and derives predictive coding and (continuous time and state) active inference. It also presents the 'full-construct' predictive coding including with hierarchical layers and generalised coordinates in an accessible fashion. I would reccomend reading this after Bogacz' tutorial (although be prepared -- it is a long and serious read)

A short and concise review of predictive coding algorithms up to 2017.

A nice review of simple predictive coding architectures with a focus on their potential implementation in the brain.

Classics

A key influential early paper proposing predictive coding as a general theory of cortical function.

One of the earliest works proposing predictive coding in the retina.

An early but complete description of predictive coding as an application of the FEP and variational inference under Gaussian and Laplace assumptions. Also surprisingly readable. This is core reading on predictive coding and the FEP

The first paper establishing the links between predictive coding and variational inference.

Makes a conjectured link between precision in predictive coding and attention in the brain.

Presents the 'full-construct' predictive coding model with both hierarchies and generalised coordinates.

Extends predictive coding to generalised coordinates, and derives the necessary inference algorithms for working with them -- i.e. DEM, dynamic expectation maximisation.

Foundational treatment of variational inference for dynamical systems, as represented in generalised coordinates. Also relates variational filtering to other non-variational schemes like particle filtering and Kalman filtering.

Andy's book is great for a high level overview, strong intuition pumps for understanding the theory, and a fantastic review of potential evidence and neuropyschiatric applications.

Neurobiological Process Theories

A key process theory paper. Proposing perhaps the default implementation of predictive coding in cortical layers.

Demonstrates that predictive coding is equivalent to popular biased competition models of neural function.

A process theory of predictive coding including action predictions which implement active inference (continuous version).

A great review delving deep into the evidence for predictive coding being implemented in the brain. Evidence is currently somewhat lacking, although the flexibility of the predictive coding framework allows it to encompass a lot of the findings here.

Neuroscience applications

Relationship to Backpropagation

PC-inspired machine learning

Extensions and Developments

This paper investigates how serveral biologically implausible aspects of the standard predictive coding algorithm -- namely requiring symmetric forward and backward weights, nonlinear derivatives, and 1-1 error unit connections can be relaxed without unduly harming performance of the network.

This paper further looks at how various implausibility of the predictive coding algorithm can be relaxed, and focuses especially on the question of how negative prediction errors could be represented, as well as invents a divisive prediction error scheme -- where prediction errors are the activities divided by the predictions.

UK Government Design System

Mike's Notes

The UK Government has created a design system for building accessible websites. It includes many templates, components, tools, code, and guidance on achieving this.

I am using this design system as a starting point for making the Pipi User Interface (UI) fully accessible.

Please note: This blog is for a technical audience and is intended to help Mike (me), who has synesthesia (that's why everything is colour-coded), keep notes and share them with collaborators. It is not intended to be accessible.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library >
  • Home > Handbook > 

Last Updated

18/05/2025

UK Government Design System

By: Mike Peters
On a Sandy Beach: 31/12/2023

Mike is the inventor and architect of Pipi and the founder of Ajabbi.









User Testing

Assume every person is unique and allow for personalisation. W3C WCAG 2.1 is the standard to aim for. Accessibility testing is underway in English for,

  • Braille Devices for the Deaf-Blind
  • Screen Readers
  • Screen Magnifiers
  • Low Vision
  • Irlen's
  • Colour Blindness
  • Dyslexia
  • Dyscalculia
  • Autism
  • Epilepsy
  • Synesthesia
  • Strokes
  • Older adults require a more straightforward UI
  • Muscular Dystrophy (large buttons)

The current testing process steps are,

  1. Speak to groups of people and their organisations with everyday accessibility needs. Ask for volunteers.
  2. Watch and learn from people who volunteer with accessible needs. How do they find using a computer to visit and use a website? What are the problems? What works?
  3. Use personalised handmade web pages for volunteers to test.
  4. Configure the Content Management System (CMS) to generate the web UI automatically to meet the individual accessibility needs of logged-in users.

UK Gov Design System

UK Gov Design System

The UK government's design principles and examples of their use.

  1. Start with user needs
  2. Do less
  3. Design with data
  4. Do the hard work to make it simple
  5. Iterate. Then iterate again
  6. This is for everyone
  7. Understand context
  8. Build digital services, not websites
  9. Be consistent, not uniform
  10. Make things open: it makes things better
The Design System components are reusable parts of the user interface that have been made to support various applications.

  • Accordion
  • Backlink
  • Breadcrumbs
  • Button
  • Character count
  • Checkboxes
  • Cookie banner
  • Date input
  • Details
  • Error message
  • Error summary
  • Exit this page
  • Fieldset
  • File upload
  • Footer
  • Header
  • Inset text
  • Notification banner
  • Pagination
  • Panel
  • Phase banner
  • Radios
  • Select
  • Skip link
  • Summary list
  • Table
  • Tabs
  • Tag
  • Task list
  • Text input
  • Textarea
  • Warning text
Patterns are best-practice design solutions for specific user-focused tasks and page types.

Ask users for…
  • Addresses
  • Bank details
  • Dates
  • Email addresses
  • Equality information
  • Gender or sex
  • Names
  • National Insurance numbers
  • Passwords
  • Payment card details
  • Telephone numbers
Help users to…
  • Check if a service is suitable
  • Check answers
  • Complete multiple tasks
  • Confirm a phone number
  • Confirm an email address
  • Contact a department or service team
  • Create a username
  • Create accounts
  • Exit a page quickly
  • Start using a service
  • Recover from validation errors
Pages
  • Confirmation pages
  • Cookies page
  • Page not found
  • There is a problem with the service pages
  • Question pages
  • Service unavailable pages
  • Step-by-step navigation

Free Posters

The UK Home Office has free Accessibility design posters (PDF).

Smashing Magazine

Chrome's web.dev

System Design

Mike's Notes

I discovered this great newsletter, which uses simple stories and visual explanations of complex IT systems.

Resources

References

  • Reference

Repository

  • Home > Ajabbi Research > Library > Subscriptions > System Design
  • Home > Handbook > 

Last Updated

17/05/2025

Article

By: Mike Peters
On a Sandy Beach: 30/12/2025

Mike is the inventor and architect of Pipi and the founder of Ajabbi.

NK has a website and weekly email newsletter to teach system design. These are excellent resources and beautifully written with great diagrams. 

The System Design website gives architectural deep dives and system design fundamentals.

The weekly newsletter gives simplified case studies, curated valuable resources and a feed of recent posts.


Here is a recent selection of links to his articles that arrived in my inbox today.
A full list is here

Using ColdFusion as a Static Site Generator

Mike's Notes

Pipi has its own static site generator (SSG).

Resources

References

  • The Content Management Bible

Repository

  • Home > Ajabbi Research > Library > Authors > Bob Boiko
  • Home > Handbook > 
  • Hoem > pipiWiki > Engines > CMS

Last Updated

17/05/2025

Using ColdFusion as a Static Site Generator

By: Mike Peters
On a Sandy Beach: 29/12/2023

Mike is the inventor and architect of Pipi and the founder of Ajabbi.

Static site generators (SSGs) are engines that use text input files (such as Markdown, reStructuredText, AsciiDoc and JSON) to generate static web pages.

Static sites generated by static site generators do not require a backend after site generation, making them first-class citizens on content delivery networks (CDNs).

Some of the most popular static site generators are Jekyll, Hugo, Next.js (JavaScript), and Angular (TypeScript). SSGs are typically used for rarely changing, informative content, such as product pages, news websites, (software) documentation, manuals, and blogs.

Pipi 2

From 2000 to 2001, Pipi 2 used templates written in Visual Basic and stored in "Backpage", an Access Database, to render thousands of HTML web pages. I did the database design, Matthew Carter wrote the VB, and Graeme Cook gave helpful advice about MS Access. Many separate Access Databases store the data that the templates use to create each page.

Pipi 4

From 2005 to 2008, Pipi4 used templates written in ColdFusion CFML code to render 25,000 static HTML pages from data stored in an MS SQL 6 database. Each week, on a Wednesday morning, it took 2 hours to render every page. The logic was stored in a library of 550 class objects.

The book "The Content Management Bible" by Bob Boiko was a great help to me in figuring out how to build the CMS and the rendering engine.





Pipi 9

Now, in Pipi 9, the Pipi 7 CMS has been rebuilt. CFML templates have been added to automatically create a series of linked Wiki articles (like Wikipedia) that give an overview of each system and subsystem, and a set of classically framed "PipiDocs" (a bit like JavaDocs) that drill into the minute detail of each system.

The Wiki and Docs are also cross-linked. The next stage enables direct editing of the parameters of the underlying systems, which the Wiki and Docs then self-document—a reverse loop of sorts.

During testing in October 2023, 1200 static Wiki web pages of 300 systems were rendered in 7 seconds. I was surprised by how fast it was. This is a significant 500x performance improvement on Pipi 4. 

The CFML templates are nested and use a rule engine to determine where, when, and how they are used. As in Bob Boiko's book, I use content-type templates. In some ways, CFML is similar to Jekyll but much more powerful. CFML is straightforward to use and makes for fast prototyping.