Skip to content

Add AADC driver for automatic training label generation - #1

Open
mar20tinha-dot wants to merge 1 commit into
diff-ml-with-a-difference:mainfrom
mar20tinha-dot:aadc-driver
Open

Add AADC driver for automatic training label generation#1
mar20tinha-dot wants to merge 1 commit into
diff-ml-with-a-difference:mainfrom
mar20tinha-dot:aadc-driver

Conversation

@mar20tinha-dot

Copy link
Copy Markdown

Summary

Adds an AADC (Automatic Adjoint Differentiation) driver that generates DiffML training labels (prices + pathwise derivatives) automatically, without manual derivative formulas.

Results

Test Result
BS European call AADC = manual pathwise (error < 1e-15)
Heston call (50-step) Delta AAD/FD = 0.9997, Vega AAD/FD = 1.0004
Heston + barrier Pathwise biased at barrier (confirms LRM is needed)
Basket d=20 25x speedup (20 deltas in 1 pass vs 40 FD bumps)
Heston label generation 3-4x speedup vs FD

Key points

  • Smooth payoffs: AADC gives exact pathwise derivatives automatically. No manual formulas.
  • Complex models: Heston stochastic vol — delta + vega from ONE reverse pass. Manual: need coupled SDE chain rule.
  • Multi-asset: N deltas in one pass, independent of dimension. Scales linearly.
  • Barriers: Honest — pathwise through indicator is biased (your LRM contribution solves this). AADC doesn't change that.
  • Speed: Label generation 3-4x faster than FD for Heston. 25x for d=20 basket.

File

src/driver_diffml_aadc.py — self-contained, 5 tests + benchmarks.

Requires: AADC Python package.

Demonstrates AADC (automatic adjoint differentiation) for generating
DiffML training labels (prices + pathwise derivatives) automatically.

Results on 5 tests:
- BS European: exact match with manual pathwise (error < 1e-15)
- Heston call: delta AAD/FD = 0.9997, vega AAD/FD = 1.0004
  One reverse pass gives both. No manual chain rule derivation.
- Heston + barrier: honest assessment — pathwise biased at barrier
  (confirms Glasserman's point about LRM being needed)
- Basket d=20: 25x speedup (20 deltas in one pass vs 40 FD bumps)
- Label generation: 3-4x speedup vs FD for Heston 50-step

AADC value: generate exact derivatives for arbitrary models
without manual formulas. Scales to stochastic vol, multi-asset,
path-dependent — record simulation on tape, one reverse pass.

Requires: aadc (https://matlogica.com/aadc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant