Cookie Consent
Hi, this website uses essential cookies to ensure its proper operation and tracking cookies to understand how you interact with it. The latter will be set only after consent.
Read our Privacy Policy


GAN, also known as Generative Adversarial Network, refers to a class of artificial intelligence algorithms used in unsupervised machine learning. Proposed by Ian Goodfellow in 2014, this type of neural network enables the generation of new data instances that resemble your training data – for instance, creating a sound, image or video that looks and sounds like a human could have created it.

How GANs work

GAN works through a system of two neural networks -- the generator and the discriminator -- that are trained simultaneously. The generator's role is to create fake data to pass to the discriminator. It starts from a random point and enhances its technique as more iterations run.

On the other hand, the discriminator receives both real and fake data from the generator. It's responsible for identifying which data is real and which is fake. Over time, the discriminator becomes better at discerning real data from the fabricated ones.

The ultimate goal is for the generator to become so good at generating data that the discriminator can't distinguish real data from fake, hence, creating a kind of "fool the police" situation. This serves as a kind of self-improving system, which in the end, has the capability to generate near-perfect data replicas, assuming the real data distribution is learned successfully by the generator.

This adversarial process leads to the generator network producing highly realistic data as the discriminator network gets trained to better differentiate between the generated and real data.

Lakera LLM Security Playbook
Learn how to protect against the most common LLM vulnerabilities

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

Related terms
untouchable mode.
Get started for free.

Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.

Join our Slack Community.

Several people are typing about AI/ML security. 
Come join us and 1000+ others in a chat that’s thoroughly SFW.