Skip to content
AI.info

Research

Chimera: State Space Models Beyond Sequences

Chimera: State Space Models Beyond Sequences Overview Research area: Machine learning architecture design, spanning state space models (SSMs), graph neural networks, and multimodal modeling of languag

arXiv
2510.12111
Published
2025-10-14
Authors
Aakash Lahoti, Tanya Marwah, Ratish Puduppully, Albert Gu

AI summary

Chimera: State Space Models Beyond Sequences

Overview

Research area: Machine learning architecture design, spanning state space models (SSMs), graph neural networks, and multimodal modeling of language, vision, and graph data.

Technical level: Advanced. The paper leans heavily on linear algebra (resolvents, adjacency matrices, the Liouville–Neumann series, nilpotency) and assumes familiarity with Mamba-2, RetNet, and linear attention.

Scope: The paper proposes Chimera, a single model family that incorporates a domain's underlying graph topology directly into a generalized state space model, and validates it on GLUE, ImageNet-1k, and the Long Range Graph Benchmark.

What This Paper Is About

Transformer-based models treat data as an unordered set of elements, so they ignore the neighborhood structure (graph topology) that underlies language, images, and molecules. Researchers have patched this with domain-specific fixes such as position embeddings and random walks, but those fixes must be redesigned for each domain and can hurt generalization. Chimera instead observes that state space models already encode the topology of a sequence through their recurrence, then generalizes that mechanism so any graph topology can be encoded directly, without hand-crafted biases.

Key Contributions

  1. A unified topology-aware model. Chimera generalizes state space models by replacing the causal mask with the resolvent of a graph's adjacency matrix, L = (I − A)^-1, so that the mask itself encodes the graph structure rather than being bolted on as a heuristic. This contrasts with prior work that applies attention or SSMs as a black box to "flattened data".

  2. Two algorithmic optimizations. For directed acyclic graphs (DAGs), the authors prove the resolvent can be computed by a recurrence that is linear in the number of nodes and edges, O(|V| + |E|), and they further give a squaring technique requiring O(log(dia(G))) matrix multiplications in the forward pass and O(1) in the backward pass. For general graphs they relax the resolvent using a finite-sum truncation of the Neumann series at k = dia(G), giving Transformer-level quadratic complexity without domain-specific biases.

  3. A parameterization scheme for numerical stability. The adjacency matrix entries are set to A_ij = exp(−(Δ_i + Δ_j + Δ′_(i,j))/3), combining node selectivity from both endpoints plus edge embeddings, with a data-dependent row-wise normalization using a parameter Ψ that guarantees ‖A‖ < 1 and bounded resolvent with probability > 1 − Φ(−1/(2γ)) under Gaussian initialization.

  4. Cross-domain empirical validation. Chimera outperforms BERT on GLUE by 0.7 points, beats ViT on ImageNet-1k by 2.6%, and outperforms baselines on the Long Range Graph Benchmark, all with a linear-time variant available.

Main Findings

  • Language (GLUE): Chimera (DAG) reaches a GLUE average of 83.93 versus 83.2 for BERT-Base, with a masked-LM cross-entropy of 1.46 versus 1.59 for BERT-Base and a masked accuracy of 68.9% versus 67.3%. Both Chimera variants have 110M parameters, matching BERT-Base, while BERT is described as doing so at an additional quadratic cost.

  • Linear baselines trail: M2 reaches a GLUE average of 80.9 (116M parameters), MLP-Mixer 77.5 (112M), and FNet 75.8 (112M). Chimera (UG) reaches 82.97, described as competitive with BERT while surpassing other recent linear baselines.

  • Vision (ImageNet-1k): Chimera-ViT-B at 88M parameters reaches 81.4% Top-1 and 95.4% Top-5, with EMA 82.1% Top-1 and 95.9% Top-5. ViT-B reaches 78.8%/94.2% (EMA 80.6%/95.2%), S4-ViT-B 79.4%/94.2% (EMA 80.4%/95.1%), and Hyena-ViT-B 78.4%/94.0% (EMA 76.4%/93.0%).

  • Topology beats flattening: A 22M-parameter ablation shows the 2D DAG structure (77.8% Top-1, 76.7% EMA) outperforms forward-only 1D flattening (73.8% both) and forward-plus-reverse 1D flattening (76.5% Top-1, 75.6% EMA), supporting the claim that maintaining topological structure matters.

  • Graphs (LRGB): The paper states Chimera outperforms all baselines on the Long Range Graph Benchmark and that the model handles both long- and short-range interactions between nodes while respecting graph structure. The specific LRGB numerical scores are not reported in the content provided.

  • Exactness on canonical modalities: For images and language, where data can be decomposed into DAGs, the finite-sum approximation of the resolvent becomes exact. Undirected line graphs decompose into two directed line graphs, and grid graphs decompose into four directed grid graphs.

  • Approximation quality: The finite-sum approximation with k = dia(G) performs as well as the method using the sum of infinitely many terms, while guaranteeing that any positive entry L_ij in the exact resolvent also appears positive in the approximation.

Methodology in Plain English

The starting point is an observation about state space models such as Mamba-2, RetNet, and linear attention. When these models process a sequence, they can be written as a matrix multiplication M = L ⊙ (QK^T) applied to the input, where L is a mask matrix that plays the same role as the causal mask in attention. The authors show that L is exactly the resolvent of the adjacency matrix of a directed line graph, i.e. L = (I − A)^-1 = Σ A^i. Because A^k counts influence propagated along paths of length k, this resolvent sums influence along all paths of all lengths.

