LTEM: LLM-Friendly Table-Enhanced Markdown for Table Understanding and Generation
Organizations: Department of Computer Science and Engineering, Chungnam National University, Republic of Korea · EurekaAI
Abstract
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.
Figures & tables
| Feature | CSV | MD | MMD | HTML | LaTeX | LTEM | LTEM Syntax |
|---|---|---|---|---|---|---|---|
| F1 Grid Formation | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | |
| F2 Header Designation | ✓ | ✓ | ✓ | ✓ | ✓ | |---| | |
| F3 Cell Merging | ✗ | ✗ | ✓ | ✓ | ✓ | << , ^^ , {c:N,r:M} | |
| F4 Header Nesting | ✗ | ✗ | ✓ | ✓ | ✓ | multi-header rows | |
| F5 Section Stacking | ✗ | ✗ | ✗ | ✓ | ✓ | section-label rows | |
| F6 Table Composition | ✗ | ✗ | ✗ | ✓ | ✓ | | # id | , @ref |
| Format | nEM | TokenF1 | NumEM | PromptTok | TableTok | TNP |
|---|---|---|---|---|---|---|
| LTEM | 0.813 ±0.002 | 0.844 ±0.002 | 0.943 ±0.000 | 449 | 228 | 1.809 |
| HTML | 0.812 ±0.001 | 0.844 ±0.000 | 0.945 ±0.000 | 612 | 392 | 1.326 |
| MMD | 0.810 ±0.000 | 0.843 ±0.000 | 0.946 ±0.001 | 436 | 215 | 1.858 |
| MD | 0.810 ±0.000 | 0.842 ±0.000 | 0.945 ±0.001 | 437 | 217 | 1.852 |
| CSV | 0.808 ±0.001 | 0.840 ±0.001 | 0.940 ±0.000 | 370 | 149 | 2.183 |
| LaTeX | 0.777 ±0.001 | 0.812 ±0.001 | 0.933 ±0.001 | 447 | 227 | 1.737 |
| Format | Refusal (%) | Invalid (%) | Total Error (%) |
|---|---|---|---|
| LTEM | 0.15 | 0.14 | 0.29 |
| CSV | 0.22 | 0.09 | 0.31 |
| HTML | 0.30 | 0.11 | 0.41 |
| MMD | 0.34 | 0.15 | 0.49 |
| MD | 0.46 | 0.15 | 0.61 |
| LaTeX | 0.38 | 2.67 | 3.04 |
| Format | ANLS | Good+ (%) | PromptTok |
|---|---|---|---|
| HTML | 0.913 | 96.2 | 1149 |
| LaTeX | 0.749 | 72.2 | 1168 |
| MultiMarkdown | 0.734 | 69.0 | 1170 |
| LTEM | 0.720 | 67.9 | 1429 |
| CSV | 0.618 | 50.0 | 1170 |
| Markdown | 0.549 | 41.2 | 1168 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Level | Required Features | Description | Example |
|---|---|---|---|
| L1 | F1 | Atomic Grid | Simple data listing |
| L2 | F1 + F2 | Headered Table | Standard table with headers |
| L3 | F1 + F2 + F3 | Spanning Table | Table requiring cell merging |
| L4 | F1 + F2 + F3 + F4 | Multi-level Header | Hierarchical header structure |
| L5 | F1 + F2 + F3 + F4 + F5 | Block-partitioned | Same-schema section division |
| L6 | F1 + F2 + F3 + F4 + F5 + F6 | Composite Table | Multi-schema combination |
| Level | #Tables | Share (%) | Avg. rows | Avg. cols |
|---|---|---|---|---|
| L1 (Grid Only) | 96 | 8.82 | 4.33 | 3.15 |
| L2 (Basic Header) | 334 | 30.67 | 5.63 | 3.34 |
| L3 (Spanned) | 342 | 31.40 | 7.15 | 5.22 |
| L4 (Multi-level Header) | 164 | 15.06 | 8.84 | 6.65 |
| L5 (Section Stacking) | 87 | 7.99 | 12.66 | 4.20 |
| L6 (Composite) | 66 | 6.06 | 15.55 | 11.50 |
| Domain | #Tables | Share (%) |
|---|---|---|
| Scientific | 366 | 33.61 |
| Financial | 286 | 26.26 |
| Survey | 179 | 16.44 |
| Product | 171 | 15.70 |
| Schedule | 87 | 7.99 |
| Total | 1,089 | 100.00 |
| FY2025 | FY2026 | |||||
| Area | Program | Budget | Spent | Budget | Spent | Change |
| E-document standards | 1,240 | 1,180 | 1,380 | 612 | +11.3% | |
| Open public data | 860 | 845 | 910 | 402 | +5.8% | |
| Digital | Data structuring | - | - | 420 | 95 | - |
| Regional hubs | 2,100 | 2,064 | 2,050 | 1,010 | -2.4% | |
| Regional | Youth settlement | 730 | 701 | 790 | 355 | +8.2% |
| Symbol | Meaning |
|---|---|
| = | Definition |
| , | Concatenation |
| | | Alternation |
| [ ] | Optional (0 or 1 occurrence) |
| { } | Repetition (0 or more occurrences) |
| ( ) | Grouping |
| Property | Value | Implication |
|---|---|---|
| Chomsky Type | Type 2 (CFG) | Efficient parsing (O(n 3 ) worst, O(n) practical) |
| Ambiguity | Unambiguous | Deterministic parsing |
| Left Recursion | None | LL parser compatible |
| Lookahead | LL(1) for most constructs | Simple recursive descent |
| Unicode | Supported in content | UTF-8 encoding |
| Format | nEM | TokenF1 | NumEM | PromptTok | TNP | Rank |
|---|---|---|---|---|---|---|
| HTML | 0.295 ±0.001 | 0.331 ±0.002 | 0.519 ±0.001 | 1310 | 0.225 | 1 |
| LaTeX | 0.292 ±0.003 | 0.333 ±0.003 | 0.527 ±0.002 | 966 | 0.303 | 2 |
| LTEM | 0.289 ±0.005 | 0.329 ±0.004 | 0.504 ±0.004 | 1101 | 0.262 | 3 |
| MD | 0.285 ±0.003 | 0.322 ±0.004 | 0.515 ±0.003 | 1078 | 0.264 | 4 |
| MMD | 0.281 ±0.001 | 0.320 ±0.001 | 0.520 ±0.002 | 1058 | 0.266 | 5 |
| CSV | 0.266 ±0.004 | 0.306 ±0.003 | 0.515 ±0.003 | 770 | 0.345 | 6 |
| Format | Excellent (%) |
|---|---|
| HTML | 76.2 |
| LaTeX | 29.3 |
| MultiMarkdown | 35.4 |
| LTEM | 25.8 |
| CSV | 25.4 |
| Markdown | 22.5 |
| Level | N | MD nEM | LTEM nEM | Invalid MD/LTEM | |
|---|---|---|---|---|---|
| L1 | 96 | 0.863 | 0.866 | +0.003 | 0.05/0.05 |
| L2 | 334 | 0.845 | 0.847 | +0.002 | 0.22/0.13 |
| L3 | 342 | 0.787 | 0.791 | +0.004 | 0.11/0.16 |
| L4 | 164 | 0.735 | 0.737 | +0.002 | 0.17/0.19 |
| L5 | 87 | 0.858 | 0.863 | +0.004 | 0.00/0.00 |
| L6 | 66 | 0.788 | 0.793 | +0.005 | 0.28/0.20 |
| Feature slice | N | MD nEM | LTEM nEM | Invalid MD/LTEM | |
|---|---|---|---|---|---|
| F2 | 1,057 | 0.809 | 0.812 | +0.003 | 0.16/0.14 |
| F3 | 593 | 0.783 | 0.787 | +0.004 | 0.11/0.15 |
| F4 | 345 | 0.762 | 0.766 | +0.004 | 0.17/0.20 |
| F5 | 87 | 0.858 | 0.863 | +0.004 | 0.00/0.00 |
| F6 | 66 | 0.788 | 0.793 | +0.005 | 0.28/0.20 |
| Element ( ) | LTEM | Alternative | nEM (%) | p |
|---|---|---|---|---|
| Colspan (400) | << | {c:N} | 77.8 / 78.8 | .481 |
| Rowspan (348) | ^^ | {r:N} | 75.6 / 76.7 | .454 |
| Header scope (288) | Separator | Header count | 75.3 / 77.1 | .302 |
| Section label (348) | Marker row | Attribute row | 85.6 / 85.9 | 1.000 |
| Table ID (264) | In-grid row | MD heading | 83.3 / 82.2 | .453 |
| Condition | Bucket | HTML | LaTeX | LTEM | MD |
|---|---|---|---|---|---|
| Merged density | None (430) | 0.852 | 0.811 | 0.852 | 0.849 |
| Merged density | Low (318) | 0.781 | 0.750 | 0.781 | 0.783 |
| Merged density | Medium (265) | 0.792 | 0.759 | 0.796 | 0.786 |
| Merged density | High (10) | 0.735 | 0.725 | 0.725 | 0.725 |
| Duplicate-value | None (668) | 0.823 | 0.789 | 0.822 | 0.820 |
| Duplicate-value | Low (246) | 0.773 | 0.741 | 0.778 | 0.775 |
| Format | nEM | Refusal | Invalid | Logged error |
|---|---|---|---|---|
| CSV | 0.808 | 0.22 | 0.09 | 0.11 |
| HTML | 0.812 | 0.30 | 0.11 | 0.15 |
| LaTeX | 0.777 | 0.38 | 2.67 | 3.55 |
| LTEM | 0.813 | 0.15 | 0.14 | 0.18 |
| MD | 0.810 | 0.46 | 0.15 | 0.20 |
| MMD | 0.810 | 0.34 | 0.15 | 0.19 |
| Format | Aggregation | Comparison | Counting | Lookup |
|---|---|---|---|---|
| CSV | 0.529 | 0.949 | 0.919 | 0.834 |
| HTML | 0.531 | 0.954 | 0.925 | 0.838 |
| LaTeX | 0.513 | 0.915 | 0.891 | 0.788 |
| LTEM | 0.530 | 0.954 | 0.925 | 0.843 |
| MD | 0.529 | 0.955 | 0.923 | 0.831 |
| MMD | 0.532 | 0.955 | 0.924 | 0.830 |
| Backbone | Base nEM | LoRA nEM | nEM |
|---|---|---|---|
| Qwen3-4B-Instruct | 0.489 | 0.763 | +0.274 |
| Phi-4-mini | 0.539 | 0.737 | +0.198 |
| Gemma-3-4B-IT | 0.361 | 0.707 | +0.346 |
| Slice | Base nEM | LoRA nEM | |
|---|---|---|---|
| LOOKUP | 0.817 | 0.983 | +0.165 |
| COUNTING | 0.609 | 0.696 | +0.087 |
| AGGREGATION | 0.148 | 0.478 | +0.330 |
| COMPARISON | 0.383 | 0.896 | +0.513 |
| L1 | 0.500 | 0.773 | +0.273 |
| L2 | 0.522 | 0.750 | +0.228 |
| Model | n 01 | n 10 | Fisher p | Winner |
|---|---|---|---|---|
| DeepSeek-R1 | 196 | 343 | 5.4 10 -9 *** | LTEM |
| Llama-4-Maverick | 343 | 441 | 0.0056** | LTEM |
| Gemini-2.5-Pro | 253 | 275 | 0.410 (ns) | — |
| GPT-5 | 246 | 353 | 2.1 10 -4 *** | LTEM |
| Qwen3-235B | 398 | 2,377 | 10 -100 *** | LTEM |
Document Understanding
Document understanding enables machines to interpret text, layout, tables, and images to extract information and answer questions about documents.
See all 93 papers