# What is overfitting in AI?

> Overfitting is when an AI model learns its training examples too closely, including their quirks, so it does well on them and poorly on new cases.

Source: https://learn.ynteractive.com/content/glossary/overfitting · Updated 2026-10-20 · Free from Stepthrough (https://learn.ynteractive.com)

[AI basics](https://learn.ynteractive.com/content/glossary#topic-ai-basics) · [AI glossary](https://learn.ynteractive.com/content/glossary)

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 October 20, 2026

[Take the free module →](https://learn.ynteractive.com/courses/better-prompts/5)Module 5 of the free [Better Prompts](https://learn.ynteractive.com/courses/better-prompts) course, about 6 minutes. No account needed.

Updated October 20, 2026 · By [Robert Breen](https://learn.ynteractive.com/content/about)

## 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](https://learn.ynteractive.com/content/few-shot-prompting-chatgpt-examples-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](https://learn.ynteractive.com/modules/prompt-few-shot-examples) or [read the step-by-step guide](https://learn.ynteractive.com/content/few-shot-prompting-chatgpt-examples-your-style).

## 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

[Fine-tuning](https://learn.ynteractive.com/content/glossary/fine-tuning) · [Training data](https://learn.ynteractive.com/content/glossary/training-data) · [Few-shot prompting](https://learn.ynteractive.com/content/glossary/few-shot-prompting) · [Machine learning](https://learn.ynteractive.com/content/glossary/machine-learning) · [AI evals](https://learn.ynteractive.com/content/glossary/ai-evals)

## More AI basics terms

[Personally identifiable information (PII)](https://learn.ynteractive.com/content/glossary/pii) · [Pretraining](https://learn.ynteractive.com/content/glossary/pretraining) · [Prompt caching](https://learn.ynteractive.com/content/glossary/prompt-caching) · [Prompt leaking](https://learn.ynteractive.com/content/glossary/prompt-leaking)

## Where you use it: free lessons

- [Give Examples: Few-Shot Prompts That Copy Your Style](https://learn.ynteractive.com/content/few-shot-prompting-chatgpt-examples-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.

[All AI glossary terms, A to Z](https://learn.ynteractive.com/content/glossary) · [Free prompt templates](https://learn.ynteractive.com/content/prompts)