That equivalence is the lever: swap the directed line graph for the graph describing the actual data, and the same machinery handles images, molecules, or any other structured domain. Tokens become nodes, and selectivity parameters (borrowed from Mamba-2) become edge weights that modulate how much influence one node passes to another.

Computing a matrix inverse is expensive — cubic in the number of nodes — so the authors offer two routes. First, for DAGs the adjacency matrix is nilpotent (A^K = 0), so the infinite sum terminates and the whole thing can be run as a single recurrence over nodes in topological order, taking time linear in nodes plus edges, exactly like a linear-time SSM. A squaring trick converts that recurrence into a small number of matrix multiplications on GPUs or TPUs. Second, for general graphs, they truncate the series at the graph's diameter, which keeps every node connected to every other node in the sum, and compute the truncated sum through a factored product (I + A)(I + A^2)(I + A^4)⋯(I + A^p) where p is the smallest power of two at least the diameter.

The remaining practical problem is that inverting I − A can blow up numerically, since path counts grow exponentially. The authors add a row-wise normalization with a learned parameter Ψ and a scaling hyperparameter γ, and prove this keeps ‖A‖ < 1 and the resolvent bounded. On DAGs they use a variant normalization, dividing by √|p(i)| (the square root of the number of parents), and prove the output variance stays at or below 1.

Empirically, Chimera is trained with masked language modeling on the C4 dataset for 70k steps following the M2 recipe, then fine-tuned on GLUE; separately evaluated on ImageNet-1k classification; and tested against graph baselines on LRGB. Code is released at github.com/goombalab/chimera.

Why This Matters

Impact on research. The paper reframes position embeddings and graph-specific biases as compensations for a limitation that state space models do not actually have. If the mask of an SSM is just the resolvent of a graph's adjacency matrix, then topology is a first-class modeling primitive rather than a per-domain patch. That is a conceptual unification across sequence models, vision architectures, and graph neural networks, and it suggests that the SSM literature's selectivity mechanism has a natural graph-theoretic interpretation.

Real-world applications.

  • Language and audio modeling, where the directed line graph already describes the data and a linear-time model can match or exceed quadratic Transformers at the same parameter count.
  • Vision systems such as classification backbones, where the 2D grid is preserved instead of being flattened into a sequence, and where the reported 81.4% Top-1 at 88M parameters is directly relevant.
  • Molecular property prediction and drug discovery, where atoms and bonds form an explicit graph with node and edge features that the method accepts through its edge-embedding selectivity term.
  • Long-range structured reasoning such as protein interaction graphs or knowledge graphs, since the finite-sum approximation gives every node access to every other node's contribution.

Industry relevance. Any deployment that is constrained by the quadratic cost of attention — long-context inference, high-resolution vision, large molecule libraries — is a candidate. The DAG variant's linear time complexity is the headline claim for engineering teams, and the paper points out that for line graphs the computation can reuse existing Mamba-2 kernels.

Future Directions

  • Reducing the worst-case cost for general graphs. The authors state that for general graphs the worst-case complexity of the finite-sum approximation remains quadratic and that as structure complexity grows, so does the cost of computing L. Finding structure-exploiting algorithms for broader graph classes is open.

  • Tighter complexity for dense DAGs. The paper notes that for a complete transitive DAG with |E| = |V|(|V|−1)/2, the quadratic bound on materializing the adjacency matrix is tight, but for structured subclasses with O(|V|) edges it can be reduced substantially.

  • Extending the stability theory. The normalization guarantee holds "under Gaussian initialization" with probability > 1 − Φ(−1/(2γ)), and the DAG variance bound assumes the vectors are i.i.d. Gaussians. Whether these conditions hold throughout long training runs, beyond the argument that normalization approximately preserves such distributions, is left to future work.

  • Broadening beyond the tested domains. The paper's experiments cover language, images, and graphs, and it emphasizes edge embeddings for structured data. Extending validation to domains with richer edge attributes, heterogeneous graphs, or non-canonical decompositions is a natural next step.

Target Audience

This paper is best suited to machine learning researchers and graduate students working on sequence model architectures, state space models (Mamba, RetNet, linear attention), and graph representation learning. Practitioners building efficient long-context or structured-data models will find the complexity results and the released code directly useful, but the derivations of the resolvent and nilpotency arguments assume a solid linear algebra background. Readers looking for a gentle introduction to SSMs should start elsewhere first.

Authors’ abstract

Transformer-based deep learning methods have become the standard approach for modeling diverse data such as sequences, images, and graphs. These methods rely on self-attention, which treats data as an unordered set of elements. This ignores the neighborhood structure or graph topology of the data and requires inductive biases--such as position embeddings in sequences and images, or random walks in graphs--to incorporate topology. However, designing such task-specific biases requires significant effort and can introduce side effects that hinder generalization. We introduce Chimera, a unified model that directly incorporates data topology in a principled way, removing the need for domain-specific biases. The key idea is that state space models--which naturally do not require position embeddings--can be generalized to capture any graph topology. Our experiments show that Chimera achieves strong performance across language, vision, and graph domains, outperforming BERT on GLUE by 0.7 points, ViT on ImageNet-1k by 2.6%, and all baselines on the Long Range Graph Benchmark. We further propose algorithmic optimizations to improve Chimera's efficiency: (1) for Directed Acyclic Graphs, Chimera can be implemented as a linear-time recurrence; (2) for general graphs, a simple mathematical relaxation achieves Transformer's quadratic complexity without domain-specific heuristics. These results validate Chimera's core contribution and support the idea that data topology is a powerful inductive bias across modalities.

Read the original paper