← Latest papers
🧠 neuroscience

A neural circuit algorithm for action grammar

Motivated by monkey experiments, this study demonstrates that a recurrent neural network generates rule-based action sequences by planning initial states along orthogonal directions, executing shapes on specific manifolds, and preserving sequence parameters during transitions, thereby revealing a neural circuit implementation of a symbolic grammar algorithm.

Original authors: Liu, Y., Tian, L. Y., Tenenbaum, J. B., Freiwald, W. A., Wang, X.-J.

Published 2026-10-11
📖 6 min read🧠 Deep dive

Original authors: Liu, Y., Tian, L. Y., Tenenbaum, J. B., Freiwald, W. A., Wang, X.-J.

Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). ⚕️ This is an AI-generated explanation of a preprint that has not been peer-reviewed. It is not medical advice. Do not make health decisions based on this content. Read full disclaimer

The human brain is a master of pattern, capable of taking a finite set of rules and generating an infinite variety of behaviors. This ability to follow abstract instructions—like the grammar that organizes words into sentences or the sequence that turns a series of movements into a coherent action—is a hallmark of intelligence. While modern artificial intelligence has made tremendous strides in recognizing patterns, it often struggles to apply learned rules flexibly to entirely new situations in the way humans and animals do. Scientists have long suspected that the frontal and parietal regions of the brain, areas associated with planning and organization, hold the key to this flexibility. However, the specific machinery inside these neural circuits that allows an animal to learn a rule and then apply it to a more complex problem has remained a mystery. Understanding how a biological network translates a simple instruction into a multi-step plan is essential for bridging the gap between the abstract logic of thought and the physical reality of neurons firing.

To uncover this mechanism, researchers turned to a task that monkeys have already mastered: drawing. In previous experiments, macaque monkeys were shown images containing multiple objects, such as lines and circles, and were asked to trace them in a specific order dictated by a rule, like "lines first, then circles." Remarkably, the monkeys were not explicitly taught the rule; they inferred it from experience. Once they learned the pattern, they could apply it to new images with more objects than they had ever seen before, successfully tracing five lines followed by three circles even if they had only practiced with two lines and one circle. This ability to generalize suggests the brain has an inbuilt bias for learning and using action grammars. To see how this works under the hood, the research team trained a computer model, specifically a recurrent neural network, to perform this same drawing task. By reverse-engineering the model's internal activity, they discovered a precise, three-part algorithm that the network uses to plan and execute these sequences, offering a concrete blueprint for how the brain might solve similar problems.

The researchers found that the network does not simply react to the image as it draws; instead, it formulates a complete plan before the first stroke is made. When the task begins, the network's internal state shifts to a specific starting position that encodes the entire future sequence. Imagine the network's activity as a point in a vast, multi-dimensional space. Before drawing starts, this point moves to a location that simultaneously holds two pieces of information: how many lines need to be drawn and how many circles need to be drawn. Crucially, these two numbers are stored along separate, independent directions within this space, much like how a map uses north-south and east-west axes to locate a point. This initial positioning acts as a high-level blueprint, ensuring the network knows exactly how many repetitions of each shape are required before it even begins to move.

Once the drawing begins, the network executes the plan by moving along a specific path dedicated to the current shape. If the rule is to draw lines first, the network's activity travels along a "line" path, repeating the action for as long as the distance to the end of that path allows. The network does not count out loud; rather, the distance it has to travel along this path corresponds directly to the number of repetitions it must perform. As it moves, it gradually consumes the distance until it reaches the end of the line path. At this precise moment, the network transitions to the next phase. It jumps to a different path dedicated to circles. The brilliance of this system lies in how it handles the transition: the jump is so orderly and parallel that it preserves the information about how many circles are left to draw. The network arrives at the start of the circle path at a distance from the end that perfectly matches the number of circles it needs to produce, allowing it to continue the sequence without losing track of the count.

This mechanism relies on three distinct types of neural activity working in concert. Some neurons are dedicated to identifying which shape is currently being drawn, effectively switching the network's mode from "line" to "circle." Others track the progress of the current stroke, signaling how many repetitions remain. Finally, a specific group of neurons becomes highly active right at the boundary between shapes, acting as a trigger that drives the network from one path to the next. The researchers observed that as the network nears the end of a sequence of lines, the inhibition that usually suppresses the "circle" neurons weakens, allowing them to fire up and take over. This seamless handoff ensures that the count for the upcoming shape is never lost during the switch. The study suggests that the brain uses a similar strategy of orthogonal planning and parallel transitions to organize complex behaviors, allowing it to generate endless variations of action from a simple set of rules.

The implications of this discovery extend beyond the drawing task. The mechanism the researchers uncovered provides a tangible explanation for how the brain can hold a mental program in place while executing its steps. It shows that the brain does not need to constantly re-calculate the entire sequence from scratch; instead, it sets an initial state that contains the full plan and then lets the dynamics of the neural circuit run that plan out. This approach allows for remarkable flexibility: if the problem changes and requires more repetitions, the network simply starts further out along the same paths, using the same underlying machinery. While the current study used a computer simulation to demonstrate this, the specific patterns of activity predicted by the model—such as the orthogonal encoding of numbers and the parallel transitions between shapes—offer clear, testable predictions for future experiments in living brains. By revealing how a neural circuit can implement a symbolic algorithm, this work brings us closer to understanding the biological basis of human intelligence and the ability to learn, adapt, and create.

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 →