Papers › Layout and Task Aware Instruction Prompt for Zero-shot Document Image Question Answering

Layout and Task Aware Instruction Prompt for Zero-shot Document Image Question Answering

1 Jun 2023arXiv:2306.00526archive 2025-07-28

Wenjin Wang, Yunhao Li, Yixin Ou, Yin Zhang

Layout-aware pre-trained models has achieved significant progress on document image question answering. They introduce extra learnable modules into existing language models to capture layout information within document images from text bounding box coordinates obtained by OCR tools. However, extra modules necessitate pre-training on extensive document images. This prevents these methods from directly utilizing off-the-shelf instruction-tuning language foundation models, which have recently shown promising potential in zero-shot learning. Instead, in this paper, we find that instruction-tuning language models like Claude and ChatGPT can understand layout by spaces and line breaks. Based on this observation, we propose the LAyout and Task aware Instruction Prompt (LATIN-Prompt), which consists of layout-aware document content and task-aware instruction. Specifically, the former uses appropriate spaces and line breaks to recover the layout information among text segments obtained by OCR tools, and the latter ensures that generated answers adhere to formatting requirements. Moreover, we propose the LAyout and Task aware Instruction Tuning (LATIN-Tuning) to improve the performance of small instruction-tuning models like Alpaca. Experimental results show that LATIN-Prompt enables zero-shot performance of Claude and ChatGPT to be comparable to the fine-tuning performance of SOTAs on document image question answering, and LATIN-Tuning enhances the zero-shot performance of Alpaca significantly. For example, LATIN-Prompt improves the performance of Claude and ChatGPT on DocVQA by 263% and 20% respectively. LATIN-Tuning improves the performance of Alpaca on DocVQA by 87.7%. Quantitative and qualitative analyses demonstrate the effectiveness of LATIN-Prompt and LATIN-Tuning. We provide the code in supplementary and will release it to facilitate future research.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2306.00526")

Code

Syntology Ran 1 of 10 code samples harvested from 2 repositories linked to this paper; 9 have no recorded run. Of those that ran: 1 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 1 ran; community (archive-listed): 2 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wenjinw/latin-prompt officialmentioned in papermentioned on GitHubpytorchMIT report
deepopinion/anls-star-metric mentioned on GitHubApache-2.0 report
deepopinion/anls_star_metric mentioned on GitHubApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 1 ran; 0 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran
9unverified

Licence: 0 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

normalize_bbox wenjinw/latin-prompt/utils/docvqa.py official repository ran fingerprinted MIT (permissive) · c23469a99394f25f · report
compute_l2_dist wenjinw/latin-prompt/utils/util.py official repository unverified MIT (permissive) · 9741f65bce116c5a · report
cos_sim wenjinw/latin-prompt/utils/util.py official repository unverified MIT (permissive) · c480c7bac03cd36f · report
document_sim wenjinw/latin-prompt/utils/util.py official repository unverified MIT (permissive) · 87fed178011a98e9 · report
load_image wenjinw/latin-prompt/utils/docvqa.py official repository unverified MIT (permissive) · db4bf2624e9f59ae · report
openai_chat_completion wenjinw/latin-prompt/utils/openai_api.py official repository unverified MIT (permissive) · f03fda2a07bb8465 · report
openai_completion wenjinw/latin-prompt/utils/openai_api.py official repository unverified MIT (permissive) · 430f1617115f7078 · report
quad_to_box wenjinw/latin-prompt/utils/docvqa.py official repository unverified MIT (permissive) · ec25301365f6d685 · report
construct_nested_dict deepopinion/anls-star-metric/src/anls_star/key_scores_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · e5d4f184819c330c · report
merge_and_calculate_mean deepopinion/anls-star-metric/src/anls_star/key_scores_utils.py community (archive-listed) unverified Apache-2.0 (permissive) · a2e70e7ad97878ef · report

Tasks

Optical Character Recognition (OCR)Question AnsweringVisual Question Answering (VQA)Zero-Shot Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Visual Question Answering (VQA) DocVQA test GPT-4 ANLS 0.884 #9 of 33 Archive leaderboard report
Visual Question Answering (VQA) DocVQA test Claude + LATIN-Prompt ANLS 0.8336 #19 of 33 Archive leaderboard report
Visual Question Answering (VQA) DocVQA test GPT-3.5 + LATIN-Prompt ANLS 0.8255 #20 of 33 Archive leaderboard report
Visual Question Answering (VQA) InfographicVQA Claude + LATIN-Prompt ANLS 54.51 #11 of 21 Archive leaderboard report
Visual Question Answering (VQA) InfographicVQA GPT-3.5 + LATIN-Prompt ANLS 48.98 #14 of 21 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

ALIGNAWARE

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections