Spuerkeess / BCEEFinancial services

Checking the Period, Unit and Source of a Financial Answer

Returning cited financial facts from confirmed context, and using semantic retrieval when the metric is unresolved.

System overviewVisual summary
The same metric, two reporting dates
30 June 202542.7 EUR bnRequested period · rounded
Original half-year report cell showing customer deposits of 42,665,480,544 euros.
31 December 202543.3 EUR bnYear-end disclosure
Original investor presentation excerpt showing client deposits of 43.3 billion euros.

Half-year statements, PDF p. 15 · year-end investor presentation, p. 10. Excerpts from the original reports.

The task we want to support

Consider a financial analyst refreshing a funding briefing’s 30 June 2025 customer-deposits slide. The input is a question plus the required reporting date and scope; the deliverable is one cited figure for a finance reviewer, who opens the source and checks the column, unit and footnotes before circulation.

There is a concrete trap in the public material. The year-end presentation gives customer deposits as EUR 43.3 billion. The midyear figure is about EUR 42.7 billion, shown as EUR 42,665,480,544 in the half-year statements. A search can find a real deposits figure with a genuine citation and still put the December balance into the June briefing. A reviewer must verify what the number refers to as well as whether it appears on the page. Year-end presentation, p. 10 · Half-year statements, PDF p. 15

The lookup should return a reviewable evidence record, or a specific reason to stop. It should not silently substitute December for June, another edition, or a different unit. This independent public-data prototype implements retrieval and validation; briefing integration and its effect on analyst work remain proposed.

Turn the problem into requirements

What can go wrongRequired system behaviour
The same metric occurs in several periods.Require a reporting period and filter candidates before similarity scoring.
A document includes several reporting columns.Store each period’s value as its own fact, linked to the original page.
A ratio uses a different reporting scope.Verify the requested scope against the fact and preserve its basis.
Editions use different units or precision.Keep the published representation and ask which edition to use when eligible figures differ.
The requested fact is absent or unretrieved.Return a reason that distinguishes missing evidence from a retrieval miss.

A source edition and a reporting period are separate fields: the November presentation contains June figures, while the 2025 statements contain 2024 comparative values. A document’s date cannot supply the requested period.

Boundary before lookup — proposed. Treat an external language model’s intent as a draft: validate entity, metric and version IDs against the catalogue, require an explicit period, and confirm scope and requested unit. Ask about unresolved fields instead of guessing. The implemented CLI requires metric and scope and restricts the scope enum; it does not provide this complete validation or infer fields from prose.

Analyse the data before choosing retrieval

The reviewed catalogue contains 24 metric-period facts from three public source editions, covering eight metric IDs, two reporting scopes and four published units. Rows repeat the same metric across reporting periods and source editions. A November publication can describe June; the source date cannot supply the reporting period.

The first implementation already received entity, period, metric and scope from the caller. It scanned compatible rows, then made their availability depend on a vector top-three shortlist. That mixes identity lookup with metric discovery. If the user has confirmed deposits / H12025 / consolidated / investor-h125, similarity adds no information to that exact key.

Request stateAppropriate methodDecision boundary
Metric and context confirmedStructured lookup across all eligible rowsReturn the reviewed fact, missing evidence, or an edition conflict.
Context confirmed, metric unresolvedBM25 or embedding candidate discoverySuggest a metric and its source for confirmation; do not emit a financial answer.
Period or edition ambiguousAsk a specific clarificationNeither semantic similarity nor a reranker can supply the intended reporting context.

The upgrade implements both paths. Natural-language context extraction remains outside this experiment: the caller explicitly supplies period, scope and edition. This prevents a retrieval result from being credited with understanding those fields.

Technical design: route by what is already known

Separate metric discovery from financial fact lookup
Reviewed fact catalogue
  • 24 records · metric, period, scope, unit, edition and source page
  • Approved source versioning and refresh are proposed integration controls.
Request gate
  • Confirm entity, period, scope and edition. Ask about missing context.
  • Is the metric ID already confirmed?

