{"slug": "yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away", "title": "yolowpdf 0.2.0: Rebuilding the Math That PDF Throws Away", "summary": "The yolowpdf project released version 0.2.0, a pure-Rust PDF-to-Markdown library that reconstructs two-dimensional math from glyph geometry before line splitting. On olmOCR's 1,269-page born-digital benchmark, the mean score rose from 0.5915 to 0.6950 and the arXiv math subset jumped from 0.0881 to 0.6505, while throughput reached 2,256 pages/s. The release also open-sourced YolowOCR-Suite v2, five from-scratch models published on Hugging Face under MIT at 109.59 MB, 8.14× smaller than the 892 MB FP32 reference stack.", "body_md": "yolowpdf is a pure-Rust PDF-to-Markdown library that parses the format itself — no Poppler, no MuPDF. Version 0.2.0, released this week, is a consolidated release with two halves: the PDF core learned to reconstruct two-dimensional mathematics from glyph geometry, and the OCR side open-sourced its model suite. This post covers both, with the measured numbers.\n\nA PDF does not store formulas. It stores glyphs at coordinates: a numerator here, a drawn line under it, a denominator below. A text extractor reading in stream order produces linear soup — the fraction loses which part was on top, a matrix flattens into a column of numbers, the limits of a summation detach and wander into the prose. For a human reader of the rendered page this is invisible. For an LLM pipeline ingesting papers, the math is precisely the part that matters, and it is the part that arrives broken.\n\nThe scores showed it plainly. On the born-digital benchmark suite (olmOCR's 1,269-page set), the math-heavy arXiv subset scored **0.0881** with the previous release — the extractor was effectively not reading those pages at all.\n\n0.2.0 adds a reconstruction pass that runs on glyph geometry *before* line splitting, folding drawn structure bottom-up:\n\n`pmatrix` / `bmatrix` / `vmatrix` / `cases` — and `\\binom` when a parenthesized two-by-one stack is really a binomial coefficient.\nMeasured on the same born-digital set, same machine: mean score **0.5915 → 0.6950**, passed tests **3,484 → 5,170**, and the arXiv math subset **0.0881 → 0.6505**. Speed went up at the same time — 1,269 pages in 0.562 s (** 2,256 pages/s**, p50 3.4 ms/page), because the release also carries the parsing work: a flat direct-indexed object table, zero-copy lexing and filter paths, reused inflate state, and prefix-only decoding where only a stream's head is needed. Layout gained recursive X-Y-cut column detection for mixed two/three-column pages, and a round of TeX font-decoding fixes (mathabx, CM family) landed with it.\n\nFor scanned pages, `yolowpdf-ocr` ships **YolowOCR-Suite v2** — five models trained from scratch (detection, multilingual recognition, Latin recognition, layout, formula), published on Hugging Face under MIT as BF16 safetensors: **109.59 MB for the full multilingual suite, 8.14× smaller** than the 892 MB FP32 upstream reference stack it stays format-compatible with (PP-OCRv6 / PP-DocLayoutV3 / PP-FormulaNet_plus-L). Pinned revisions and SHA-256 digests are registered in the crate itself, so the models you run are the models that were measured.\n\nTwo pieces of engineering came with the models:\n\nOn the scanned suite (134 pages, full layout + formula stack): score **0.4799**, **2.40× faster** than the v1 stack, peak memory **938 MB — 58% less** than v1's 2,225 MB.\n\n``` php\nfn main() -> Result<(), Box<dyn std::error::Error>> {\n    let bytes = std::fs::read(\"document.pdf\")?;\n    let doc = yolowpdf::extract(&bytes)?;\n    println!(\"{}\", doc.markdown);\n    Ok(())\n}\n[dependencies]\nyolowpdf = \"0.2\"\nyolowpdf-ocr = \"0.2\"   # optional, for scanned pages\n```\n\nUse yolowpdf when you ingest documents — papers especially — into an LLM or RAG pipeline and the formulas are content, not decoration; or when you need the whole stack, models included, self-hosted and offline. If your PDFs are plain prose and any extractor's output looks fine, this is more machinery than you need.", "url": "https://wpnews.pro/news/yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away", "canonical_source": "https://dev.to/yolow92/yolowpdf-020-rebuilding-the-math-that-pdf-throws-away-1fin", "published_at": "2026-11-25 23:05:16+00:00", "updated_at": "2026-11-25 23:13:14.360542+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-infrastructure", "computer-vision", "developer-tools"], "entities": ["yolowpdf", "YolowOCR-Suite v2", "Hugging Face", "olmOCR", "PP-OCRv6", "PP-DocLayoutV3", "PP-FormulaNet_plus-L"], "also_reported_by": [], "takeaway": "Reconstructing math from glyph geometry before line splitting lifted the arXiv math subset from 0.0881 to 0.6505 and the overall born-digital mean from 0.5915 to 0.6950, at 2,256 pages/s.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away", "markdown": "https://wpnews.pro/news/yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away.md", "text": "https://wpnews.pro/news/yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away.txt", "jsonld": "https://wpnews.pro/news/yolowpdf-0-2-0-rebuilding-the-math-that-pdf-throws-away.jsonld"}}