LatentMD:基准测试大语言模型生成文本中的 Markdown 边界失败
LatentMD: Benchmarking Markdown Boundary Failures in LLM-Generated Text
浏览论文内容
中文总结 AI 辅助
本研究提出 LatentMD 基准,用于诊断 LLM 生成 Markdown 中的围栏边界失败,发现 38% 的输出内容正确但边界损坏,主要由对称定界符冲突导致。
中文摘要 AI 辅助
大型语言模型(LLMs)越来越多地生成由渲染器、智能体、代码提取器和结构化下游流水线消费的 Markdown 文本。然而,现有的评估常常将内容质量与格式遵循混为一谈,导致 Markdown 边界失败未被充分测量。我们引入了 LatentMD,一个用于诊断 LLM 生成的 Markdown 中 CommonMark 级别围栏边界失败的基准测试和评估协议。LatentMD 将内容正确性与边界正确性分离,能够检测出内容正确但边界损坏的输出。该基准测试包含 4,179 个提示词和一个用于对任意模型输出进行评分的命令行界面(CLI)。在 9 个 LLM 和大约 37,600 次生成中,我们发现 Markdown 边界失败普遍存在:38.0% 的有效主网格输出是内容正确但边界损坏的,在未指定提示词和小规模人工撰写的验证集中存在显著的边界损坏。消融实验表明,失败主要由同族对称定界符冲突驱动,而非仅由嵌套引起;提示提示只能部分缓解这些失败;并且这些失败可推广到 Python 三引号文档字符串,而 JSON 作为非对称定界符对照仍然稳健。LatentMD 为对解析器敏感的 LLM 评估提供了一个可复现的诊断目标。
英文摘要
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. 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.
发表机构
- Seoul National University(首尔国立大学)
机构由 AI 辅助整理,请以论文原文为准。