Skip to content
AI360Xpert

Generative AI

Autoencoder / VAE

Compress data through a bottleneck and reconstruct it.

how an autoencoder compresses data into a lower-dimensional latent space and reconstructs it

Stage 1 of 3: See the Input & Output

Bottleneck Size: 10. MSE: 0.000.

  • Original Input
  • Latent Representation
  • Reconstructed Output

The autoencoder attempts to recreate the input at the output.

Check your understanding

1 questions in the bank. Each attempt draws a fresh set in a fresh order, so a second go is a real second go.

An Autoencoder is a neural network designed to learn a compressed representation of data. It consists of two parts: an encoder that compresses the input into a smaller latent vector (the bottleneck), and a decoder that attempts to reconstruct the original input from this compressed representation.

By forcing the data through a bottleneck, the network cannot simply copy the input to the output. Instead, it must learn the most important structural features (like edges, shapes, or correlations) that allow it to approximate the original data. If the bottleneck is too small, the reconstruction becomes blurry or averages out distinct patterns because it lacks the capacity to store all necessary information.

In a Variational Autoencoder (VAE), this latent space is further regularized to be continuous and structured, allowing us to sample from it to generate entirely new data points that look like the training data.

1. The Encoder and Decoder

The encoder maps a high-dimensional input xx to a lower-dimensional latent vector z=f(x)z = f(x). The decoder maps zz back to a reconstruction x^=g(z)\hat{x} = g(z). The network is trained by minimizing the reconstruction error, typically the Mean Squared Error between xx and x^\hat{x}.

2. The Bottleneck Effect

The size of the bottleneck determines the network's capacity.

  • A wide bottleneck might learn an exact mapping without discovering any meaningful patterns.
  • A narrow bottleneck forces extreme compression, capturing only the most dominant features (principal components) of the dataset.

In this simulation, you can see how reducing the bottleneck size forces the model to drop less important combinations, increasing the reconstruction error and causing patterns to blur.

Reference

Bottleneck
A constrained layer in the network that forces data compression and feature extraction.
Reconstruction Error
The difference (usually MSE) between the original input and the decoded output.
Latent Space
The compressed, lower-dimensional space where the bottleneck vector lives.

Break it on purpose

The bottleneck is too small to capture all distinct patterns. The network is forced to blend or drop features, leading to high reconstruction error.