Programs-of-Layers in LLMs through the Lens of Cortical Areas
cs.AI
Submitted: 2026-09-25
Updated: 2026-09-25
Code: https://github.com/tianyi-lab/PoLAr
Project page: https://datexis.github.io/RE-PoLar
License: http://creativecommons.org/licenses/by/4.0/
The gist: Inference in LLMs is conventionally a fixed-depth, fixed-order forward pass through every layer, regardless of how difficult the input is.
Terminology
Abstract
Inference in LLMs is conventionally a fixed-depth, fixed-order forward pass through every layer, regardless of how difficult the input is. The human brain does not work this way: using the thalamus as a central hub, it routes information flexibly to all regions of the cortex according to demand. Li et al. (2026) recently showed, with a system they call program-of-layers (PoLar), that transformers can be given an analogous flexibility if their layers are treated as a library of functions rather than a fixed sequence. Performance improves over the standard forward pass when each input is dynamically routed through an adaptive sequence of skipped or repeated contiguous layer blocks. We reconstructed PoLar's diagnostic MCTS in more detail than the original paper and applied it across 5 models. We reproduced several of PoLar's findings: skipping outperformed the standard pass, repeating outperformed skipping, and combining both outperformed either alone. Shorter programs sufficed for easier questions, while harder questions required more layer repeats. However, we failed to replicate the main claim regarding their learned router for single-shot inference: its top-ranked prediction consistently collapsed back to the standard pass, even though its top-k predicted programs, taken together, did show a real accuracy gain. Beyond reproduction, we find that a small number of generic programs are enough to solve most of the questions. We also provide a much deeper analysis of these programs' structure and robustness: for example, we found that programs that correct errors are highly brittle: undoing even a single edit inside a program typically breaks the correction. Connecting this to the brain's routing mechanisms, PoLar mirrors principles of thalamo-cortical coordination between cortical-area-like transformer layers. We publicly release the code at https://datexis.github.io/RE-PoLar/
Sources
- Scalable Machines with Intrinsic Higher Mental-State Dynamics
- Mixture of Cognitive Reasoners: Modular Reasoning with Brain-Like Specialization
- Is One Layer Enough? Understanding Inference Dynamics in Tabular Foundation Models
- Memory Layers at Scale
- Continuous Thought Machines
- Reducing Transformer Depth on Demand with Structured Dropout
- Looped Transformers for Length Generalization
- Coordination Among Neural Modules Through a Shared Global Workspace
- HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models
- Router-Tuning: A Simple and Effective Approach for Enabling Dynamic-Depth in Transformers
- Dr.LLM: Dynamic Layer Routing in LLMs
- From Noise to Diversity: Random Embedding Injection in LLM Reasoning
- The Neuroscience of Transformers
- What Layers When: Learning to Skip Compute in LLMs with Residual Gates
- Skip a Layer or Loop it? Test-Time Depth Adaptation of Pretrained LLMs
- Adaptive Layer-skipping in Pre-trained LLMs
- Let's Think Dot by Dot: Hidden Computation in Transformer Language Models
- Mixture-of-Depths: Dynamically allocating compute in transformer-based language models
- Representational Alignment Across Model Layers and Brain Regions with Multi-Level Optimal Transport
- Meaningless Tokens, Meaningful Gains: How Activation Shifts Enhance LLM Reasoning
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems