Merged cells and multi-row headers, in plain Markdown tables.
LTEM: LLM-Friendly Table-Enhanced Markdown for Table Understanding and Generation

Main Conference · Oral
1Department of Computer Science and Engineering, Chungnam National University2EurekaAI
*Corresponding author
| Region | Revenue | Growth | |
|---|---|---|---|
| Q1 | Q2 | ||
| Asia | 100 | 120 | +20% |
| Europe | 90 | 110 | +22% |
Edit the table. << merges a cell into the one on its left, ^^ into the one above. Every row above |---| is a header row. header cell merged header cell merged cell
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.
A language model reads a table as a line of text. The format decides how much of the structure survives.
A model never sees the grid. It reads a serialization token by token and has to rebuild which cells are headers, how far a merged cell reaches and how the headers nest. The same table gives different answers depending on the format it is written in. And the tables people care about, in papers, financial reports and statistics, depend on exactly that structure: merged cells, multi-level headers, sections.
The formats models handle best cannot hold it. Markdown fills their training data, from GitHub to StackExchange, and chat assistants answer with Markdown tables, yet Markdown has no way to merge a cell. HTML and LaTeX can express everything, at a price: more tokens, and a model must decode colspan or \multicolumn to work out where each cell sits. LTEM keeps Markdown's familiar, linear form and makes the structure explicit.
| Structural feature | Lightweight | Expressive | LTEM | |||
|---|---|---|---|---|---|---|
| CSV | Markdown | MultiMarkdown | HTML | LaTeX | ||
| F1 Grid | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| F2 Header roles | △ | ✓ | ✓ | ✓ | ✓ | ✓ |
| F3 Cell merging | ✗ | ✗ | △ | ✓ | ✓ | ✓ |
| F4 Header nesting | ✗ | ✗ | △ | ✓ | ✓ | ✓ |
| F5 Section stacking | ✗ | ✗ | ✗ | △† | ✓ | ✓ |
| F6 Table composition | ✗ | ✗ | ✗ | △† | ✓ | ✓* |
What each format can express (paper, Table 1; see the taxonomy). ✓ native, △ partial or non-standard, ✗ not supported.
* In the paper's design; LTEM 1.0 leaves F6, several linked tables, for a later version.
† HTML can approximate sections and composed tables with several <tbody> elements or separate <table> elements, but it cannot state how the parts relate; that takes extra markup or code of your own.
<<, ^^, {c:N,r:M} and \\. Every row above |---| is a header.Seven patterns cover what Markdown tables could not express. Each one shows a GFM table first, then the same table in LTEM.

