An autoencoder learns to compress an input and reconstruct it. It is useful when a compact representation matters, or when reconstruction can reveal missing structure—such as edges in a graph. Unlike a classifier that learns boundaries between classes, its immediate training task is to reproduce data. section 5.5 section 5.2
The basic pipeline has three steps:
- Encode the input with a neural network, compressing it into a lower-dimensional latent representation. section 5.5
- Decode that representation with another neural network to reconstruct the input. section 5.5
- Repeat training to reduce the reconstruction error between the input and its output. section 5.5
From images to missing graph edges
For an image, the encoder compresses the image and the decoder tries to reproduce it. For a graph, reconstruction must also account for the adjacency matrix. A graph autoencoder can therefore be trained for link prediction: given node features and edge lists, it learns to predict edges that may be missing. The Amazon Products dataset provides a concrete setting for this workflow. section 5.5 section 5.2
To build a graph autoencoder, define an encoder and decoder, prepare node features and edge lists, then train with an appropriate loss using edge data and test on held-out data. The framework is adaptable: the encoder and decoder can be replaced with other neural networks, including GCN or GraphSAGE components. A common graph decoder uses a dot product on the edge list. section 5.2 section 5.6
The same encoder–decoder structure also appears in extensions. A variational autoencoder adds a regularizing loss term to produce a more structured, continuous latent space. In neural relational inference, an autoencoder structure embeds graph information at each timestep before an RNN updates the encoded data. These extensions require objectives beyond ordinary reconstruction, including KL divergence. section 5.6 section 6.4











