Introduction
Modern linear Recurrent Neural Networks (RNNs), such as Mamba and xLSTM, have recently emerged as efficient alternatives to Transformers, particularly for long-sequence modeling. By removing non-linear dependencies between hidden states, these models enable parallelization during training while maintaining the linear inference complexity of traditional RNNs. However, a significant limitation remains: these architectures are fundamentally one-dimensional. This paper introduces pLSTM (parallelizable Linear Source Transition Mark networks), a novel architecture designed to natively process multi-dimensional data—including images and graphs—without sacrificing parallelizability.
The Challenge of Multi-Dimensional Data
Standard linear RNNs process multi-dimensional data, like 2D images, by flattening them into 1D sequences (e.g., a raster scan). This approach inherently destroys spatial locality; pixels that are vertically adjacent in a grid become distantly separated in the sequence. This separation leads to severe "credit assignment" problems, making it difficult for models to learn long-range spatial relationships. While traditional Multi-Dimensional RNNs (MDRNNs) addressed this by using multi-directional hidden state transitions, their sequential nature made them incompatible with modern GPU acceleration. pLSTM bridges this gap by providing a multi-dimensional recurrent structure that is fully parallelizable.
The pLSTM Architecture
The core innovation of pLSTM is its operation on Directed Acyclic Graphs (DAGs) rather than simple sequences. This allows it to model grids and complex graph structures natively.
The architecture relies on three key shifts:
- Edge-Centric Gating: Unlike standard LSTMs that gate nodes, pLSTM utilizes Source, Transition, and Mark gates that operate on the edges connecting nodes. This allows for more granular control over information flow across the structure.
- Hierarchical Parallelization: By generalizing 1D parallel associative scans to DAGs, pLSTM can process chunks of data simultaneously. This enables logarithmic time complexity relative to the sequence length, making it viable for large-scale training.
- Stabilization Modes: To manage signal propagation over long paths, pLSTM employs two routing modes: P-mode (Propagation) for directed signal flow and D-mode (Distribution) for global context gathering.
Experimental Evaluation
The authors evaluated pLSTM across synthetic vision tasks, standard image classification, and graph benchmarks.
Arrow Pointing Extrapolation
To test spatial reasoning, the authors introduced the Arrow Pointing Extrapolation task. Models must determine if an arrow in a 2D grid points toward a target circle.
While Vision Transformers (ViTs) and 1D linear RNNs struggled to generalize when evaluated on resolutions larger than their training set (384x384 vs 192x192), pLSTM achieved 77.8% accuracy. This demonstrates that native 2D recurrence allows for superior spatial extrapolation compared to models relying on positional embeddings or 1D flattening.
ImageNet-1K and Graph Benchmarks
On ImageNet-1K, pLSTM-Vis-B achieved 82.5% top-1 accuracy, matching or exceeding state-of-the-art vision-specific RNNs and ViT baselines. Furthermore, pLSTM demonstrated versatility by outperforming standard Graph Neural Networks (GNNs) on the TUDataset, achieving 85.12% on the MUTAG bioinformatics dataset.
Conclusion
pLSTM represents a significant step forward in recurrent modeling, extending the efficiency of linear RNNs to multi-dimensional domains. By avoiding the pitfalls of 1D flattening and leveraging hierarchical parallelization, pLSTM offers a robust framework for spatial and structural reasoning. Future work may involve integrating domain-specific inductive biases, such as convolutions, and applying the model to complex 3D scientific data.
Summary updated