Why did we open-source our inference engine? Read the post
← All Posts

Trace one restated figure through three SEC filings without losing the source

Trace one restated figure through three SEC filings without losing the source

This article walks through financial-filing-agent, a workable example from the open-source SIE repo on GitHub: a fail-closed pipeline that traces a restated figure across three SEC filings while preserving source attribution. SIE is Superlinked’s self-hosted inference engine, one cluster that serves embedding, reranking, OCR, vision, entity-extraction, and generation models behind three primitives (extract, encode, score). The example is a complete project built on public SEC facts. Built by Superlinked.

A company reports net income of $45.096 million in a 10-Q. Months later, a corrective notice appears. Then a 10-K/A restates the figure to $36.080 million, a 20% drop, along with language that earlier filings “should no longer be relied upon.”

Now answer a simple question: what was the number, what is it now, and which document says which? Any analyst can do this by hand in twenty minutes. The interesting problem is doing it with software that never confuses the original figure with the restated one, never presents a superseded number as current, and can show its work for every claim. Get the attribution wrong and you haven’t automated analysis; you’ve automated a compliance incident.

The financial-filing-agent example in the SIE repo traces this exact case (Pathward Financial’s restatement) through the original Form 10-Q, the corrective notice, and the Form 10-K/A, preserving source status the whole way.

The pipeline

Five stages, each output feeding the next, all served from one SIE deployment.

Docling parses the SEC filings into markdown with structure intact, which matters because the figures live in tables and a parser that flattens tables has already lost. BAAI/bge-m3 embeds and ranks candidate passages; Qwen3-Reranker-4B reorders that evidence against the specific question being asked. Then two separate entity models (urchade/gliner_multi-v2.1 and fastino/gliner2-large-v1) extract the exact source spans: table values, dates, company names, and the reliance-status statements. Finally, plain Python decimal arithmetic computes the change between original and restated figures. The model finds the numbers; the subtraction happens in code you can read.

The original value must come from the 10-Q’s tables. The restated comparison comes from the 10-K/A’s “As Previously Reported” column. The pipeline validates that these two sources align before it computes anything, and the company’s own caveats are preserved verbatim, but only when they appear in the reranked evidence. No paraphrased disclaimers, no invented hedges.

Fail closed

The design decision that defines this example: if either entity model misses a required span, the result is discarded. Not flagged, not filled in with a best guess. Discarded.

Running two extraction models and requiring both to succeed costs you completed runs; some inputs that a single lenient model would have “handled” now halt. In financial reporting, that trade is correct. A pipeline that says “I couldn’t verify this” is annoying. A pipeline that confidently reports a superseded figure as current is dangerous. Fail-closed validation converts the second failure mode into the first.

The output side matches the rigor: comprehensive evidence bundles capture every intermediate model output and per-stage latency, so any figure in the final result traces back through reranked passages to exact spans in the source filings.

Why two entity models instead of one

Running gliner_multi-v2.1 and gliner2-large-v1 side by side looks redundant until you think about what each miss means. A single extraction model that hallucinates a span produces output indistinguishable from a correct run; there’s no second opinion to disagree with it. Two independently trained models extracting the same required spans give you a cheap consensus check: agreement raises confidence, disagreement halts the run, and either way you learn something a single model can’t tell you.

This is the document-AI equivalent of double-entry bookkeeping, and it costs almost nothing here because both models are small and served from the same cluster. The expensive version of this idea (two full LLM passes with a judge) is what most teams reach for. Span extraction makes the cheap version work, because spans can be compared mechanically: either both models found “$36.080” in the “As Previously Reported” column or they didn’t.

Running it

cd examples/financial-filing-agent
cp .env.example .env
uv sync
uv run review-filing --run-id local
uv run eval-filing runs/local

That runs against a local SIE server on http://localhost:8080; set SIE_CLUSTER_URL and SIE_API_KEY to use a cloud cluster. The eval step checks the run’s outputs, so you see immediately whether your deployment reproduces the committed result: $45.096M original, $36.080M restated, the 20.0% decline, diluted EPS changes, and the reliance language, each attributed to the right document.

One more boundary the README draws explicitly: the system doesn’t classify restatements as fraud and doesn’t produce investment recommendations. It establishes what the filings say. Interpretation stays with the humans reading the output.

Why this case is worth your afternoon

Restatements are a stress test for every document AI claim you’ve heard. Multiple documents disagree with each other on purpose. The truth changes over time. Attribution is the entire product. If a pipeline handles this, ordinary single-document extraction is easy by comparison; if it can’t, no benchmark score matters.

The Pathward case ships with the example, public and verifiable against EDGAR. Run it, then read the evidence bundle and follow one number all the way down.

Try it on GitHub: superlinked/sie/examples/financial-filing-agent

Open source inference for agents

Open-source inference for the models behind your agents. Run it yourself, or let us run it for you.

Github 2.7K

Contact us

Tell us about your use case and we'll get back to you shortly.

Apply for an inference grant

Free capacity on our hosted cluster for selected projects. Tell us what you run and we reply by email.