arXiv:2610.41426cs.CVOct 2026

Manuscript Offprint

arXiv:2610.41426

FlexReader: Towards Adaptive Decoding Paths for Efficient Arbitrary-Length Scene Text Recognition

Zhibin Ma, Pengwen Dai, Zhigang Yao, Xugong Qin, Wenqi Ren, Xiaochun Cao

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

Abstract

Existing Scene Text Recognition (STR) models are inherently coupled with a specific decoding strategy by their training paradigms, limiting their flexibility in deployment across diverse recognition scenarios. In this paper, we propose FlexReader, an STR model that supports multiple decoding strides, enabling a single model to achieve an optimal accuracy–efficiency trade-off across different datasets. Specifically, we first introduce a Sub-string Perception module to perceive the target sub-string from visual features, followed by multiple parallel decoding blocks that independently decode each character in the sub-string. During inference, FlexReader supports decoding with arbitrary strides within the perceived sub-string range. Furthermore, we propose Adaptive Prefix Decoding, which adaptively selects the decoding stride at each step based on the model's confidence in the decoded characters, thereby identifying the optimal decoding path for each input. Experimental results demonstrate that FlexReader exhibits robust recognition capability across a diverse range of benchmarks, including those featuring long text, curved text, and occlusions. It consistently outperforms existing decoding strategies in recognition accuracy while achieving up to 6x decoding speedup over autoregressive decoding.

1. Introduction

Scene Text Recognition (STR) aims to extract textual information from natural scene images. It serves as a fundamental component of visual understanding and has broad applications in autonomous driving, embodied intelligence, augmented reality, and other fields.

Unlike conventional Optical Character Recognition [6, 47, 59] scenarios, STR entails recognizing text under chal-

Figure

Figure 1. Left: Comparison of different decoding methods. Right: A representative recognition example, where our method adaptively selects the optimal decoding path.

lenging visual conditions, such as complex backgrounds and irregular layouts, while posing stringent requirements on inference efficiency. However, existing methods struggle to balance recognition accuracy and inference efficiency. For example, AR methods [1, 21, 37, 42] achieve high recognition accuracy but incur substantial decoding overhead, while parallel decoding [9, 35, 55] and CTC-based [7, 11, 41] methods enable efficient inference at the expense of limited character dependency modeling. Although recent mask diffusion-based decoding approaches [12, 38, 53] effectively balance accuracy and efficiency, their fixed-length design limits their ability to handle texts with varying lengths. Moreover, existing methods are typically optimized with a single objective (e.g. the AR loss), which restricts them to a single decoding strategy at inference time. However, the difficulty of scene text varies considerably across real-world scenarios, necessitating adaptive decoding strategies that can dynamically adjust to the input difficulty for an optimal accuracy–efficiency trade-off.

Inspired by the success of multi-token prediction (MTP) in large language models (LLMs) [2, 15, 29, 49], we explore its application to STR decoding for flexible and effi-cient inference. However, unlike language modeling, where future tokens can be inferred from contextual representations, STR requires fine-grained alignment between each predicted character and its corresponding visual evidence. Therefore, how to develop a STR framework that can effectively exploit multi-token prediction to accelerate decoding without sacrificing character-level recognition accuracy across diverse text lengths remains an open challenge.

In this work, we propose FlexReader, an efficient and flexible STR network to address the aforementioned challenges. First, we decompose the decoding process into two components: Sub-string Perception and Multi-branch Prediction. Unlike the next-token perception adopted in AR decoding, Sub-string Perception captures the visual evidence of the next L characters conditioned on the previously decoded character sequence, and encodes the entire sub-string into a single token (as illustrated in Fig. 2(c)). Subsequently, Multi-branch Prediction utilizes L parallel decoding branches to individually recover each character from the encoded sub-string. This decoding strategy decouples the perception and decoding processes, enabling flexible inference-time decoding with different decoding strides ranging from 1 to L. Second, we propose Adaptive Prefix Decoding, which enables the model to adaptively determine the decoding length for each forward pass based on prediction confidence, achieving an optimal speed-accuracy trade-off within a single model. Compared with the speculative decoding commonly used in LLMs [2, 25], our decoding approach eliminates the complex draft prediction and verification process, enabling faster inference with a lightweight model.

The proposed FlexReader provides two key advantages. (1) Flexibility: FlexReader allows a single model to decode with arbitrary step sizes and adaptively selects the decoding stride based on sample difficulty. This capability effectively mitigates the speed-accuracy dilemma faced by existing approaches. (2) Efficiency: Through Adaptive Prefix Decoding, FlexReader autonomously searches for an optimal decoding path by leveraging prediction confidence as prior guidance. Furthermore, sub-string perception enables the decoder to incorporate textual information from future sub-strings, breaking the limitation of conventional autoregressive decoding that relies solely on previously decoded tokens. The main contributions of this work are fourfold:

(1) We pioneer the integration of multi-token prediction into the STR task, introducing a new decoding paradigm that enables efficient recognition of text sequences with a wide range of lengths.

(2) We decompose the decoding process into Sub-string Perception and Multi-branch Prediction, which enables fine-grained sub-string-level alignment and allows a single model to perform variable-step decoding.

(3) We propose Adaptive Prefix Decoding, a dynamic de-

coding strategy that adaptively adjusts the number of predicted tokens for an optimal accuracy-efficiency trade-off.

(4) Extensive experiments demonstrate the effectiveness of the proposed FlexReader. It achieves state-of-the-art performance across diverse benchmarks while delivering a 4-6× speedup in decoding.

References (61)