DEV Community

Papers Mache
Papers Mache

Posted on

Looped Transformers Double Depth Without Extra Memory

Current transformer pipelines stall once layer‑wise memory hits the hardware ceiling, forcing engineers to trade depth for batch size. A simple residual‑scaling rule now lets a compact block be executed repeatedly, effectively doubling unrolled depth without any extra token‑level storage.

Before DeepLoop, adding recurrent passes to a transformer required ad‑hoc gates, learned scaling factors, or auxiliary losses to keep gradients from exploding, and most implementations still grew the KV cache linearly with depth. The community therefore treated looped execution as an unstable curiosity rather than a production technique.

DeepLoop raises the residual exponent from ¼ to ½ as the number of passes grows, setting α = (2N)^{1/2} and β = (8N)^{-1/2} for an unrolled depth N, which mathematically guarantees first‑order perturbation stability even when parameters are visited repeatedly. “DeepLoop introduces no gates, learned residual coefficients, auxiliary losses, or architecture-specific tuning constants.”[1] Empirically, the method is neutral when no block is revisited and consistently improves final validation loss at larger loop counts on GPT‑2 small and medium scales.

The paper’s evaluation stops at GPT‑2‑scale models, leaving open whether the same scaling holds for multi‑billion‑parameter families or under mixed‑precision pipelines. Its stability analysis assumes a conservative aligned regime for the visit‑alignment coefficient κ_R, so real‑world workloads with highly correlated token patterns might still see gradient spikes. Moreover, the reported gains focus on validation loss; downstream latency and KV‑cache grafting overheads are not quantified.

If the scaling rule truly decouples depth from memory, developers can reap deeper model capacity on existing GPUs simply by looping a small physical stack, rewriting the usual “bigger = better” hardware upgrade narrative. Re‑running standard language‑model benchmarks with a looped configuration should now become a baseline sanity check for any new deployment.

References

  1. DeepLoop: Depth Scaling for Looped Transformers

Top comments (0)