Source-linked AI summary
LTEM: LLM-Friendly Table-Enhanced Markdown for Table Understanding and Generation
Eunbin Kim, Hyeonseok Kang, Sangkeun Jung
TL;DR
Lightweight table formats are easy for LLMs to handle but cannot express common structures, while more expressive formats impose markup and token costs. The paper develops a taxonomy, benchmark, and Markdown extension for studying this trade-off; experiments report competitive understanding accuracy and improved response stability for LTEM.
Problem
Lightweight formats cannot faithfully represent common table structures such as merged cells and hierarchical headers, while expressive formats impose greater token cost and parsing burden, and existing studies offer limited tools to compare preserved structure.
Source: §1 · p. 1Method
The paper defines structural features and complexity levels, constructs a controlled benchmark, and proposes LTEM, a Markdown extension encoding spans and hierarchical headers.
Source: §1 · p. 1, §7 · pp. 8–9Results
LTEM achieves competitive table-understanding accuracy and improves response stability at structural transitions where lightweight formats fail and verbose formats introduce noise.
Source: §7 · p. 9Takeaways & Limitations
The taxonomy and benchmark provide reusable infrastructure for future research on robust and efficient LLM–table interaction.
Source: §7 · p. 9Format rankings differ between synthetic STB and real-world HiTab, making superiority difficult to generalize from one benchmark and motivating validation on domain-matched data.
Source: Limitations · p. 9
Abstract
from arXiv · showhide
Tables in real-world documents, including scientific papers, financial reports, and statistical summaries, frequently use merged cells, multi-level headers, and sectioned layouts. Yet the lightweight formats LLMs handle best (Markdown, CSV) cannot express these structures, while expressive formats (HTML, LaTeX) impose excessive token cost and parsing complexity. To enable systematic analysis of this trade-off, we introduce a taxonomy decomposing table structure into six atomic features (F1-F6) and corresponding complexity levels (L1-L6), and construct STB (Synthetic Table Benchmark), a controlled benchmark with 1,089 tables systematically distributed across complexity levels. Using this framework, we propose LTEM (LLM-friendly Table-Enhanced Markdown), a formally specified, minimal extension of Markdown that explicitly encodes spans and hierarchical headers. Experiments across five state-of-the-art LLMs show that LTEM achieves accuracy comparable to HTML, offers a favorable accuracy-token trade-off relative to HTML and LaTeX, and produces substantially fewer invalid responses than LaTeX; for table generation, LTEM is comparable to MultiMarkdown though HTML is best. We release our taxonomy, benchmark, and format specification to support future research on LLM-table interaction.
1 Introduction
Real-world tables contain structure that lightweight formats cannot fully express, while more expressive formats add markup burden. The paper introduces a structural taxonomy, the STB benchmark, and LTEM to study this trade-off across LLMs and table tasks.
1 Introduction
- Lightweight formats such as Markdown and CSV cannot faithfully express common structures such as merged cells and multi-level headers, whereas HTML and LaTeX require substantial markup interpretation.These contrasting constraints motivate systematic comparison of structural expressiveness and processing cost.Source: §1 · p. 1
- The paper formalizes table structure with six features, F1–F6, and cumulative complexity levels, L1–L6, for comparing format expressiveness.The taxonomy makes structural requirements explicit.Source: §1 · pp. 1–2
- The paper proposes LTEM, a minimal Markdown extension that explicitly encodes cell spans and hierarchical headers while retaining linear readability.It targets L3–L5 structures and is designed to be parsable in a single pass.Source: §1 · pp. 1–2
- The evaluation covers table understanding, table generation, and token efficiency across six formats and five state-of-the-art LLMs.The compared formats are Markdown, CSV, HTML, LaTeX, MultiMarkdown, and LTEM.Source: §1 · pp. 1–2
- The authors construct STB, a controlled benchmark of 1,089 tables systematically distributed across complexity levels.The benchmark is intended to enable controlled analysis of structural effects on LLM performance.Source: §1 · p. 2
2 Related Work
Prior table-QA benchmarks and serialization studies address table reasoning and format sensitivity, but offer limited tools for comparing preserved structural information. This work frames serialization format as a primary variable and examines markup expressiveness and text-to-table evaluation.
2.1 Table QA and Table Reasoning
- Early table QA mapped questions to executable programs, while later pretrained table encoders and datasets broadened reasoning; many datasets still emphasize flat tables over document-style hierarchies.HiTab and TAT-QA better reflect hierarchical and numerically grounded reasoning.Source: §2.1 · p. 2
2.2 LLMs on Tables and Format Choice
- Recent studies find tabular-task performance sensitive to serialization, delimiters, and ordering, but provide limited tools for comparing the structural information representations preserve.The paper addresses this gap with a taxonomy of atomic structural operations.Source: §2.2 · p. 2
2.3 Markup Expressiveness and Text-to-Table Evaluation
- Prior work proposes multiple approaches to text-to-table evaluation, while this paper analyzes format-dependent structural consistency through normalized representations.The related work notes multi-granularity metrics, statement-based checks, and structure-aware metrics under constrained decoding.Source: §2.3 · p. 2
3 Taxonomy of Table Structural Complexity
The paper defines a taxonomy for assessing table complexity and the structural information a serialization must preserve. Applying it to existing formats identifies cell merging as a key expressiveness boundary and motivates explicit span and header-hierarchy encoding.
3 Taxonomy of Table Structural Complexity
- The taxonomy uses atomic structural features and cumulative complexity levels to characterize table requirements and compare serialization expressiveness.Features identify individual structural operations; levels combine feature requirements for particular tables.Source: §3 · p. 2
3.1 Structural Features
- The six features cover grid formation, header designation, cell merging, header nesting, section stacking, and composition of tables with different schemas.Features are assessed independently as present or absent.Source: §3.1 · pp. 2–3
- Table composition covers tables with different schemas treated as one logical unit.Section stacking instead combines sections that share a schema.Source: §3.1 · p. 3
3.2 Complexity Levels
- Each complexity level cumulatively includes the features required at prior levels, so lacking a feature can prevent expression of that level and higher ones.The text gives lack of cell merging as a barrier to L3–L6 tables.Source: §3.2 · p. 3
3.3 Expressiveness of Existing Formats
- Markdown lacks cell merging and therefore cannot structurally express L3+ tables; MultiMarkdown support is partial or non-standard, especially for row spans.The taxonomy identifies cell merging as the decisive branching point.Source: §3.3 · p. 3
- LaTeX is the only format described as fully expressive across all levels, while HTML cannot structurally specify logical relationships between sections.HTML can approximate section stacking and composition with multiple table bodies or separate tables.Source: §3.3 · p. 3
- The taxonomy highlights a mismatch: Markdown is efficient for LLM processing but cannot express L3+ tables, while HTML and LaTeX can express complex structures but are inefficient to process.The analysis motivates a format targeting L3–L5 with explicit spans and header hierarchies while retaining linear readability.Source: §3.3 · pp. 3–4
4 LTEM: Language Design
LTEM instantiates taxonomy-derived requirements as a minimal Markdown extension that encodes spans and hierarchical headers while retaining linear readability. Its syntax also supports rich cell content, linked tables, and formal parsing.
4.1 Design Principles
- LTEM builds on familiar Markdown, prioritizing linear readability, explicit structure, a small syntax extension, and single-pass parsing.The design principles aim to support human review and debugging while enabling parsers with linear time complexity.Source: §4.1 · p. 4
4.2 Core Syntax
- Column and row spans use marker or attribute syntax, while multiple rows above the separator encode nested headers without extra syntax.Marker syntax preserves alignment; attributes can concisely express large spans, and compound spans combine column and row attributes.Source: §4.2 · pp. 4–5, Figure 1 · p. 4, Figure 2 · p. 5
4.3 Rich Cell Content
- Inline line breaks let LTEM combine lists, checkboxes, and formulas within a single cell.The escape sequence \\ represents in-cell line breaks.Source: §4.3 · p. 5, §4.2 · p. 5, Figure 3 · p. 5
4.4 Relational Tables
- LTEM decomposes relational tables and links them with explicit references instead of nesting tables within cells.Nested HTML and LaTeX structures require recursive parsing and express intertable relationships only implicitly.Source: §4.4 · p. 5, Figure 4 · p. 5
4.5 Formal Specification
- LTEM is specified as a context-free grammar, with EBNF, validation rules, and AST and TableStructure JSON schemas provided in Appendix D.The complete formal specification includes validation rules V1–V12.Source: §4.5 · p. 5
5 Experimental Setup
The experiments test table understanding, generation, and token efficiency across formats, using controlled structural complexity and a real-world hierarchical-table benchmark. The setup combines multiple models, task-specific metrics, and repeated-run statistical testing.
5.1 Experimental Design
- The evaluation asks whether formats support table comprehension and generation and how their token efficiency compares.STB enables controlled analysis by complexity level, while HiTab supports comparison with prior research.Source: §5.1 · p. 5
5.2 Synthetic Table Benchmark (STB)
- STB addresses benchmarks’ limited control of structural complexity with 1,089 tables and 4,356 question–answer pairs distributed across L1–L6.Its five domains are sampled independently of complexity levels; approximately 30% of the benchmark is L3, where cell merging first appears.Source: §5.2 · pp. 5–6
5.3 Table QA Benchmarks
- HiTab’s test split evaluates table understanding and table generation using the same hierarchical tables.Understanding uses one original question–answer pair per table across six formats; generation reconstructs tables from natural-language requests.Source: §5.3 · p. 6
5.4 Models and Evaluation Metrics
- Five LLMs are evaluated for understanding and three for generation, using task-specific metrics and three repeated QA runs per setting.Understanding reports nEM and tokenF1, while generation uses ANLS and threshold-based success rates; paired predictions are tested with McNemar’s test.Source: §5.4 · pp. 6–7
6 Results
On STB, LTEM matches HTML in table-understanding accuracy and has fewer invalid responses than LaTeX, while format rankings vary on HiTab. For generation, HTML leads and LTEM performs near MultiMarkdown.
6.1 Table Understanding
- 0.813 vs. 0.812 nEM for LTEM and HTML on STB; LaTeX scores 0.777, and LTEM’s Invalid rate is 0.14% versus LaTeX’s 2.67%.LTEM has the lowest Total Error; its accuracy–token trade-off is favorable relative to HTML and LaTeX, and it significantly outperforms LaTeX for four of five models.Source: §6.1 · p. 7, Table 2 · p. 8, Table 3 · p. 8
- Performance declines from L2 to L3 and again at L4, where cell merging and multi-level headers require models to track spans and header roles.LTEM is designed to reduce ambiguity by explicitly encoding spans and header nesting.Source: §6.1 · pp. 7–8, Figure 6 · p. 8
- On HiTab, average nEM is 0.295 for HTML, 0.292 for LaTeX, and 0.289 for LTEM, with a 0.6 percentage-point gap.Absolute accuracy decreases across formats, and their relative ordering changes across datasets.Source: §6.1 · p. 8, Figure 7 · p. 8
6.2 Table Generation
- HTML leads table generation with ANLS 0.913 and a 96.2% Good+ rate; LTEM is close to MultiMarkdown at ANLS 0.720 vs. 0.734.Markdown and CSV perform worse, while LaTeX, MultiMarkdown, and LTEM form a similar middle-performing group.Source: §6.2 · p. 8
7 Conclusion
The paper introduces a structural-complexity taxonomy and controlled benchmark, then proposes LTEM as a minimal Markdown extension for spans and hierarchical headers. Experiments on STB and HiTab report competitive understanding accuracy and improved response stability at structural transitions.
7 Conclusion
- The taxonomy and STB provide a framework and controlled benchmark for analyzing how serialization formats affect LLM performance across complexity levels.The taxonomy decomposes table structure into F1–F6 and L1–L6.Source: §7 · pp. 8–9
- LTEM explicitly encodes cell spans and hierarchical headers; the authors conclude it offers competitive understanding accuracy and improved stability at structural transitions.The paper presents the taxonomy and benchmark as reusable infrastructure for research on LLM–table interaction.Source: §7 · p. 9
Limitations
The authors caution that format rankings depend on benchmark distribution, training exposure, model choice, and experimental settings. Their conclusions also have boundaries in format and domain coverage.
Limitations
- Format rankings differ between synthetic STB and real-world HiTab, so formats should be reevaluated on validation data matching the target domain.A single benchmark does not establish a generally superior serialization format.Source: Limitations · p. 9
- Unequal pretraining exposure may favor established formats, and may partly explain HTML’s strong table-generation performance.The authors report that corpora contain substantially more HTML and Markdown tables than LTEM-formatted content.Source: Limitations · p. 9
- Format effects vary across models, so selection should be validated on the deployment backbone rather than made independently of the model.Some model–format pairs show elevated invalid-response rates.Source: Limitations · p. 9
- Rankings may change with prompting and decoding settings; output limits, wording, and post-processing can affect invalid or refusal rates for verbose formats such as LaTeX.The experiments use a specific prompt template and decoding configuration.Source: Limitations · p. 9
- The six-format comparison and Wikipedia-focused HiTab dataset limit transfer to other serialization designs and domains such as OCR-extracted or noisy financial tables.The authors call for additional verification before applying conclusions to those settings.Source: Limitations · p. 9
C LTEM Rendering Examples
- Rendering examples pair LTEM source with rendered tables, including a report table combining row spans, column spans, and a two-row header.The report table’s numeric columns use Markdown right alignment.Source: C LTEM Rendering Examples · pp. 12–13, Figure 9 · p. 13, Figure 8 · p. 13
D Formal Grammar (EBNF)
- LTEM’s syntax is defined in EBNF as a context-free grammar (CFG) following ISO/IEC 14977:1996; supplied excerpts show table structure, cell definitions, and span markers and attributes.Source: D Formal Grammar (EBNF) · p. 14, §D.2 · p. 14, §D.3 · p. 14
D.2 Document Structure
- LTEM tables may begin with an optional table-ID row, followed by a header section and separator row, with an optional data section; cells consist of content with an optional span attribute.Source: §D.2 · p. 14, §D.3 · p. 14
D.9 Lark Implementation
The appendix provides a Lark parser grammar, prompt templates, and the staged pipeline used to construct STB.
D.9 Lark Implementation
- The Lark parser grammar is derived from the EBNF and implements table structure, span markers and attributes, references, and inline content.The grammar includes document and table rules as well as cell and span-attribute productions.Source: §D.9 · pp. 16–17
E Prompt Templates
- Prompt templates cover STB generation, verification, and table-understanding evaluation, with LTEM inputs receiving guidance for resolving spans before answering.Curly-brace fields are runtime variables; intent guidance distinguishes lookup, counting, comparison, and aggregation questions.Source: E Prompt Templates · pp. 17–18
F STB Generation Pipeline
- STB construction has three stages: sample table structure, populate it with LLM-generated content, then generate and cross-check question–answer pairs.The structural generator samples complexity, domain, dimensions, and operations; QA pairs cover four intent types and are filtered by agreement between two model families.Source: F STB Generation Pipeline · p. 18
G HiTab Overall Results
On HiTab, HTML leads the reported understanding results, while supplementary STB analyses find only small level-wise differences between Markdown and LTEM. The authors emphasize that rankings vary by dataset and that LTEM’s distinction is explicit structural representation.
G HiTab Overall Results
- HTML achieves the highest nEM on the 515-table HiTab test split, followed by LaTeX, whose ranking changes from sixth on STB to second on HiTab.The reversal indicates that format effectiveness is dataset-dependent.Source: Table 10 · p. 19
H.1 Fine-grained STB Understanding Analyses
- On STB, LTEM’s nEM is slightly higher than Markdown’s at every complexity level, while invalid rates are low for both and show no uniform level-wise advantage.The authors characterize the main distinction as explicit structural representation rather than a large, uniform QA gain.Source: §H.1 · p. 19, Table 12 · p. 19
- Feature-conditioned slices overlap rather than forming cumulative levels; the key distinction begins at F3, where LTEM marks span extent explicitly.Markdown can only approximate merged cells through visual alignment or repeated text.Source: §H.1 · pp. 19–20, Table 13 · p. 20
H.2 LTEM Design-Choice Ablation
The appendix reports LTEM’s design-choice ablation, structure-conditioned and failure analyses, and a fine-tuning pilot.
H.2 LTEM Design-Choice Ablation
- None of five paired surface-form comparisons was statistically significant (all p ≥.302), so the ablation identifies no accuracy-based preferred form.The proposed forms were retained for Markdown Compatibility and Linear Readability.Source: §H.2 · p. 20, Table 14
H.3 Structure-conditioned Accuracy
- Across larger L1–L5 slices stratified by span-continuation and repeated-value ratios, LTEM remains comparable to HTML and Markdown while LaTeX is generally lower; small High buckets limit generalization.Table 15 reports descriptive nEM results.Source: §H.3 · p. 20, Table 15 · p. 20
H.4 Failure Modes and Question Types
- LaTeX shows substantially higher Invalid and logged-error rates than other text formats, while Refusal and Invalid rates are low for most formats.Refusal and Invalid are calculated among nEM-incorrect outputs; logged errors are recorded independently and may overlap.Source: §H.4 · p. 21, Table 16 · p. 21
- Aggregation is the most difficult question type across formats, and the breakdown supports no format-specific question-type advantage.Table 17 reports descriptive nEM by question type.Source: §H.4 · p. 21, Table 17 · p. 21
H.5 Fine-tuning Pilot
- All three 4B-scale backbones gained substantially on held-out STB tables after LoRA fine-tuning on LTEM-formatted QA examples.Format exposure and task supervision were introduced jointly, and the pilot used one STB distribution and one set of LoRA hyperparameters.Source: §H.5 · p. 21, Table 18 · p. 21
- For Qwen3-4B-Instruct, comparison and aggregation questions show the largest gains, while lookup and counting improve more modestly.Table 19 breaks down the LTEM LoRA results by question type and complexity level.Source: §H.5 · p. 21, Table 19 · p. 22
I McNemar’s Test for LTEM vs. LaTeX on STB
- LTEM–LaTeX paired differences on STB were tested with McNemar’s test within each of three runs, then combined using Fisher’s method.Table 20 reports summed discordant counts and Fisher-combined p-values.Source: I McNemar’s Test for LTEM vs. LaTeX on… · p. 22, Table 20 · p. 22
J Translation Disclosure
- Authors used AI tools as auxiliary translation aids, then reviewed and revised all translations and verified final factual accuracy and phrasing.Source: J Translation Disclosure · p. 22