What is overfitting in AI?
Quick answer
Overfitting is when a model memorizes the quirks of its training examples instead of the general pattern. It scores well on the data it learned from and badly on anything new. Underfitting is the opposite: the model is too simple to learn the pattern at all.
Last updated
Take the free module →Module 5 of the free Better Prompts course, about 6 minutes. No account needed.
Updated · By Robert Breen
Why it matters for a small business
Overfitting matters when you fine-tune a model or train a classifier on your own data. A few hundred examples that all look alike can teach a model to copy them too closely. The standard defense is to hold back some examples and test on those.
There is a prompt-level cousin you'll meet more often. Give a chatbot examples that all share one detail, like the same opening line, and it may copy that detail every time. That isn't overfitting in the strict training sense, but the fix is similar: varied examples.
For most office teams the practical rule is simple: never judge an AI setup only on the examples you built it with. Keep a few fresh cases aside, run them at the end, and trust the result on those more than on the rest.
In a real lesson: Give Examples: Few-Shot Prompts That Copy Your Style
In Give Examples: Few-Shot Prompts That Copy Your Style, the bike shop owner pastes three of his real past review replies, and ChatGPT's new reply sounds like him instead of the usual corporate thank-you.
Three examples change the prompt, not the model, so nothing is overfitted. But the same lesson applies: if all three replies thanked the customer by first name and mentioned the same bike, the new one might too. Varied examples show the style without one detail being copied.

Try this lesson free or read the step-by-step guide.
Common confusions
Overfitting vs hallucination
Overfitting is a training problem: too close to the examples. Hallucination is the model producing false information.
Overfitting vs copying examples in a prompt
Copying details from few-shot examples looks similar but is fixed by changing the prompt, not by retraining.
Tips
- When fine-tuning, keep a separate test set the model never trains on.
- Use varied examples in prompts.
- Test on new cases, not the ones you used to build the prompt.
Related terms
More AI basics terms
Where you use it: free lessons
- Give Examples: Few-Shot Prompts That Copy Your Style (ChatGPT, 6 min)
Frequently asked questions
- How do you know if a model is overfitting?
- It does much better on its training examples than on fresh ones you held back.
- Can prompts overfit?
- Not in the technical sense, but a prompt tuned on a few cases can fail on new ones. Test it on fresh inputs.
- Is overfitting a problem when I use ChatGPT?
- Not directly; you don't train ChatGPT. It matters if you fine-tune a model or train a classifier on your own data.