| name | mineru-diffusion-ocr-inverse-rendering |
| title | MinerU-Diffusion: Document OCR via Diffusion Decoding |
| version | 0.0.3 |
| engine | skillxiv-v0.0.3-claude-opus-4.6 |
| license | MIT |
| url | https://arxiv.org/abs/2603.22458 |
| keywords | ["OCR","Diffusion Models","Parallel Decoding","Block-Wise Attention","Curriculum Learning"] |
| description | Replace autoregressive token-by-token OCR decoding with block-wise diffusion decoding to achieve 3.2× speedup while maintaining 99.9% accuracy. Works best for document layout parsing where parallel generation is feasible. Trigger: When optimizing OCR systems and want faster inference without accuracy loss. |
| category | Component Innovation |
What This Skill Does
Swap autoregressive sequential decoding with block-wise diffusion decoding in document OCR to improve inference speed by 3.2× while maintaining competitive accuracy on structured document parsing tasks.
Problem with Autoregressive Decoding
Autoregressive models generate OCR tokens sequentially (left-to-right), treating token ordering as an intrinsic property of the task. This forces O(n) sequential steps where each token depends on all prior tokens. For document OCR, this sequential bottleneck is unnecessary: document structure allows parallel token generation once block-level dependencies are satisfied.
The paper's insight: Document OCR is fundamentally an inverse rendering problem where content can be refined in parallel within blocks, not strictly left-to-right.
The Swap: Diffusion Decoder with Block-Wise Attention
Replace sequential autoregressive generation with iterative diffusion refinement using factored attention:
def autoregressive_decode(tokens, hidden_states):
"""Generate tokens one by one, each attending to all prior tokens"""
for i in range(len(tokens)):
next_token = model(tokens[:i+1], hidden_states)
tokens[i] = next_token
def block_diffusion_decode(noisy_tokens, hidden_states, blocks=4):
"""
Iteratively refine all tokens in parallel.
Attention is factored:
- Within block: bidirectional (all tokens see each other)
- Across blocks: causal (tokens attend to preceding blocks)
- Reduces complexity from O(L²) to O(B·L'²) where L' = L/B
"""
for step in range(num_diffusion_steps):
for block_idx in range(blocks):
start = block_idx * ((tokens) // blocks)
end = (block_idx + ) * ((tokens) // blocks)
refined = model(noisy_tokens, hidden_states,
block_range=(start, end),
attend_to_prior_blocks=)
noisy_tokens[start:end] = refined[start:end]
noisy_tokens