Overfitting & Regularization
Overfitting is when a model learns the noise in its training data instead of the underlying signal, so it scores well in-sample but fails out-of-sample. Regularization is the family of techniques that deliberately constrain a model's flexibility to prevent that — accepting slightly worse fit on the training set in exchange for better generalization. In markets the stakes are unusually high: financial data has a low signal-to-noise ratio, is non-stationary, and is cheap to test against millions of times, so overfitting is not an edge case but the default outcome. The core tension is the bias-variance tradeoff — too little flexibility underfits (high bias, misses real structure); too much overfits (high variance, memorizes noise). The goal is the minimum of total error, not the best training score.
The mechanism: bias, variance, and noise
Expected prediction error decomposes into three parts: bias² (error from an over-simple model that can't represent the true relationship), variance (error from a model so flexible it changes wildly with each new sample of data), and irreducible noise (the part no model can remove). Adding capacity — more features, deeper trees, more neurons, more training epochs — lowers bias but raises variance. Regularization moves a model back down the variance curve. The telltale signature of overfitting is a widening gap between training error (which keeps falling) and validation error (which bottoms out, then rises). In finance the irreducible-noise term dominates, so the "true signal" a model can legitimately extract is small, and the room to accidentally fit noise is enormous.
Regularization techniques
- L2 / Ridge — adds a penalty proportional to the sum of squared weights (λ·Σwᵢ²). Shrinks all coefficients toward zero without eliminating them; best with many correlated features. λ controls strength (λ=0 is no regularization).
- L1 / Lasso — penalty proportional to the sum of absolute weights (λ·Σ|wᵢ|). Drives some weights exactly to zero, performing automatic feature selection; useful when many features are irrelevant. Elastic Net blends L1 and L2.
- Dropout (neural nets) — randomly deactivates a fraction of neurons each training step, forcing redundant, distributed representations.
- Early stopping — halt training when validation error stops improving, even if training error keeps falling. Effectively limits how far the model travels into the overfit zone.
- Tree constraints — max depth, min samples per leaf, and ensembling (random forests, gradient boosting with shrinkage/subsampling) bound variance.
- Reducing model capacity / feature count — the simplest regularizer: fewer parameters relative to the number of genuinely independent observations.
The hyperparameter (λ, dropout rate, depth) is itself tuned on validation data — which, crucially, must be a clean validation set, or you simply overfit the regularizer.
How it's used in practice
In quant work, regularization is only half the defense; the larger problem is selection (backtest) overfitting — searching across thousands of strategy variants, features, or hyperparameters and reporting the best one. That winner is partly luck. The practitioner's toolkit:
- Out-of-sample / walk-forward testing — train on a window, test on the next unseen window, roll forward. Standard but criticized as a single path that is itself easy to overfit through repeated tuning.
- Purged k-fold cross-validation (López de Prado, Advances in Financial Machine Learning, 2018) — standard k-fold leaks in finance because labels overlap in time (e.g. a label built from forward returns shares data with neighboring observations). Purging removes training samples whose label window overlaps the test fold; an embargo drops a buffer of observations immediately after each test fold to block leakage from autocorrelation.
- Combinatorial Purged CV (CPCV) — generates many train/test path combinations, yielding a distribution of out-of-sample performance rather than one point estimate.
- Multiple-testing corrections — the Deflated Sharpe Ratio (Bailey & López de Prado, 2014) discounts a reported Sharpe for the number of trials run and for non-normal returns; the Probability of Backtest Overfitting (PBO) estimates how often the in-sample-best strategy underperforms the median out-of-sample. Campbell Harvey argues most published factor "discoveries" need much higher significance hurdles because of the multiple-testing problem.
Standing & evidence
The concepts (bias-variance, L1/L2) are textbook-settled in ML and not contested. What is specific and well-evidenced in finance is how brutally easy backtest overfitting is. Bailey, Borwein, López de Prado & Zhu (the "Pseudo-Mathematics and Financial Charlatanism" line of work) give a concrete, repeatedly-cited illustration: with only five years of daily data, trying no more than about 45 strategy variations is enough to find one whose in-sample Sharpe is likely to be 1.0 or greater purely by chance, even when its true Sharpe is zero — and the threshold falls as the sample gets shorter (only a handful of trials suffice on a 2-year sample). This is a mathematical result, not folklore: the optimal in-sample Sharpe is right-unbounded in the number of trials, so with enough trials no Sharpe is large enough to reject the "false strategy" null. Comparative studies (e.g. a 2024 ScienceDirect comparison of out-of-sample testing methods) report CPCV producing lower PBO and higher deflated Sharpe than plain walk-forward or single hold-out in controlled synthetic tests. The genuine debate is operational, not conceptual: CPCV is computationally heavy and assumes you can define non-overlapping label windows cleanly, and some practitioners argue walk-forward better preserves the true temporal ordering a live strategy faces. There is no dispute that regularization plus rigorous, leakage-free validation is necessary; there is dispute about which validation scheme is best.
Strengths & limitations
Regularization reliably improves generalization when the problem is genuine variance (a flexible model, limited data). It works because it encodes a prior that simpler explanations generalize better. When it fails: (1) regularization cannot fix a non-stationary regime — a model perfectly validated on 2015–2019 can still break in 2020 because the data-generating process changed, not because it overfit; (2) it cannot undo selection bias from running hundreds of experiments — that needs deflated metrics, not a bigger λ; (3) tuning λ on data you also test on just relocates the overfitting. The single most common misuse is data leakage masquerading as a clean backtest — using standard cross-validation on overlapping financial labels, scaling/feature-engineering before the train/test split, or peeking at the test set during feature selection — which makes an overfit model look validated. A model that generalizes within a sample can still fail forward; the only true test is genuinely unseen, future data.
System relevance
This is a methodology node, not an indicator. Its bearing on Delvantic is a discipline constraint: any ML- or rule-derived signal that feeds the Augustus trade-setup agent should be treated as suspect until it survives leakage-free, multiple-testing-aware validation, and its live track record (via Cairn) is the real out-of-sample test that supersedes any backtest. A strong backtested Sharpe is weak evidence in proportion to how many variants were tried to find it. Cross-link: sibling nodes on feature engineering, walk-forward/cross-validation, and the regime engine (which addresses the non-stationarity that regularization alone cannot).
Sources
- M. López de Prado, Advances in Financial Machine Learning (Wiley, 2018) — purged k-fold CV, embargo, CPCV. Summary via Wikipedia, "Purged cross-validation."
- D. Bailey, J. Borwein, M. López de Prado, Q. Zhu, "The Probability of Backtest Overfitting" (J. Computational Finance, 2015) / "Pseudo-Mathematics and Financial Charlatanism" (Notices of the AMS, 2014) — source of the "5 years of daily data → ~45 variations to reach SR ≥ 1.0 by chance" result and the False Strategy Theorem. davidhbailey.com/dhbpapers/backtest-prob.pdf and davidhbailey.com/dhbpapers/overfit-tools-at.pdf
- D. Bailey & M. López de Prado, "The Deflated Sharpe Ratio" (SSRN 2460551, 2014). davidhbailey.com/dhbpapers/deflated-sharpe.pdf
- "Backtest overfitting in the machine learning era: A comparison of out-of-sample testing methods" (ScienceDirect, 2024) — CPCV vs walk-forward PBO/DSR comparison.
- C. Harvey, Y. Liu, H. Zhu, "… and the Cross-Section of Expected Returns" (Review of Financial Studies, 2016; NBER w20592) — multiple-testing argument that newly discovered factors need a t-ratio above ~3.0, not the usual 2.0.
- ml4devs.com / IIT-Madras CS7015 lecture notes — L1/L2, dropout, early stopping, bias-variance mechanics (textbook ML, cross-checked).