A linear autoencoder with a -dimensional bottleneck, encoder and decoder , is trained with squared reconstruction error on centred data. How does its solution relate to PCA, and what changes with a nonlinear autoencoder?
Unsupervised learning, Dimensionality reduction
Level L4 Advanced. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can use the best low-rank approximation result to show that a linear autoencoder learns the same subspace as PCA, and say what it does not learn.
Key idea
The autoencoder maps to a code and back to . The matrix has rank at most , and by the Eckart–Young theorem the best rank- approximation of the data, in squared error, is the projection onto the top principal directions. So at the optimum , where holds the top principal directions as columns: the same subspace as PCA, but is fixed only up to an invertible matrix.
Steps
- Write the loss over all centred samples (rows of ): , where is the sum of squared entries. Note that has rank at most , because it passes through numbers.
- Apply Eckart–Young: among all rank- matrices, the truncated SVD is closest to , and it equals . So the loss is minimised when . Baldi and Hornik (1989) showed this is the global minimum and the other stationary points are saddles, so gradient descent can find it.
- Show the non-uniqueness. For any invertible matrix , the pair gives the same product and so the same reconstruction. The code spans the PCA subspace, but its axes need not be orthogonal or ordered by variance.
- Say how to recover the actual principal directions: orthonormalise the columns of and run PCA on the -dimensional codes. Tied weights with orthonormal rows are not enough on their own: any rotation of the rows gives the same loss, so they give an orthonormal basis of the subspace, not the ordered directions.
- Nonlinear autoencoder: a nonlinear encoder and decoder can follow curved surfaces in the data (for example a spiral) that would need many linear components. The price is a non-convex loss, harder training, and a result that is not unique or as easy to interpret as PCA.
Common mistakes
- Saying a linear autoencoder learns exactly the principal components. It learns their subspace, not the specific orthonormal, ordered basis.
- Forgetting to centre the data (or to include bias terms). This changes the subspace found.
- Assuming a nonlinear autoencoder always beats PCA. With a small bottleneck and little data it often does not.
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: How can the principal components in a feature space be found by solving an eigenvalue problem for the kernel matrix , with ? How are the coefficients normalised, how is centred, and how is a new point projected?
Next in Unsupervised learning: For a similarity graph with symmetric non-negative weights and degree matrix , let . How do you prove that , how does this show that the number of zero eigenvalues of equals the number of connected components, and why does this justify spectral clustering?