Manuscript Offprint

arXiv:2610.21979

P2TPO: Structure-Aligned Page-to-Token Credit Assignment for Full-Page Document Parsing

Yong Zu, Ninghua Yang, Zezhong Tan, Xinhong Ma, Ziqiang Dong, Yang Yang

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

Yong Zu §†1,2^{§†1,2}, Ninghua Yang §1^{§1}, Zezhong Tan 1^{1}, Xinhong Ma 1^{1}, Ziqiang Dong ∗1^{*1} and Yang Yang †1^{†1}

1^{1}Qwen Business Unit, Alibaba, 2^{2}Xidian University

§^{§}Core contributors. ∗^{*}Project lead. †^{\dagger}Team lead. ‡^{\ddagger}Work done during an internship at Alibaba.

End-to-end full-page document parsing must preserve the content and structure of heterogeneous elements, yet otherwise accurate outputs can contain local errors and omissions. A single page-level advantage does not explicitly identify which elements differ in quality across sampled outputs or where their errors occur. We introduce Page-to-Token Policy Optimization (P2TPO), a structure-aligned credit-assignment framework that operates on full-page policy trajectories. Reference-element alignment first associates block-level quality contrasts with generated spans. Unified Anchor Pricing (UAP) incorporates matched and missing element outcomes and provides feedback relative to a fixed quality ceiling when sampled outputs receive identical but imperfect scores for a reference element. Within matched blocks, Span Credit Redistribution (SCR) redistributes existing block credit according to aligned correct and erroneous spans, using boundary proxies for within-block omissions while preserving the total block-derived advantage across its tokens. Under a fixed-weight additive page utility, we show that element-indexed contrasts retain local quality differences that page-level aggregation can cancel out. In the main experimental comparison, P2TPO outperforms all evaluated policy optimization baselines in seed-averaged scores on each of the six document parsing benchmarks. Additional experiments demonstrate gains across model scales and initializations.

1. Introduction

End-to-end document parsers transcribe images of digital documents, scans, and photographs into a single structured sequence in reading order (Blecher et al., 2024; Taghadouini et al., 2026; Ouyang et al., 2025; Du et al., 2025). We study full-page Markdown transcription, with faithful text, EIFX formulas, and HTML tables. Dense heterogeneous content, skew, warping, and uneven illumination challenge accuracy and completeness (Ouyang et al., 2025; Zhou et al., 2026). Errors are often local: an otherwise accurate output may corrupt a formula, omit words, or miss an entire element.

Supervised next-token learning serves as the foundation for these parsers, while reinforcement learning (RL) is used for post-training optimization of reference-based measures for fully generated documents. These measures evaluate content accuracy, structural fidelity, and completeness. Recent parsers highlight the effectiveness of reinforcement learning in post-training through layout-aware rewards and verifiable unit tests (Wang et al., 2025; Chen et al., 2025; Poznanski et al., 2025). A key question for full-page transcription is how to convert these measurements into feedback that corrects missing or corrupted content while preserving correctly transcribed sections.

With page-level outcome rewards, GRPO assigns one response advantage to all generated tokens (Shao et al., 2024). Yet two outputs of the same page can receive similar overall scores while making opposite local errors: one transcribes a formula correctly but omits a table, whereas the other recovers the table and corrupts the formula (Figure 1(a)). A shared response coefficient does not preserve these element-specific contrasts. GDPO normalizes reward dimensions separately before combining them into a shared response coefficient (Liu et al., 2026b); CSPO routes table-wide functional-attribute advantages to corresponding tokens (Yang et al., 2026). Our focus is the remaining reference-instance question: how to compare corresponding individual elements across full-page outputs, include missing outcomes, and allocate their signed credit to generated positions.

We analyze this phenomenon at three levels. First, reference identity maintains contrasts between individual elements, including instances of the same type. Second, element-wise comparisons must account for missing outcomes and retain feedback when all outcomes are equally imperfect: an omitted element lacks a generated span, and centering tied scores diminishes its relative signal. Third, feedback must differentiate erroneous positions from correct content within a matched block, rather than assigning uniform credit across the block. Together, the four failure modes illustrated in Figure 1(b) highlight three key requirements: preserve element identity, complete the comparison outcomes, and control where credit is assigned.

