A Good Point Estimate Can Still Produce a Bad Surface

An option chain is often presented as a table: spot, strike, time to expiration, market variables, and price. That representation makes it tempting to shuffle the rows and train a standard regression model.

The model may achieve a low average pricing error while missing the structure connecting the observations.

Options quoted on the same day are not independent samples. Together, their strikes and maturities reveal the market’s volatility smile, skew, and term structure. Predicting each row in isolation discards this context. It can also generate a set of individually plausible prices that becomes inconsistent when assembled into a surface.

This project began with a different objective: learn a pricing function whose derivatives remain economically meaningful, then extend it with a representation of the complete daily surface.

Preserving Time and Market Context

The data pipeline draws option-chain observations and volatility-surface records from WRDS. Each contract is joined with the underlying price and broader state variables, including:

  • VIX

  • SOFR

  • Historical volatility over several windows

  • Interest rates

  • Dividend yield

Contracts with unusable quotes are removed before training. The downloader filters for European-style options, positive implied volatility, meaningful bids, and nontrivial volume. Prices, strikes, expirations, and market variables are then transformed into a consistent model input.

A simplified representation of the pricing function is:

C(S,K,T,z)=Kfθ(SK,T,z)C(S,K,T,z)=K\,f_\theta\left(\frac{S}{K},T,z\right)

Here:

  • SS is the underlying price.

  • KK is the strike.

  • TT is time to expiration.

  • zz represents the prevailing volatility and macroeconomic environment.

Expressing price relative to strike and using moneyness, S/KS/K, gives the network a more stable coordinate system.

Splitting by Date

The training, validation, and test sets are separated by date rather than by randomly shuffled rows. Earlier dates train the model, while later dates evaluate it.

This prevents contracts from the same market session from leaking across folds and produces a test that more closely resembles actual deployment.

From a Differentiable Baseline to a Surface Transformer

The public repository contains the project’s differentiable neural-pricing core. Its baseline is a compact multilayer network with smooth activations and a positive output.

Because the pricing function is differentiable with respect to spot, strike, time, and volatility, its risk sensitivities can be calculated directly through automatic differentiation:

Δ=CS\Delta=\frac{\partial C}{\partial S}
Γ=2CS2\Gamma=\frac{\partial^2 C}{\partial S^2}
Θ=CT\Theta=-\frac{\partial C}{\partial T}
Vega=Cσ\text{Vega}=\frac{\partial C}{\partial \sigma}

These are derivatives of the learned pricing function itself—not values produced by a separate lookup table or secondary model.

Adding Date-Level Context

The next iteration introduces date-grouped learning.

Instead of pricing an option using only that contract’s features, a Transformer encoder first observes a collection of contracts and market variables from the same date. It compresses them into a learned surface-state vector.

A query head then combines that state with the target contract’s strike, maturity, and other characteristics.

The resulting pipeline is:

  1. Group observations by date
    Collect strikes, maturities, prices, and market variables from the same session.

  2. Create surface tokens
    Represent each observed contract as an input token.

  3. Encode cross-contract relationships
    Use attention to learn relationships across strike and tenor.

  4. Generate a surface state
    Compress the daily market regime into a shared latent representation.

  5. Price a requested contract
    Fuse the surface state with the query features to produce price and Greeks.

This separation is particularly useful when quotes are sparse. The context encoder learns what the market looks like on a given date, while the query network learns where a requested option sits within that market.

Accuracy Is Only One Part of the Loss

A pricing model is not ready for risk management simply because its mean squared error is small. The predicted function must also satisfy basic economic shape conditions.

The training objective therefore combines a robust price loss with penalties derived from option-pricing relationships:

L=Lprice+λarb(Lbounds+LΔ+LΓ+LΘ+Lvega)\mathcal{L} = \mathcal{L}_{\text{price}} + \lambda_{\text{arb}} \left( \mathcal{L}_{\text{bounds}} + \mathcal{L}_{\Delta} + \mathcal{L}_{\Gamma} + \mathcal{L}_{\Theta} + \mathcal{L}_{\text{vega}} \right)

The model is penalized when:

  • A call price becomes negative.

  • A call costs more than the underlying asset.

  • Delta falls outside its economically valid range.

  • Gamma becomes negative.

  • Strike derivatives violate monotonicity or convexity.

  • Theta becomes implausibly positive or excessively negative.

  • Vega becomes negative where it is included in training.

These are soft constraints. Violations increase the loss instead of being repaired after prediction, allowing the model to balance pricing accuracy and economic shape during optimization.

This approach does not mathematically eliminate every possible form of static arbitrage. It does, however, give the network a strong economic inductive bias and make violations directly measurable.

Testing Prices, Surfaces, and Derivatives

The out-of-sample evaluation covered approximately 13,700 options from dates not used to fit the model.

Performance was measured at several levels:

MetricResultOut-of-sample price R2R^2 0.9997 Overall test price MAPE 7.45% Successful implied-volatility inversions 9,152 / 9,152 Upper-price constraint penalty Approximately zero

The absolute pricing error becomes very small for deep out-of-the-money options. Percentage errors are less forgiving in this region because the denominator—the option price—is close to zero.

For that reason, MAPE should be considered alongside absolute error and the distribution of errors across moneyness.

Greeks as an Independent Diagnostic

The autograd Greeks were compared with point-implied Black–Scholes sensitivities:

GreekTest R2R^2 Delta 0.91 Theta 0.85 Gamma 0.79

These results are encouraging because the Greeks are derivatives of the learned pricing function rather than separately fitted outputs.

Black–Scholes is used here as a diagnostic, not as unquestionable ground truth. Its point-implied Greeks inherit the assumptions of the model, while the neural network learns from a changing market surface.

Agreement indicates that the learned local sensitivities are sensible. Disagreement can reveal either model error or genuine surface effects that a constant-volatility calculation cannot represent.

Recovering Implied Volatility

Predicted option prices are inverted through a bounded root solver to recover implied volatility.

The resulting values can be plotted over strike—or delta—and time to expiration. The repository’s comparison pipeline produces three useful views:

  1. The observed WRDS market surface

  2. The model-implied surface

  3. The model-minus-market error surface

This makes it possible to locate regions where the model performs well and where its fit deteriorates across moneyness and tenor.

The Surface Should Be Treated as the Object

The central lesson from this work is not that a Transformer automatically solves option pricing. It is that the structure of the learning problem matters as much as the model class.

A random row split answers the wrong question. A scalar price loss ignores the geometry of the function being learned. A model that cannot be differentiated smoothly may predict prices but still be unsuitable for hedging.

Conversely, a modest architecture with the correct normalization, temporal split, derivative structure, and economic penalties can form a strong baseline.

Practical principle: An option is not an isolated tabular observation. It is a coordinate on a surface shaped by every other strike, maturity, and market-state variable observed at the same time.

Toward Production Surface Reconstruction

The next stage is to evaluate the model across a broader range of volatility regimes and underlying assets.

Further work includes:

  • Stronger calendar-arbitrage controls

  • Stronger butterfly-arbitrage controls

  • Joint call-and-put modeling

  • More explicit dividend treatment

  • Uncertainty estimates for sparse areas of the chain

  • Testing across additional underlyings and market regimes

  • Scaling the date-level context encoder for intraday updates

The longer-term objective is an intraday reconstruction engine that can ingest an incomplete option chain, infer a coherent surface state, price missing contracts, and expose stable Greeks for scenario analysis.

Most importantly, the engine should make its constraint violations visible instead of hiding them behind a single headline accuracy metric.


Project Sources