arXiv:2610.34879cs.CVOct 2026

Manuscript Offprint

arXiv:2610.34879

LayoutMamba: Efficient Document Layout Analysis with Hybrid Mamba-Transformer Networks

Kehua Chen, Mingyi Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Document layout analysis (DLA) suffers from a long-standing dilemma: existing methods either capture rich local details at the cost of prohibitive computational overhead (e.g., Transformer-based approaches with quadratic complexity) or achieve efficient global modeling but sacrifice fine-grained structural awareness (e.g., state-space models). This fundamental trade-off has severely hindered the deployment of DLA systems in real-world, resource-constrained scenarios. To fundamentally resolve this conflict, we present LayoutMamba, a pioneering hybrid framework that synergistically combines the strengths of sparse-attention Transformers for localized feature extraction ( O(n)O(n) complexity) and the recurrent state-space mechanism of Mamba for dilution-free, long-range dependency modeling across the 2D document canvas. Our key insight is a two-stage paradigm: first, a lightweight Transformer encoder hierarchically distills salient local semantics; second, Mamba's state-space model propagates global contextual dependencies without attention dilution, enabling precise, efficient, and scalable layout understanding. Furthermore, we identify and address a critical yet overlooked issue in existing DLA benchmarks: the inherent low-overlap distribution bias of layout objects, which we mitigate through our novel Geometric Overlap Penalty Loss (GOPLoss), a dual-optimization objective that simultaneously minimizes redundant bounding box overlaps and encourages geometrically consistent predictions. Extensive experiments on two challenging benchmarks, PubLayNet and D4LAD^{4}LA, demonstrate that LayoutMamba not only surpasses the state-of-the-art AP on PubLayNet with 8×8\times fewer parameters, but also maintains leading performance on D4LAD^{4}LA, ranking top-3 among all published methods, achieving an unprecedented balance between accuracy, efficiency, and scalability. Our work pioneers a new cognition-inspired paradigm for document analysis, making substantial strides towards practical deployment in edge computing and resource-limited environments.

1 Introduction

The automated understanding of visually rich documents represents a pivotal challenge in artificial intelligence, underpinning digital transformation initiatives across diverse sectors. Documents, unlike natural images, possess a complex structure characterized by high-frequency textual details, graphical elements like tables and figures, and critical semantic information encoded within their spatial layout. Document Layout Analysis (DLA), the task of segmenting a document image into distinct semantic regions (e.g., paragraphs, tables, figures), serves as a fundamental prerequisite for downstream tasks such as information extraction and document retrieval. However, the vast heterogeneity in document types (from structured forms to research papers and invoices), intricate layouts, and variable scan quality pose significant hurdles.

Early endeavors in Document Layout Analysis (DLA) predominantly relied on conventional computer vision techniques, leveraging Convolutional Neural Network (CNN) architectures (LeCun et al., 1998; Ren et al., 2015; Liu et al., 2016; He et al., 2016; Oliveira & Viana, 2017; Chen et al., 2017; Huang et al., 2017; Hu et al., 2018; Redmon & Farhadi, 2018) to extract visual features, where layout elements were treated as objects to be detected or segmented. While this series of CNN-based methods, through continuous refinements, has achieved an excellent trade-off between accuracy and inference speed, they inherently suffer from a critical limitation: their propensity towards local feature extraction makes it arduous to directly capture long-range global contextual information, which is crucial for understanding complex document layouts. To mitigate this shortcoming, researchers in the document analysis community have subsequently introduced Transformer-based architectures, notably the Vision Transformer (ViT) paradigm (Gupta et al., 2021; Huang et al., 2022; Da et al., 2023; Chai et al., 2023; Shehzadi et al., 2023; Gu et al., 2023; Wang et al., 2024b; Shehzadi et al., 2024), capitalizing on the powerful global modeling capability of self-attention mechanisms. These Transformer-based models have showcased remarkable potential in various computer vision applications. For instance, DiT (Li et al., 2022a) has demonstrated the effectiveness of large-scale unsupervised pre-training in the context of document visual self-supervised learning, while VGT (Da et al., 2023) proposed a Vision Grid Transformer to enhance layout representation learning through a more structured, grid-like modeling of visual dependencies. Despite their superior modeling capabilities, these Transformer-based approaches are fundamentally constrained by the intrinsic quadratic computational complexity of self-attention (scaling with the square of the number of image patches or text tokens), which imposes a severe scalability bottleneck when processing high-resolution documents or text-dense layouts commonly encountered in real-world scenarios. Although techniques such as key-value caching (KV caching) can optimize computations for previously processed tokens to reduce inference latency, the quadratic complexity persists during both the training phase and when handling new inputs, remaining a core limitation. More recent efforts (Fang et al., 2022; Ullah et al., 2023; Li et al., 2022b) have thus begun to rethink the architectural paradigm, pivoting towards designing hybrid structures that synergistically combine the strengths of CNNs and Transformers while alleviating the complexity overhead. Very recently, State Space Models (SSMs) (Gu & Dao, 2023; Liu et al., 2024; Zhu et al., 2024b), and particularly the newly proposed Mamba architecture, have unveiled immense potential in this regard. By virtue of their ability to model long-range dependencies with linear or near-linear computational complexity, SSMs/Mamba offer a fresh, highly promising perspective for surmounting the aforementioned challenges.

