Library of Layers (LoL): adaptively ordering Transformer layers at runtimeLibrary of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime
Researchers propose the Library of Layers (LoL) architecture, which dynamically adjusts the execution order of Transformer blocks at inference time to adapt to the current task; after pretraining on text data, performance is comparable to three baselines: dense, depth-recurrent, and MoE. The architecture has only one hyperparameter, the size of the global Transformer block library, and can continuously switch between parameter reuse and sparsification. On synthetic Sudoku and maze data, the model uses different layer orderings to implement different problem-solving strategies, and researchers can also intervene in routing to force the model to adopt a specified strategy for a given problem instance. In multilingual settings, the model selects different layer-order patterns by language and writing system; after training on safety data, a probe fitted to the router outputs can distinguish safe from unsafe text with high AUROC.