TEDS-Structure: Table Structure Similarity
- TEDS-Structure is a metric that quantitatively measures table structure fidelity using normalized tree edit distance on DOM-like trees.
- It employs dynamic programming methods, such as the Zhang–Shasha algorithm, to compute the minimal edit operations required for structural alignment.
- The metric focuses solely on the logical arrangement of table elements, excluding cell content, and has become a key benchmark in table recognition tasks.
A TEDS-Structure (Tree Edit Distance-based Similarity for Structure) metric quantitatively evaluates the structural fidelity of predicted tables compared to ground-truth table structures in document understanding tasks. It is rooted in the formalism of ordered tree edit distance and measures the minimum number of edit operations (insertions, deletions, substitutions) at the HTML-like DOM level required to make the predicted table’s structure isomorphic to the ground truth. The TEDS-Structure score, normalized to [0,1], focuses solely on the logical arrangement of table elements, explicitly excluding any cell content or OCR text similarities. The TEDS-Structure metric has become a critical benchmark for table recognition, particularly in evaluating detection-based, transformer-based, and multi-corpus document layout models (Zhong et al., 2019, Nassar et al., 2022, Li et al., 13 Apr 2026, Tan et al., 4 Aug 2025).
1. Formal Definition and Mathematical Formulation
TEDS-Structure is defined via normalized tree edit distance over DOM-like ordered trees representing table structure. Given a predicted table tree and a ground-truth table tree , both with nodes labeled as HTML tags (<table>, <thead>, <tbody>, <tr>, <td>) and cell span attributes, TEDS-Structure is computed as follows:
Let denote the tree edit distance—the minimal cost sequence of insertions, deletions, and substitutions (as defined below) to transform into . For each tree , let be the total number of nodes.
The edit-cost function for TEDS-Structure ignores HTML cell content; substitutions on <td> nodes are scored as cost 0 if their row/colspan structural attributes match and cost 1 otherwise. All node insertions or deletions and substitutions of non-matching tags incur unit cost (Zhong et al., 2019).
This construction is faithful to structure alone—any change in nesting, number of rows, columns, or multi-span cell positions will directly penalize the similarity.
2. Algorithmic Implementation
TEDS-Structure is computed using a dynamic programming-based ordered tree edit distance algorithm, such as the Zhang–Shasha algorithm. The steps are as follows (Zhong et al., 2019, Li et al., 13 Apr 2026):
- Both predicted and ground-truth tables are parsed into ordered trees reflecting their DOM structure, with all node labels and span values but not content.
- For each pair of nodes, the edit cost is:
- 1 for insertion or deletion.
- 1 for substitution if node types differ or (for
<td>) if spans mismatch. - 0 for substitution if tags and spans match.
- The dynamic program computes minimal total cost, which is then normalized as above.
This metric can be extended to corpora containing multiple tables per page by forming a cost matrix of pairwise TEDS-Structure values and greedily or optimally matching tables (e.g., via Hungarian algorithm) before aggregating document-level scores (Tan et al., 4 Aug 2025).
3. Evaluation Protocols and Empirical Use
TEDS-Structure is integral to table structure recognition benchmarks such as PubTabNet and FinTabNet (Zhong et al., 2019, Nassar et al., 2022), as well as to new cross-corpus layout representation harmonization protocols (Li et al., 13 Apr 2026). In typical evaluation pipelines:
- Prediction and annotation are post-processed to ensure structural tags only.
- Token normalization or reduction to semantic classes (e.g., cell type) may be used in tasks focusing only on pure structure.
- Structure-only TEDS scores are reported independently of full TEDS (which includes content).
For example, (Li et al., 13 Apr 2026) reports table TEDS (structure-only) scores for different training strategies, demonstrating drops in table fidelity (TEDS: 0.800 → 0.750) when merging datasets with inconsistent annotation, and gains (TEDS: 0.814) when dataset harmonization is applied algorithmically pre-training.
4. Representation Analysis and Metrics Sensitivity
Representation-level analyses (UMAP, silhouette scores) show that inconsistent table-structure annotations induce fragmentation in the learned feature space, increasing structural errors and lowering TEDS-Structure. Harmonized annotation pools, as in agentic harmonization workflows, restore cluster compactness and separability, which directly translates into improved structural TEDS (Li et al., 13 Apr 2026).
Worked examples further illustrate metric behavior: for multi-hop shifts or missing rows/columns, the edit script accumulates costs for required insertions/deletions, driving TEDS-Structure down even when local adjacency-based metrics would not register the error (Zhong et al., 2019).
5. Variants and Extensions
While classical TEDS-Structure is text/content-agnostic and acts only on structure, variants exist:
- TEDS-IOU incorporates bounding box overlaps into the substitution cost for
<td>nodes, thus integrating spatial alignment (Kumar et al., 2022). - Markdown TEDS applies to Markdown table representations by parsing into an analogous tree structure and employing identical insertion/deletion/substitution costs, with potential for string similarity-based graded substitution (Tan et al., 4 Aug 2025).
- The "corrected" TEDS variant first aligns cells by content labels before computing structure-only distance, increasing robustness to cell orderings when semantic identity is preserved (Li et al., 13 Apr 2026).
6. Metric Comparison, Limitations, and Best Practices
TEDS-Structure supersedes classic adjacency-relation metrics by capturing global misalignments and multi-hop cell errors that adjacency-based F1 cannot diagnose. Adjacency metrics also penalize minor OCR/text errors excessively, which TEDS-Structure by construction ignores.
A limitation is computational: while tree edit distance is optimal for tables of moderate size, its complexity is quadratic in the cell count. It is ill-suited for monolithic tables with extreme dimensionality without further optimization. TEDS-Structure’s interpretability hinges on faithful DOM construction and the explicit omission of cell content.
Empirically, structure-only TEDS is highly sensitive to cell-class merging/splitting errors in annotations—fungibility of header/body regions, or inconsistent whitespace/cell-splitting conventions, will artificially degrade TEDS-Structure unless harmonization is enforced before mixed-dataset training (Li et al., 13 Apr 2026).
7. Applications and Impact
TEDS-Structure is the authoritative metric for model development and comparison in table structure recognition tasks. It is used to benchmark transformer-based models (TableFormer, StructureFormer) (Nassar et al., 2022), detection-based hybrids (Li et al., 13 Apr 2026), and vision-language table converters (Tan et al., 4 Aug 2025). TEDS-Structure serves as a direct proxy for the end utility of table structure extraction in downstream analytical pipelines, explaining its adoption for leaderboard ranking and statistical ablation reporting.
Its proper use has led to methodological best practices: precise DOM-normalization, dataset harmonization, early metric monitoring to detect “structure drift,” and the inclusion of representation-level diagnostics to support TEDS outcomes in the presence of ambiguous annotation conventions (Li et al., 13 Apr 2026, Zhong et al., 2019).
References:
- (Zhong et al., 2019) Zhong, X. et al., “Image-based table recognition: data, model, and evaluation.”
- (Nassar et al., 2022) Herzig, J. et al., “TableFormer: Table Structure Understanding with Transformers.”
- (Kumar et al., 2022) Rao, S. et al., “Evaluating Table Structure Recognition: A New Perspective.”
- (Tan et al., 4 Aug 2025) Lee, G. et al., “Fine-Tuning Vision-LLMs for Markdown Conversion of Financial Tables in Malaysian Audited Financial Reports.”
- (Li et al., 13 Apr 2026) Chuang, Z. et al., “Improving Layout Representation Learning Across Inconsistently Annotated Datasets via Agentic Harmonization.”