File size: 1,647 Bytes
097fd83
414b4fe
 
 
097fd83
 
 
 
414b4fe
 
 
097fd83
 
414b4fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
title: PaDoc Document Parser
emoji: πŸ“„
colorFrom: indigo
colorTo: pink
sdk: gradio
sdk_version: 6.22.0
app_file: app.py
short_description: Parse document layout regions and content with PaDoc
python_version: "3.12"
startup_duration_timeout: 1h
---

## PaDoc: Layout-Grounded Parallel Decoding for Document Parsing

This Space demonstrates **[PaDoc](https://huggingface.co/Longin-Yu/PaDoc)**, an end-to-end
document parser that leverages parallel decoding. A single image-text model emits a compact
main sequence of layout boxes and starts independent content branches at learned fork tokens β€”
no draft model or additional prediction head is required.

### How it works

1. Upload a document image (or try one of the examples).
2. Click **Parse document** β€” the model predicts layout bounding boxes in `[0, 1000]`
   coordinates and decodes a content branch for each region.
3. The annotated image shows detected regions; the markdown output lists each region's
   category and extracted text.

### Execution modes

- **Sequential** (default): batch=1 reference decoding β€” finishes each branch before
  resuming the main stream.
- **Parallel**: prefills the prompt once, snapshots the parent KV cache at each fork,
  and advances the main stream plus all active branches together in one lockstep GPU batch.

### Model

- **Model:** [Longin-Yu/PaDoc](https://huggingface.co/Longin-Yu/PaDoc) (Qwen3-VL 2B base)
- **Paper:** [arXiv:2608.06146](https://arxiv.org/abs/2608.06146)
- **Code:** [GitHub](https://github.com/Longin-Yu/Padoc)

### License

Model weights are under CC-BY-NC-4.0. Example document images are generated for this demo.