<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc 3.13" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <title>01_introduction.md.web</title>
  <style>
    /* Default styles provided by pandoc.
    ** See https://pandoc.org/MANUAL.html#variables-for-html for config info.
    */
    html {
      color: #1a1a1a;
      color: light-dark(#1a1a1a, #fdfdfd);
      background-color: #fdfdfd;
      background-color: light-dark(#fdfdfd, #1a1a1a);
      color-scheme: light dark;
    }
    body {
      margin: 0 auto;
      max-width: 36em;
      padding-left: 50px;
      padding-right: 50px;
      padding-top: 50px;
      padding-bottom: 50px;
      hyphens: auto;
      overflow-wrap: break-word;
      text-rendering: optimizeLegibility;
      font-kerning: normal;
    }
    @media (max-width: 600px) {
      body {
        font-size: 0.9em;
        padding: 12px;
      }
      h1 {
        font-size: 1.8em;
      }
    }
    @media print {
      html {
        color-scheme: light only;
      }
      html, body, pre, code {
        background-color: transparent;
      }
      body, a, a:visited, blockquote {
        color: black;
      }
      pre, code {
        padding: 0;
      }
      p, h2, h3 {
        orphans: 3;
        widows: 3;
      }
      h2, h3, h4 {
        page-break-after: avoid;
      }
    }
    p {
      margin: 1em 0;
    }
    a, a:visited {
      color: inherit;
    }
    img {
      max-width: 100%;
    }
    svg {
      height: auto;
      max-width: 100%;
    }
    h1, h2, h3, h4, h5, h6 {
      margin-top: 1.4em;
    }
    h5, h6 {
      font-size: 1em;
      font-style: italic;
    }
    h6 {
      font-weight: normal;
    }
    ol, ul {
      padding-left: 1.7em;
      margin-top: 1em;
    }
    li > ol, li > ul {
      margin-top: 0;
    }
    blockquote {
      margin: 1em 0 1em 1.7em;
      padding-left: 1em;
      border-left: 2px solid;
      border-color: #e6e6e6;
      border-color: light-dark(#e6e6e6, #4c4c4c);
      color: #606060;
      color: light-dark(#606060, #b6b6b6);
    }
    code {
      white-space: pre-wrap;
      font-family: Menlo, Monaco, Consolas, 'Lucida Console', monospace;
      font-size: 85%;
      margin: 0;
      hyphens: manual;
    }
    pre {
      margin: 1em 0;
      overflow: auto;
    }
    pre code {
      padding: 0;
      overflow: visible;
      overflow-wrap: normal;
    }
    .sourceCode {
     background-color: transparent;
     overflow: visible;
    }
    hr {
      border: none;
      border-top: 1px solid currentColor;
      height: 1px;
      margin: 1em 0;
    }
    table {
      margin: 1em 0;
      border-collapse: collapse;
      width: 100%;
      overflow-x: auto;
      display: block;
      font-variant-numeric: lining-nums tabular-nums;
    }
    table caption {
      margin-bottom: 0.75em;
    }
    tbody {
      margin-top: 0.5em;
      border-top: 1px solid currentColor;
      border-bottom: 1px solid currentColor;
    }
    th {
      border-top: 1px solid currentColor;
      padding: 0.25em 0.5em 0.25em 0.5em;
    }
    td {
      padding: 0.125em 0.5em 0.25em 0.5em;
    }
    header {
      margin-bottom: 4em;
      text-align: center;
    }
    #TOC li {
      list-style: none;
    }
    #TOC ul {
      padding-left: 1.3em;
    }
    #TOC > ul {
      padding-left: 0;
    }
    #TOC a:not(:hover) {
      text-decoration: none;
    }
    span.smallcaps{font-variant: small-caps;}
    div.columns{display: flex; gap: 1.5em;}
    div.column{flex: auto;}
    @media screen {
    div.columns{gap: min(4vw, 1.5em);}
    div.column{overflow-x: auto;}
    }
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    /* The extra [class] is a hack that increases specificity enough to
       override a similar rule in reveal.js */
    ul.task-list[class]{list-style: none;}
    ul.task-list li input[type="checkbox"] {
      font-size: inherit;
      width: 0.8em;
      margin: 0 0.8em 0.2em -1.6em;
      vertical-align: middle;
    }
  </style>

<link data-template-favicon rel="icon" href="favicon.ico">

<style>
:root {
  --brand-1: #5b6ee0;
  --web-bg: #f8f8f8;
  --web-surface: #ffffff;
  --web-text: #2c3e50;
  --web-border: #bdc3c7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-1: #7e8ce8;
    --web-bg: #0f1420;
    --web-surface: #161c2b;
    --web-text: #e6eaf2;
    --web-border: #2a3447;
  }
}
.theorem-box {
  border-left: 4px solid var(--brand-1);
  background: var(--web-surface);
  padding: 0.6em 1em;
  margin: 1.1em 0;
  border-radius: 0 4px 4px 0;
}
.theorem-box.definition { border-left-style: dashed; }
.theorem-box > p:first-child { margin-top: 0; }
.theorem-box > p:last-child { margin-bottom: 0; }
.figure-long-description {
  border: 1px solid var(--web-border);
  border-radius: 4px;
  margin-block: 0.75rem;
  padding: 0.5rem 0.75rem;
}
.figure-long-description > summary { cursor: pointer; font-weight: 700; }
.figure-long-description > p { max-width: 80ch; overflow-wrap: anywhere; }
.figure-exact-values { max-width: 80ch; overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; word-break: break-word; }
pre {
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
pre code { overflow-wrap: inherit; white-space: inherit; word-break: inherit; }
div.sourceCode { max-width: 100%; overflow: visible; }
pre.sourceCode { background: #2c3e50; color: #ecf0f1; }
pre.sourceCode code,
pre.sourceCode code span { color: inherit; }
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}
mjx-container[display="true"] { max-width: 100%; overflow: visible; }
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}
.table-scroll:focus-visible {
  outline: 3px solid var(--brand-1);
  outline-offset: 3px;
}
.table-scroll > table { margin-block: 0; display: table; min-width: 100%; width: 100%; }
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  font-family: 'Liberation Serif', 'Times New Roman', serif;
  line-height: 1.6;
  width: min(100%, 800px);
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f8f8f8;
  color: #1a1a1a;
  overflow-wrap: break-word;
  overflow-x: hidden;
  overflow-x: clip;
}

main,
nav,
section,
article,
figure,
figcaption {
  min-width: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 0.65rem 0.9rem;
  transform: translateY(-120%);
  background-color: #1a1a1a;
  color: #ffffff;
  font-family: sans-serif;
  font-weight: 700;
  text-decoration: underline;
}

.skip-link:visited {
  color: #ffffff;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
}

@media (max-width: 600px) {
  body {
    width: 100%;
    max-width: 100%;
    padding: 16px;
  }

  figure img {
    width: 100% !important;
  }
}

@media (max-width: 800px) {
  body {
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
  }
}

h1, h2, h3, h4, h5, h6 {
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 5px;
  overflow-wrap: anywhere;
}

code {
  background-color: #ecf0f1;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Liberation Mono', 'Courier New', monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 5px;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  overflow-wrap: inherit;
  white-space: inherit;
  word-break: inherit;
}

div.sourceCode {
  max-width: 100%;
  overflow: visible;
}

pre.sourceCode {
  background: #2c3e50;
  color: #ecf0f1;
}

pre.sourceCode code,
pre.sourceCode code span {
  color: inherit;
}

pre > code.sourceCode {
  white-space: pre-wrap;
}

pre > code.sourceCode > span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px 0;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.table-scroll:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 3px;
}

.table-scroll > table {
  margin-block: 0;
  display: table;
  min-width: 100%;
  width: 100%;
}

figure {
  max-width: 100%;
  margin: 1.5rem 0;
}

th, td {
  border: 1px solid #bdc3c7;
  padding: 8px;
  text-align: left;
}

th {
  background-color: #1f6f8b;
  color: white;
}

/* Preserve a complete inline-code header within the table's scroll region. */
th code {
  color: inherit;
  background-color: transparent;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

img {
  max-width: 100%;
  height: auto;
  border: 1px solid #bdc3c7;
  border-radius: 5px;
  margin: 20px 0;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

a {
  color: #b91c1c;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}

a:visited {
  color: #8f1d1d;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

a:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 3px;
}

.toc {
  background-color: #ecf0f1;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 30px;
}

.toc a,
#TOC a {
  color: #b91c1c;
  display: inline-block;
  min-height: 28px;
  line-height: 1.5;
  padding-block: 2px;
}

.toc li,
#TOC li {
  margin-block: 1px;
}

.math {
  text-align: center;
  margin: 20px 0;
  font-size: 1.1em;
}

mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow: visible;
  padding-bottom: 0.25rem;
}

.figure {
  text-align: center;
  margin: 30px 0;
}

.figure img {
  max-width: 100%;
  height: auto;
  border: 2px solid #3498db;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* A reading column keeps prose comfortable, but dense scientific figures need
   a larger inspection surface.  The rendered image remains responsive and the
   explicit link opens its source-resolution asset without changing the PDF. */
.figure-full-size-link {
  color: inherit;
  display: block;
  max-width: 100%;
  text-align: center;
}

.figure-full-size-link img {
  cursor: zoom-in;
  margin-bottom: 0.45rem;
}

.figure-full-size-label {
  color: #1f6f8b;
  display: inline-block;
  font-family: sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.figure-full-size-link:focus-visible {
  outline: 3px solid #1f6f8b;
  outline-offset: 4px;
}

@media (min-width: 1000px) {
  /* Wide figure links stay within the viewport but extend beyond the prose
     column. Do not clip their labels at the narrower body boundary. */
  body {
    overflow-x: visible;
  }

  .figure-full-size-link {
    left: 50%;
    max-width: none;
    position: relative;
    transform: translateX(-50%);
    width: min(1080px, calc(100vw - 3rem));
  }
}

.figure-caption {
  font-style: italic;
  color: #4b5563;
  margin-top: 10px;
  text-align: center;
}

.figure-long-description,
.figure-exact-values {
  max-width: 100%;
  overflow-wrap: anywhere;
}

</style>
<script data-template-source-font-loader src="assets/source-web-fonts.js"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to main content</a>
<main id="main-content" tabindex="-1">
<h1 id="sec:introduction">Introduction</h1>
<h2 id="motivation">Motivation</h2>
<p>Active Inference has matured into a broad research program spanning
the free energy principle [friston2010], discrete state-space
formulations of perception and action [dacosta2020], and a growing body
of pedagogy and reference implementations [parr2022; smith2022]. Recent
graphical-specification and message-passing work makes the same
practical pressure visible: active-inference agents need representations
that can be inspected as model structure and then carried into
executable inference updates without being reauthored by hand
[koudahl2023syntheticAgents1; vandelaaar2023syntheticAgents2;
bagaev2021reactiveMessagePassing]. As the field has grown, so has a
quieter problem: the models themselves are difficult to share,
reproduce, and compare. A generative model that lives only as a tangle
of matrix definitions inside one author’s script, a diagram in a slide
deck, and a paragraph of prose in a paper has no single authoritative
form. The same model is described three times, in three incompatible
media, with no guarantee that they agree. When a reader wants to re-run
that model in a different toolkit, they must reverse-engineer it from
whichever fragment they happen to have.</p>
<p>This is a reproducibility and interoperability crisis specific to the
structure of Active Inference work. The discipline depends on precisely
specified state spaces, observation and transition tensors, prior
preferences, and policy structures; small notational ambiguities
propagate into materially different behaviour. The heterogeneity of the
models themselves compounds the problem: the field works in several
model kinds at once — discrete categorical POMDPs over finite state
spaces, continuous linear-Gaussian state-space models, multi-agent
systems whose agents each carry their own generative vocabulary,
hierarchical compositions layered over timescales — and each kind
attracts its own notation, its own notebooks, and its own simulation
stack. Yet the community has lacked a notation that is simultaneously
human-readable, machine-parseable, and faithful to the underlying
mathematics across those kinds. Generalized Notation Notation (GNN) was
introduced to fill exactly that gap [gnn2023]: a standard, text-based
way to write down an Active Inference generative model once, such that
every downstream use derives from the same source of truth.</p>
<h2 id="the-gnn-approach">The GNN Approach</h2>
<p>GNN treats the model specification as a first-class artifact. A model
is written in a plain-text language whose syntax captures the components
an Active Inference modeller actually reasons about — state factors,
observation modalities, the matrices that link them, control structure,
and the temporal organization of the model — and whose declared matrix
vocabulary fixes which kind of generative model the file denotes:
categorical
<code>A</code>/<code>B</code>/<code>C</code>/<code>D</code>[/<code>E</code>]
tensors for a discrete state-space model, linear-Gaussian system
matrices for a continuous one, per-agent and per-level compositions for
structured variants. Because the specification is text, it lives
comfortably in version control, diffs cleanly across revisions, and can
be authored and reviewed by humans without specialized tooling.</p>
<p>The defining commitment of GNN is what the project calls the Triple
Play: a single text specification is the common origin for three
coordinated renderings of the same model. The text form is the
authoritative, editable description. From it, GNN produces graphical
visualizations that expose the model’s factor and dependency structure
for inspection and communication. And from the same source it produces
executable cognitive models that can actually be run, so that the
diagram, the equations, and the running code are all generated from one
parsed document rather than three artifacts that merely claim to
describe the same model. The Triple Play turns a model from a
description scattered across media into one specification with traceable
projections (see <span class="citation"
data-cites="fig:triple_play">[@fig:triple_play]</span>). Shared source
identity supports their comparison; parameter, orientation, model-kind,
and numerical checks are still required to establish fidelity.</p>
<h2 id="contributions">Contributions</h2>
<p>This work contributes a standard notation together with the
infrastructure that makes it usable in practice:</p>
<ul>
<li><strong>A parseable, human-readable notation</strong> for Active
Inference generative models, whose text form is authoritative and from
which every other representation is derived.</li>
<li><strong>A model-kind taxonomy with per-kind rendering and execution
semantics</strong> — discrete categorical, continuous linear-Gaussian,
multi-agent, hierarchical, learning, and structural kinds, classified
structurally from the declared notation and rendered or
recorded-unsupported per backend — so that what a specification can do
on a given framework is a checkable property of the model’s kind, not a
trial-and-error discovery.</li>
<li><strong>A 25-step processing pipeline</strong> (0–24), whose stages
are implemented across 44 source packages, that carries a specification
from parsing and validation through visualization, rendering, and
execution.</li>
<li><strong>12 rendering backends</strong> (PyMDP, RxInfer.jl,
ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan, bnlearn,
cpomdp, THRML, ngc-learn) that materialize a single GNN specification as
backend-specific model code, of which 12 (PyMDP, RxInfer.jl,
ActiveInference.jl, JAX, DisCoPy, PyTorch, NumPyro, Stan, bnlearn,
cpomdp, THRML, ngc-learn) have Step 12 execution adapters. Actual
execution requires an admitted model, a ready runtime, and a
source-bound run receipt.</li>
<li><strong>164 Model Context Protocol tools</strong> that expose the
pipeline’s capabilities to agentic and programmatic clients, so the
notation and its tooling are directly accessible to automated
workflows.</li>
<li><strong>9-family reliability gates</strong> that exercise the
pipeline against a curated set of model families (basics, discrete,
continuous, hierarchical, multiagent, precision, structured, gridworld,
scaling-study), turning interoperability claims into checks that must
pass rather than assertions that are merely made.</li>
</ul>
<h2 id="reader-orientation">Reader Orientation</h2>
<p>The remainder of this manuscript is organized to move from language
to mechanism to evidence. <span class="citation"
data-cites="sec:system_context">[@sec:system_context]</span> states the
notation and the model kinds it denotes — the discrete categorical
factorization, its four matrices, and its two free-energy objectives as
explicit equations (<span class="citation"
data-cites="eq:generative_model">[@eq:generative_model]</span> through
<span class="citation" data-cites="eq:policy">[@eq:policy]</span>), the
continuous linear-Gaussian state-space kind with its optional
closed-loop control structure (<span class="citation"
data-cites="eq:lgssm_state">[@eq:lgssm_state]</span> through <span
class="citation" data-cites="eq:closed_loop">[@eq:closed_loop]</span>),
and the multi-agent, hierarchical, learning, and structural compositions
— and it presents the model-kind table (<span class="citation"
data-cites="tbl:model_kinds">[@tbl:model_kinds]</span>), the pipeline
structure (<span class="citation"
data-cites="fig:pipeline">[@fig:pipeline]</span>), the Triple Play
(<span class="citation"
data-cites="fig:triple_play">[@fig:triple_play]</span>), and the
per-step responsibility table (<span class="citation"
data-cites="tbl:pipeline_steps">[@tbl:pipeline_steps]</span>). <span
class="citation" data-cites="sec:methods">[@sec:methods]</span> follows
a specification through the pipeline — parsing, kind-scoped type
checking, rendering, execution, and reporting — and presents the backend
registry (<span class="citation"
data-cites="tbl:backend_registry">[@tbl:backend_registry]</span>), the
per-kind framework capability matrix (<span class="citation"
data-cites="tbl:framework_capability">[@tbl:framework_capability]</span>),
the backend registry surface (<span class="citation"
data-cites="fig:backend_matrix">[@fig:backend_matrix]</span>), and the
long-running orchestration contracts (<span class="citation"
data-cites="fig:orchestration">[@fig:orchestration]</span>). <span
class="citation"
data-cites="sec:artifacts_evidence">[@sec:artifacts_evidence]</span>
reports what the project has produced and how each number is grounded,
with the model-family registry (<span class="citation"
data-cites="tbl:model_families">[@tbl:model_families]</span>), the
family-by-framework coverage (<span class="citation"
data-cites="fig:family_matrix">[@fig:family_matrix]</span>), and
repository-scale metrics (<span class="citation"
data-cites="fig:repo_metrics">[@fig:repo_metrics]</span>). <span
class="citation"
data-cites="fig:graphical_abstract">[@fig:graphical_abstract]</span>
condenses this same arc — specification, validation, rendering,
execution, analysis, and interchange — into the summary panel at the
head of the manuscript. Claims of independent re-execution are addressed
in <span class="citation"
data-cites="sec:reproducibility">[@sec:reproducibility]</span>, the
boundaries of the current system in <span class="citation"
data-cites="sec:limitations_next_steps">[@sec:limitations_next_steps]</span>,
the symbol and construct tables in <span class="citation"
data-cites="sec:symbols_glossary">[@sec:symbols_glossary]</span>, and
full source details in <span class="citation"
data-cites="sec:references">[@sec:references]</span>. Read in this
order, the manuscript moves from why a standard notation is needed,
through how GNN realizes it across model kinds, to the scoped evidence
available for the notation and its implementations.</p>
</main>
</body>
</html>
