Papers › LaTr: Layout-Aware Transformer for Scene-Text VQA

LaTr: Layout-Aware Transformer for Scene-Text VQA

23 Dec 2021CVPR 2022 1arXiv:2112.12494archive 2025-07-28

Ali Furkan Biten, Ron Litman, Yusheng Xie, Srikar Appalaraju, R. Manmatha

We propose a novel multimodal architecture for Scene Text Visual Question Answering (STVQA), named Layout-Aware Transformer (LaTr). The task of STVQA requires models to reason over different modalities. Thus, we first investigate the impact of each modality, and reveal the importance of the language module, especially when enriched with layout information. Accounting for this, we propose a single objective pre-training scheme that requires only text and spatial cues. We show that applying this pre-training scheme on scanned documents has certain advantages over using natural images, despite the domain gap. Scanned documents are easy to procure, text-dense and have a variety of layouts, helping the model learn various spatial cues (e.g. left-of, below etc.) by tying together language and layout information. Compared to existing approaches, our method performs vocabulary-free decoding and, as shown, generalizes well beyond the training vocabulary. We further demonstrate that LaTr improves robustness towards OCR errors, a common reason for failure cases in STVQA. In addition, by leveraging a vision transformer, we eliminate the need for an external object detector. LaTr outperforms state-of-the-art STVQA methods on multiple datasets. In particular, +7.6% on TextVQA, +10.8% on ST-VQA and +4.0% on OCR-VQA (all absolute accuracy numbers).

PaperPDFConference PDFCodeCode 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="2112.12494")

Code

Syntology Ran 0 of 11 code samples harvested from 1 repository linked to this paper; 11 have no recorded run.

By repository: community (archive-listed): 11 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.

uakarsh/latr mentioned on GitHubpytorchMIT 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

11 samples harvested; 0 ran; 0 honoured the contract we drafted; 11 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.

11unverified

Licence: 0 of the 11 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 uakarsh/latr. “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.

apply_mask_on_token_bbox uakarsh/latr/src/latr/utils.py community (archive-listed) unverified MIT (permissive) · 0160a0950f8a408d · report
collate uakarsh/latr/src/new_latr/utils.py community (archive-listed) unverified MIT (permissive) · b04111d961ebf081 · report
convert_ans_to_token uakarsh/latr/src/latr/utils.py community (archive-listed) unverified MIT (permissive) · 022328e95ccf040b · report
draw_bounding_box_on_pil_image uakarsh/latr/src/new_latr/utils.py community (archive-listed) unverified MIT (permissive) · 5b6c6bb7ff0f4c5f · report
find_pad_idx uakarsh/latr/src/latr/utils.py community (archive-listed) unverified MIT (permissive) · 819eeaf4648239c4 · report
get_specific_file uakarsh/latr/src/latr/dataset.py community (archive-listed) unverified MIT (permissive) · 8a052cb43cf0afb4 · report
get_tokens_with_boxes uakarsh/latr/src/new_latr/dataset.py community (archive-listed) unverified MIT (permissive) · eeddd31a58b2af44 · report
load_json_file uakarsh/latr/src/latr/dataset.py community (archive-listed) unverified MIT (permissive) · 547898699994a72b · report
normalize_box uakarsh/latr/src/new_latr/dataset.py community (archive-listed) unverified MIT (permissive) · e596d6641d127bd8 · report
pad_sequence uakarsh/latr/src/new_latr/utils.py community (archive-listed) unverified MIT (permissive) · 51ccac8f6cb9bd79 · report
resize_align_bbox uakarsh/latr/src/latr/dataset.py community (archive-listed) unverified MIT (permissive) · 1c118f09dd72e170 · report

Tasks

Optical Character Recognition (OCR)Question AnsweringVisual Question AnsweringVisual Question Answering (VQA)

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

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