VAE architecture (encoder → latent space → decoder)

Description

A deep generative model that compresses user sessions into a smooth probabilistic latent space and can decode points in that space into realistic synthetic sessions.

A VAE has an encoder that maps each input (such as a session feature vector) to a distribution over a low-dimensional latent space, and a decoder that reconstructs the input from a sampled latent point. Training balances reconstruction accuracy against a KL divergence term that keeps the latent space smooth and close to a standard normal. The result is a continuous map of behaviour where nearby points are similar sessions and new samples generate plausible synthetic data. In UX research, VAEs support synthetic test data, anomaly detection (high reconstruction error) and exploration of behaviour space. Rigour includes held-out reconstruction evaluation, latent dimensionality choice, checking for posterior collapse and validating synthetic data against real distributions.

Attributes

Loss type
Unmigrated
Stage
Post-launch
Effort
Weeks

Steps

  1. Represent each session as a fixed-length feature vector, standardised, with categorical features one-hot encoded.
  2. Define encoder and decoder networks (e.g. two hidden layers of 128-256 units) and a latent dimension of 2-16.
  3. Train on 80% of sessions with a reconstruction plus KL loss, monitoring validation loss for overfitting, using KL annealing to avoid posterior collapse.
  4. Evaluate reconstruction error on held-out data and inspect latent space by colouring by known attributes.
  5. Generate synthetic samples and compare their marginal and joint distributions with real data (e.g. KS tests, correlation matrix differences).
  6. Assess privacy risk by checking nearest-neighbour distances between synthetic and real sessions.

Sources

  • Deep Generative Modeling (Jakub Tomczak, Springer)
  • Deep Learning (Ian Goodfellow, Yoshua Bengio & Aaron Courville)
  • Methods Atlas (Vivek Gopinath)
  • Kingma & Welling (2013) Auto-encoding variational Bayes
  • Deep Generative Modelling (Springer)
  • Deep Learning (Goodfellow)
  • Methods Atlas (Gopinath)
  • The Inquiry Series, Ch 53 — Generative Models & Synthetic User Testing

Also known as

  • Variational autoencoder
  • VAE

Categories

  • Analytics & Behaviour
  • Computational & Machine Learning