Large Language Models in Finance · Chapter 5 / Lecture 5 · Practical

LLMs for Business Valuation

Hands-on: auditing an LLM's 10-K extraction, chain-of-thought forecasting, and a Monte Carlo DCF.
Juan F. Imbet  ·  EDHEC Business School / Paris Dauphine – PSL University
Session overview · 1 hour

What this hour looks like

A working session: you audit machine-read financials, design a forecasting prompt, and run a valuation simulation — then we walk the solutions.

  1. Recap (5 min) — FCFF, the DCF equation, error propagation, evaluation metrics
  2. Problem 1 (15 min) — audit an LLM's 10-K extraction; propagate the error into the DCF
  3. Problem 2 (10 min) — design a chain-of-thought forecasting prompt
  1. Case study (20 min) — run a Monte Carlo DCF; test sensitivity to WACC and \(g\)
  2. Discussion (5 min) — when is the DCF unreliable, and how do you report uncertainty?
  3. Solutions (5 min) — walkthrough of Problems 1 and 2
what you will practise Auditing LLM-extracted financials and propagating extraction error; structuring a CoT forecasting prompt; parameterising and reading a Monte Carlo DCF — reasoning about how model error, not the formula, drives valuation uncertainty.
01

Recap: the machinery you will use

Free cash flow, discounting, why a small growth error becomes a big valuation error.
Recap · the valuation engine

From cash flow to firm value, in two steps

A valuation is just two ideas: figure out the cash the business throws off each year, then add up that cash in today's money.

Free cash flow to the firm
Operating profit after tax, plus the non-cash depreciation charge, minus what you reinvest in equipment and working capital.
Enterprise value
Each future year's cash, shrunk back to today by the cost of capital, plus a "terminal value" for everything past the forecast horizon.
Recap · the dangerous knob

A tiny growth error is a huge valuation error

The terminal value divides by the gap between the discount rate and the growth rate. When that gap is small, nudging the growth rate even slightly swings the whole valuation.

the number to remember At WACC = 9% and \(g\) = 3%, a 100-basis-point error in \(g\) produces a 15–18% error in enterprise value.
Recap · how to forecast and how to grade it

Make the model narrate before it numbers

A good forecasting prompt forces four stages of reasoning before any number appears — so the logic is visible and checkable.

CoT four-stage structure (Wei et al., 2022)
  1. Macro — rates, GDP, inflation
  2. Industry — drivers, headwinds, competition
  3. Firm — position, CapEx plans, margins from MD&A
  4. Synthesis — point estimate + P10 downside + P90 upside per year
MetricMeasures
MAPEMagnitude accuracy
RMSESensitivity to outliers
DADirection for decisions

Always compare against a random-walk baseline and analyst consensus (Zhang et al., 2024).

02

Problem 1: audit the machine's extraction

One field is wrong. Find it, fix it, and watch the valuation break.
Problem 1 · 15 min

The LLM read a 10-K — but one field is mis-extracted

You pointed an extraction model at a mid-cap industrial's FY2023 10-K. It returned this JSON (USD millions). A classic failure hides inside: it copied CapEx from the cash-flow statement without the parenthesis that marks an outflow, and flattened a footnote.

FieldValue
Revenue2,850
EBIT428
Depreciation & Amortisation195
Capital Expenditure240
NWC (FY2023)380
FieldValue
NWC (FY2022)315
Income Tax Expense85
EBT (Earnings Before Tax)368
Interest Expense60
Net New Borrowing+40
the point This exercise is about the extraction, not the arithmetic. Your tasks are on the next slide.
Problem 1 · your tasks

Catch the bad field, then price the damage

The extraction figures are on the previous slide. Work through four tasks:

  1. Audit the extraction. Which textual features of a 10-K make CapEx, parenthesised negatives, or footnoted figures error-prone for an LLM? Name the automated check (e.g. a sign/units cross-check against the cash-flow statement) you would add to catch it.
  2. Compute FCFF. Using the audited figures, compute FCFF with the effective tax rate (infer it from income tax / EBT). This \(\text{FCFF}_0\) feeds the case study.
  3. Propagate the error. Recompute the DCF enterprise value (WACC = 10%, 5-yr growth = 6%, terminal growth = 2.5%) with the mis-extracted CapEx vs. the corrected value. How big a valuation error does one bad field cause?
  4. State a rule. At what extraction-confidence level would you block an automated valuation from reaching a portfolio manager without human review?
03

Problem 2: design the forecasting prompt

Turn a paragraph of MD&A guidance into structured, checkable reasoning.
Problem 2 · 10 min

Build a CoT forecasting prompt from MD&A guidance

You are building a valuation agent for the same industrial company. Its MD&A states:

