Controlled paired-format benchmark evaluates retrieval quality of Markdown versus PDF in text processing.
Retrieval-Augmented Generation (RAG) grounds large language models on enterprise knowledge, and the format of the source document determines how that knowledge is chunked and embedded. PDF is a two-dimensional rendering format with no explicit semantic structure, whereas Markdown encodes heading hierarchies and tables natively. To isolate the effect of source format on retrieval quality — holding the underlying document content constant — we build a paired corpus of 20 documents, each available in both PDF and Markdown form (aligned by construction), and evaluate dense retrieval over 48 questions spanning three domains (financial reports, academic papers, technical manuals) and four question types (Table, Factual, Definition, Code). We find that neither format dominates outright. On the full 48-question benchmark, Markdown chunks achieve higher hit@1 (0.875 vs. 0.792) and MRR (0.938 vs. 0.892), with hit@3 saturated at 1.0 for both pipelines. The advantage is concentrated in structure-heavy question types: Markdown wins on Definition questions (hit@1 0.889 vs. 0.556) and Table questions (0.889 vs. 0.852), while PDF wins on Factual questions (0.909 vs. 0.818). An ablation study shows that AST header breadcrumbs account for +0.111 hit@1 on Definition queries, confirming that header context propagation is a key mechanism behind Markdown's retrieval advantage. Token analysis indicates that Markdown documents consume 12.3% fewer tokens than raw PDF extractions while delivering 12.0% higher hit density per token. On a 20-question one-per-document subset, the ordering flips (PDF hit@1 0.800 vs. Markdown 0.650), demonstrating high sensitivity to question sampling. McNemar's test on the 48-question paired outcomes yields chi-squared=1.125, p=0.289, indicating that while directional advantages exist, the difference does not reach statistical significance on this sample size. Six questions were answered at hit@1 only by Markdown retrieval, two only by PDF. Our results indicate that structured chunking yields measurable retrieval gains for definitional and tabular queries, but that conclusions depend strongly on benchmark composition; larger corpora are required before generalizing. Official Source Code & Benchmark Data: https://github.com/RABNEER/M-RAG
No takes yet. Share an insight, caveat, or question.
Ranveer Kumar (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: