Denoising Objectives › The Denoising Autoencoder Framework

Michael BrenndoerferUpdated July 14, 20254 min read
Language AI HandbookAll chapters
Part 22 of 67Pre-training Objectives
Chapter 161Denoising Objectives › The Denoising Autoencoder Framework
Reading section 2 of 15 · The Denoising Autoencoder Framework · 4 minSection 2 of 15 · 4 min

Book contents

Section 2 of 15 · 4 min read

Denoising Objectives › The Denoising Autoencoder FrameworkOne section · Sections in this chapter2 / 15 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Denoising objectives treat pretraining as an autoencoding problem. The model receives corrupted input and must reconstruct the original. This differs from standard autoencoders, which simply copy input to output. By corrupting the input, we force the model to learn meaningful representations rather than trivial identity mappings.

Denoising Autoencoder

A model trained to reconstruct clean data from corrupted inputs. By learning to remove noise, the model develops representations that capture the underlying structure of the data rather than surface-level patterns.

The key insight is that the corruption function acts as a form of regularization. If the model could see the clean input directly, it could achieve zero loss by copying the input to the output token by token, learning nothing useful in the process. By hiding part of the information, corruption forces the model to build internal representations that encode the meaning and structure of the text, because those representations are what allow it to fill in what is missing. This is analogous to how studying by closing your notes and trying to reconstruct key ideas is more effective than simply re-reading them.

Formally, given original text xx, we apply a corruption function c(⋅)c(\cdot) to obtain noisy input x~=c(x)\tilde{x} = c(x). The model learns parameters θ\theta to maximize the probability of recovering xx from x~\tilde{x}. The training objective minimizes the negative log-likelihood of reconstructing the original:

L=−log⁡Pθ(x∣x~)\mathcal{L} = -\log P_\theta(x \mid \tilde{x})

where:

  • L\mathcal{L}: the denoising loss we want to minimize
  • xx: the original, uncorrupted text sequence
  • x~\tilde{x}: the corrupted input produced by applying the corruption function c(⋅)c(\cdot) to xx
  • θ\theta: the model parameters (encoder and decoder weights)
  • Pθ(x∣x~)P_\theta(x \mid \tilde{x}): the probability the model assigns to the original text xx given the corrupted input x~\tilde{x}

The negative log maps the probability (a value between 0 and 1) into a loss: when the model assigns high probability to the correct reconstruction, the loss is low. When the model is uncertain or wrong, the loss is high. Minimizing this loss trains the model to reliably reconstruct clean text from corrupted inputs.

The choice of corruption function determines what the model must learn. Simple corruptions like random token replacement teach local dependencies. Complex corruptions like document rotation teach global structure. By combining multiple corruption types, we can train models that understand language at every level.

The encoder-decoder architecture fits naturally with denoising. The encoder processes the corrupted input bidirectionally, building rich representations. The decoder generates the original text autoregressively, learning to produce coherent output. This combination gives BART-style models the best of both worlds: bidirectional encoding for understanding and autoregressive decoding for generation. Notice that this architectural choice is not arbitrary: the bidirectional encoder is necessary because reconstructing missing information often requires looking ahead as well as back. The autoregressive decoder is necessary because generating coherent text requires conditioning each output token on all previously generated tokens.

Out[4]:
Visualization
Flow diagram showing original text, corruption step, encoder, decoder, and reconstructed text.
The denoising autoencoder framework for language models. Corruption maps the original text into noisy input. The encoder processes this bidirectionally, and the decoder reconstructs the original text autoregressively.