From the MD&A
"We expect continued demand in our infrastructure segment driven by public investment in grid modernisation. However, supply chain bottlenecks in copper and steel may compress margins in the near term. We are targeting a 200-basis-point EBIT margin improvement over three years through operational efficiency programs. CapEx will remain elevated at 8–9% of revenue as we expand two manufacturing facilities."

Your tasks:

  1. Write the four-stage CoT reasoning (macro → industry → firm → synthesis) a well-designed prompt should elicit.
  2. Identify at least one potential internal inconsistency in the guidance that a consistency-checking step should flag.
  3. Specify the JSON output format for Year 1–3 FCF forecasts (base, upside, downside, justification).
04

Case study: the Monte Carlo DCF

Don't pick one growth rate — draw thousands, and read the spread.
Case study · motivation

What the sensitivity surface looks like

Before drawing thousands of WACC and growth combinations, look at the sensitivity heatmap for a real company — it shows exactly why the distribution shape matters.

DCF sensitivity heatmap: WACC × terminal growth → enterprise value for AAPL
Figure. DCF terminal-value sensitivity heatmap for Apple Inc. (AAPL). Each cell shows the implied enterprise value in $B from the Gordon Growth formula, evaluated at AAPL's FY2024 free cash flow. Near the lower-right corner (low WACC, high growth) the denominator \(\text{WACC} - g\) approaches zero and enterprise value swings sharply — exactly the regime your Monte Carlo must handle by clipping \(g < \text{WACC}\). Source: Generated deterministically from AAPL FY2024 10-K via gen_dcf_sensitivity.py; WACC ∈ [6%, 14%], g ∈ [1%, 4%].
Case study · 20 min · setup

Replace point estimates with a distribution

Instead of guessing a single WACC and growth rate, you draw thousands of plausible combinations and watch the whole range of enterprise values that results. The base cash flow is your \(\text{FCFF}_0\) from Problem 1.

Parameters (mean ± std dev)
ParameterMeanStd
WACC10%1.5%
Explicit growth / yr6%3%
Terminal growth2.5%1%
Simulation spec
  • \(M = 5{,}000\) draws; 5-year explicit horizon; seed = 42
  • Clip terminal growth so \(g_{\text{terminal}} < \text{WACC} - 0.5\%\)
  • Report mean, median, std, P10, P25, P75, P90 of the EV distribution
why clip the growth rate If a draw lets growth meet or exceed WACC, the terminal value blows up to infinity. Clipping keeps every simulated valuation finite and economically sane — as visible in the lower-right corner of the heatmap above.
Case study · step 1 (1/2)

Draw the parameters

First, sample the uncertain inputs and clip terminal growth safely below the discount rate.

import numpy as np

def monte_carlo_dcf(fcff0, g_exp_mean, g_exp_std, wacc_mean, wacc_std,
                    g_term_mean, g_term_std, n=5, M=5000, seed=42):
    rng = np.random.default_rng(seed)
    wacc   = rng.normal(wacc_mean,   wacc_std,   M)
    g_term = rng.normal(g_term_mean, g_term_std, M)
    g_exp  = rng.normal(g_exp_mean,  g_exp_std,  (M, n))

    # Clip terminal growth below WACC -> finite Gordon value
    g_term = np.minimum(g_term, wacc - 0.005)

Each draw is one possible future. The valuation loop follows on the next slide.

Case study · step 1 (2/2)

Value each draw, collect the distribution

For every draw, grow the cash flows, discount them, add a terminal value, and store the enterprise value.

    ev = np.zeros(M)
    for m in range(M):
        fcfs = [fcff0]
        for t in range(n):
            fcfs.append(fcfs[-1] * (1 + g_exp[m, t]))
        pv_fcf = sum(fcfs[t]/(1+wacc[m])**t for t in range(1, n+1))
        tv = fcfs[n]*(1+g_term[m])/(wacc[m]-g_term[m])
        ev[m] = pv_fcf + tv/(1+wacc[m])**n
    return ev

# Use FCFF0 from Problem 1
ev_sim = monte_carlo_dcf(fcff0=???, ...)
do this first Fill in fcff0 with your audited \(\text{FCFF}_0\) from Problem 1 — a wrong extraction here poisons all 5,000 valuations.
Case study · diagnostics

Three questions to interrogate your output

  1. Question A — where does the uncertainty come from? Compare the P10 and P90 enterprise values. What fraction of total EV uncertainty is terminal-value uncertainty vs. explicit-period FCF uncertainty? (Hint: re-run with \(\sigma_g = 0\) to isolate the explicit period.)
  2. Question B — how sensitive is the headline number? At what terminal growth rate \(g\) does the median EV roughly double relative to the Problem 1 base case? (Hint: solve \(TV \propto 1/(\text{WACC}-g)\) for the target \(g\).)
  3. Question C — does the market agree? A competitor is acquired at 12× EV/EBITDA. With EBITDA = EBIT + DA = $623M, does the comparables EV fall inside the Monte Carlo P10–P90 range? What does the gap (or its absence) say about pricing?
