← Latest papers
🔢 mathematics

Compositional Dynamics in Learning and Mechanics

This paper introduces a unified compositional framework using the operad of smooth adaptive arrangements to demonstrate that both gradient-based learning and Hamiltonian mechanics arise as functorial semantics, where a single "lens internalization" construction yields either dissipative gradient descent or conservative wave dynamics depending on whether the system tracks only position or both position and momentum.

Original authors: David I. Spivak

Published 2026-06-30
📖 5 min read🧠 Deep dive

Original authors: David I. Spivak

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a giant box of LEGO bricks. Some bricks are simple, like a single red block. Others are complex machines with wires, gears, and knobs. In the world of math and computer science, we often want to build big, complex systems by snapping these smaller pieces together.

This paper, by David Spivak, introduces a new, universal "instruction manual" (a mathematical framework) for how to snap these pieces together. The amazing thing is that this single manual explains two very different worlds that usually don't talk to each other: learning (like training an AI) and physics (like how a spring bounces or a wave ripples).

Here is the breakdown of how it works, using simple analogies.

1. The "Smart Box" (The Adaptive Arrangement)

Usually, when you connect two LEGO boxes, the connection is static. A wire just carries a signal from A to B.

But this paper imagines "Smart Boxes." These boxes have three special features:

  • An Input and Output: They receive data and send data out.
  • A Knob (The Parameter): Inside the box, there is a dial that can be turned. This represents things like the "weights" in a neural network or the "stiffness" of a spring.
  • A Goal (The Potential): The box has a built-in desire to minimize something. In a computer, this is the "error" (how wrong the answer is). In physics, this is "potential energy" (how high a ball is).

The paper calls these Smooth Adaptive Arrangements. Think of them as LEGO bricks that can change their own shape based on what's happening inside them and what they are trying to achieve.

2. The Two Lenses: Looking at the Same Box Differently

The paper's biggest trick is showing that you can look at the same Smart Box in two different ways, depending on which "lens" you put on your glasses.

Lens A: The "Descent" Lens (Configuration Dynamics)

Imagine you are hiking down a mountain. You look at the ground, feel the slope, and take a step downhill.

  • How it works: The box looks at its "Goal" (the error or energy), calculates the steepest path down, and updates its internal "Knob" to move in that direction.
  • What it creates: This is exactly how Gradient Descent works in machine learning. It's how computers learn. The "backward pass" (backpropagation) is just the box figuring out which way is "downhill" and sending that instruction back through the wires.
  • The Paper's Claim: The paper proves that if you build a neural network out of these Smart Boxes and look at them through this lens, you get the exact math used to train AI.

Lens B: The "Momentum" Lens (Phase Dynamics)

Now, imagine you are a surfer riding a wave. You don't just move where the water pushes you; you carry your own speed (momentum). You might overshoot a little, then correct.

  • How it works: This lens doesn't just look at the current slope; it also remembers the "velocity" or "momentum" of the system. It updates the position and the speed simultaneously.
  • What it creates: This is Hamiltonian Mechanics, the math used to describe how planets orbit or how springs vibrate.
  • The Paper's Claim: If you take the exact same Smart Box (with the same wiring and the same goal) and look at it through this second lens, you get the Wave Equation. It describes how energy ripples through a chain of particles.

3. The Magic: One System, Two Realities

The most surprising part of the paper is that the system doesn't change; only your perspective does.

  • The Setup: Imagine a chain of springs connected to each other.
  • Perspective 1 (Descent): If you treat this chain as a learning machine trying to minimize energy, it behaves like a Heat Equation. The heat dissipates, and the system settles down. It's "dissipative" (it loses energy).
  • Perspective 2 (Momentum): If you treat the same chain as a physical object with momentum, it behaves like a Wave Equation. The energy bounces back and forth forever. It's "conservative" (it keeps energy).

The paper proves that these are just two different "readings" of the same underlying mathematical structure. You can swap the "lens" (the integrator) to switch between a learning algorithm and a physics simulation without rebuilding the system.

4. Why This Matters (According to the Paper)

The paper claims this is a "compositional" setting. This means:

  • Nesting: You can build a huge system by snapping smaller Smart Boxes together.
  • Automatic Assembly: If you know how one small box moves (its rules), the math automatically tells you how the whole giant machine moves. You don't have to re-calculate everything from scratch.
  • Executable: The paper claims these aren't just abstract ideas. Because the rules are so clear, you can take a diagram of these boxes and "compile" it into a computer program that actually runs, simulating either a learning AI or a bouncing spring.

Summary Analogy

Think of a Swing.

  • If you look at the swing through the Descent Lens, you see a child trying to stop. They push against the motion to slow down. This is like training a computer to stop making mistakes.
  • If you look at the swing through the Momentum Lens, you see a child pumping their legs to go higher. They use the momentum to keep moving. This is like physics describing how the swing naturally oscillates.

This paper provides the single set of blueprints that explains how to build the swing, and proves that whether it acts like a learning machine or a physics object depends entirely on which set of rules (lens) you apply to the blueprints.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →