LatentMD: Benchmarking Markdown Boundary Failures in LLM-Generated Text

Sungjune Lee, Myungjoo Kang
9/7/2026
cs.SEcs.CLcs.LG
benchmark-dataset

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) increasingly generate Markdown that is consumed by renderers, agents, code extractors, and structured downstream pipelines. Yet existing evaluations often conflate content quality with format adherence, leaving Markdown boundary failures under-measured.

Show full abstract

We introduce LatentMD, a benchmark and evaluation protocol for diagnosing CommonMark-level fence-boundary failures in LLM-generated Markdown. LatentMD separates content correctness from boundary correctness, enabling detection of outputs that are content-correct but boundary-broken. The benchmark contains 4,179 prompts and a CLI for scoring arbitrary model outputs. Across 9 LLMs and roughly 37,600 generations, we find that Markdown boundary failures are widespread: 38.0% of valid main-grid outputs are content-correct but boundary-broken, with substantial boundary breakage under unspecified prompts and in a small human-authored validation set. Ablations show that failures are driven primarily by same-family symmetric-delimiter collisions rather than nesting alone, are only partially mitigated by prompt hints, and generalize to Python triple-quote docstrings while JSON remains robust as an asymmetric-delimiter control. LatentMD provides a reproducible diagnostic target for parser-sensitive LLM evaluation.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lee2026latentmd,
  title  = {LatentMD: Benchmarking Markdown Boundary Failures in LLM-Generated Text},
  author = {Sungjune Lee and Myungjoo Kang},
  year   = {2026},
  eprint = {2609.06993},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.06993v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.06993.svg)](https://codeofpaper.com/paper/2609.06993)

Discussion