DocKylin: A Large Multimodal Model for Visual Document Understanding with Efficient Visual Slimming

Jiaxin Zhang, Wentao Yang, Songxuan Lai, Zecheng Xie, Lianwen Jin

Introduction

Visual Document Understanding (VDU) is a critical domain in multimodal AI, encompassing tasks such as receipt parsing, chart analysis, and scientific paper interpretation. These tasks inherently require high-resolution input to capture fine-grained textual details. However, standard Multimodal Large Language Models (MLLMs) face a significant efficiency bottleneck: while low resolution loses critical information, high resolution generates an overwhelming number of visual tokens.

This "token explosion" is computationally expensive and often exceeds the effective context window of the underlying Large Language Model (LLM). Furthermore, document images are typically "sparse," containing significant redundant areas like margins or empty backgrounds. Existing models often treat every pixel with equal weight, wasting processing power on "dead space." DocKylin addresses these challenges through a novel "visual slimming" approach at both the pixel and token levels.

Methodology: The DocKylin Pipeline

DocKylin introduces a two-stage slimming pipeline designed to maximize information density while minimizing sequence length. The architecture integrates adaptive preprocessing with dynamic token management to streamline the input sent to the LLM.

The DocKylin architecture featuring Adaptive Pixel Slimming and Dynamic Token Slimming.

Adaptive Pixel Slimming (APS)

Adaptive Pixel Slimming is a parameter-free preprocessing step that operates before the image reaches the encoder. By utilizing the Sobel operator, the model calculates gradient maps of the input image. Regions with low gradients—representing smooth, empty areas like margins—are identified as redundant. DocKylin removes these redundant rows and columns, effectively "squeezing" the document to increase the density of semantic information. This method can reduce the total pixel count by nearly 50% without losing meaningful text or layout data.

Workflow of the Adaptive Pixel Slimming (APS) module identifying redundant regions.

Flexible Swin Encoder

To avoid the text distortion common in models that force images into fixed square aspect ratios, DocKylin employs a lightweight Swin Transformer (0.07B parameters). This encoder caps the total number of pixels while allowing for variable aspect ratios, ensuring that the structural integrity of the document is preserved during encoding.

Dynamic Token Slimming (DTS)

Once the image is encoded into tokens, the Dynamic Token Slimming (DTS) module further refines the sequence. Using Dual-center K-Means clustering, DTS partitions tokens into "essential" and "nonessential" groups. Unlike traditional pruning methods that simply discard unimportant data, DTS utilizes Similarity Weighted Aggregation. This process "folds" the information from nonessential tokens into the most similar essential ones, preventing information loss while drastically shortening the sequence length provided to the LLM.

Experimental Results

DocKylin was evaluated across a comprehensive battery of VDU benchmarks, including DocVQA, InfoVQA, ChartQA, and various information extraction tasks like FUNSD and SROIE.

Performance and Efficiency

The model achieved state-of-the-art (SOTA) performance, significantly outperforming larger general-purpose MLLMs. On the DocVQA benchmark, DocKylin reached 65.1% accuracy, compared to 48.1% for Qwen-VL and 50.1% for Monkey.

Beyond accuracy, the efficiency gains were substantial:

  • Compression: Visual sequence lengths were reduced by approximately 45-55%.
  • Speed: Inference time was reduced by roughly 40% compared to baseline models without slimming.
  • Robustness: Ablation studies confirmed that masking the redundant regions identified by APS/DTS resulted in negligible performance drops, validating the accuracy of the redundancy detection algorithms.

Discussion and Future Work

DocKylin demonstrates that redundancy in document images is an opportunity for optimization. By shifting from simple elimination to intelligent aggregation, the model maintains a high performance ceiling while operating with a fraction of the computational overhead of its peers.

However, limitations remain. The current APS implementation is "coarse," as it only removes entire rows or columns rather than localized "holes" of white space within a page. Additionally, extremely complex layouts, such as dense, non-standard tables, may occasionally lose grid context if aggregation is overly aggressive. Future research will focus on refining these slimming techniques for even more complex document structures and exploring their application in natural scene understanding.

Summary updated

BibTeX
@inproceedings{zhang2025dockylin,
  author = {Jiaxin Zhang and Wentao Yang and Songxuan Lai and Zecheng Xie and Lianwen Jin},
  title = {{DocKylin: A Large Multimodal Model for Visual Document Understanding with Efficient Visual Slimming}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i9.33076},
}
Figure