Skip to main content
QUICK REVIEW

[Paper Review] FIT: Far-reaching Interleaved Transformers

ting chen, Lala Li|arXiv (Cornell University)|May 22, 2023
Generative Adversarial Networks and Image SynthesisComputer Science5 citations
TL;DR

FIT introduces a novel transformer architecture that interleaves local and global self-attention mechanisms using grouped data tokens and adaptive latent tokens to achieve efficient, quadratic attention over long sequences. By combining local windowed attention with global attention on a small set of learned latent tokens, FIT reduces computational complexity to O(L⁴/³) while enabling end-to-end training on 160K-token inputs (e.g., 6400×6400 images) within 16GB memory, demonstrating state-of-the-art performance in high-resolution image tasks without model parallelism or optimizations.

ABSTRACT

We present FIT: a transformer-based architecture with efficient self-attention and adaptive computation. Unlike original transformers, which operate on a single sequence of data tokens, we divide the data tokens into groups, with each group being a shorter sequence of tokens. We employ two types of transformer layers: local layers operate on data tokens within each group, while global layers operate on a smaller set of introduced latent tokens. These layers, comprising the same set of self-attention and feed-forward layers as standard transformers, are interleaved, and cross-attention is used to facilitate information exchange between data and latent tokens within the same group. The attention complexity is $O(n^2)$ locally within each group of size $n$, but can reach $O(L^{{4}/{3}})$ globally for sequence length of $L$. The efficiency can be further enhanced by relying more on global layers that perform adaptive computation using a smaller set of latent tokens. FIT is a versatile architecture and can function as an encoder, diffusion decoder, or autoregressive decoder. We provide initial evidence demonstrating its effectiveness in high-resolution image understanding and generation tasks. Notably, FIT exhibits potential in performing end-to-end training on gigabit-scale data, such as 6400$ imes$6400 images, or 160K tokens (after patch tokenization), within a memory capacity of 16GB, without requiring specific optimizations or model parallelism.

Motivation & Objective

  • To address the quadratic computational complexity of standard transformers when processing long sequences.
  • To enable efficient, scalable attention over long sequences without sacrificing performance or requiring model parallelism.
  • To design a unified architecture that functions as an encoder, diffusion decoder, or autoregressive decoder for diverse vision tasks.
  • To explore the effectiveness of interleaved local and global transformer layers with adaptive latent tokens for improved long-range dependency modeling.

Proposed method

  • Divide input data into groups of tokens, each processed by local self-attention within a windowed context.
  • Introduce a small set of learnable latent tokens per group to represent global context, enabling global self-attention with reduced complexity.
  • Interleave local and global transformer layers, with cross-attention enabling bidirectional information flow between data and latent tokens.
  • Use iterative updates of data and latent tokens in a single forward pass to ensure deep integration of local and global representations.
  • Maintain standard feed-forward networks and attention mechanisms in both local and global layers, differing only in input scope and attention pattern.
  • Leverage cross-attention to route information from data tokens to latent tokens and vice versa within each group, enabling adaptive computation.

Experimental results

Research questions

  • RQ1Can interleaved local and global transformer layers with latent tokens achieve better long-range modeling than standard or sparse attention mechanisms?
  • RQ2How does the number of latent tokens per group affect model performance and efficiency in high-resolution image tasks?
  • RQ3Does interleaving local and global layers improve performance compared to stacking them sequentially or using only local layers?
  • RQ4Can FIT train end-to-end on gigabit-scale inputs (e.g., 6400×6400 images) within 16GB of memory without model parallelism or optimization?
  • RQ5To what extent can FIT serve as a versatile architecture across different autoregressive, diffusion, and encoder tasks in vision?

Key findings

  • FIT achieves near state-of-the-art performance on ImageNet-64×64 autoregressive modeling with 153M parameters, attaining 3.42 bits per dim, comparable to larger models.
  • Increasing the number of latent tokens improves performance (lower nll and bpd) with minimal impact on parameters or training speed, indicating efficient scaling.
  • Interleaving local and global layers yields superior performance (e.g., 3.49 bpd on ImageNet) compared to sequential stacking or using only local layers, with negligible training cost increase.
  • FIT enables end-to-end training on 160K-token sequences (e.g., 6400×6400 images) within 16GB of memory, without model parallelism or specialized optimizations.
  • The architecture demonstrates strong generalization across tasks, functioning effectively as an encoder, diffusion decoder, and autoregressive decoder in high-resolution vision benchmarks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.