NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TextPecker: Rewarding Structural Anomaly Quantification for Enhancing Visual Text Rendering

Hanshen Zhu, Yuliang Liu, Xuecheng Wu, An-Lan Wang, Hao Feng, Dingkang Yang, Chao Feng, Can Huang, Jingqun Tang, Xiang Bai

TL;DR

TextPecker introduces a plug-and-play reinforcement learning (RL) strategy to fix a major flaw in visual text rendering (VTR) for text-to-image models: the "structural blindness" of standard OCR evaluators. By utilizing a fine-grained, structure-aware reward function trained on a newly curated 1.4-million-sample anomaly dataset, TextPecker significantly boosts both the semantic accuracy and visual quality of rendered text across leading generative models.

What Problem Does This Paper Address?

State-of-the-art text-to-image generators (like Flux or Qwen-Image) frequently struggle to render text cleanly, often producing blurry, distorted, or incomplete characters. To fix this, researchers typically use Reinforcement Learning from AI Feedback (RLAIF), where an OCR model or Multimodal Large Language Model (MLLM) reads the generated text and provides a reward based on accuracy.

However, the authors identify a critical bottleneck: existing OCR models and MLLMs are structurally blind. Because they are trained to optimize for semantic recovery, they use strong linguistic priors to "correct" or hallucinate text, completely overlooking visual defects like missing strokes or warped letters. This leads to noisy, overinflated reward signals that prevent RL algorithms from actually fixing text rendering artifacts.

Figure 1. Existing OCR models and MLLMs struggle to perceive fine-grained structural anomalies in rendered text images, creating a key bottleneck for both VTR evaluation and RL-based optimization. Misrecognized characters are highlighted in RED.

Methods

The authors propose TextPecker, a plug-and-play RL strategy that replaces standard OCR rewards with a perception-guided composite reward function:

  1. Structure-Aware Assessor: The authors fine-tune a custom MLLM (based on Qwen3-VL or InternVL3) to act as a structure-aware text recognizer. Instead of blindly transcribing text, it inserts special error tokens (e.g., <#> or <###>) directly into the recognized text stream whenever a character or word is deformed, blurry, or incomplete.
  2. Composite Reward Functions: The reward is split into two terms:
  3. Semantic Alignment Score ($S_E$): Uses Hungarian matching at the word level to penalize missing or out-of-order words, avoiding the pitfalls of standard long-string edit distances.
  4. Structural Quality Score ($S_Q$): Measures the ratio of structurally anomalous characters and applies a scaling factor ($\omega$) to heavily penalize visually jarring failures.
  5. Flow-GRPO Optimization: This composite reward is integrated into a Group Relative Policy Optimization framework tailored for rectified-flow matching models, allowing stable, critic-free RL training without altering the underlying generator's architecture.
Figure 2: The TextPecker framework uses a structure-aware recognizer to generate composite semantic and structural rewards for Group Relative Policy Optimization.

Datasets

To train their structure-aware assessor, the authors constructed a massive hybrid dataset containing 1.4 million samples:

  • Manual Annotations (559.6K boxes): Real generative artifacts from models like Flux, SD 3.5, and Qwen-Image, meticulously annotated by humans at the character level to flag structural flaws.
  • Synthetic Data Augmentation (452.5K boxes): A stroke-editing engine that programmatically applies three operators—Stroke Deletion, Stroke Swapping, and Stroke Insertion—to Chinese characters to simulate a combinatorial explosion of structural errors.
  • Evaluation Benchmarks: Models were tested on standard benchmarks (OneIG-Bench, CVTG-2K, LongText-Bench) and a newly aggregated benchmark called GenTextEval (comprising 314 English and 417 Chinese prompts).

Key Insights and Ideas

  • Semantic Over-Correction: Standard MLLMs are actually too smart for evaluation; their internal language models automatically fix typos and malformed glyphs in their "heads", making them terrible at judging visual quality.
  • The 2D Complexity of Chinese: Unlike linear English text, Chinese characters possess complex 2D spatial layouts. This makes them highly susceptible to subtle stroke errors that completely change or ruin a character, necessitating a programmatic stroke-level synthesis engine for robust training data.
  • Word-Level vs. String-Level Matching: Standard string edit distance fails when a model renders text out of order or splits it across lines. Word-level Hungarian matching provides a much more stable and fair semantic alignment signal for VTR optimization.

Key Results

  • Perception Breakthrough: TextPecker achieved massive gains in Text Structural Anomaly Perception (TSAP), jumping from near-zero F1 scores in baseline OCRs/MLLMs to over 86% (English) and 92% (Chinese).
  • RL Optimization Gains:
  • On Flux.1 [dev] (English): TextPecker boosted semantic alignment by +38.3% and structural quality by +31.6% over the base model.
  • On Qwen-Image (Chinese): Even on this highly optimized model, TextPecker delivered an average gain of 4% in structural fidelity and 8.7% in semantic alignment, setting a new state-of-the-art.

Limitations and Future Work

Not explicitly discussed in the paper. However, potential future directions include extending the fine-grained stroke-level synthesis engine to other non-Latin scripts (such as Arabic or Indic scripts) and optimizing the computational overhead of running an MLLM assessor inside an online RL loop.

Summary updated

BibTeX
@inproceedings{zhu2026textpecker,
  author = {Hanshen Zhu and Yuliang Liu and Xuecheng Wu and An-Lan Wang and Hao Feng and Dingkang Yang and Chao Feng and Can Huang and Jingqun Tang and Xiang Bai},
  title = {{TextPecker: Rewarding Structural Anomaly Quantification for Enhancing Visual Text Rendering}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=Xid1NnszlJ},
}
Figure