Overfitting
Overfitting in machine learning occurs when a model is excessively complex and starts to learn both the underlying pattern and the noise in the training data. This results in a model that performs well on training data but poorly on unseen data, as it fails to generalize.
How Overfitting Happens
Overfitting is often a result of a model being too complex or having too many parameters relative to the amount of training data. It can be identified by a significant difference in performance between the training and validation datasets. Techniques to prevent overfitting include simplifying the model, using regularization methods, and increasing the size of the training dataset.
![Lakera LLM Security Playbook](https://cdn.prod.website-files.com/65080baa3f9a607985451de3/65254b087d7b8af4624a0982_CTA%20Image.webp)
Download this guide to delve into the most common LLM security risks and ways to mitigate them.
![](https://cdn.prod.website-files.com/65080baa3f9a607985451de3/650d8986cacb870bc87f91f2_Spacer%20Bottomr.webp)
untouchable mode.
Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.
Several people are typing about AI/ML security. 
Come join us and 1000+ others in a chat that’s thoroughly SFW.