No · Discover a candidate metric

  1. Filter by confirmed contextThe expected metric is unavailable to retrieval.
  2. Compare BM25 and actual embeddingsSame six eligible facts; ranked candidates and gaps stay visible.
  3. Ask for confirmationA similarity score does not authorise a financial claim.

Yes · Use the structured key

  1. Match all supplied fieldsNo model call; no top-k shortlist can hide an eligible fact.
  2. Inspect every compatible claimConflicting values, units or bases trigger source clarification.
  3. Return the cited record for reviewKeep published value, unit, basis, edition and PDF page together.

A known key should bypass semantic ranking

structured_lookup() matches every supplied identity/context field and retains the conservative ambiguity check. Different (value, unit, basis) claims trigger source clarification; rounding does not authorise silently replacing a presentation figure with an exact-euro statement amount. The selected record keeps its PDF page link.

A confirmed metric never depends on a vector shortlistPython16 lines
def structured_lookup(request, facts):
    """Never gate a fully specified key behind a semantic top-k shortlist."""
    if not request.get('period'):
        return {'reason': 'clarify_period', 'evidence': None}
    if not request.get('metric'):
        return {'reason': 'discover_metric', 'evidence': None}
    rows = [f for f in facts if all(f[key] == request[field]
            for field, key in [('entity', 'entity'), ('period', 'period'),
                ('version', 'source'), ('metric', 'metric'), ('scope', 'scope'), ('unit', 'unit')]
            if field in request)]
    claims = {(Decimal(f['value']), f['unit'], f.get('basis', '')) for f in rows}
    if len(claims) > 1:
        return {'reason': 'conflicting_evidence' if request.get('version') else 'clarify_version',
                'evidence': None}
    return {'reason': 'answered' if rows else 'insufficient_evidence',
            'evidence': rows[0] if rows else None}

Replaying all 36 existing explicit requests yields their expected answer-or-stop decisions with zero model calls. These are the existing authored fixtures, not a new independent accuracy estimate. The useful result is architectural: the former shortlist-miss failure is removed from the known-key path.

An unresolved metric is a retrieval problem

For the second path, hold H12025, consolidated scope and the November investor edition constant. Six facts remain. The query’s expected metric is withheld from filtering and inference. BM25 and actual Nomic embeddings receive the same fact descriptions; both return a ranked shortlist. No generated answer, hand-written synonym map or fitted relevance threshold is used.

BM25 uses token-level inverse document frequency and length normalisation (k1=1.2, b=0.75). Nomic uses local 768-dimensional vectors with search_document: / search_query: prefixes and cosine similarity. Reciprocal rank fusion combines the two complete rankings with the fixed constant 60. This is a new experiment, separate from the historical MiniLM run below. Nomic model contract

Same six eligible facts · Metric withheld from retrieval

Candidate methodLiteral · top1Paraphrase · top1Paraphrase · top3
BM256/63/64/6
Nomic embeddings6/65/66/6
Rank fusion6/63/65/6

12 author-written diagnostic queries. Candidate relevance only; these counts do not measure answer correctness or general search accuracy.

Money customers keep with the bank

Reviewed target: deposits

BM25
  1. Total balance sheet sizeh1-assets · 0.000
  2. Net income after taxh1-income · 0.000
  3. Client depositsh1-deposits · 0.000
Nomic embeddings
  1. Client depositsh1-deposits · 0.619
  2. Client loansh1-loans · 0.570
  3. Total balance sheet sizeh1-assets · 0.545
Rank fusion
  1. Total balance sheet sizeh1-assets · 0.032
  2. Client depositsh1-deposits · 0.032
  3. Client loansh1-loans · 0.032

How large is the bank's overall book?

Reviewed target: assets

BM25
  1. Total balance sheet sizeh1-assets · 0.000
  2. Net income after taxh1-income · 0.000
  3. Client depositsh1-deposits · 0.000
Nomic embeddings
  1. Total balance sheet sizeh1-assets · 0.651
  2. Client depositsh1-deposits · 0.582
  3. Client loansh1-loans · 0.557
Rank fusion
  1. Total balance sheet sizeh1-assets · 0.033
  2. Client depositsh1-deposits · 0.032
  3. Client loansh1-loans · 0.031

