# Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime

- **ID:** 1509
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2611.03526
- **Authors:** Abdellah Rahmani, Sean McLeish, Ang Li, Sanae Lotfi, Pascal Frossard, Micah Goldblum
- **Venue:** arXiv preprint
- **Published:** 2026
- **Source:** arxiv
- **Language:** en
- **Access:** free
- **Added:** 2026-11-03
- **Verified:** 2026-11-03
- **Page:** https://papers.projxon.ai/entries/1509

## Summary

Every production transformer executes its layers in one fixed order; programs, by contrast, chain the same primitives (conditionals, loops) in different orders per algorithm. Library of Layers (LoL) gives the model a single global library of transformer blocks plus a router that dynamically ORDERS them at inference time for the problem at hand. The architecture has essentially one hyperparameter - the library size - which sweeps a continuum: a small library forces heavy block reuse (depth recurrence / looping), a large library with a subset active per step behaves like sparsity (MoE), and the endpoints recover dense and depth-recurrent designs, so the authors frame LoL as one family generalizing the parameter-efficiency and FLOPs-efficiency trade-offs of all three. Results are parity results, not wins: pretrained on text (FineWeb), LoL is competitive with dense, depth-recurrent, and MoE baselines - main experiments at 360M parameters (GPT-2-Medium shape modernized with RoPE, RMSNorm, SwiGLU, bias-free attention; a 1B variant follows the Llama-3.2-1B shape), and on lm-evaluation-harness benchmarks (ARC-Easy/Challenge, HellaSwag, PIQA, GSM8K) all models sit within 2 standard errors of each other, except the vanilla full-attention model scoring notably lower on ARC-Easy. The distinctive evidence is behavioral: on synthetic sudoku and maze tasks the model uses DISTINCT layer orderings to implement different solution strategies, and the routing can be intervened on to force a chosen strategy onto a given problem instance - the ordering is a controllable computational graph, not just a learned permutation. In a multilingual setting the chosen order patterns differ systematically by language and script. And when LoL is trained on safety data, simple probes fitted to the ROUTER's outputs distinguish safe from unsafe text with high AUROC (the exact figure was not extractable from the HTML full text at catalog time) - the routing decisions themselves carry a readable signal about the input. Caveats: 360M-1B scale throughout; headline text results are parity within noise rather than improvements; the strategy evidence is on synthetic toy tasks, not natural reasoning; runtime reordering costs and behavior at frontier scale are untested. In the catalog's looped-models cluster, LoL is the generalization at the end of the line: a fixed loop is LoL with a one-block library and a hard-coded cyclic order, and MoE is the same routing idea applied across width instead of depth order - LoL routes over both WHICH blocks and IN WHAT SEQUENCE. The intervenable routing and probe-able router state are also the monitoring angle: layer-order choices are an observable, steerable intermediate that fixed-order models do not expose.

## Research notes

- arXiv 2611.03526 (cs.LG/cs.AI/cs.CL), submitted 2 Nov 2026, 32 pages, 22 figures; license is the arXiv default nonexclusive distribution license (no CC icon on the arXiv page). DOI 10.48550/arXiv.2611.03526. Shared 2026-11-03 via a bare t.co link resolving to the paper's arXivBangers page ('Certified Banger', editorial score 82/100). Research combines the arXiv abstract and the arXivBangers full-text summary; the safety-probe AUROC is reported qualitatively in the paper and its exact value was not extractable from the HTML rendering.

## Similar entries

- [Is One Layer Enough? Training A Single Transformer Layer Can Match Full-Parameter RL Training](https://papers.projxon.ai/entries/446) (paper, #446)
- [A Smaller Transformer in Your Transformer](https://papers.projxon.ai/entries/1074) (paper, #1074)
- [LiFT: Loop Flow Transformers](https://papers.projxon.ai/entries/1274) (paper, #1274)
- [Dr.LLM: Dynamic Layer Routing in LLMs](https://papers.projxon.ai/entries/542) (paper, #542)
- [TokenGate: Adapting LLMs for Fast and Memory-Efficient Prefill with Learned Token Pruning](https://papers.projxon.ai/entries/1430) (paper, #1430)
- [LibraryDesignBench: can agents design libraries other agents can use?](https://papers.projxon.ai/entries/819) (paper, #819)
