AnyLearn
All lessons
AIadvanced

Building Something That Holds Up

Given that the tradable-signal path is narrow and hard to evidence, the systems worth building are the ones the first lesson identified: extraction at scale. This lesson covers the engineering that makes them survive audit, the evaluation that does not depend on returns, and the governance obligations that apply once a model touches a regulated process.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 8

Grounding is architectural

The requirement that shapes everything is that outputs must be traceable to a source span. Not because it is good practice, but because a number nobody can check is a number nobody can act on, and in a regulated firm a decision nobody can explain is a finding.

The practical form is that an extraction pipeline returns evidence alongside every value.

{
  "metric": "fy_revenue_guidance_low",
  "value": 2400000000,
  "currency": "USD",
  "source_doc": "8-K_2026-02-11.pdf",
  "source_span": [14822, 14901],
  "quote": "we now expect full year revenue of $2.4 to $2.6 billion",
  "model": "provider/model@2026-01",
  "prompt_hash": "9f2c..."
}

Every field is doing a job. The span and quote let a human verify in seconds. The document identifier makes the claim reproducible. The model version and prompt hash make it reproducible against the same artefact, which the look-ahead lesson showed is not automatic.

A pipeline that returns only the number is not a weaker version of this. It is a different thing: an unverifiable assertion, which is unusable for anything with money attached.

The design rule is that the model's job is to locate and normalise, never to state a fact of its own. If a value cannot be pointed at, it is not extracted, and the correct output is an abstention.

Full lesson text

All 8 steps on one page, for reading, reference, and search.

Show

1. Grounding is architectural

The requirement that shapes everything is that outputs must be traceable to a source span. Not because it is good practice, but because a number nobody can check is a number nobody can act on, and in a regulated firm a decision nobody can explain is a finding.

The practical form is that an extraction pipeline returns evidence alongside every value.

{
  "metric": "fy_revenue_guidance_low",
  "value": 2400000000,
  "currency": "USD",
  "source_doc": "8-K_2026-02-11.pdf",
  "source_span": [14822, 14901],
  "quote": "we now expect full year revenue of $2.4 to $2.6 billion",
  "model": "provider/model@2026-01",
  "prompt_hash": "9f2c..."
}

Every field is doing a job. The span and quote let a human verify in seconds. The document identifier makes the claim reproducible. The model version and prompt hash make it reproducible against the same artefact, which the look-ahead lesson showed is not automatic.

A pipeline that returns only the number is not a weaker version of this. It is a different thing: an unverifiable assertion, which is unusable for anything with money attached.

The design rule is that the model's job is to locate and normalise, never to state a fact of its own. If a value cannot be pointed at, it is not extracted, and the correct output is an abstention.

2. Evaluating without waiting for returns

The great advantage of extraction over prediction is that it can be measured now, against a standard that is not the market.

Build a labelled set. A few hundred documents with correct extractions, produced by people who know the domain, is enough to be informative and is a week of work rather than a year of paper trading.

Then measure the things that matter separately, because they fail differently.

Precision. Of the values extracted, how many are right? This is the number that governs whether downstream users can trust the output without checking.

Recall. Of the values present in the documents, how many were found? Silent omission is the more dangerous failure, because nothing signals it.

Abstention quality. When the model declined to answer, was the value genuinely absent? A model that abstains on hard cases is far more useful than one that guesses, and this is the metric that captures it.

Consistency. Run the same document repeatedly. Variation is a direct measure of the non-determinism problem, and it bounds how much any single output can be relied upon.

None of these requires a single trade or a single day of market data, and none is contaminated by the look-ahead problem, because whether a guidance figure was correctly pulled from a filing does not depend on what happened next.

3. A pipeline that can be audited

Two properties of this shape matter more than any individual component.

Validation is deterministic and sits outside the model. A revenue figure must be a number in a plausible range; a quarterly breakdown must sum to the annual total; a date must fall inside the reporting period. These are ordinary rules, they catch a large fraction of extraction errors, and they cost nothing.

That point generalises. The most effective guard on a probabilistic component is usually a deterministic check downstream, because it fails loudly, reproducibly, and without a model's involvement.

The uncertain path goes to a person, not to a default. The alternative designs are worse in ways that are easy to miss: dropping uncertain values silently creates gaps nobody notices, and passing them through unmarked pollutes the store.

A review queue also does something valuable over time. It is a stream of exactly the cases the system finds hard, which is the highest-value labelled data available, and feeding it back into the evaluation set makes the measurements sharpen where it matters.

That is the same closed loop the execution lesson argued for: measurement is only worth its cost if it changes the next iteration.

flowchart TD
A["Source document, hashed and stored"] --> B["Segment into passages"]
B --> C["Retrieve candidate passages"]
C --> D["Extract with span citations"]
D --> E["Validate: types, ranges, arithmetic"]
E --> F["Confident and consistent"]
E --> G["Uncertain or failed validation"]
F --> H["Into the data store, with provenance"]
G --> I["Human review queue"]
I --> H

4. Cost, and why it decides the architecture

Inference cost is not a footnote here, because the volumes are large and the cost model interacts with the value.

Work it through. A universe of several thousand companies, each producing quarterly filings, earnings calls, and a steady stream of news. Long documents, so many tokens each. Processing the universe every quarter is a substantial recurring bill, and re-processing history to build a research dataset is a much larger one-off.

That has three architectural consequences.

Route by difficulty. Most documents are routine and a smaller model handles them; escalate only the ambiguous ones. The lesson LLM Pricing and Latency: What Actually Drives Cost develops this properly.

Cache aggressively. Documents are immutable once published, so an extraction is a pure function of document, prompt and model version. Anything already computed for that triple never needs recomputing, which makes the content-addressing idea from the Git and container cursus directly applicable.

Extract once, query many times. The expensive step is converting a document into structured data. Do it once, store the result with provenance, and answer subsequent questions from the store rather than by re-reading.

That last one is the difference between a system that scales and one whose bill grows with usage rather than with the corpus.

5. Adversarial input arrives by design

This domain has a threat property most do not: the documents are written by interested parties, and some of those parties know their filings are read by machines.

That makes prompt injection a first-class concern rather than a theoretical one. Text embedded in a filing, a press release or a web page can attempt to steer a model reading it, and the input arrives through the normal ingestion path because it is a legitimate document.

The defences are structural rather than clever.

Never let document content be instructions. Keep the system prompt and the document strictly separated, and treat everything from the document as data to be analysed rather than as text to be followed.

Constrain the output. A model returning a value from a fixed schema, validated on the way out, has a narrow channel through which to do damage. A model returning free text has a wide one.

Validate against the source. A quoted span must actually appear in the document. This single check defeats a large class of both injection and fabrication, and it is cheap.

Cross-check independent sources. A figure appearing in a filing and a data vendor's feed should agree, and disagreement is worth a human's attention regardless of cause.

The general lesson from LLM Guardrails and Red-Teaming applies with the volume turned up: the input is untrusted by construction, and here the untrusted party has a financial interest in the output.

6. What a regulator will ask

Once a model influences a regulated activity, model risk management applies, and the questions are the same ones asked of any model the firm relies on.

What does it do and where is that written down? An inventory entry with a stated purpose and scope.

How do you know it works? Evidence, which is why the evaluation set in the second step is not optional. "The vendor's benchmark" is not an answer about your documents.

Who validated it, independently of the people who built it? Separation of development and validation is standard and it applies here.

How would you know if it stopped working? Ongoing monitoring, which for this kind of system means tracking abstention rates, validation failure rates and review-queue volume, because those move before accuracy visibly degrades.

What happens when it is wrong? A defined escalation path and a demonstrated ability to fall back.

Can you reproduce a past decision? This is the one that catches teams. It requires the model version, the prompt, the document and the output all retained together, which has to be designed in and cannot be added afterwards.

The lesson AI Guardrails for Regulated Industries covers the general framework. The specific consequence here is that auditability is a design input, and a system that produces good answers without provenance has failed a requirement that is not about quality.

7. Where the value actually lands

Pulling the cursus together, the applications that survive all four lessons share a shape.

Coverage expansion. Producing consistent, comparable assessments across a universe far larger than analysts can read. The output is a dataset, and its value is breadth rather than depth.

Research throughput. Summarising filings, calls and research so a person reads the relevant ten pages rather than the full two hundred. The human still decides; the model changes what reaches them.

Structured extraction into a store. Turning documents into queryable data with provenance, which then feeds conventional quantitative work that was previously impossible for lack of the inputs.

Document-heavy compliance. Surveillance, obligation tracking, contract review. High volume, checkable answers, and a domain where recall matters more than elegance.

What these share is that the model produces an input to a decision rather than the decision, and that its output is checkable against something other than a return series.

