Skip to content

LTEM: LLM-friendly Table-Enhanced Markdown

Merged cells and multi-row headers, in plain Markdown tables.

LTEM: LLM-Friendly Table-Enhanced Markdown for Table Understanding and Generation

EMNLP 2026, Budapest

Main Conference · Oral

Eunbin Kim1, Hyeonseok Kang1, Sangkeun Jung1,2,*

1Department of Computer Science and Engineering, Chungnam National University2EurekaAI

*Corresponding author

LTEM source
Rendered
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

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.

Why LLM-friendly tables? ​

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 featureLightweightExpressiveLTEM
CSVMarkdownMultiMarkdownHTMLLaTeX
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.

Five design rules ​

Markdown-compatibleA superset of GFM pipe tables. Models already know the syntax, and where LTEM is not supported the body still reads as a Markdown table.
LinearRead top to bottom, the source already makes sense, for a model writing it token by token and for a person reviewing it.
ExplicitEvery span is written down. Nothing is left to infer from alignment or repeated text, a common source of structural hallucination.
MinimalA handful of marks on top of Markdown: <<, ^^, {c:N,r:M} and \\. Every row above |---| is a header.
One passA formal grammar that parses in a single pass, with no forward references, in linear time.

How these rules compare with other merged-cell syntaxes →

Syntax at a glance ​

Seven patterns cover what Markdown tables could not express. Each one shows a GFM table first, then the same table in LTEM.

Writing LTEM tables: the full guide →

How we tested it ​

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.

The taxonomy in full, with an example for each level →

Can a plain Markdown table express it?LevelWhat the table needsSTB tables
YesL1A grid of cells96
L2A header row334
No: Markdown has no syntax for merged cells, nested headers or sectionsL3Merged cells342
L4Multi-level headers164
L5Stacked sections87
L6Several linked tables66

Results ​

Table question answering on STB, averaged over five LLMs and three runs per format.

Accuracy on par with HTML
0.813
nEM, HTML 0.812
Fewer table tokens than HTML
42%
228 vs. 392 tokens per table
Lowest error rate of six formats
0.29%
refusals + invalid answers; LaTeX 3.04%
FormatAccuracyTokensErrors (%)
nEMToken F1Num EMPromptTable
LTEM0.8130.8440.9434492280.29
HTML0.8120.8440.9456123920.41
MultiMarkdown0.8100.8430.9464362150.49
Markdown0.8100.8420.9454372170.61
CSV0.8080.8400.9403701490.31
LaTeX0.7770.8120.9334472273.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.

This table is itself written in LTEM: view its source
text
| 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       |
  • As accurate as HTML, far shorter. LTEM matches HTML (0.813 vs. 0.812 nEM) with 42% fewer tokens per table.
  • The most stable answers. LTEM has the lowest error rate of the six formats, about a tenth of LaTeX's (0.29% vs. 3.04%). Some models break on LaTeX: Qwen3-235B falls from 0.811 with LTEM to 0.660 with LaTeX. LTEM beats LaTeX significantly for four of the five models (McNemar's test).
  • Structure is where models struggle. Accuracy drops by 5.7 points at L3, where merged cells appear, and by another 5.4 at L4, where headers nest. This is the range LTEM makes explicit.
  • Models pick it up quickly. In a LoRA pilot, fine-tuning three 4B models on LTEM table questions raised accuracy on held-out STB tables by 0.20 to 0.35 nEM.

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.

Ready to adopt ​

Cores and plugins for the Markdown parsers people already use, in five languages, plus an editor component. Every implementation passes the same conformance tests.

JavaScript / TypeScript
  • Core and ltem command: parse, validate, render, write canonical LTEM, convert HTML tables
    npm install ltem-core
  • markdown-it 14 and 15. This site runs on it.
    npm install markdown-it markdown-it-ltem
  • marked-ltemComing soon
    marked 17 and 18
    npm install marked marked-ltem
  • remark-ltemComing soon
    remark plugin, also next to remark-gfm; with micromark-extension-ltem and mdast-util-ltem. For HTML, pass ltemHandlers to remark-rehype
    npm install remark-ltem
  • codemirror-ltemComing soon
    CodeMirror 6: table widget, merge and split, paste from Excel and the web; codemirror-ltem-live adds live preview
    npm install codemirror-ltem
Python
  • Core and ltem command, the reference implementation; imported as ltem
    pip install ltem-core
  • mdit-py-ltemComing soon
    markdown-it-py plugin
    pip install mdit-py-ltem
  • markdown-ltemComing soon
    Python-Markdown extension, for MkDocs too
    pip install markdown-ltem
Rust
  • ltemComing soon
    Core crate
    cargo add ltem
  • ltem-cliComing soon
    The ltem command: check, render, format, convert HTML
    cargo install ltem-cli
  • pulldown-cmark adapter
    cargo add pulldown-cmark-ltem
  • mdbook-ltemComing soon
    mdBook preprocessor (mdBook 0.4 and 0.5)
    cargo install mdbook-ltem
  • comrak-ltemComing soon
    comrak adapter, for the engine behind GitLab and crates.io
    cargo add comrak-ltem
Go
  • Core package (standard library only) and the ltem command
    go get github.com/hugman/ltem/ltem-lib/go@latest
  • goldmark extension, for goldmark v1 and v2
    import "github.com/hugman/ltem/ltem-lib/go/goldmarkltem"
Lua · Pandoc · Quarto
  • Core in pure Lua 5.4, no C code
  • Readers for Pandoc Markdown and commonmark_x with LTEM tables, and a filter for ```ltem blocks
    pandoc -f ltem-markdown.lua in.md -o out.docx
  • The filter for Quarto: it turns ```ltem blocks into tables
Build your own
  • Specification 1.0
    Grammar, merge rules, escapes, canonical form, validation
  • Table model
    Language-neutral JSON Schema that parsers produce
  • Conformance tests
    Pass them and you may call your implementation LTEM

Every 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

An editor built on LTEM ​

Cellmark Editor is a desktop Markdown editor for Windows. It writes and edits its tables in LTEM.

Cellmark Editor ​

Desktop app for Windows · Free

A fast, lightweight Markdown editor that is especially good with tables. Its table editing is built on codemirror-ltem.

Learn more at eurekax.co →

  • Live editing. Formatting shows right where you type. Switch to Source or Split at any time to see the Markdown.
  • Table editing in LTEM. Click a cell to edit it in place, and use the table menu to add rows and columns or merge cells. Tables pasted from the web, Word or Excel keep their merged cells.
  • AI table recognition. Drag over a table in a PDF or HWP document, and it comes in as an LTEM table.
  • Free, and only on your PC. Free for personal use and for work. Documents never leave the PC, and every feature works without the internet.

Cite ​

@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"
}