Interest earned less interest paid

Reviewed target: net_interest_margin

BM25
  1. Net Interest Marginh1-margin · 1.069
  2. Net income after taxh1-income · 0.817
  3. Total balance sheet sizeh1-assets · 0.000
Nomic embeddings
  1. Net income after taxh1-income · 0.607
  2. Net Interest Marginh1-margin · 0.606
  3. Client loansh1-loans · 0.543
Rank fusion
  1. Net income after taxh1-income · 0.033
  2. Net Interest Marginh1-margin · 0.033
  3. Client loansh1-loans · 0.031
Inspect all twelve recorded rankings

D01 · Client deposits
BM25: h1-deposits → h1-loans → h1-assets. Nomic embeddings: h1-deposits → h1-loans → h1-fees. Rank fusion: h1-deposits → h1-loans → h1-assets.

D02 · Total balance sheet size
BM25: h1-assets → h1-income → h1-deposits. Nomic embeddings: h1-assets → h1-margin → h1-deposits. Rank fusion: h1-assets → h1-income → h1-deposits.

D03 · Net income after tax
BM25: h1-income → h1-margin → h1-fees. Nomic embeddings: h1-income → h1-fees → h1-margin. Rank fusion: h1-income → h1-margin → h1-fees.

D04 · Client loans
BM25: h1-loans → h1-deposits → h1-assets. Nomic embeddings: h1-loans → h1-deposits → h1-fees. Rank fusion: h1-loans → h1-deposits → h1-assets.

D05 · Net interest margin
BM25: h1-margin → h1-income → h1-fees. Nomic embeddings: h1-margin → h1-income → h1-fees. Rank fusion: h1-margin → h1-income → h1-fees.

D06 · Net fees and commissions
BM25: h1-fees → h1-margin → h1-income. Nomic embeddings: h1-fees → h1-margin → h1-income. Rank fusion: h1-fees → h1-margin → h1-income.

D07 · Money customers keep with the bank
BM25: h1-assets → h1-income → h1-deposits. Nomic embeddings: h1-deposits → h1-loans → h1-assets. Rank fusion: h1-assets → h1-deposits → h1-loans.

D08 · How large is the bank's overall book?
BM25: h1-assets → h1-income → h1-deposits. Nomic embeddings: h1-assets → h1-deposits → h1-loans. Rank fusion: h1-assets → h1-deposits → h1-loans.

D09 · The bottom line left for shareholders after taxation
BM25: h1-income → h1-assets → h1-deposits. Nomic embeddings: h1-income → h1-assets → h1-deposits. Rank fusion: h1-income → h1-assets → h1-deposits.

D10 · Money the bank has lent to its customers
BM25: h1-assets → h1-income → h1-deposits. Nomic embeddings: h1-loans → h1-deposits → h1-margin. Rank fusion: h1-loans → h1-deposits → h1-assets.

D11 · Interest earned less interest paid
BM25: h1-margin → h1-income → h1-assets. Nomic embeddings: h1-income → h1-margin → h1-loans. Rank fusion: h1-income → h1-margin → h1-loans.

D12 · Earnings from charging for services rather than lending
BM25: h1-assets → h1-income → h1-deposits. Nomic embeddings: h1-fees → h1-loans → h1-deposits. Rank fusion: h1-income → h1-loans → h1-deposits.

The literal-label questions are easy for every method. On six author-written paraphrases, dense retrieval places the reviewed metric first in five cases versus three for BM25. Fusion drops back to three: combining a weak lexical ranking with a stronger semantic ranking can demote the right candidate. Keep Nomic as the candidate-discovery option in this bounded sample; do not add fusion or a reranker without a specific failure they improve.

The remaining dense top-one error stays visible. A top-three shortlist can contain the right metric without identifying which row the analyst meant. Similarity is relevance, not confidence that a financial claim is correct.

How the reference cases inform the design

DoorDash

Define identity through attributes

Period and scope distinguish similarly named financial facts. The adaptation is an explicit schema with field-level checks, prepared manually here. Automated extraction would still need source review.

