Structured Data Extraction From Financial Regulatory Filings
Each filing format fails differently, so reliable extraction stacks layers.

Why regulatory filings resist automated extraction
- Role: Opens the argument by establishing the core problem — filings are not built for machines — so every subsequent section reads as a response to a specific, documented failure mode rather than a general survey of tools.
- Regulatory filings contain the data that drives investment analysis, compliance reporting, and audit workflows, but the file formats they arrive in were designed for human reading, not machine parsing.
- PDFs do not store data in rows and columns the way a spreadsheet does; they store individually positioned text fragments, and the reader's eye does the work of assembling them into a table — a structural property of the format, not a fixable quirk
- The same filing type — a 10-K, for instance — can arrive as clean HTML, Inline XBRL, scanned image PDFs, plain text, or legacy formats depending on the filer, the year, and the filing software
- No universal template exists: one company labels the first line of its income statement "Revenue," another uses "Net Sales," a third uses "Total Turnover" — all referring to the same concept
- Critical data regularly appears not in primary tables but in narrative footnotes covering lease obligations, contingent liabilities, segment breakdowns, and accounting policy details — extracting a complete picture requires reading both
- Financial statements span multiple pages with sub-totals and cross-references; a balance sheet that starts on one page and continues on the next breaks any extraction logic that processes pages in isolation
- Note: Keep this section tight — its job is to motivate the rest of the piece, not to catalogue every difficulty. Close on the point that these are not random inconsistencies but predictable, format-level obstacles, which is why the solution must be layered.
What XBRL was supposed to fix, and where it falls short
- Role: Builds on the opening by showing that the "obvious" institutional fix — XBRL — was real progress but introduced its own failure mode, justifying why practitioners cannot simply rely on structured tagging and must combine approaches.
- XBRL made financial data machine-readable within a single company's filing history, but it does not deliver consistent, comparable data across companies because tag usage varies too widely.
- The standard delivers standardization within one company's filings over time — the same tag reappears consistently across that company's annual reports — but it does not enforce cross-company consistency
- Custom extension tags are the structural cause: companies of all sizes create company-specific tags outside the FASB taxonomy for line items not sufficiently covered by standard elements, with large filers often creating them at higher rates than smaller ones; a tag one company uses for "adjusted operating income" is not the same tag another company uses for the same concept
- A separate structural problem: LLM pipelines appear to consume only the human-readable HTML portions of SEC filings, not the machine-readable XBRL data already embedded in most public company filings — meaning the richer structured layer is being bypassed by the very tools meant to automate analysis, and this causes date-period confusion when models confidently return figures from the wrong reporting period
- Note: The XBRL enforcement update (March 2026) is a concrete regulatory fact — use it to show the standard is tightening, not loosening. Don't get deep into XBRL taxonomy mechanics; the point is that tagging inconsistency is the residual problem XBRL alone cannot solve.
How OCR fits into a modern extraction pipeline — and where it stops
- Role: Transitions from the problem of structured formats to the problem of unstructured ones, explaining OCR's role as a necessary first step that does not by itself produce structured data — setting up why ML and LLMs must be added on top.
- OCR solves the image-to-text conversion problem for scanned and image-based filings but produces raw, unstructured output that still requires a second layer of logic to become usable data.
- Traditional OCR tools scan a PDF and convert text to machine-readable characters — this is the necessary first step for any filing that arrives as a scanned image rather than a native digital file
- OCR output is raw text: tables come out misaligned, headers merge with data rows, and multi-column layouts collapse — the user is left with a structuring problem only slightly easier than working from the original PDF
- Rule-based systems built on top of OCR output — template matchers, regex extractors — broke against layout variability; a rule calibrated to one company's income statement format fails when a different company uses a different column order or label
- Intelligent Document Processing (IDP) platforms combine OCR, NLP, and machine learning into a single workflow: OCR handles initial image-to-text conversion, ML models classify the document type and identify relevant fields, and the system validates extracted data against business rules — breaking the linear relationship between document volume and processing cost
- The shift from rule-based to ML-driven extraction means systems can handle document formats they have never seen before — a critical capability given the inconsistency across filers
- Note: This section should not read as a history lesson. Frame it as a layering argument: each technology solves the problem the previous one left behind, which is exactly why modern pipelines stack them. Keep the rule-based failure brief — it motivates the ML layer, not a full section.
What LLMs add to the extraction stack — and the hallucination problem they introduce
- Role: Advances the argument to the current state of practice — LLMs as the layer that handles semantic variability across labels and formats — while immediately introducing the reliability problem that prevents them from being used alone, setting up the case for hybrid pipelines.
- LLMs resolve the semantic variability problem that rule-based and template systems cannot, but they introduce fabrication risks that are especially dangerous in financial contexts where precise numeric accuracy and source traceability are non-negotiable.
- LLMs understand that "Net Sales," "Revenue," and "Total Turnover" refer to the same concept; they can interpret complex table structures, handle multi-page layouts, and extract data from narrative footnotes — capabilities no template-based system can match
- LLM pipelines can turn SEC filings into summaries, extracted metrics, and answers to natural-language questions, accelerating workflows that previously required analysts to comb documents manually
- The hallucination problem is acute and documented: finance LLMs still fall short on hallucinations and mis-answer optional questions the majority of the time; models fabricate financial metrics, invent regulatory citations, and in at least one documented case generated names of executives who do not appear in the source document — with clean, well-formatted outputs that make the fabrications harder to catch
- Hallucinated answers are especially hazardous in financial settings because downstream decisions — compliance checks, investment analysis, regulatory reporting — rely on precise numeric values, units, and temporally grounded facts that must be verifiable against primary sources
- Accuracy drops meaningfully when LLMs move from single-document reasoning to cross-entity and temporal analysis — the exact tasks financial analysts most need — driven by comparison hallucinations and entity mismatches
- Extraction systems must preserve provenance — linking each extracted data point back to its source location in the original document — because audit contexts require demonstrated data lineage, not just a correct-looking answer
- Note: The hallucination findings are the pivot point of the whole argument. Don't bury them. State them clearly and early in this section, then let the next section propose the structural response. Avoid framing LLMs as either the solution or the villain — they are a necessary layer with a known failure mode that the architecture must manage.
Why RAG architectures reduce but do not eliminate extraction errors
- Role: Drills into the most common architectural response to LLM hallucination — retrieval-augmented generation — and shows it has its own structural failure mode specific to financial tables, making the case that pipeline design choices (chunking strategy, embedding choice, re-ranking) are not cosmetic but load-bearing.
- RAG pipelines reduce hallucination by grounding generation in retrieved document segments, but fixed-size chunking splits financial tables across chunk boundaries in ways that cause retrieval to return section headers instead of data rows.
- Standard RAG architectures convert filing text into embeddings stored in a vector database; a retrieval step finds the chunks most similar to a query, and the generative model produces an answer grounded in those chunks
- The failure mode is structural: fixed-size chunking splits financial statement tables across chunk boundaries; cosine similarity on a sentence encoder then reliably retrieves the section header row — which contains formatting characters and whitespace that dominate the vector representation — rather than the data rows beneath it
- Better embeddings or re-ranking cannot resolve this mismatch — the problem is between the chunk format and the query intent, not the similarity metric
- Accuracy drops further on cross-entity and longitudinal tasks — comparing one company's figures to another's, or tracking a metric across multiple periods — because these tasks require the pipeline to hold context across multiple retrieved segments without introducing entity mismatches
- Note: The Johnson & Johnson example is the sharpest concrete illustration of a chunking failure — lead with it to make the structural argument vivid before explaining the mechanism. Keep the Microsoft case brief; it illustrates the solution direction, not a full answer.
How to build a layered extraction pipeline that handles each format's failure mode
- Role: Synthesizes the argument into a practical architecture — one layer per failure mode — showing how OCR, XBRL parsing, and LLM-based extraction compose into a pipeline that is more reliable than any single approach. This is the constructive payoff the earlier problem sections have been building toward.
- A reliable extraction pipeline is not a single technology choice but a sequence of layers, each matched to the failure mode of the format it handles, with provenance threading through every stage.
- Layer 1 — format detection and preprocessing: identify whether the filing arrives as native HTML, Inline XBRL, scanned PDF, or legacy text; route each to the appropriate handler rather than applying a single extraction strategy uniformly
- Layer 2 — OCR for image-based documents: apply OCR as the conversion step for scanned filings, treating its output as raw material for the next layer, not a finished product; modern IDP platforms combine this with NLP and ML classification in a single workflow
- Layer 3 — XBRL parsing for structured filings: where XBRL tags are present and standardized, parse them directly rather than relying on the human-readable HTML; SEC-API.io's XBRL-to-JSON endpoint converts financial statements from 10-K, 10-Q, and other XBRL-supported SEC filings into JSON, making tagged data immediately queryable without HTML parsing
- Flag custom extension tags explicitly rather than silently passing them through — they are the primary source of cross-company comparability failures and must be normalized or excluded from comparative analysis
- The XBRL US Standardized Statement Taxonomy (XUSSS) is one normalization layer; applying it to XBRL output before passing data downstream improves cross-company comparability
- Layer 4 — LLM-based extraction for semantic variability: use LLMs for the cases XBRL and template matching cannot handle — narrative footnotes, inconsistently labeled line items, multi-page structures — but constrain generation with structured output schemas so the model cannot fabricate fields
- Structure-first prompting: define the expected output schema before generation, so the model fills known slots rather than generating free-form text that may invent fields
- Chunk financial tables as semantic units (a complete table, not a fixed token count) to avoid the header-retrieval failure mode documented in RAG evaluations
- Affinda's regulatory filings extraction platform applies reading-order models, OCR, LLMs, and RAG together — combining these layers rather than selecting one — and applies business-logic validation rules in natural language to ensure output meets compliance requirements before it passes downstream
- Layer 5 — provenance and validation: link every extracted data point back to its source location in the original document; validate numeric outputs against the original filing rather than trusting model output alone; audit contexts require this lineage, and it is the only reliable defense against well-formatted hallucinations
- Note: This section is the most actionable in the piece — give it enough depth to be genuinely useful to a practitioner. The five-layer structure is the spine; don't let it collapse into a bullet list of tool names. Each layer should carry a clear rationale derived from the failure mode it addresses.
Choosing the right extraction approach for different filing types and use cases
- Role: Translates the layered architecture into practical decision logic — which combination of approaches fits which filing type and analytical goal — so the piece ends with guidance a reader can act on immediately rather than an abstract framework.
Notes
- SEC EDGAR Filings API
Described the XBRL-to-JSON endpoint that converts 10-K and 10-Q financial statements into queryable JSON.
- XBRL US takes on the SEC data challenge
Supported the discussion of XBRL US's standardized taxonomy as a normalization layer for cross-company comparability.
- XBRL US - The national consortium for the business reporting standard.
Background on XBRL US and its Standardized Statement Taxonomy used to normalize tags across companies.
- FAITH: A Framework for Assessing Intrinsic Tabular Hallucinations in Finance
Informed the discussion of numeric and tabular hallucinations in finance and why outputs must be verifiable.
- Towards reducing hallucination in extracting information from financial reports using Large Language Models
Contributed to the discussion of hallucination risk when extracting information from financial reports with LLMs.
Every new piece from The Parse Layer, as it's published.
Follow