BabelDOC: Better Layout-Preserving PDF Translation via Intermediate Representation
Qi Yang, Xiangyao Ma, Xiao Wang, Hao Wang, Rui Wang · 2026
Read BabelDOC: Better Layout-Preserving PDF Translation via Intermediate Representation by Qi Yang, Xiangyao Ma, Xiao Wang, Hao Wang, Rui Wang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-10845.txt.
Introduction
Qi Yang and four colleagues introduce BabelDOC, a 2026 framework for translating PDF documents while keeping their original layout intact. Existing tools either strip layout when they translate text or extract text without a way to rebuild the page faithfully, leaving formulas, tables, and glossaries adrift.
BabelDOC splits layout metadata from meaning into an intermediate representation, so translation can handle terms, cross-page context, and glossaries before an adaptive typesetting engine re-anchors the result to the original page. On a two-hundred-page benchmark, human and automated judges rated it ahead of rivals on layout fidelity, looks, and term consistency. Teams translating rich documents get an open toolkit that preserves the page, not just the words.
Catalog record
| CREATOR | Qi Yang, Xiangyao Ma, Xiao Wang, Hao Wang, Rui Wang |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 33362 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.10845
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
BabelDOC: Better Layout-Preserving PDF Translation via Intermediate Representation Qi Yang, Xiangyao Ma, Xiao Wang, Hao Wang, Rui Wang Abstract As global cross-lingual communication intensifies, language barriers in visually rich documents such as PDFs remain a practical bottleneck. Existing document translation pipelines face a tension between linguistic processing and layout preservation: text-oriented Computer-Assisted Translation (CAT) systems often discard structural metadata, while document parsers focus on extraction and do not support faithful re-rendering after translation. We introduce BabelDOC , an Intermediate Representation (IR)-based framework for layout-preserving PDF translation. BabelDOC decouples visual layout metadata from semantic content, enabling document-level translation operations such as terminology extraction, cross-page context handling, glossary-constrained generation, and formula placeholdering. The translated content is then re-anchored to the original layout through an adaptive typesetting engine. Experiments on a curated 200-page benchmark, together with human evaluation and multimodal LLM-as-a-judge evaluation, show that BabelDOC improves layout fidelity, visual aesthetics, and terminology consistency over representative baselines, while maintaining competitive translation precision. The open-source toolkit and its interactive downstream applications are publicly available and have attracted over 8.4K GitHub stars and 17 contributors at the time of writing: https://github.com/funstory-ai/BabelDOC . A demonstration video is available at https://youtu.be/chwrlApH7a4 . 1 Introduction Feature BabelDOC PDFMathTrans. Doc2X Google / DeepL Formula processing ✓ ✓ ✓ ✗ Footnote translation ✓ ✗ ✗ ✗ Visual style preservation (PDF) ✓ ✗ ✗ Partial In-figure text translation ✓ ✗ Partial ✗ Intermediate representation ✓ ✗ ✗ ✗ Auto contextual terminology ✓ ✗ ✗ ✗ Table 1: Comparison of capabilities between BabelDOC and representative document translation systems. PDFMathTrans. denotes PDFMathTranslate 10 . PDF is extensively utilized across diverse domains—including scientific research, commerce, law, and technical exchange—owing to its cross-platform compatibility and strict visual integrity. Nevertheless, the dominance of the English language in global knowledge production creates significant inequality 6 ; 1 . Language barriers severely impede the dissemination and reuse of visually rich documents, often excluding non-English-speaking researchers from participating fully in the international scientific community 11 ; 2 ; 9 . Achieving high-quality technical translation 12 for PDFs is therefore of practical significance for open science 16 ; however, it remains challenging because PDFs are fundamentally designed for display rather than semantic editing. Currently, document translation is caught in a technical dilemma. On one hand, traditional Machine Translation (MT) and Computer-Assisted Translation (CAT) tools 7 focus primarily on textual streams, often destroying rich structural metadata during extraction. On the other hand, recent advancements in document parsers (e.g., Doc2X and MinerU) excel at structural extraction but perform mainly unidirectional conversion, such as PDF-to-Markdown. They usually discard or abstract away the typesetting metadata required to reverse the process, rendering them insufficient for high-fidelity PDF reconstruction after translation. Furthermore, monolithic end-to-end translation attempts, such as our early precursor PDFMathTranslate 10 , act as comparatively opaque pipelines. This limits scalability and makes document-level NLP interventions difficult, especially for terminology consistency and cross-page context awareness. To overcome these bottlenecks, we propose BabelDOC , a translation framework built upon an Intermediate Representation (IR) paradigm. Instead of treating document translation as a black-box end-to-end task, BabelDOC explicitly decouples textual semantics from visual layout information. Unlike unidirectional parsers, our bidirectional IR allows semantic content to be manipulated for advanced NLP tasks while preserving structural metadata for layout-aware PDF reconstruction. The system first parses the source document into a structured IR, isolating elements such as paragraphs, formulas, and graphic bounding boxes. Complex linguistic processing—including translation powered by Large Language Models 4 ; 5 , automated glossary extraction, and cross-column contextual modeling—is executed at the semantic layer. Finally, an adaptive typesetting engine re-maps the translated text back into the original structural constraints, adjusting localized scaling factors to improve visual reconstruction. Table 1 summarizes how BabelDOC differs from representative PDF translation and document parsing systems. By transforming the translation workflow into a transparent, plugin-based architecture, BabelDOC serves as a bridge between the Document Understanding and Natural Language Processing communities. The major contributions of this system demonstration are threefold: • An IR-based Translation Paradigm: We propose a decoupled architecture that translates text at the semantic level while preserving structural layout metadata, reducing the conflict between linguistic processing and visual formatting. • Document-Level NLP Integration: Unlike generic parsers, our IR framework supports translation interventions including automatic terminology extraction, customized glossary constraints, cross-page context handling, and mathematical placeholders. • An Open-Source, Extensible Ecosystem: Recognizing the challenges and benefits of open-source software in product development 15 , we open-source the BabelDOC backend engine alongside interactive user-facing interfaces. The framework’s modular design allows researchers to hot-swap LLMs and OCR engines, fostering further work in cross-lingual document intelligence. A more comprehensive capability comparison between BabelDOC and existing systems is presented in Table 2 . BabelDOC is designed for two audiences: (1) scientific researchers and professionals who need to consume multilingual literature without losing complex layouts (e.g., math-heavy arXiv papers), and (2) NLP developers who can utilize our Python API to build custom cross-lingual document intelligence pipelines. A 2.5-minute screencast demonstrating the interactive features of BabelDOC, alongside the open-source repository and live demo access, is provided in the supplementary materials. 2 Related Work Document Layout Analysis and Parsing. The accurate extraction of visual and structural metadata from PDFs is a prerequisite for downstream document intelligence. Recent advancements have significantly improved structural analysis; for instance, models like DocLayout-YOLO 21 and YOLOv10 18 have enhanced high-speed bounding box detection, while tools such as Doc2X and MinerU excel at converting complex PDFs into Markdown or L a T e X source code. Specialized tools also exist for localized tasks, such as Mathpix for formula extraction and LayoutReader for reading-order determination. However, these systems function primarily as unidirectional extractors. They are not designed to re-render processed semantic content back into its original visual layout, making them insufficient for end-to-end layout-preserving document translation tasks. Machine Translation for Visually Rich Documents. Machine translation has evolved from statistical approaches 3 to highly sophisticated Neural Machine Translation (NMT) architectures based on the Transformer 17 and subword tokenization 13 ; 22 . More recently, Large Language Models (LLMs) have demonstrated strong zero-shot translation capabilities 4 , which can be further enhanced through strategic role-play prompting 14 ; 8 . Despite these linguistic advances, generic LLMs operate mainly on one-dimensional text streams and do not directly model the layout constraints of PDFs. To bridge the modality gap, our prior work, PDFMathTranslate 10 , pioneered an end-to-end pipeline capable of synchronized translation and layout preservation, attracting significant open-source community contributions 19 ; 20 . While it demonstrated the feasibility of visual fidelity, its monolithic architecture lacked an explicit intermediate representation. Consequently, it had restricted scalability for semantic processing and structural manipulation, including document-level terminology extraction, cross-column contextual awareness, and complex nested structure rendering. BabelDOC addresses these limitations by introducing a decoupled intermediate representation paradigm. 3 System Architecture and Methodology Figure 1: The system architecture of BabelDOC. Raw PDFs are decoupled into a unified intermediate representation, allowing document-level NLP translation interventions to occur independently before the content is adaptively reconstructed via the typesetting engine. As illustrated in Figure 1 , BabelDOC departs from traditional black-box translation pipelines by employing a modular, Intermediate Representation (IR)-centric architecture. By explicitly decoupling visual layout from textual semantics, the system executes linguistic processing at the semantic