TL;DR
This paper introduces the first pure black-box adversarial attack against generative OCR vision-language models where an attacker can only observe the final decoded text string. By framing the attack as a zeroth-order optimization problem driven by string-similarity metrics, the authors expose severe qualitative vulnerabilities—such as infinite text repetition and prompt leakage—while demonstrating that executing precise, targeted text manipulation through a text-only API remains an exceptionally difficult task.
What Problem Does This Paper Address?
Optical Character Recognition (OCR) has evolved from simple character-by-character recognizers into sophisticated Vision-Language Models (VLMs) like DeepSeek-OCR (Deep-OCR), which read entire document pages end-to-end and output structured Markdown. Because these models often feed directly into financial databases, legal systems, and autonomous agents, they are high-value targets for adversarial attacks.
However, real-world deployed OCR systems present a massive challenge for attackers. Most classic adversarial attacks assume a "white-box" setting (where the attacker has access to model gradients) or a "score-based" setting (where the model returns continuous confidence scores or logits). A production OCR API, by contrast, is a pure black box: it accepts an image and returns only a variable-length text string. Furthermore, real-world pipeline steps like JPEG compression, dynamic image tiling, and autoregressive text decoding completely break the mathematical gradient path. This paper tackles this highly restrictive, realistic "string-only" threat model.
Methods
The authors propose RD-ZOO (Random-Direction Zeroth-Order Optimization), a query-efficient black-box attack that treats the OCR system as an image-in/string-out oracle.
The attack pipeline operates as follows:
- String-level Loss: Instead of relying on logits, the method computes a scalar loss directly from the text output using the Ratcliff-Obershelp sequence-similarity ratio ($\rho$). For untargeted attacks, the goal is to minimize similarity to the original text; for targeted attacks, the goal is to maximize similarity to an attacker-chosen target string.
- Random-Direction Gradient Estimation: Standard zeroth-order attacks perturb one pixel coordinate at a time, which is computationally impossible for high-resolution document images. RD-ZOO solves this by sampling $q$ random directions from a Gaussian distribution and perturbing all pixels simultaneously. This keeps the query cost per optimization step independent of the image's resolution.
- Projected Adam Updates: The estimated gradients feed into an Adam optimizer. After each step, an $\ell_\infty$ projection operator clamps the perturbations to ensure they remain imperceptible ($\epsilon \le 8/255$) and that the pixel values stay within a valid range.
Datasets
The authors evaluated their approach using a stratified pilot dataset drawn from OmniDocBench, a benchmark containing diverse PDF document layouts, including academic articles, textbooks, textbooks, and spreadsheets. The local evaluation pool consisted of:
- 20 English pages dedicated to evaluating untargeted degradation attacks.
- 4 Chinese pages dedicated to evaluating targeted integrity/rewriting case studies.
Key Insights and Ideas
- The String-Only Interface is a Formidable Defense: The most striking takeaway is how resilient the system is purely by virtue of hiding its internal probabilities. Without logits or scores, the optimization landscape is incredibly flat and noisy, making successful optimization exceptionally difficult under strict imperceptibility constraints.
- Generative OCR Fails Catastrophically: Traditional OCR models fail by misreading a letter or a word. Because modern OCR systems are generative language models, successful adversarial perturbations cause them to experience severe systemic breakdowns. The authors documented four distinct failure modes: paragraph repetition loops, text truncation/omission, plausible content substitution, and internal prompt/grounding-marker leakage.
- The Targeted Gap: There is a massive asymmetric difficulty between destroying information (untargeted degradation) and controlling information (targeted rewriting). Forcing a generative model to cleanly output a specific fraudulent sentence via black-box pixel manipulation is vastly harder than forcing it to break down into an infinite loop.
Key Results
- Qualitative Success: On official Deep-OCR demonstration pages, the attack successfully triggered massive decoder failures. In one instance, an imperceptible perturbation caused the model to enter an infinite repetition loop, exploding the output from 7,775 characters to 27,411 characters and dropping the sequence similarity score ($\rho$) to 0.0571.
- Quantitative Rigor: On the formal, pre-registered pilot dataset with a strict success threshold of $\tau = 0.05$, the Attack Success Rate (ASR) was 0% (0/9 completed pages). The authors highlighted this result to emphasize that while qualitative vulnerabilities exist, claiming a generalized, reliable exploit against string-only APIs is premature without further optimization.
Limitations and Future Work
The authors openly note several limitations of this pilot study. The method is highly query-intensive, requiring up to 181 queries per page. Furthermore, the delicate finite-difference optimization signal frequently vanishes due to 8-bit image quantization and JPEG compression. Finally, the sequence-matching loss function only captures surface-level text differences rather than semantic or structural harm.
Future work will focus on scaling the evaluation across more document types, exploring lower-dimensional or structured search spaces to improve query efficiency, and testing whether these string-only attacks can successfully transfer across different commercial and open-source OCR-VLMs.
Summary updated