Enhancing Vision-Language Pre-training with Rich Supervisions

Yuan Gao, Kunyu Shi, Pengkai Zhu, Edouard Belval, Oren Nuriel, Srikar Appalaraju, Shabnam Ghadar, Vijay Mahadevan, Zhuowen Tu, Stefano Soatto

TL;DR

The authors introduce S4 (Strongly Supervised pre-training with ScreenShots), a novel pre-training paradigm that utilizes large-scale web page rendering to automatically generate rich semantic, structural, and spatial supervisions. By training Vision-Language Models (VLMs) on 10 diverse, automatically annotated tasks, S4 achieves massive performance boosts on downstream tasks, including an absolute improvement of up to 76.1% on Table Detection.

What Problem Does This Paper Address?

While Vision-Language Models (VLMs) have made massive strides, their pre-training heavily relies on simple image-text pairs or self-supervised pixel reconstruction. These approaches often fail to capture the complex spatial layouts and structural hierarchies inherent in documents, user interfaces (UIs), and web pages.

Recent attempts have used web screenshots paired with raw HTML text for pre-training. However, they typically treat the problem as a simple image-to-text translation task, ignoring the goldmine of fine-grained data embedded within the HTML Document Object Model (DOM) tree—such as exact element coordinates, parent-child relationships, and functional attributes. Manually labeling this data is prohibitively expensive, leaving a gap for a scalable, automated method to extract and utilize these rich supervisions.

Methods

The authors propose the S4 framework, which automatically extracts high-quality, multi-modal annotations by rendering web pages.

Using a headless browser pipeline (via Playwright), they render raw HTML into screenshots and traverse the DOM tree to collect spatial and textual properties for leaf nodes (Text, Image, Table, Input). To ensure data quality, they implement a strict cleaning pipeline that filters out invisible or occluded elements by checking CSS visibility and bounding box alignments.

Instead of a single monolithic training objective, S4 introduces 10 diverse pre-training tasks aligned with common downstream applications.

Figure 2. Compared to traditional pre-training paradigms, our rich supervised pre-training leverages much more information that is also cheap to acquire (i.e via browser). We can then utilize the rich semantic and structural annotations to construct novel pre-training tasks that are naturally and directly aligned with downstream tasks. We use green words to refer to the words contained (visible) in the screenshot. We use red words to refer to the words that are not visible in the screenshot. For instance, “price” is not shown on the screenshot, but is the id of an element (refer to picture). We use brown words in the format of <x><y><x><y> to denote the bounding box.

Crucially, the authors discovered that mixing language and localization tasks together can degrade performance. To solve this, they split the tasks into two specialized pre-training schemas:

  1. $S4_{NL}$ (Natural Language Generation): Focuses on textual and structural tasks like Screen Parsing, Attribute Prediction, Table Parsing, Title Generation, and Node Relation Prediction.
  2. $S4_{Loc}$ (Localization): Focuses on spatial tasks like OCR, Image Grounding, Element Grounding, Table Detection, and Layout Analysis.

The underlying architecture is an OCR-free, autoregressive model consisting of a ViT image encoder and a Transformer text decoder, augmented with 1,000 dedicated coordinate tokens to handle bounding box predictions.

Datasets

  • Pre-training: The authors built the S4 Data dataset, consisting of 15 Million unique screenshots derived from CommonCrawl web pages, complete with automatically generated rich supervisions.
  • Downstream Evaluation: The model was evaluated across 9 diverse benchmarks:
  • Language-focused: ChartQA, WebSRC, Screen2words, Widget Captioning, and UI $RefExp_{cls}$.
  • Localization-focused: PubLayNet, ICDAR 2019 (Modern Subset), and PubTables-1M.
  • New Benchmark Variant: The authors introduced UI $RefExp_{cand\_free}$, a more challenging version of the standard UI Referential Expression task where the model must predict bounding boxes directly from text descriptions without being handed a set of candidate boxes.

Key Insights and Ideas

  • "Free" Supervision via Web Rendering: The web is inherently structured. By leveraging browser rendering engines, researchers can generate pixel-perfect bounding boxes and structural labels at scale without paying for human annotation.
  • The Interference of Language and Location: Directly combining language generation and localization objectives ($S4_{Joint}$) harms downstream performance. Separating them into specialized tracks ($S4_{NL}$ and $S4_{Loc}$) yields significantly better results.
  • Closing the Gap with Specialist Models: General-purpose, autoregressive text-generation models usually underperform on detection tasks compared to specialized architectures like DETR. However, S4 demonstrates that proper localization pre-training allows a generic VLM to achieve comparable performance to detection-specific models.

Key Results

S4 consistently outperformed the strong Pix2Struct baseline across all evaluated downstream tasks:

Downstream results on Chart, Web, and UI Understanding datasets
  • Localization Tasks: On the ICDAR 2019 table detection dataset, S4 achieved a staggering 79.4 AP50 compared to Pix2Struct’s 3.6 AP50.
  • Candidate-Free Grounding: On the challenging new UI $RefExp_{cand\_free}$ task, S4 improved accuracy from 55.1% to 84.3%.
  • Language Tasks: S4 achieved notable gains across the board, including a +2.9% improvement on ChartQA and +6.8% on UI $RefExp_{cls}$ when scaled to 15M pre-training images.

Limitations and Future Work

While highly effective, S4 requires high-resolution input images (1280x1280) to accurately read small text elements on web pages, which significantly increases memory consumption during training. Additionally, the authors noted a distribution shift between their CommonCrawl-derived dataset and the private datasets used by models like Pix2Struct, which requires scaling the pre-training data to fully overcome. Future work could explore more memory-efficient architectures or cross-domain adaptation techniques to mitigate these constraints.

Summary updated

BibTeX
@misc{gao2024enhancing,
  author = {Yuan Gao and Kunyu Shi and Pengkai Zhu and Edouard Belval and Oren Nuriel and Srikar Appalaraju and Shabnam Ghadar and Vijay Mahadevan and Zhuowen Tu and Stefano Soatto},
  title = {{Enhancing Vision-Language Pre-training with Rich Supervisions}},
  year = {2024},
  eprint = {2403.03346},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.03346},
}
Figure