# Useful Overfitting

> Deliberate overfitting when the goal is to approximate a known, deterministic function

- **Category**: Machine Learning
- **Subcategory**: Training Process and Optimization
- **Canonical URL**: https://designpattern.fyi/patterns/useful-overfitting/

---

## Description
**Intent**: Handle cases where overfitting is actually the goal because there is no unseen data in the usual sense—the entire input domain is fully knowable and the goal is a fast approximation of an exact function.

**Context**: For narrow problems like approximating a physics simulation or system of equations across its entire enumerable input domain, the point is a fast approximation of an exact function rather than generalization to a broader population.

**Solution**: Reduce or remove regularization techniques (dropout, weight decay, held-out-set early stopping) that would normally fight overfitting. Train until the model tightly fits the data; low training error is now the actual goal rather than a warning sign. Validate against domain-appropriate error tolerances relative to the true function.



## Use Cases
- Physics or engineering simulation surrogates
- Data distillation for known functions
- Approximating deterministic computations
- Any case with fully known, bounded ground-truth function






## Trade-offs


### Advantages

- Produces optimal approximation of known function

- Avoids unnecessary regularization that hurts performance

- Fast inference compared to original computation

- Well-suited for deterministic, enumerable domains




### Considerations & Drawbacks

- Dangerous outside narrow condition of known function

- Doesn't generalize to broader distributions

- Requires periodic retraining if underlying function changes

- Not applicable to open-ended real-world problems







---
**Reference**: [Original Source](https://github.com/GoogleCloudPlatform/ml-design-patterns)