Case study · record your results

Fill in this table

StatisticValue (USD M)
Mean EV?
Median EV?
Std Dev?
P10 (bear)?
P25?
P75?
P90 (bull)?
DerivedValue
P90 − P10 range?
P90 / P10 ratio?
Comparables EV (12× EBITDA)?
interpret Is the DCF estimate consistent with the comparables estimate? What does a P90/P10 ratio > 2 suggest about this valuation?
05

Discussion: communicating uncertainty

When the number is fragile, how do you say so honestly?
Discussion · 5 min · in pairs

When is the DCF unreliable, and how do you report it?

When is the estimate unreliable?
  • When \(g \approx \text{WACC}\) — the terminal denominator approaches zero
  • When FCF is negative or volatile (e.g. early-stage biotech)
  • When the horizon is short, so terminal value dominates
How to report it to a client
  • Point estimate only? Never — why not?
  • Point estimate + range (P10–P90)?
  • Full distribution histogram?
  • Bull/base/bear narrative + Monte Carlo range?
governance question (FSB, 2023) You run this pipeline on 200 companies daily. What human-in-the-loop checkpoint(s) would you add, and at what threshold? (Consider P90/P10 ratio, FCFF extraction confidence, and number of non-recurring items flagged.)
06

Solutions

Walkthrough of Problems 1 and 2 — including the number that breaks.
Solutions · Problem 1

One dropped sign, a 3.2× overstatement

  1. The audit. CapEx, parenthesised negatives, and footnoted figures are the classic LLM extraction traps — the model drops the sign/parenthesis or flattens a note. Fix: a verification sub-agent that cross-checks each figure's sign and units against the cash-flow statement and flags disagreements.
  2. FCFF (corrected, CapEx as outflow). Effective tax rate \(\tau = 85/368 = 23.1\%\); \(\Delta\text{NWC}=65\), giving \(\text{FCFF}_0 = \mathbf{219.3}\) M.
  3. Propagated error. If the LLM treats CapEx as \(+240\) (sign dropped), FCFF jumps to 699.3 M — a 3.2× overstatement that flows straight into the DCF (corrected EV ≈ 3,672 M vs. a grossly inflated figure). A single mis-extracted field, not the discounting, breaks the valuation.
  4. The rule. Block any automated valuation whose extraction confidence is below threshold (or whose sign-check fails) from reaching a portfolio manager without human review.
Solutions · Problem 2

The firm-stage reasoning — and the tension to flag

Stage 3 (firm-specific) key points
  • + grid modernisation tailwind supports infrastructure revenue
  • copper/steel bottlenecks compress near-term margins
  • + 200-bps margin improvement target over 3 years
  • CapEx at 8–9% of revenue is elevated, limiting FCF conversion
inconsistency to flag A "200-bps EBIT margin improvement" promised while "CapEx stays elevated at 8–9% to expand facilities." Margin gains are more plausible once the expansion phase ends. If the improvement is claimed during the high-CapEx period, a consistency-checking agent should flag the tension for clarification.
Wrap-up

Five things to carry out of this session

  1. FCFF is not a field in any filing. It is derived from EBIT, DA, CapEx, \(\Delta\)NWC, and the effective tax rate. Each input can carry LLM extraction error, and errors propagate multiplicatively.
  2. CoT separates narrative from number. Force the model to commit to a macro/industry/firm story before generating numbers — inconsistencies become detectable (Wei et al., 2022).
  3. Terminal growth dominates the uncertainty. A 100-bps error in \(g\) yields a 15–18% EV error. Report Monte Carlo percentile ranges, not just point estimates.
  4. Comparables and DCF are complements. A large gap signals either mispricing or a flawed assumption — investigate, don't average.
  5. Production pipelines need hallucination guards. Validate every ticker; trace every figure to a specific accession number. One hallucinated comparable can distort the whole multiple analysis.
A

Appendix — stretch problem

For students who finish early: decompose where the valuation variance actually comes from.
Appendix · stretch problem

Decompose the EV variance, then check the theory

The LLM forecasts the explicit growth path (Problem 2's CoT step), so its forecast error is the uncertainty the model injects. How much of the valuation spread does that error explain?

Tasks
  1. Re-run the simulation three times, each freezing two of the three inputs (WACC, explicit growth, terminal growth) at their mean and letting one vary.
  2. Record \(\mathrm{Var}(EV)\) for each single-input run; express each as a fraction of the all-inputs-varying variance.
  3. Predict, then check: which input dominates?
expected finding Terminal-growth uncertainty should dominate, consistent with the 15–18% EV error per 100-bps \(g\) shock. The decomposition makes the analytic sensitivity tangible.