Overfitting is when a machine learning model learns its training data too closely, including its noise and quirks, so it performs well on the examples it has seen but poorly on new data.
In simple terms, the model memorised the answers instead of learning the lesson. A student who memorises past exam papers word for word may score perfectly on those papers and fail a new one. An overfit sales forecasting model might match past months exactly because it learned one-off events, then miss badly next quarter.
Underfitting is the opposite: the model is too simple to capture the real pattern and does badly on both training and new data. The goal is a model that generalises, which Google machine learning course describes as making good predictions on new data rather than only on the data it trained on.
How do you know you are overfitting? Hold back part of your data the model never trains on. If accuracy is high on training data and much lower on that held out set, the model is overfit. Is 99 percent accuracy overfitting? Not by itself. It depends on the held out score, and on the data: if 99 percent of cases belong to one class, a model that always guesses that class scores 99 percent and is useless. Common fixes are more and more varied data, a simpler model, regularisation, stopping training earlier, and cross validation. The same idea applies to prompts and AI agents: a prompt tuned only on five hand picked examples can fail on the sixth, which is why we evaluate on a wider set of real cases before launch.
Saraswati Stitch®