arXiv(opens in a new tab)cs.AISep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.31360

Programs-of-Layers in LLMs through the Lens of Cortical Areas

Justus Westerhoff, Stephan Olbrich, Hatem Oraby, Matthew Evan Larkum, Felix Alexander Gers

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Justus Westerhoff*

Berliner Hochschule für Technik (BHT), Berlin, Germany

justus.westerhoff@bht-berlin.de

Stephan Olbrich*

Berliner Hochschule für Technik (BHT), Berlin, Germany

stephan.olbrich@bht-berlin.de

Hatem Oraby

Humboldt-Universität zu Berlin, Berlin, Germany

hatem.oraby@hu-berlin.de

Matthew Evan Larkum

Humboldt-Universität zu Berlin, Berlin, Germany

matthew.larkum@hu-berlin.de

Felix Alexander Gers

Berliner Hochschule für Technik (BHT), Berlin, Germany

felixalexander.gers@bht-berlin.de

Abstract

Inference in large language models (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 Monte Carlo Tree Search (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/.

1 Introduction

Most large language models (LLMs) apply one fixed-depth architecture (Vaswani et al., 2017) to every input, regardless of how difficult it actually is. A conventional computer program, by contrast, is adaptive: program structure and complexity scale with the problem (e.g., through if-clauses and for-/while-loops). Similarly, the

∗^{*}Shared first authorship; order chosen at random.

Figure

Figure 1: A program-of-layers (POLAR), predicted by a lightweight router, executes a schedule of skip, keep, and repeat operations over frozen, pretrained transformer layers (left). We read this coordinating role as functionally analogous to the thalamus routing computation across cortical areas (right). A transformer's layer order is fixed only by training, not by necessity: a model trained to run its layers in order can nonetheless be usefully executed out of that order at inference time, a flexibility the brain already has by default.

human brain, as a resource-constrained system, follows an adaptive principle, allocating different amounts and types of neural computation to different tasks. This is reflected both in which brain circuits are recruited and in how long activity is sustained within them. Difficult tasks can engage recurrent processing: activity reverberates within and between cortical circuits until sufficient evidence has accumulated (Wang, 2002; Kar et al., 2019). Familiar tasks instead rely on faster, more automatic pathways (Poldrack et al., 2005). While anatomy constrains where sensory information first arrives, it does not fix how that information is routed afterward: feedback loops within the cortex, and between the cortex and the thalamus, can amplify some pathways and suppress others depending on context and the brain's current behavioral state (Munn et al., 2026).

One axis of adaptivity LLMs do have at inference time is sequence length: a model can “think longer” by emitting more tokens (Wei et al., 2022), but the computation performed by any single forward pass through the network stays fixed regardless of how hard that step actually is. This raises a basic question for transformer inference: can a fixed forward pass be adapted to recover more of a model’s latent capability, without retraining it?

One family of answers changes the architecture and trains the model itself to be more recursive. Li et al. (2026) instead answer it without retraining the base model at all, treating the DD pretrained layers f0,…,fD−1f_0, \ldots, f_{D-1} of an LLM as a library of functions rather than a fixed pipeline. A per-input program-of-layers (POLAR) π=(i1,…,iK)\pi = (i_1, \ldots, i_K), where each iji_j is a layer index, selects a schedule of contiguous layer segments. Each segment is skipped, kept, or repeated. Their paper has two halves: a diagnostic Monte Carlo Tree Search (MCTS) over the skip/repeat program space, and the POLAR predictor (a lightweight network that outputs a program in a single shot, replacing per-input search) itself. The diagnostic search shows that better programs almost always exist, among other findings. This paper's primary contribution is a careful reproduction of these findings alongside a public release of the code and search implementation Li et al. (2026) do not themselves provide. On this basis, we build a detailed analysis and audit of the discovered programs, together with a brain-inspired analogy for how such a program coordinates computation (fig. 1). POLAR belongs to a broader family of cheap, training-free interventions that recover a model's latent capability without touching the weights (section 5). Models can be “under-elicited”: they compute a correct answer internally but fail to state it. A POLAR is one concrete way to recover such an answer, and the rest of this paper asks how reliably that recovery works and how recovered programs behave. Concretely, this paper makes three contributions:

Table 1: Every finding in section 4, checked against Li et al. (2026)'s own study. ✓=\checkmark = reproduced, ∤=\nmid = not reproduced (we tested it and got a contradicting result), ⋆=\star = a new finding of ours with no equivalent in the original paper to check against. F1–F4 are Li et al.'s own diagnostic Findings 1–4.

FindingDescriptionStatus
F0Reproducing Li et al.'s baseline numbers✓
F1Skip & Repeat combined beats either alone✓
F2Occam's razor: most samples have shorter valid programs than a standard forward pass✓
F3Harder inputs need larger programs (test-time scaling via recurrence)✓
F4Valid programs concentrate on short, mostly single-recurrence segments✓
F5A small menu of programs generalizes across many questions★
F6A wrong answer close to the ground truth is rescued ~1.5× more often than a distant one★
F7Programs are fragile: most edits are essential, and fragility depends on model, not difficulty★
F8Router gives a pass@1 gain over BASE✓
F9Router's pass@5 gain comes from a small, fixed menu, mainly input-independent★
F10MMLU-Pro rescuing programs overfit to answer position, not content★
  1. We reproduce Li et al.'s diagnostic MCTS study and its router across 5 models, reconstructing the search algorithm they leave underspecified, since neither it nor its precursor (Li et al., 2025) releases code. We confirm the majority of POLAR's diagnostic findings, but cannot reproduce its headline router result at all: in every configuration we test, and across every training recipe and anti-collapse mitigation we tried (section A.8), the router's top-1 prediction is simply the standard forward pass, never a genuine alternative program (table 1).

  2. Building on our reproduction, we audit quantity and quality of the discovered programs, which also helps explain the router's collapse. Its candidate pool does contain real, executable diversity, but it never ranks the right candidate at the top, always the identity program instead. A small menu of programs already covers most of what a far larger search space finds. These programs are also fragile: undoing a single edit inside a program that fixes a wrong answer breaks the fix more often than not.

  3. We develop a neuroscience-motivated analogy between programs-of-layers and thalamo-cortical coordination between cortical-area-like transformer layers, reviewed against the wider brain-inspired-machine learning (ML) literature.

We publicly release code and the full set of MCTS-discovered programs for every question studied here, along with further visualizations such as an interactive program-tree explorer, at https://datexis.github.io/RE-PoLar/.

References (100)

Couldn't load all references. Reload the page to try again.