learned
A Perceiver of 6 blocks: 1,024 learned queries read the standardized GPT-2 features and become the latents , one per position.
Why
Jointly. The latents come from an encoder that is being trained, so the diffusion objective acts on the latent space itself. The paper names this the key difference from latent diffusion pipelines whose encoder is frozen while the diffusion model trains. LDLM paper §4.2
Shallow token embeddings give a suboptimal latent space even when perfectly tuned for diffusion, and the representations of pre-trained encoders are not optimally suited to diffusion, since those encoders are trained on surrogate tasks. Training the latent encoder jointly with the diffusion model is how the paper addresses this gap. LDLM paper §1
Perceiver. The encoder is a Perceiver Resampler: it keeps a set of trainable latent vectors and updates them by cross-attention to the pre-trained hidden states, which stay fixed across its layers, so the latents aggregate information from the whole sequence. Against a self-attention encoder it has a better generative perplexity (66.3 against 94.7) and diversity and a lower Mauve (89.1 against 91.9). LDLM paper Appendix B.4
All 18 steps
- in
- [B batch, T positions, 768 d]
- out
- [B batch, T positions, 768 d]
- parameters
- 51,161,856
Parameters
51,161,856 parameters per instance, across its learned components
| Component | Calculation | Parameters |
|---|---|---|
| Position table | 786,432 | |
| Learned latent queries | 786,432 | |
| Input RMSNorm | 768 | |
| Encoder block | 49,587,456 | |
| Output RMSNorm | 768 | |
| Per-instance total | 51,161,856 | |
Derived from the pinned implementation’s constructors and configuration. The checkpoint’s tensors have not been counted. 306,011,162 of these parameters are trained; frozen GPT-2 and the decoder’s mask vector, 124,442,112, are not.
Explanation
The latents do not start from the text: they start from the same 1,024 learned vectors for every sequence, and everything they know of the text they read from the features through attention.
There are as many latents as positions (num_latents follows max_sequence_len), so nothing is compressed along the sequence.
Sources4
Direct evidence
The encoder owns the learned latent queries, a position table, an input and an output RMSNorm and the blocks.
The implementation, pinned at revision e18c42acdfb7, not yet public
Direct evidence
The encoder adds positions to the features, normalizes the learned queries, applies the blocks, each attending to the features, and normalizes the result.
The implementation, pinned at revision e18c42acdfb7, not yet public
Direct evidence
The latent encoder: 12 heads of 64 features, query and key normalization, softcap 50, 6 layers, MLP multiplier 4, dropout 0.1, ε = 10⁻⁵.
The implementation, pinned at revision e18c42acdfb7, not yet public
Direct evidence
The feature model is GPT-2, frozen; the hidden state at index −3 is extracted; the encoder and the decoder are of the Perceiver kind; the file’s vocabulary size and mask token ID are defaults that the trainer overwrites with the tokenizer’s; there are as many latents as positions, of 768 features.
The implementation, pinned at revision e18c42acdfb7, not yet public