Structure Preserving Machine Translation

54 concepts32 papers1 proposal

Standard Neural Machine Translation (NMT) models excel at translating plain text sequences. However, real-world documents rarely exist as unformatted text. They are filled with inline markup tags (HTML, XML), markdown tables, or complex 2D spatial layouts (multi-column PDFs, forms, and financial reports).

When a standard NMT model encounters these structural elements, it treats them as ordinary text tokens. This creates a fundamental tension: while semantic text must be translated and reordered according to target-language syntax, structural markers must remain intact and map precisely to their corresponding translated segments. Without specialized handling, standard models frequently drop, hallucinate, or misplace tags, rendering the output incompatible with automated publishing pipelines. Early work by Yaser Alonaizan et al. in the TIPS: A Translingual Information Processing System framework and diagnostics by Mikko Aulamo et al. (OpusTools and Parallel Corpus Diagnostics) highlighted this exact limitation: standard processing pipelines lack native support for inline markup, leading to broken document integrity.

To solve this, researchers have developed mechanisms that separate, anchor, or visually ground structural metadata during the translation process.

Handling Textual Markup: Anchors and Placeholders

When translating a sentence with inline formatting, the word order changes. For example, translating an adjective-noun pair from English to French requires flipping the word order, meaning any formatting tags wrapping the adjective must move with it.

English:  The <b> red </b> apple
French:   La pomme <b> rouge </b>

To prevent the model from corrupting these tags during reordering, researchers use two primary strategies:

1. Tag Masking and Injection

Instead of forcing the model to process raw markup syntax, tags can be replaced with abstract placeholders. Greg Hanneman (How Should Markup Tags Be Translated?) demonstrated that representing tags as masked placeholders, combined with tag-injection data augmentation during training, teaches the model to treat formatting as structural variables rather than translatable text.

2. Copy Mechanisms and Structural Anchors

Alternatively, the model's architecture can be modified to treat tags as immutable constraints. Kazuma Hashimoto et al. (Building Salesforce Neural Machine Translation System) implemented a specialized copy mechanism within a Transformer architecture. This approach treats XML tags as structural anchors, forcing the model to copy them directly to the target sequence based on alignment weights rather than generating them from vocabulary probabilities.

When explicit copy mechanisms are absent, models struggle to distinguish between translatable text and fixed structural markers. As shown by Maosong Sun et al. (A Template-based Method for Constrained Neural Machine Translation), framing translation as a two-step planning process—generating a structural template first, then filling in the text—prevents the corruption of document constraints. A simpler variant of this idea, reviewed by Toshiaki Nakazawa et al. (Overview of the 9th Workshop on Asian Translation), involves stripping the tags entirely before translation and using an external word-alignment model to re-insert them into the target text.

From 1D Sequences to 2D Spatial Layouts

For visually rich documents like PDFs, scanned forms, or images, structure is defined by spatial geometry rather than text tags. Standard translation approaches fail here because they flatten the text into a 1D sequence, discarding the physical positioning of elements. As Tengchao Lv et al. (XFUND: A Benchmark Dataset for Multilingual Visually Rich Form Understanding) pointed out, losing this 2D context makes it impossible to reliably interpret non-linear elements like multi-column text, sidebars, or key-value pairs in forms.

To preserve visual topology, translation pipelines must bind text to its spatial coordinates:

[Scanned Document] ➔ [OCR + Bounding Boxes] ➔ [Layout-Aware Translation] ➔ [Re-rendered Target Document]

Despite these architectural improvements, complex structural elements remain a significant bottleneck. For instance, Mariam Nakhlé et al. (DOLFIN - Document-Level Financial Test-Set for Machine Translation) found that financial translation models frequently break Markdown tables by misinterpreting structural characters like horizontal dividers. Similarly, Ahmed Heakl et al. (KITAB-Bench: A Comprehensive Multi-Domain Benchmark for Arabic OCR and Document Understanding) demonstrated that even state-of-the-art vision-language models struggle with high-fidelity PDF-to-Markdown conversions.

To resolve these chaotic layouts, the authors of From Chaotic OCR Words to Coherent Document: A Fine-to-Coarse Zoom-Out Network for Complex-Layout Document Image Translation proposed modeling human reading patterns. By progressively zooming out from word-level features to sentence-level organization and document-level topology, their framework ensures that spatial context guides the translation flow.

Leveraging Structure for Cross-Lingual Label Projection

An elegant side effect of structure-preserving translation is its utility in cross-lingual data annotation. If an NMT model can reliably preserve structural tags across language barriers, those tags can be repurposed as entity markers to transfer span-level annotations (such as Named Entity Recognition labels) from resource-rich languages to resource-poor ones.

Source (Annotated):  The [ORG] Google [/ORG] headquarters.
Target (Projected):  Les quartiers généraux de [ORG] Google [/ORG].

This insight forms the basis of several cross-lingual transfer techniques:

This structural preservation is also critical for benchmark adaptation. As shown by Ibrahim Tolga Öztürk et al. (How Different Is Stereotypical Bias Across Languages?), preserving structural tokens and task-specific formatting during translation ensures that probing mechanisms, such as fill-in-the-blank evaluation tasks, remain fully functional when translated into different linguistic structures.

Key Foundational Work

TIPS: A Translingual Information Processing System (2003) — contributed 1 concept elements to this direction.
Various Representations of Text Proposed for Eurotra (1985) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_structure_preserving_translation_c37e4e68,
  title = {structure-preserving translation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/structure-preserving-translation/rdr_c37e4e680ece450a9f5c52e80bf52cf1},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_structure_preserving_translation_c37e4e68_v1,
  title = {structure-preserving translation},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/structure-preserving-translation/rdr_c37e4e680ece450a9f5c52e80bf52cf1/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake