NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LEDiT: Your Length-Extrapolatable Diffusion Transformer without Positional Encoding

Shen Zhang, Siyuan Liang, Yaning Tan, Zhaowei Chen, Linze Li, Ge Wu, Yuhao Chen, Shuheng Li, Zhenyu Zhao, Caihua Chen, Jiajun Liang, Yao Tang

TL;DR

LEDiT (Length-Extrapolatable Diffusion Transformer) is a novel architecture that enables image generation at resolutions far beyond its training data without using explicit positional encodings. By replacing standard self-attention with causal attention and adding a simple locality-enhancement module, LEDiT leverages implicit positional signals to achieve high-quality 4× resolution scaling and arbitrary aspect ratios.

The Resolution Ceiling in Diffusion Transformers

Diffusion Transformers (DiTs) are currently the state-of-the-art models for image generation. However, they suffer from a significant limitation: a "resolution ceiling." If a DiT is trained on $256 \times 256$ images, it typically fails to produce coherent structures when tasked with generating images at higher resolutions, such as $512 \times 512$.

The primary culprit behind this limitation is Positional Encoding (PE). Most Transformer architectures rely on explicit PEs (like Rotary Positional Embedding or Sinusoidal embeddings) to inform the model about the spatial location of each image "patch." Unfortunately, these encodings do not extrapolate well. When the model encounters positional indices during inference that it never saw during training, its performance degrades, often resulting in blurry images or repetitive artifacts (e.g., generating multiple heads on an animal). While some existing methods attempt to "stretch" or "scale" these encodings, they frequently introduce distribution shifts that compromise overall image quality.

The LEDiT Approach: Less is More

To overcome the extrapolation barrier, the authors propose LEDiT, an architecture that completely removes explicit positional encodings. Instead, it relies on three core components to maintain spatial awareness and structural integrity:

  1. Causal Attention: Instead of the standard bidirectional attention where every image patch can "see" every other patch, LEDiT employs a causal mask. This restricts patches to only attend to preceding ones following a specific scan order. The authors found that a "Mask Lower-right Corner" scan works best for 2D images.
  2. Implicit Positional Encoding: The foundational theory of LEDiT is that causal attention implicitly encodes positional information. The authors mathematically demonstrate that the variance of a token's output in a causal Transformer decreases as its position in the sequence increases. This phenomenon provides the model with a "global compass" for structural organization, eliminating the need for explicit coordinates.
  3. Locality Enhancement Module: While causal attention excels at capturing global structure, it can struggle with fine-grained details. To address this, LEDiT incorporates a multi-dilation convolution layer immediately after the initial patchification step. This module "leaks" local positional information, helping the model render sharp textures and intricate details.

To prevent the model from over-relying on a fixed receptive field—which can cause object duplication at high resolutions—the authors also introduce a Multi-dilation Training strategy, randomly varying the convolution's dilation and padding during the training phase.

Key Insights

  • The Variance Phenomenon: A striking theoretical finding in the paper is that in a causal system, the output variance is inversely proportional to the position index ($Var \approx C / (i+1)$). This implies the model can infer a token's relative position based on the concentration of its features.
  • Causality as a Structural Tool: While causal masks are ubiquitous in Large Language Models (LLMs), they are rarely used in Vision Transformers. This research highlights that for diffusion models, the directional "flow" of information is crucial for maintaining global coherence during length extrapolation.
  • Efficiency Gains: Causal attention is inherently more computationally efficient than bidirectional attention. Since each token only attends to previous tokens, the total number of attention computations is halved, significantly reducing the theoretical compute cost per layer.
  • Fine-tuning is Sufficient: The authors demonstrate that training from scratch is not strictly necessary. Fine-tuning a pre-trained DiT into an LEDiT for just 100k steps is enough to endow it with robust extrapolation capabilities.

Experimental Results

The researchers evaluated LEDiT on ImageNet (class-conditional) and MS COCO (text-to-image) benchmarks, testing extrapolation up to $1024 \times 1024$ (4× the training resolution) and various non-square aspect ratios.

LEDiT significantly outperformed existing state-of-the-art extrapolation methods, such as RoPE-scaling, VisionYaRN, and RIFLEx:

  • Quantitative Superiority: On ImageNet extrapolated from $256^2$ to $512^2$, LEDiT achieved an impressive FID of 33.25, compared to 49.86 for the best previous method (VisionYaRN) and a disastrous 213.77 for a vanilla DiT.
  • Qualitative Fidelity: While baseline models often produced disconnected textures or "double-headed" artifacts at a 4× scale, LEDiT successfully maintained structural fidelity, generating realistic, high-resolution subjects.
  • Aspect Ratio Flexibility: LEDiT seamlessly generated images at non-square resolutions like $512 \times 384$ and $384 \times 512$ despite only being trained on square data, showcasing true geometric adaptability.
High-quality extrapolated images generated by LEDiT

Limitations and Future Directions

While LEDiT presents a significant leap forward, the authors note a few limitations:

  • Dataset Scale: Evaluations were primarily conducted on ImageNet and COCO. Validating the architecture on massive-scale datasets like LAION-5B remains a necessary next step.
  • In-Distribution Trade-off: At the original training resolution, LEDiT performs slightly worse than standard DiTs (e.g., an FID of 2.38 vs 2.27 on ImageNet $256^2$). This indicates a minor trade-off between peak in-distribution quality and extrapolation flexibility.
  • Convergence Speed: The multi-dilation training strategy can occasionally slow down convergence when training from scratch. A "progressive" multi-dilation approach may offer a more optimal training path.

Ultimately, the insights regarding implicit positional encoding in causal attention could extend beyond vision, potentially offering new ways to improve context window extrapolation in Large Language Models.

Summary updated

BibTeX
@inproceedings{zhang2025ledit,
  author = {Shen Zhang and Siyuan Liang and Yaning Tan and Zhaowei Chen and Linze Li and Ge Wu and Yuhao Chen and Shuheng Li and Zhenyu Zhao and Caihua Chen and Jiajun Liang and Yao Tang},
  title = {{LEDiT: Your Length-Extrapolatable Diffusion Transformer without Positional Encoding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=8x5OmcFtJV},
}
Figure