Read the engineering case

Airbnb and Faire

Let failures guide the next change

Separate wrong-period retrieval, field mismatch and shortlist omission before choosing a remedy. The trace makes those failures inspectable. The upgrade follows Faire’s candidate-coverage reasoning: first identify whether a relevant item enters the shortlist, then decide whether ranking needs more machinery. The actual BM25/dense/fusion comparison above is the local adaptation; their production metrics are not transferred. Faire retrieval engineering

Read the engineering case

Follow one request through the two paths

  1. Confirm context. The analyst selects the reporting period, scope and source edition. Missing or conflicting context stops the lookup.
  2. Discover only when needed. “Money customers keep with the bank” receives metric candidates from the semantic path. The analyst confirms deposits; this experiment does not infer acceptance from the score.
  3. Fetch the complete fact. The structured path resolves the confirmed key and preserves value, unit, basis and source page. A different edition or unit remains a separate claim.
  4. Review before circulation. The reviewer opens the source and checks the column and footnotes. Deployment would additionally need source approval and availability controls.

The November deck’s historical URL is currently unavailable. New retrieval recordings use the existing manually reviewed catalogue; they do not establish fresh source availability. A briefing integration should hold publication for source reapproval instead of replacing the unavailable edition with a convenient alternative.

Earlier MiniLM development walkthrough and shortlist failure

This historical run compares unfiltered vectors with filters and field checks. It receives the metric ID in advance. Its rephrasing failure motivated the new deterministic known-key path above; it is not a head-to-head Nomic/MiniLM model comparison.

What the comparison changes

Use structure when identity is known. Financial context is not a semantic similarity problem. Exact filtering is simpler, cheaper and easier to explain than ranking a confirmed metric.

Use semantics for vocabulary gaps. The embedding model contributes where an analyst’s wording differs from a published label. That result supports a candidate picker, with a human confirmation step before exact lookup.

Measure candidate coverage before ranking complexity. A reranker cannot recover an absent candidate. In this small six-row pool, widening a shortlist or confirming the metric is more defensible than adding another model.

Keep the experiment boundary visible. Twelve authored queries over one small period/edition slice do not establish generalisation, analyst time savings, automated extraction or a natural-language intent parser. The old MiniLM recording and the new discovery comparison use different tasks and must not be compared as model accuracy numbers.

New comparison: exact inputs, recorded vectors and offline replay

The download includes discovery/compare.py, twelve frozen queries and complete local embedding requests/responses, model digest, runtime version and code/input hashes. Run python3 discovery/compare.py --verify from the extracted experiment directory to recompute rankings and structured decisions without a model service. --run explicitly invokes a cached local Nomic model. Site preparation never calls a model.

Download the implementation and both experiment records
Validation evidence and reproduction

The small experiment checks whether the proposed rules address the failure modes. Sixteen questions were set aside from 20 development questions, using the same source documents.

Design changes and their observed effect
Retrieval pathJointly correct on 11 supported questions
Unfiltered vector top one6/11
Metadata filters, then vector top one10/11
Filters and candidate checks11/11

Joint correctness requires the period, value, unit, context and source page to agree with the label. The checked path also handled five missing or ambiguous requests. One assets question required rejecting equity at rank one and accepting assets at rank two. The separate rephrasing probe in the walkthrough documents an unresolved retrieval failure.

These results assume manually reviewed facts and supplied intent fields. They do not validate automated extraction, intent parsing, edition updates or analyst time savings.

The June benchmark uses the November investor deck, whose historical link is currently unavailable. The opening image instead shows the accessible half-year statements’ full euro amount; that amount is not a row in this benchmark. A proposed publication workflow would hold the briefing for source reapproval rather than silently substitute that PDF. Recorded results retain their original IDs and units.

Run the June request using the fields above with --ask and --trace. The download also includes this exact-euro annual-assets probe:

Shell4 lines
python benchmark.py --model-dir .model \
  --ask "What were total assets at 31 December 2025 in the English consolidated financial statements?" \
  --period FY2025 --metric assets --scope consolidated \
  --version statements-fy25-en --unit EUR --trace