Latent Flow Transformer

Yen-Chen Wu, Feng-Ting Liao, Meng-Hsi Chen, Pei-Chen Ho, Farhang Nabiei +1 more
5/20/2025
cs.LGcs.AI

No official code found. Best implementation: mtkresearch/latent-flow-transformer (6 stars, last commit 2025-05-20).

Abstract

Transformers, the standard implementation for large language models (LLMs), typically consist of tens to hundreds of discrete layers. While more layers can lead to better performance, this approach has been challenged as far from efficient, especially given the superiority of continuous layers demonstrated by diffusion and flow-based models for image generation. We propose the Latent Flow Transformer (LFT), which replaces a block of layers with a single learned transport operator trained via flow matching, offering significant compression while maintaining compatibility with the original architecture. Additionally, we address the limitations of existing flow-based methods in \textit{preserving coupling} by introducing the Flow Walking (FW) algorithm. On the Pythia-410M model, LFT trained with flow matching compresses 6 of 24 layers and outperforms directly skipping 2 layers (KL Divergence of LM logits at 0.407 vs. 0.529), demonstrating the feasibility of this design. When trained with FW, LFT further distills 12 layers into one while reducing the KL to 0.736 surpassing that from skipping 3 layers (0.932), significantly narrowing the gap between autoregressive and flow-based generation paradigms.

View on arXivView PDF

Code Implementations(1)

61May 20, 20251 years ago

Similar Papers

Cite this paper

@article{wu2025latent,
  title  = {Latent Flow Transformer},
  author = {Yen-Chen Wu and Feng-Ting Liao and Meng-Hsi Chen and Pei-Chen Ho and Farhang Nabiei and Da-shan Shiu},
  year   = {2025},
  eprint = {2505.14513},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.14513v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.14513.svg)](https://codeofpaper.com/paper/2505.14513)

Discussion