That is the summary of the path. The look-ahead problem makes return-based validation structurally unreliable, so the defensible applications are the ones whose correctness is established some other way, and those turn out to be the ones the technology is best at anyway.

The framing worth keeping: an LLM in a trading firm is best understood as a very fast junior analyst who reads everything, never gets bored, must show their working, and whose conclusions you check. That is a genuinely valuable colleague and not an oracle, and building for the first produces systems that survive audit while building for the second produces demonstrations.

8. The build checklist

RequirementWhy it is not optional
Every value cites a source spanUnverifiable numbers cannot be acted on or audited
Deterministic validation downstreamCatches most errors, cheaply and reproducibly
Abstention over guessingA silent wrong value is worse than a gap
Labelled evaluation set on your documentsThe only evidence not contaminated by look-ahead
Model version and prompt pinned and loggedReproducing a past decision requires the exact artefact
Document content never treated as instructionsThe authors have an interest in how they are read
Human review queue for uncertaintyAlso the best source of new labels
Monitoring on abstention and validation ratesThese move before accuracy visibly degrades

Every row is a consequence of something established earlier: contamination makes return-based evidence unreliable, non-determinism makes reproduction hard, adversarial authorship makes input untrusted, and regulation makes provenance mandatory.

The closing observation is that none of this is exotic engineering. It is provenance, validation, evaluation and monitoring, which is what any serious data pipeline has had for decades.

What the technology changed is the class of input that can enter such a pipeline. Text used to require a person; now it does not. The discipline around what comes out did not change and should not.

Systems that treat the model as one component inside conventional engineering tend to work. Systems built around the model as the product tend to demonstrate well and fail audit.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. Why must every extracted value carry a source span and quote?
    • A number nobody can check cannot be acted on or audited, so an uncited value is an unverifiable assertion
    • It reduces token costs on subsequent queries
    • It prevents the model from being fine-tuned on proprietary data
    • Regulators require quotations in all model outputs
  2. Why can extraction be evaluated without waiting for market outcomes?
    • Because extraction errors are rare enough to ignore
    • Because vendors publish benchmarks on financial documents
    • Because whether a value was correctly pulled from a document does not depend on what happened next
    • Because returns can be simulated from historical data
  3. What makes deterministic validation such an effective guard?
    • It replaces the need for human review entirely
    • It allows a smaller model to be used throughout
    • It reduces the variance of model outputs
    • It sits outside the model and fails loudly and reproducibly, catching a large fraction of errors cheaply
  4. Why is prompt injection a first-class concern in this domain specifically?
    • The documents are written by interested parties who know machines read them, and they arrive through the normal ingestion path
    • Financial models are more susceptible to injection than general ones
    • Regulators mandate acceptance of unfiltered filings
    • Injection is the only way to exceed a model's context window
  5. Which regulatory requirement most often has to be designed in from the start?
    • Independent validation of the model
    • An inventory entry stating purpose and scope
    • Reproducing a past decision, which needs model version, prompt, document and output retained together
    • A defined escalation path for errors

Related lessons

AI
intermediate

What This Teaches About Measuring Anything

The exchange is a case study with transferable rules. A conclusion resting on failures needs a failure taxonomy. Every instance must be verified solvable before anyone is scored against it. Output format is a confound whenever answers get long. And when two explanations fit the same data, the productive move is to find the prediction on which they differ, then test it.

8 steps·~12 min
AI
intermediate

The Rebuttal: Three Ways to Score Zero Without Failing

The response disputed none of the data and argued the experiment measured something other than reasoning. Models had to print move lists exceeding their output limits, and said so in the transcripts. Some instances had no solution and were scored as failures anyway. And asking for a program instead of a move list produced high accuracy on instances reported as total collapse.

8 steps·~12 min
AI
intermediate

The Experiment: Puzzles With a Difficulty Dial

Apple researchers built an evaluation designed to fix a real problem with benchmarks: puzzles where difficulty turns up smoothly while the logic stays identical, and every step can be checked. They found accuracy collapsing to zero past a threshold, and not improving when the solution algorithm was handed to the model. This lesson covers the design and why it was a good one.

8 steps·~12 min
AI
intermediate

Ten Domains, and a Profile That Is Not Flat

The framework scores ten cognitive domains at ten percent each. Running it produces something more useful than the headline totals of 27 percent for GPT-4 and around 57 for GPT-5: a jagged profile, where a model is at or near full marks on some domains and at zero on others. This lesson walks the domains, reads both profiles column by column, and shows what the jaggedness explains.

8 steps·~12 min