BioLogic: does the brain need a common language?

I started this in January 2024 by playing with Hopfield networks for a class, and somehow it’s still following me around. At first it was a fairly small question: if a recurrent network can remember a pattern, could I use those patterns as the states of a finite-state machine and teach it to move between them? I could already draw the diagram. Circles, arrows, input labels, all wonderfully discrete. The neuron part turned out to be considerably less cooperative.

This became BioLogic State Machines, although there have been so many versions of it that the name is probably doing a little too much work by now. There was the original associative-memory construction, all the arguments I had with myself about whether transitions needed intermediate states, learning the transitions, stability, language recognition, trying to give the thing biological interpretations, papers I found along the way and people I talked to at conferences, and eventually a separate line of work on certifying continuous-time recurrent dynamics. I keep going back to the same few questions, which is why I still group it all together.

A memory is a nice place to start

Hopfield networks were convenient because I could actually picture what was going on. Store a pattern, perturb it a little, let the dynamics bring it back. The pattern is an attractor and some neighbourhood around it belongs to its basin, which is exactly the sort of thing you would want if you intend to call some neural configuration a state without requiring the system to reproduce one sacred vector of numbers forever.

Now suppose the current pattern represents AA and the input is aa. I want the network to move to BB and stay there long enough that the next input sees BB. And, somewhere else in the network, the same input presented in state CC should perhaps do nothing. In symbols it’s tiny:

δ:S×Σ⟶S.\delta:S\times\Sigma\longrightarrow S.

Writing that little function is trivial. Designing dynamics that actually obey it, especially when every neuron is coupled to other neurons that might be doing slightly unexpected things, became most of the project.

There’s an uncomfortable relationship here: the better a memory is at holding on to its state, the more effort you need to push it out of that state when the input asks it to change. In the first implementations I could make one half of the problem look good and then discover I’d made the other half worse. I spent a lot of time experimenting with explicit edge states, direct transitions, input-dependent selection, Hebbian-style associative registers and more structured transition mechanisms. And then learning them rather than writing each transition down by hand, because otherwise what’s the point of making the construction learnable at all?

The research code includes experiments on finite-state language problems, including Tomita-style and Reber grammars. They’re useful little tasks because the machine can’t just recognize one pattern and congratulate itself: it has to retain the consequence of a transition and use whatever state it actually arrived at to decide the next one. Small mistakes accumulate rather quickly. There’s a difference between the diagram being correct and the experiment going the way the diagram says it should.

Different parts of the brain speaking different languages

Somewhere along the way I became much more interested in what the state machine description was buying me cognitively than in a particular arrangement of synaptic weights.

I have a hard time imagining a universal neural code spoken identically by every circuit in the brain. Different populations can represent information in very different ways, depending on their anatomy and on the sort of computations they perform; and when one subsystem needs to use the result of another, somebody has to make that information usable on the receiving side. This is where the idea of a learnable, stateful interface became exciting to me. A translation can depend on context. The same incoming activity can mean something different if the receiving system is already doing something else.

Think of a collection of small neural subsystems that each have their own dynamics, own representations, own things they can retain or change. If you describe one of them by the states you can reliably distinguish and the transitions you can trigger, you’ve given another subsystem something to interact with, and you can start composing behaviours without specifying every microscopic detail of every component at once. The result could be an extremely complicated behaviour built out of fairly simple local pieces. I love that idea.

There is a long cognitive-science tradition behind functional descriptions, multiple realizability, compositional behaviour and treating representations at different levels of abstraction seriously. I came to this particular problem by following my own rather odd line from a class exercise, and only afterward started finding the relevant literature. One conversation with Risto Miikkulainen in Tokyo, about composing state machines into more complex behaviour and work connected to those ideas, remains one of my favourite memories from the project. It was wonderful to have somebody who’d been thinking about related problems for years find the question interesting enough to discuss.

This whole business of translating between neural languages was a sidequest within the larger project. I still think about it. The model gives you a pleasant way to ask questions about representation and context, and it doesn’t require every population to have the same internal coordinates. There’s rather a lot that could be done with that.

An excursion into the dendrites

I also tried thinking about what might physically implement some of these functional pieces. Real neurons have dendritic trees, local nonlinearities, several kinds of plasticity, and more structure than the ordinary artificial neuron where everything is just summed at the soma. So I started playing with small constructions of Boolean functions using local operations.

One particularly easy construction takes a Boolean function and expands it into minterms:

f(x1,…,xn)=⋁k=1rMk(x1,…,xn).f(x_1,\ldots,x_n)=\bigvee_{k=1}^{r} M_k(x_1,\ldots,x_n).

A minterm specifies one conjunction of conditions, and you can combine these local conditions to reproduce the function. It’s a constructive way to reason about which operations would be required. The interesting property is functional equivalence: many circuits, morphologies and intermediate representations can compute the same function, sometimes much more economically, and there’s room for approximations and imperfect components as well. A complex dendritic tree doesn’t somehow break the argument because it fails to look exactly like the drawing of a minterm gate; that drawing was one way into the problem.

I enjoyed working through that machinery and then trying to imagine how it might fit into a network maintaining state, while also realizing how many biological questions appeared the closer I looked. Which synaptic mechanisms would make such a calculation learnable? How would you identify the relevant input in a real circuit? How stable is the functional equivalence under the actual neural dynamics, and what would you have to measure to tell?

This is roughly where I began drifting into more concrete biological questions, in parallel with the mathematical work. I still find the cognitive construction interesting. I also find it increasingly interesting to know what a particular cell type does, what the actual wiring can support, and how an experiment distinguishes one mechanistic explanation from another. Spending a long time thinking about a model can make you want to get your hands on the system it’s supposed to help you understand.

A small timing rabbit hole

One experiment I remember with a ridiculous amount of affection involved the timing of transitions in a continuous-time system. I was trying out an additional phase-cycle term that could change the probability of accidentally escaping an attractor basin. With a suitable dependence on phase, I could shape an approximately exponential escape-time distribution and move where the escapes concentrated in the cycle, as well as how spread out they were.

It’s a rather specific result to become attached to. I wasn’t using it to claim that I had discovered how some biological circuit times its decisions. I liked being able to imagine a mechanism for something which had previously been a discrete arrow on paper. The network could linger in a region, be more or less susceptible to escape at different times, and suddenly the transition had temporal structure I could play with. Sometimes the fun of a mathematical model is simply that it gives you something new to think with.

Where the questions went

There was no big moment when BioLogic suddenly stopped being interesting. I was already reading more biology and moving toward experimental neuroscience while still developing the model, and the conferences in Split and Tokyo made me more excited about the entire field. They were my first opportunities to talk about my work in an actual research setting, to have people ask proper questions about it, to encounter related work I’d never seen. That was a very good experience.

Over time I also became interested in a more precise version of one old annoyance: if the model says a neural network implements a finite-state machine, what does that promise really cover? A transition that behaves nicely in a plot can fail for a nearby starting condition, and in some of my CTRNN experiments transitions failed even before I’d introduced noise. That question developed into the separate CTRNN verification project, which is considerably narrower and much more mathematical.

BioLogic still feels like a worthwhile place to have spent a few years. The idea of small learnable components and stateful translations between different representations is endlessly fun to talk about, and it sits within a much larger conversation about cognition that I want to keep learning from. I’m currently spending a lot of time reading actual neuroscience, which means there may be fewer new experiments in this repository for a while. I seem to have found several more questions than I started with.