---
title: 'RS-IMLE: Rejection Sampling for IMLE Correction'
url: https://www.emergentmind.com/topics/rs-imle
type: topic
---

# RS-IMLE: Rejection Sampling for IMLE Correction

Rejection Sampling Implicit Maximum Likelihood Estimation (RS-IMLE) is a method for improving the train-test alignment and sample quality of deep implicit generative models, most notably in the few-shot regime and in fast policy learning. RS-IMLE modifies the classical IMLE objective by changing the training latent prior via a rejection sampling rule, thereby correcting the mismatch between latents selected during training and those encountered at inference in standard IMLE. RS-IMLE has achieved leading performance across few-shot image synthesis tasks and has been effectively extended to imitation learning for multimodal policy generation in robotics.

## 1. Foundations: IMLE and Latent Prior Mismatch

Implicit Maximum Likelihood Estimation (IMLE) was originally introduced as a mode-collapse-resistant alternative to GANs. Given a generator $T_\theta(z)$ mapping latent vectors $z \sim \mathcal{N}(0, I)$ to images, standard batch IMLE minimizes
\[
\theta_{\mathrm{IMLE}} = \arg\min_\theta
\mathbb{E}_{z_1, ..., z_m \sim \mathcal{N}(0, I)}
\left[\sum_{i=1}^n \min_{j \in [m]} d(x_i, T_\theta(z_j)) \right]
\]
where $n$ is the dataset size, $m \geq n$ is the number of samples per iteration, and $d(\cdot,\cdot)$ is a suitable distance metric. One key property is that each data point $x_i$ is matched to its closest generated sample. While effective for large datasets, standard IMLE suffers a pronounced mismatch in few-shot settings: as $m \gg n$, the subset of latent codes that are selected during training become highly localized near data examples, whereas unconditional latents sampled at inference are far more dispersed. This distributional misalignment leads to degraded sample quality at test time [2409.17439].

## 2. Theoretical Construction of RS-IMLE

RS-IMLE addresses the alignment problem by designing a new prior over latents via rejection sampling. The approach begins by quantifying, for each data point $x_i$, the CDF of distances $F_{D_{i,1}}(t)$ between $x_i$ and generic samples, and the order statistics for the minimal distance among $m$ latents. The theoretical analysis shows:
\[
F_{D_i^*}(t) = 1 - (1 - F_{D_{i,1}}(t))^m
\]
with corresponding density
\[
f_{D_i^*}(t) = m (1 - F_{D_{i,1}}(t))^{m-1} f_{D_{i,1}}(t).
\]
This distribution, sharply skewed toward small distances when $m \gg n$, underlies the mismatch. To compensate, RS-IMLE introduces a rejection rule:
- Sample $z \sim \mathcal{N}(0,I)$.
- Compute $r = \min_{i=1,...,n} d(x_i, T_\theta(z))$.
- Accept $z$ only if $r \geq \epsilon$, for threshold $\epsilon$.

Analytically, this alters the prior to exclude latents that are "too close" to any training exemplar, thereby widening the effective support for both training and test latents and making their distance distributions compatible [2409.17439]. Optimal selection of $\epsilon$ balances acceptance rate and coverage; values in the range $0.1$–$0.2$ (normalized units) yield 30–50% acceptance.

## 3. RS-IMLE Algorithms and Variants

The implementation of RS-IMLE involves a rejection filter applied to each batch of sampled latents, followed by nearest neighbor assignment and gradient update for the generator. The key procedural steps are:

1. For each training iteration, sample $m$ latent codes $z_j \sim \mathcal{N}(0, I)$.
2. Retain only those $z_j$ for which $\min_{i} d(x_i, T_\theta(z_j)) \geq \epsilon$.
3. For each data point $x_i$, find the nearest retained $z_{\sigma(i)}$ and update $\theta$ via gradients of $d(x_i, T_\theta(z_{\sigma(i)}))$.

In the policy learning context, as in the PRISM system, RS-IMLE is augmented with a batch-global rejection criterion. Here, each candidate trajectory generated for a batch element is compared against all demonstrations in the batch, and only those not "too close" (according to a robust sequence-level Charbonnier distance) to any demonstration other than its assigned target are accepted. The rejection threshold $\varepsilon_{\mathrm{RS}}$ is set via an online quantile calibration:
\[
\tilde\varepsilon = \mathrm{Quantile}_q(\{D_{i,k\to j}\}),
\]
smoothed by exponential moving average and clamped within a fixed range [2602.02396]. This global rejection increases diversity across the batch and prevents mode-averaging artifacts.

## 4. Empirical Results and Performance

RS-IMLE achieves substantial improvements over GANs, diffusion models, and prior IMLE variants in few-shot image synthesis, as measured by Fréchet Inception Distance (FID) and Precision/Recall metrics.

| Dataset     | FastGAN | AdaIMLE | RS-IMLE (FID) |
|-------------|---------|---------|---------------|
| Obama       | 41.1    | 25.0    | 14.0          |
| Grumpy Cat  | 26.6    | 19.1    | 11.5          |
| Panda       | 10.0    | 7.6     | 3.5           |
| FFHQ-100    | 54.2    | 33.2    | 12.9          |

ACross nine datasets, RS-IMLE reduces average FID by nearly 46% versus the strongest baseline. In terms of Precision/Recall:

| Dataset     | Prec. (AdaIMLE) | Prec. (RS-IMLE) | Rec. (AdaIMLE) | Rec. (RS-IMLE) |
|-------------|-----------------|-----------------|----------------|----------------|
| Obama       | 0.99            | 0.98            | 0.68           | 0.82           |
| Grumpy Cat  | 0.97            | 0.93            | 0.72           | 0.95           |
| FFHQ-100    | 0.99            | 1.00            | 0.77           | 0.99           |

RS-IMLE maintains or improves sample fidelity (precision) and achieves marked gains in recall (mode coverage) [2409.17439].

In imitation learning, PRISM (Performer RS-IMLE) demonstrates state-of-the-art single-pass, real-time control and multimodal behavior coverage:

- MetaWorld: 96.4% (Easy) to 58.0% (Hard) success, surpassing diffusion policies by 10–25% absolute.
- CALVIN: 65.2% success (no dropout) vs. diffusion 36.4% and IMLE 56.2%.
- Real hardware: 10–30% absolute success improvements in manipulation tasks; trajectory jerk reduced by 20x–50x relative to diffusion [2602.02396].

## 5. Technical and Computational Considerations

Efficient nearest-neighbor search is critical to the scalability of RS-IMLE, particularly as the rejection filter may require $m\sim10 n$ samples per batch and distances must be computed for up to $m n$ pairs. Accelerations such as approximate NN search (e.g., DCI) and random projections are recommended. For policy learning, FAVOR$^+$ linear attention is used in PRISM to enable low-latency, high-throughput candidate generation.

Threshold tuning represents the main hyperparameter concern: excessively low $\epsilon$ yields negligible deviation from standard IMLE, while large $\epsilon$ values decrease acceptance and risk under-representation of difficult regions. Ablation studies indicate stable performance across a moderate $\epsilon$ range [2409.17439]. In PRISM, threshold calibration is automated via an EMA-quantile scheme, reducing the need for manual adjustment [2602.02396].

## 6. Extensions and Limitations

The RS-IMLE principle may be extended by:
- Adaptive or per-sample threshold adjustment.
- Soft reweighting of latents instead of hard rejection, using the analytically derived importance function $\varphi(t)$.
- Application to conditional generative models and to VAE prior design.
- Alternative sequence-level distances and batch selection strategies for multimodal output coverage.

Limitations include the additional computational overhead of rejection sampling and the introduction of (possibly multiple) threshold hyperparameters. Candidate sampling efficiency depends critically on the dimensionality of both latent and data spaces; approximate search and tailored metric selection mitigate this issue to some extent [2409.17439, 2602.02396].

## 7. Impact and Context in Generative Modeling

RS-IMLE constitutes a theoretically motivated and empirically validated correction to the distribution mismatch inherent in IMLE and related models when used for few-shot generation or fast policy sampling. It has provided state-of-the-art results on standard few-shot synthesis benchmarks and enabled practical single-pass, multimodal robotic policy deployment at real-time frequencies, with improved success rates and action smoothness relative to diffusion and flow matching. The method has been applied in both computer vision (few-shot synthesis) and robotics (PRISM), establishing RS-IMLE as a versatile mechanism for aligning training and inference distributions in generative modeling and imitation learning [2409.17439, 2602.02396].

Source: https://www.emergentmind.com/topics/rs-imle