TL;DR
As AI labs hit a "data wall" with exhausted web text, one of humanity's richest public repositories of factual, long-context reasoning—30 years of U.S. corporate financial disclosures—has been sitting in plain sight, trapped inside broken legacy HTML. This paper introduces the SEC Filings Dataset (SFD), reverse-engineering 18.4 million notoriously messy regulatory filings into clean, layout-faithful data estimated at 500 billion tokens. Along with a massive 152B-token public snapshot, the authors introduce two contamination-proof benchmarks showing that even frontier AI models still struggle to read complex accounting tables and forecast corporate futures.
What Problem Does This Paper Address?
Modern LLMs are starving for clean, factual, long-context training data. Standard web scrapes like Common Crawl require heavy filtering and usually flatten document structure, destroying tables and visual hierarchies.
Meanwhile, the SEC’s EDGAR archive holds decades of audited financial statements, risk disclosures, and market-moving reports. Why hasn't everyone trained on it? Because raw SEC filings are an engineering nightmare. To make documents look like crisp printed pages across browsers while obeying strict 1990s-era regulatory rules (HTML 3.2/4.0, no external CSS), enterprise filing software resorts to "layout engineering."
For instance, because legacy HTML lacks a decimal-alignment tab, filers use a "Three-Column Hack": splitting ($500.50) into three separate table cells—( in cell one, 500.50 in cell two, and ) in cell three. Naive parsers shred this, detaching negative signs from numbers and flipping profits into losses! Prior financial datasets simply gave up and deleted numeric tables altogether.
Methods
Instead of walking the messy HTML syntax tree like standard extractors, SFD uses a visual-first parsing methodology, treating the rendered document as a 2D spatial coordinate grid.
- MultiMarkdown (MMD) Serialization: Rather than verbose HTML or flat Markdown, SFD outputs MultiMarkdown—a lightweight Markdown extension using consecutive pipes (
||) and carets (^^) to preserve merged cells and complex table hierarchies with minimal tokens. - Symbol & Header Reconstruction: Rule-based algorithms scan table grids for "modifier columns" (floating
$,%, or parentheses) and stitch them back onto their numbers. Similarly, SFD detects multi-line headers that filing agents exploded into separate rows using CSS border/margin cues, coalescing them back into unified headers. - Multi-Generational Routing: The pipeline routes over 350 filing types across five formats: preserving whitespace in 1990s fixed-width ASCII, mapping 33 specialized XML schemas into readable documents, extracting SGML metadata, and running PDF attachments through Mistral OCR 3 before converting them into MMD.
Datasets
- SEC Filings Dataset (SFD) & SFD-v1: The full archive spans 1994–present (~18.4M filings, ~500B tokens), compressing 17.6TB of raw source bloat down to 1.9TB. It has <0.1% overlap with Common Crawl corpora like C4. The authors publicly release SFD-v1, a 152B-token snapshot (Jan 2022–June 2025).
- EDGAR-OCR (New Benchmark): 300 complex SEC tables synthetically mutated (swapping entities, dates, and numbers via extracted algebraic rules while keeping local arithmetic valid) and screenshotted. This tests HTML table transcription without memorization.
- EDGAR-Forecast (New Benchmark): An offline, sandboxed agentic benchmark across 50 companies (250 targets). Models read 5 years of historical SFD filings to forecast numeric metrics in hidden 2026 Form 10-Q filings released after model knowledge cutoffs.
Key Insights and Ideas
- Raw HTML is 99% scaffolding: Stripping enterprise presentation bloat often reduces token counts by over 99% while increasing semantic clarity.
- Frequency $\neq$ Token Mass: Insider trading forms (Form 4) make up ~25% of all SEC filings by count, yet only 2.0% of tokens. Conversely, filings over 100k tokens represent just 5.2% of documents but hold 64.0% of the corpus's tokens.
- Readability beats memorization at inference: When fine-tuning Qwen3-4B models across different parsers, which parser rendered the document at test time mattered far more than which parser generated the training set—proving that clean, compact structural layout directly boosts LLM comprehension.
Key Results
- Parser Fidelity: On 3,999 XBRL-anchored ground-truth facts, SFD recovers 96.3% of complete HTML table rows (vs. 77.7% for MarkItDown, 76.0% for EdgarTools, and 54.1% for
pandas). On downstream Qwen3-4B QA, SFD inference renderings led all baselines at 63.6% accuracy. - EDGAR-OCR: Qwen3.6-35B-A3B topped accuracy at 75.78% adjusted recall. However, Mistral OCR 3 hit 75.33% at roughly 1/11th the median latency (2.29s vs. 24.58s), making it the Pareto-optimal choice for building SFD.
- EDGAR-Forecast: Forecasting future numbers from 5-year filing histories proved brutal even for frontier reasoning models: GPT-5.5 led at 51.8%, followed by GPT-5.4 (48.2%), Gemini 3.1 Pro (45.2%), and Claude Opus 4.7 (42.6%), consuming 131M–189M tokens per evaluation run.
Limitations and Future Work
- XML Combinatorics & Record Grouping: Extensive XML filings like Form N-PORT contain 89 conditional branching rules, meaning rare or atypical schema paths remain unmapped. While SFD achieved the best overall XML record discrimination (44.2%), Docling outperformed it on Forms 3 and 4, leaving clear room for improvement.
- OCR Inline Formatting: Current OCR models transcribe text and grid placement well, but struggle to emit recoverable inline markup (bold, italics, superscripts/subscripts).
- Pretraining Isolation: While continual pretraining on SFD lowered held-out perplexity on Qwen3-4B (from 2.60 to 2.31), its isolated QA extraction gain (+0.43pp) was not statistically significant, leaving larger-scale pretraining ablations and RLVR (Reinforcement Learning with Verifiable Rewards) dataset construction as promising next steps.
Summary updated