To compare formats fairly, we first had to say what makes a table hard.
A taxonomy. Six structural features build up six cumulative complexity levels. A format that cannot merge cells cannot express L3, or anything above it.
A benchmark, STB. Existing benchmarks are mostly flat tables, so "format A beats format B" may only hold for simple ones. STB has 1,089 tables spread across all levels, about 30% at L3, where Markdown and CSV stop being able to express the table. They come from five domains with 4,356 questions: lookup, counting, comparison and aggregation. STB is on Hugging Face as ltem-stb, under CC BY 4.0.
Models and formats. Five LLMs (GPT-5, Gemini 2.5 Pro, Llama 4 Maverick, Qwen3-235B, DeepSeek-R1), six formats, three runs each. HiTab adds real-world hierarchical tables.
| Can a plain Markdown table express it? | Level | What the table needs | STB tables |
|---|---|---|---|
| Yes | L1 | A grid of cells | 96 |
| L2 | A header row | 334 | |
| No: Markdown has no syntax for merged cells, nested headers or sections | L3 | Merged cells | 342 |
| L4 | Multi-level headers | 164 | |
| L5 | Stacked sections | 87 | |
| L6 | Several linked tables | 66 |
Table question answering on STB, averaged over five LLMs and three runs per format.
| Format | Accuracy | Tokens | Errors (%) | |||
|---|---|---|---|---|---|---|
| nEM | Token F1 | Num EM | Prompt | Table | ||
| LTEM | 0.813 | 0.844 | 0.943 | 449 | 228 | 0.29 |
| HTML | 0.812 | 0.844 | 0.945 | 612 | 392 | 0.41 |
| MultiMarkdown | 0.810 | 0.843 | 0.946 | 436 | 215 | 0.49 |
| Markdown | 0.810 | 0.842 | 0.945 | 437 | 217 | 0.61 |
| CSV | 0.808 | 0.840 | 0.940 | 370 | 149 | 0.31 |
| LaTeX | 0.777 | 0.812 | 0.933 | 447 | 227 | 3.04 |
Paper, Tables 2 and 3. Prompt tokens exclude the LTEM guide; errors are refusals plus invalid answers. The averages include flat tables, which every format can express. The released STB corrects the answers to six questions; with them, nEM rises by 0.02 to 0.04 percentage points for each format, and no ranking or significance result changes.
| Format | Accuracy | << | << | Tokens | << | Errors (%) |
| ^^ | nEM | Token F1 | Num EM | Prompt | Table | ^^ |
|---------------|----------:|---------:|-------:|-------:|------:|-----------:|
| **LTEM** | **0.813** | 0.844 | 0.943 | 449 | 228 | **0.29** |
| HTML | 0.812 | 0.844 | 0.945 | 612 | 392 | 0.41 |
| MultiMarkdown | 0.810 | 0.843 | 0.946 | 436 | 215 | 0.49 |
| Markdown | 0.810 | 0.842 | 0.945 | 437 | 217 | 0.61 |
| CSV | 0.808 | 0.840 | 0.940 | 370 | 149 | 0.31 |
| LaTeX | 0.777 | 0.812 | 0.933 | 447 | 227 | 3.04 |On real-world HiTab tables, HTML, LaTeX and LTEM land within 0.6 points of each other (0.295, 0.292 and 0.289 nEM). For table generation, HTML scores highest and LTEM is close to MultiMarkdown. What LTEM adds is explicit structure, at HTML-level accuracy and close to Markdown's token cost.
Cores and plugins for the Markdown parsers people already use, in five languages, plus an editor component. Every implementation passes the same conformance tests.
npm install ltem-corenpm install markdown-it markdown-it-ltemmarked-ltemComing soonnpm install marked marked-ltemremark-ltemComing soonnpm install remark-ltemcodemirror-ltemComing soonnpm install codemirror-ltempip install ltem-coremdit-py-ltemComing soonpip install mdit-py-ltemmarkdown-ltemComing soonpip install markdown-ltemltemComing sooncargo add ltemltem-cliComing sooncargo install ltem-clipulldown-cmark-ltemComing sooncargo add pulldown-cmark-ltemmdbook-ltemComing sooncargo install mdbook-ltemcomrak-ltemComing sooncargo add comrak-ltemgo get github.com/hugman/ltem/ltem-lib/go@latestimport "github.com/hugman/ltem/ltem-lib/go/goldmarkltem"pandoc -f ltem-markdown.lua in.md -o out.docxSpecification 1.0Table modelConformance testsEvery library in detail, with setup for each tool →
Code under MIT · Specification under CC BY-ND 4.0 · Documentation under CC BY 4.0 · A royalty-free license to essential patent claims for conforming implementations · The name LTEM is for implementations that pass the conformance tests
Cellmark Editor is a desktop Markdown editor for Windows. It writes and edits its tables in LTEM.
Desktop app for Windows · Free
A fast, lightweight Markdown editor that is especially good with tables. Its table editing is built on codemirror-ltem.
@inproceedings{kim-etal-2026-ltem,
title = "{LTEM}: {LLM}-Friendly Table-Enhanced Markdown for Table Understanding and Generation",
author = "Kim, Eunbin and
Kang, Hyeonseok and
Jung, Sangkeun",
booktitle = "Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing",
month = oct,
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics"
}