Gradient Origin Networks

Sam Bond-Taylor, Chris G. Willcocks

Introduction

Gradient Origin Networks (GONs) introduce a novel class of generative models that completely eliminate the need for a separate encoder network. By leveraging the gradient of the data's log-likelihood with respect to a zero-initialized latent vector as the "encoding," GONs achieve lower reconstruction errors than standard autoencoders. Remarkably, they do this with half the parameters and significantly faster convergence.

The Autoencoder Bottleneck

In traditional representation learning, the Autoencoder is the standard architecture. An encoder network compresses data into a latent vector, and a decoder network reconstructs the original data from that vector. While effective, this setup has notable drawbacks:

  1. Complexity: Designing and balancing two separate networks can be cumbersome.
  2. Parameter Overhead: The encoder typically accounts for half of the model's total parameters.
  3. Inference Bottlenecks: Some alternative methods require iterative gradient descent to find a latent vector for a new sample, which is computationally expensive.

The authors pose a fundamental question: Can we obtain the benefits of a latent representation without the baggage of an explicit encoder or slow iterative optimization?

The Gradient Origin Approach

The core innovation of this paper is the Gradient Origin approach. Instead of relying on a neural network to "guess" the latent code, the model calculates it directly using Empirical Bayes.

The process works as follows:

  1. The "Origin" Step: For any given data point $x$, initialize a latent vector $z_0$ at the origin (a vector of all zeros).
  2. The "Gradient" Step: Pass this zero-vector through the decoder (or mapping function) $F$. Calculate the gradient of the reconstruction loss with respect to that zero-vector.
  3. The Encoding: This gradient itself serves as the latent representation. Intuitively, the gradient tells the model: "To represent this specific image, move away from the origin in this direction."
  4. The Reconstruction: This newly found latent vector is then passed back through the same network $F$ to produce the final output.
Comparison of VAE and GON architectures

The authors extend this foundational concept into three distinct variants:

  • Autoencoding GONs: Focused on simple, high-fidelity reconstruction.
  • Variational GONs: Incorporates the reparameterization trick (similar to a VAE) to create a smooth, sampleable latent space.
  • Implicit GONs: Applies the technique to coordinate-based networks (like SIRENs), allowing them to represent entire datasets of continuous functions (such as images or 3D shapes) without requiring complex hypernetworks.

Key Insights and Performance

The researchers evaluated GONs across a wide range of standard computer vision benchmarks, from simple datasets like MNIST and Fashion-MNIST to complex natural images like CIFAR-10, CelebA, and LSUN Bedroom.

  • The Gradient is the Encoder: The gradient of the loss function inherently contains substantial information about the data point. By backpropagating to the origin, the model effectively "discovers" its own latent space without explicit encoding layers.
  • Parameter Efficiency: Because there is no encoder, GONs use approximately 50% fewer parameters than equivalent autoencoders while often achieving superior results.
  • Activation Functions Matter: Because the method relies on backpropagating through the network to calculate a gradient used as an input, the choice of activation function is critical. Functions with non-zero second derivatives (like ELU or Sine waves in SIRENs) perform significantly better than ReLU, which has a second derivative of zero.
  • Superior Reconstruction and Speed: On datasets like MNIST and CIFAR-10, GONs achieved significantly lower validation reconstruction error compared to standard and "tied" autoencoders. Furthermore, GONs demonstrated rapid convergence, modeling significant signal information (e.g., recognizable digits) after only 3 seconds of training on a single GPU.
  • Super-Resolution Capabilities: Implicit GONs trained on $28\times28$ images successfully reconstructed them at $256\times256$ resolution with high fidelity, highlighting the power of continuous coordinate-based representations.

Limitations and Future Work

While GONs present a major step forward in simplifying generative modeling, they have limitations. For Implicit GONs, the integration terms required for training can become computationally slow as data dimensionality increases (though Monte Carlo integration is suggested as a potential fix).

Additionally, while Variational GONs permit sampling, unconditional samples from complex datasets like CelebA can still appear somewhat blurry—a common issue shared with traditional VAEs. Future work investigating different distance functions beyond Mean Squared Error may help the model capture finer details in complex natural images.

Summary updated

BibTeX
@inproceedings{bondtaylor2021gradient,
  author = {Sam Bond-Taylor and Chris G. Willcocks},
  title = {{Gradient Origin Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=EklpZmRE9qz},
}
Figure