Motivated by the complementary virtues of Transformer architectures in learning rich, nuanced feature representations and Mamba's unparalleled efficiency in modeling long-range dependencies, we formulate a central hypothesis that drives this work: a carefully crafted hybrid model, synergistically integrating the self-attention mechanism of Transformers with the state-space modeling prowess of Mamba, can yield a substantially more potent yet computationally efficient framework for Document Layout Analysis (DLA). To this end, we propose DocuMambaFormer, a novel hybrid network architecture that judiciously combines the architectural strengths of both paradigms in a non-trivial manner. Our key insight is that Mamba blocks, with their inherent ability to model long-range spatial interactions through linear state-space transformations, are ideally suited for capturing the global structural coherence across document layouts—effectively discerning relationships between spatially distant elements (e.g., headers, footers, and body text regions) without incurring the quadratic complexity overhead of self-attention. Conversely, we posit that Transformer blocks retain a unique advantage in fine-grained local feature refinement and intricate cross-modal fusion (e.g., integrating visual cues from layout structures with textual semantics), where their dense, token-level attention interactions prove indispensable. This deliberate division of labor fosters a symbiotic relationship between the two modules, potentially unlocking superior modeling capabilities for complex, multi-entity document layouts while simultaneously mitigating the notorious computational bottlenecks associated with pure Transformer-based models.

To rigorously validate the efficacy of our proposed hybrid architecture, we conduct comprehensive experiments on not only well-established but also particularly challenging DLA benchmarks, chosen for their diversity and representativeness. Specifically, we evaluate our model on the widely adopted PubLayNet dataset (Zhong et al., 2019), which primarily comprises scientific articles with relatively standardized layouts, and more critically, on the recently introduced D4LAD^{4}LA (Da et al., 2023), a significantly more demanding benchmark explicitly designed to overcome the homogeneity and simplicity limitations of prior datasets. D4LAD^{4}LA encompasses a remarkably diverse set of 12 distinct document types (ranging from academic papers and financial reports to magazines and patents) and 27 fine-grained layout categories, thereby offering a far more realistic and challenging testbed for evaluating the generalizability and robustness of DLA models. Our empirical results compellingly demonstrate that LayoutMamba consistently sets a new state-of-the-art performance on both PubLayNet and D4LAD^{4}LA, with particularly pronounced gains observed on the more complex and heterogeneous D4LAD^{4}LA benchmark. These findings strongly corroborate our central hypothesis, affirming the substantial benefits of integrating State Space Model (SSM) principles into traditional Transformer-dominated document layout analysis frameworks.

The principal contributions of this work are succinctly summarized as follows:

  1. We introduce LayoutMamba, the hybrid Transformer-Mamba architecture specifically tailored for document analysis tasks, which achieves a remarkable parameter-performance Pareto improvement: our model not only matches the accuracy of prior state-of-the-art Transformer-based methods but does so with a substantial 30% reduction in model parameters. This pioneering work effectively opens up an alternative, more efficient paradigm to the long-standing Transformer-dominated landscape in document understanding.

  2. We propose a novel Geometric Overlap Penalty (GOP) loss function, meticulously designed for document object detection scenarios, which explicitly imposes geometric constraints to minimize bounding box overlaps through an innovative combination of Intersection-over-Union (IoU) regularization and spatial repulsion terms. Our ablation studies confirm that GOP loss consistently yields more precise layout element localization and better overall detection accuracy.

  3. Through extensive experiments on two major, highly representative benchmarks, we demonstrate that our method not only establishes new state-of-the-art results in document layout analysis but also achieves a remarkable 8×8\times parameter compression compared to competitive Transformer-based baselines, thereby validating the efficiency and effectiveness of our hybrid Mamba-Transformer design.

References (45)