Skip to content
AI Learning Ground Start learning

Research ·

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

Researchers introduce Library of Layers (LoL), a transformer architecture that dynamically orders its layers during inference instead of using a fixed sequence, matching dense, depth-recurrent, and mixture-of-experts baselines on pretraining.

Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime
Image: Hugging Face

A new paper on Hugging Face presents Library of Layers (LoL), an architecture that reorders its transformer layers at inference time to fit the task at hand, unlike standard language models that always execute layers in the same fixed order. The analogy is to programmers who chain reusable primitives like conditionals and loops in different orders to build different algorithms.

LoL has a single hyperparameter: the size of its global library of transformer blocks. This lets it move smoothly between parameter reuse and sparsity, unifying the parameter- and FLOPs-efficiency tradeoffs of dense, depth-recurrent, and mixture-of-experts architectures in one family. On text pretraining, LoL matches all three baselines. On synthetic sudoku and maze tasks, it uses distinct layer orderings for different solution strategies, and routing can be intervened on to force a specific strategy. In multilingual settings it picks order patterns by language and script, and on safety data, probes on its router outputs distinguish safe from unsafe text with high AUROC.

For builders, LoL points toward models that compose their own computational graph at runtime, which could mean more efficient compute use and more controllable, interpretable routing of reasoning, multilingual, and safety behavior without separate architectures.

References

Read the full story at Hugging Face ↗Like, save or discuss on Buzz

#research