Blocks Architecture (BloArk): Efficient, Cost-Effective, and Incremental Dataset Architecture for Wikipedia Revision History

Lingxi Li, Zonghai Yao, Sunjae Kwon, Hong Yu · DOI

Introduction

Wikipedia serves as the primary corpus for modern Natural Language Processing (NLP). While most research focuses on the "latest snapshot" of articles, the Wikipedia Revision History (WikiRevHist)—a comprehensive record of every edit made since the site's inception—contains a wealth of information regarding human reasoning, document evolution, and collaborative knowledge construction. Despite its potential, the WikiRevHist remains underutilized due to significant engineering hurdles. The raw data is distributed in massive, nested XML files exceeding 30TB, making it nearly impossible to process using standard data science tools like Pandas or single-threaded Python scripts.

To address these challenges, we introduce Blocks Architecture (BloArk), a specialized data architecture designed to transform the cumbersome WikiRevHist into a manageable, parallel-friendly, and incremental format for NLP researchers.

The Challenge of Scale and Structure

Processing the full Wikipedia history presents three primary difficulties:

  1. Linear Parsing Bottlenecks: Standard XML parsers must read files sequentially. When dealing with terabytes of data, this linear approach becomes a massive time sink.
  2. Memory Instability: Certain Wikipedia articles, such as those for major historical events, contain hundreds of thousands of revisions. Attempting to load these "mega-articles" into memory often leads to system crashes, sometimes requiring upwards of 60GB of RAM for a single article's history.
  3. Redundancy in Research: Researchers often build custom, one-off scripts to parse XML for specific tasks. This leads to a duplication of effort, as there is no standardized protocol for sharing or incrementally modifying processed Wikipedia data.

The BloArk Architecture

BloArk moves away from linear XML parsing toward a hierarchical, concurrent architecture organized into three tiers:

  • Blocks: The fundamental unit of the architecture, representing a single revision of a Wikipedia page.
  • Segments: A collection of blocks belonging to a specific article. Segments are paired with metadata, such as byte offsets, to enable fast, non-linear querying.
  • Warehouses: Large storage files that group multiple segments together until a predefined size limit is reached, facilitating easier data distribution and management.

The Building and Modifying Pipeline

BloArk utilizes JSON Lines (JSONL) as its core storage format. Unlike standard JSON or XML, JSONL allows for "non-linear" reading; a process can jump to a specific byte offset in a file and read a line without parsing the preceding data. This enables massive parallelism across CPU cores.

Furthermore, BloArk introduces a standardized Modifier pipeline. Instead of re-parsing the original 30TB XML dump for every new project, researchers can apply a simple Python function to an existing BloArk warehouse. This function transforms a block (e.g., stripping Wikitext, extracting URLs, or summarizing text) and saves the output to a new warehouse. This modularity allows researchers to build upon each other's work efficiently.

Experimental Results

To evaluate the efficiency of the architecture, BloArk was tested on an Apple M1 chip using a 90GB (compressed) subset of the English Wikipedia Revision History. The results demonstrate a significant reduction in processing time through concurrency:

  • Single-process parsing: 12 hours and 43 minutes.
  • Four-process parsing (BloArk): 5 hours and 19 minutes.

By distributing the load across multiple cores and targeting article-level parallelism, BloArk successfully overcomes the I/O and parsing bottlenecks inherent in traditional methods. Additionally, by processing data revision-by-revision rather than article-by-article, the memory footprint remains low and stable even when encountering exceptionally large articles.

Example Applications

To demonstrate the architecture's flexibility, we have curated three example datasets derived from the English Wikipedia history:

  1. Clean Text and Links: A version of the history with all Wikitext markup removed, optimized for text mining.
  2. 6-Month Snapshots: A filtered version containing only one revision per article every six months, drastically reducing the dataset size for long-term longitudinal studies.
  3. 6-Month Edit Summaries: A dataset focusing on the differences (diffs) between the six-month snapshots, designed for training and evaluating edit-summarization models.

Limitations and Future Work

While BloArk significantly improves the accessibility of WikiRevHist, several areas for development remain. Currently, the architecture requires a full rebuild when Wikipedia releases new monthly dumps; we plan to implement an incremental syncing feature to extract only the differences between XML dumps. Additionally, while BloArk uses JSONL, it still stores the full text of every revision. Future iterations could incorporate "diff-only" storage to further reduce disk space requirements. Finally, we aim to expand the Modifier API to support 1-to-N transformations, allowing a single revision to be split into multiple entries, such as for knowledge graph construction.

Summary updated

BibTeX
@misc{li2024blocks,
  author = {Lingxi Li and Zonghai Yao and Sunjae Kwon and Hong Yu},
  title = {{Blocks Architecture (BloArk): Efficient, Cost-Effective, and Incremental Dataset Architecture for Wikipedia Revision History}},
  year = {2024},
  eprint = {2410.04410},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.04410},
}
Figure