(a) Long rollouts, fine-grained errors

Figure

(b) Gaps in coarse feedback

Figure

(c) Structure-aware feedback

Preserve block identity

Figure

2 Agreement ≠ correctness

Ref. Do not mix.

Relative advantage

Do mix.

Do mix.

Do mix.

Do mix.

Do mix.

Equal errors → no relative contrast

Shared reference mismatches still receive feedback

3 Which spans?

Ref. E=mc2E = mc^{2}

E

=

m

c

3

One block penalty reaches every token

Focus feedback on local errors

Ref. E=mc2E = mc^{2}

E

=

m

c

3

Local refinement shown; page / block baseline omitted

4 What about omissions?

Ref.

Out.

No generated tokens for the omitted block

Account for missing content

Include missing reference blocks in feedback

Figure 1 | Schematic motivation for structure-aware feedback. (a) Similar page rewards hide local differences. (b) Coarse feedback obscures block identity, shared errors, and error/omission locations. (c) Structure-aware feedback retains element identity and assigns local credit. Rewards and serialized content are illustrative; training outputs use HTML tables.

We introduce Page-to-Token Policy Optimization (P2TPO), which assigns local credit while retaining full-page generation and page-level feedback (Figure 1(c)). It first aligns each output to reference elements so that corresponding instances can be compared across rollouts. Unified Anchor Pricing (UAP) completes these comparisons with missing outcomes and uses a quality ceiling to retain feedback at imperfect consensus. Matched coefficients act on generated blocks; whole-element omissions act through existing boundary tokens. Span Credit Redistribution (SCR) then reallocates an eligible matched block's coefficient toward aligned errors when negative and correct positions when positive, preserving its sign and total credit mass. The final update combines this local feedback with the shared page term.

Our contributions are fourfold:

• Reference-element credit assignment. We retain individual element identities across full-page rollouts and characterize the local quality contrasts that aggregation can erase under a fixed-weight additive page utility.

• Complete outcome feedback. We propose the UAP, which outlines a unified set of rules for handling matches, managing missing values, and addressing uniformly imperfect outcomes. This includes a feedback mechanism for instances where an entire element is absent.

• Budget-preserving intra-block redistribution. We developed the SCR mechanism, which reallocates block credits while preserving both the sign and the total amount of matched block credits. We proved the conservation of credits and specified the conditions under which informative masks can increase the allocation to the target position.

• Empirical effectiveness and generality. Using a shared supervised checkpoint, matched update budgets, and a five-seed run, P2TPO outperforms four response-level baselines on all 13 primary splits across six benchmarks that include digital documents, scanned pages, and real-world photographs. In addition, across three different model and initialization settings, it achieves the highest mean in 37 out of 39 comparisons of splits and settings.

(a) P2BPO

Align · normalize · broadcast

Reference-aligned block groups

Same page · same reference block

Figure

Highlighted column = one anchor group

Normalize matched outcomes

Each anchor uses its own mean and scale

(b) P2TPO

Extend block coefficients with UAP; refine their allocation with SCR

UAP · Construct block coefficients

All valid rollouts for every reference anchor

Matched → observed reward

MISS → 0

Includes anchors missed by every rollout

Varying rewards

Relative coefficients

Equal, below ceiling

Ceiling penalty · λ

Equal, at ceiling

Zero correction

Matched

Generated block → SCR

MISS

Boundary token · bypass SCR

Route onto existing generated positions

SCR · Redistribute within blocks

Align token labels; apply the block reward gate

Merge nearby errors and short gaps

✓ Correct

✗ Error

◇ Within-block proxy

Negative credit → error regions

Positive credit → correct regions

Uniform

Redistributed

Strength β\beta · conserved block budget

Cap weights → return residual credit

Gate fails / no selected region → uniform

(c) Overall pipeline

Figure 2 | P2TPO overview. (a) P2BPO aligns reference elements, normalizes matched outcomes, and broadcasts block credit. (b) UAP incorporates missing outcomes and imperfect-consensus feedback; SCR redistributes matched-block credit under a conserved budget. (c) The complete pipeline combines local token credit with page feedback. Missing-block coefficients reach boundary tokens directly, bypassing SCR.

References (37)