LION: A bidirectional framework that trains like a Transformer and infers like an RNN

Arshia Afzal, Elias Abad Rocamora, Leyla Naz Candogan, Pol Puigdemont, Francesco Tonin, Yongtao Wu, Mahsa Shoaran, Volkan CevherOpenReview 2025 · Submission to ICLR 2025 · Rejected

Abstract

We introduce LION, a novel sequence-to-sequence framework that unifies the bidirectionality and parallelized training of Transformers with the fast inference of recurrent neural networks. LION is built upon a mathematical formulation where full kernelized attention with a learnable mask is efficiently computed using a bidirectional selective recurrent model, matching the effectiveness of softmax-based attention with constant-time inference. Our framework naturally accounts for spatial and temporal relationships within input sequences, reducing reliance on heuristic positional embeddings and facilitating straightforward scalability in context length and resolution. Using our framework and inspired by the recent state-space models, we propose three main running examples LIOn-LIT, LION-RETNET, and LION-S, a transformer with selective mask and recurrent inference. Numerical evaluations on tasks such as language modeling, the Long-Range Arena, and image classification show that LION framework achieves performance on par with state-of-the-art models while delivering fast training and inference efficiency.
BibTeX
@misc{afzal2025lion,
  author = {Arshia Afzal and Elias Abad Rocamora and Leyla Naz Candogan and Pol Puigdemont and Francesco Tonin and Yongtao Wu and Mahsa Shoaran and Volkan Cevher},
  title = {{LION: A bidirectional framework that trains like a Transformer and infers like an RNN}},
  year = {2025},
  url = {https://openreview.net/forum?id=VxJjw52dZu},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}

Loading related content...

Figure