---
title: 'CO Sampler: Multi-Domain Sampling Techniques'
url: https://www.emergentmind.com/topics/co-sampler
type: topic
---

# CO Sampler: Multi-Domain Sampling Techniques

In current arXiv usage, **CO Sampler** is not a single standardized algorithm. The label appears in several technically unrelated literatures: as **CoSam** for implicit-feedback recommendation, as a co-evolved key-frame sampler in long-form video question answering, as a **coordinated sampler** for repeated surveys and SDN telemetry, as an informal label for the **conditional ordered allocation** sampler in Bayesian nonparametrics, as the **Coordinate Sampler** in piecewise deterministic Markov process MCMC, and as a composite ODE/SDE sampler scheduler for diffusion models [2011.07739] [2602.22932] [1206.5637] [2409.05966] [2506.20021] [1809.03388] [2311.06845]. The commonality is therefore lexical rather than methodological: each usage concerns sampling, but the sampled object, optimization criterion, and theoretical guarantees differ substantially.

## 1. Terminological scope

In the cited literature, the term is attached to at least six distinct constructions. A common misconception is to treat **CO Sampler** as a single architecture; the cited works instead use the term for different families of samplers defined by domain-specific constraints.

| Usage | Domain | Core mechanism |
|---|---|---|
| CoSam | Recommendation | Collaborative adaptive negative sampling on a user–item graph |
| CO Sampler in MSJoE | Long-video QA | U-Net over a query–frame similarity matrix |
| Coordinated sampler | Survey/data summarization | Shared seeds and coordinated inclusion across instances |
| dSamp / APX | SDN telemetry | Controller-side coordinated allocation with chance constraints |
| Conditional ordered allocation sampler | Bayesian nonparametrics | Order-of-appearance Gibbs updates in mixture models |
| Coordinate Sampler | PDMP MCMC | Non-reversible continuous-time coordinate-wise dynamics |
| Composite ODE/SDE sampler | Diffusion models | Step-wise scheduler mixing samplers over one trajectory |

The resulting ambiguity is substantive. In recommendation and video understanding, the sampler is part of an end-to-end learned system. In coordinated sampling and SDN telemetry, the emphasis is overlap, unbiased estimation, and budget-aware allocation. In Bayesian computation and PDMP MCMC, the sampler is a posterior simulation algorithm. In diffusion models, the sampler is a numerical integration policy over the reverse generative process.

## 2. CoSam in implicit-feedback recommendation

In recommendation, **CoSam** denotes an efficient collaborative adaptive negative sampler for implicit-feedback learning [2011.07739]. The setting uses users \(U\), items \(I\), and binary feedback \(X \in \{0,1\}^{n \times m}\), where \(x_{ui}=1\) iff user \(u\) interacted with item \(i\), and \(\mathcal{X}_u=\{i \in I : x_{ui}=1\}\). The motivating problem is that uniform negative sampling over \(I \setminus \mathcal{X}_u\) is efficient but tends to select easy negatives, producing slow convergence, high gradient variance, instability, and sub-optimal recommendation accuracy. Existing hard-negative samplers are described as either heuristic and inflexible or adversarial/model-based and computationally heavy.

CoSam addresses this through a **collaborative sampler model** and an **integrated sampler–recommender framework**. For each user \(u\), the sampling distribution \(\rho_u\) over items is initialized uniformly, while each item \(i\) has a one-hot label vector \(\gamma_i\). The layer-wise propagation rules are
\[
\boldsymbol{\rho}_u^{(t)} = c_1 \sum_{i \in N_u} w_{ui}^{(1)} \boldsymbol{\gamma}_i^{(t-1)} + (1-c_1)\boldsymbol{\rho}_u^{(0)},
\]
\[
\boldsymbol{\gamma}_i^{(t)} = c_2 \sum_{u \in N_i} w_{iu}^{(2)} \boldsymbol{\rho}_u^{(t-1)} + (1-c_2)\boldsymbol{\gamma}_i^{(0)}.
\]
In closed form, the diffusion kernel is
\[
\mathbf{H} = (\mathbf{I}-\mathbf{C}\mathbf{W})^{-1}(\mathbf{I}-\mathbf{C}),
\]
and the user-conditioned sampling distribution is a mixture of a uniform component and item-indicator components. The construction has four stated properties: **normalization**, **adaptation**, **interaction awareness**, and **sampling efficiency**.

Sampling is implemented by an **Adaptive Random Walk (ARW)** on the user–item bipartite graph. Starting at user \(u\), the walk either terminates into a uniform sample with probability \(1-c_1\), or moves to a neighbor item according to \(w^{(1)}\); at an item node it either outputs the item with probability \(1-c_2\), or moves to a neighboring user according to \(w^{(2)}\). The ARW samples exactly from \(\rho_u\), avoids traversing the full item space, and yields per-sample complexity \(O(\ell_r)\) instead of \(O(m)\), with
\[
\mathbb{E}[\ell_r] \le \frac{2}{1-\min(c_1,c_2)}.
\]
The reported practice is to keep \(\ell_r < 10\).

The second part of CoSam is bias correction through integration with the recommender. For user \(u\), a candidate set \(G_u\) is drawn from a multinomial with probabilities \(p_s(i \mid u;\theta)\), and prediction uses
\[
p(i \in \mathcal{X}_u) \propto p_s(i \mid u;\theta)\, f_r(u,i;\varphi).
\]
This design is meant to offset the bias induced by uneven sampling. Training combines a Bernoulli cross-entropy loss for the recommender,
\[
L_\varphi=\sum_{i\in \mathcal{X}_u}\log f_r(u,i;\varphi)+\sum_{\alpha\in G_u}(1-x_{u\alpha})\log(1-f_r(u,\alpha;\varphi)),
\]
with a REINFORCE-style sampler update using reward
\[
e_{ui}=(1-x_{ui})\log(1-f_r(u,i;\varphi)).
\]

The empirical evaluation uses LastFM, Movielens-1M, Ciao, and Epinions, with Precision@K, Recall@K, and NDCG. On LastFM, CoSam reports \(0.1302/0.1162/0.3838\) with training time \(23\) s, compared with adversarial sampling at \(0.1002/0.0897/0.3503\) and \(104\) s. On Epinions, CoSam reports \(0.0153/0.0168/0.1621\) and \(420\) s, versus \(0.0094/0.0103/0.1567\) and \(8{,}760\) s for the adversarial baseline, corresponding to relative gains of \(+61.7\%\), \(+62.7\%\), \(+3.45\%\), with approximately \(20\times\) speedup. The method is evaluated with Matrix Factorization and Neural Collaborative Filtering, and BPR is stated to be compatible.

## 3. The CO Sampler in long-form video question answering

In long-form video understanding, **MSJoE** defines a **CO Sampler** as a lightweight trainable key-frame selector jointly optimized with a multimodal large language model [2602.22932]. The paper assumes that, for each question, only a small subset of frames is truly informative. It identifies three obstacles: insufficiency of question-only grounding, the difficulty of turning query–frame similarities into a diverse frame set, and the need for co-adaptation between sampler and MLLM.

The pipeline has four steps. First, the MLLM uses a sparse preview of \(N_{\text{init}}=K/2\) low-resolution frames, at **32 tokens/frame**, to generate up to \(m \le 4\) visually grounded queries. The base MLLM is **Qwen2.5-VL-7B-Instruct**. Second, the video is densely sampled at **1 FPS**, and a frozen **CLIP ViT-L/14** computes the query–frame similarity matrix
\[
S_{i,t}=\operatorname{sim}(f(q_i),g(x_t)),
\]
where \(f(\cdot)\) and \(g(\cdot)\) are the frozen text and image encoders. Third, the CO Sampler maps \(S \in \mathbb{R}^{m \times N_f}\) to frame logits using a **1D U-Net** of about **2M parameters**, treating the query axis as channels. The encoder channels are \(\{32,64,128,256\}\), the decoder mirrors them, and the encoder dilations are \(\{1,2,4,8\}\). Per-frame probabilities are obtained by masked softmax with temperature \(\tau_s\), and frames are sampled **without replacement**. Fourth, the selected \(K\) frames are sent to the MLLM at **256 tokens/frame** for final answer generation.

The optimization is joint. The overall objective is
\[
J(\theta_s,\theta_m)=\mathbb{E}_{a\sim \pi_{\theta_s}(\cdot|S)}[R(\mathrm{Ans}_{\theta_m}(a))].
\]
The MLLM is trained with **GRPO**, whereas the sampler uses **REINFORCE**:
\[
\nabla_{\theta_s}J=\mathbb{E}[(R-b)\nabla_{\theta_s}\log \pi_{\theta_s}(a|S)].
\]
Rewards include an accuracy term \(r_{\text{acc}}=0.8\) if correct and \(0.0\) otherwise, a format reward \(r_{\text{format}}=0.1\) for correct output format, and an informativeness reward
\[
r_{\text{info}}=0.1\cdot \frac{1}{m}\sum_{i=1}^m \mathbf{1}\!\left[(\max_t S_{i,t}-\min_t S_{i,t})>\tau_{\text{info}}\right],
\]
with \(\tau_{\text{info}}=10\). To stabilize early optimization, the sampler is pre-trained with a difficulty-aware advantage based on the pass rate \(c\) of the base MLLM under uniform frames.

The method is trained on a newly collected long-video QA dataset of **2.8k videos** and **7.1k QA pairs**, with videos averaging about **12 minutes**. Joint RL runs for **2 epochs**, with batch size **32**, GRPO group size \(G=8\), learning rates \(10^{-6}\) for the MLLM and \(10^{-5}\) for the sampler, and no KL regularization. Across VideoMME, LongVideoBench, LVBench, and MLVU, MSJoE reports approximately **8.0 points** accuracy gain over the base MLLM and approximately **1.1 points** over the strongest baseline. At a 64-frame budget, the reported accuracies are **75.1** on MLVU, **62.2** on LongVideoBench, **57.4** on VideoMME-Long, and **51.1** on LVBench. Measured latency over 1,000 samples is **2.809 s** for query generation, **0.029 s** for CLIP similarity, **0.038 s** for the U-Net sampler, **3.353 s** for QA, and **6.226 s** total, versus **3.723 s** for uniform sampling.

## 4. Coordinated samplers for repeated surveys, data summarization, and SDN telemetry

A different use of the term denotes a **coordinated sampler**, in which related instances share randomness so that similar instances have similar samples [1206.5637]. In this framework, each item \(h\) receives a seed \(u(h)\sim U[0,1]\), often implemented by a pairwise-independent hash. Sampling is rank-based. In Poisson PPS sampling, \(r(u,v)=v/u\); in bottom-\(k\) sampling, the \(k\) highest ranks are retained. The central estimator theory is formulated at the single-item level: for an item-function \(f(v)\) on value vectors \(v \in \mathbb{V}\subseteq \mathbb{R}^r_{\ge 0}\), the outcome \(S(u,v)\) determines a consistency set \(V^*(S)\), and the lower bound function is
\[
\underline{f}(S)=\inf\{f(v)\mid v\in V^*(S)\}.
\]
The paper characterizes when unbiased nonnegative estimators exist, when they admit finite variance, and when bounded estimates are possible. Its main constructive result is the **J estimator**, and the stated competitiveness guarantee is
\[
\forall v,\quad \int_0^1 \big(\hat f^{(J)}(u,v)\big)^2\,du \le 84 \cdot \int_0^1 \big(\hat f^{(v)}(u)\big)^2\,du,
\]
where \(\hat f^{(v)}\) is the \(v\)-optimal estimator. Coordinated samples are used for set unions, maxima, minima, \(L_p^p\) differences, Jaccard similarity, heavy hitters, and range aggregates.

In SDN telemetry, the same coordinated idea is instantiated by **dSamp**, whose coordinated sampler is a controller-side allocation mechanism that assigns each admitted flow to at most one switch and accounts for dynamic flow-rate fluctuations [2409.05966]. The network is a directed graph \(G=(V,E)\), each switch \(s\) has sampling capacity \(B_s\), and each flow \(f\) traverses a path \(S_f\). For the next epoch, the sampled load is modeled by a random variable \(r_f\) with mean \(\mu_f\) and variance \(\sigma_f^2\). The chance-constrained formulation requires
\[
\mathbb{P}\Big\{\sum_{f\in \mathcal{F}_s} r_f x_{f,s}\le B_s\Big\}\ge 1-\delta.
\]
Using a Normal approximation, the exact ISOCP constraint becomes
\[
\sum_{f \in \mathcal{F}_s}\mu_f x_{f,s}+ z_\delta \sqrt{\sum_{f\in \mathcal{F}_s}\sigma_f^2 x_{f,s}} \le B_s.
\]
For scalability, APX replaces the square root by a safe linear upper bound, yielding
\[
\sum_{f \in \mathcal{F}_s}\mu_f x_{f,s}+ z_\delta \sum_{f\in \mathcal{F}_s}\sigma_f x_{f,s} \le B_s.
\]
The controller maximizes \(\sum_{f,s} x_{f,s}\), subject to \(\sum_{s\in S_f}x_{f,s}\le 1\). This coordinated allocation is evaluated in ns-3 on Abilene and synthetic topologies, with defaults \(\alpha=0.1\), \(\delta=0.20\), and 5-second epochs. APX solves in **0.001–0.005 s** on small instances, remains below about **1.25 s** for **500 switches**, and reports **up to 10%** more fully sampled flows than deterministic or coarsely robust baselines at a given sampling rate.

These two strands share the language of coordination but target different objects. In the first, coordination is statistical overlap across related instances. In the second, it is centralized assignment of sampling responsibility across switches under capacity risk.

## 5. Conditional ordered allocation sampling in Bayesian nonparametrics

In Bayesian nonparametrics, **CO Sampler** is used informally for the **conditional ordered allocation** framework studied in the ordered allocation sampler literature [2506.20021]. The target is the posterior distribution in finite or infinite mixture models, including priors such as the Dirichlet process, Pitman–Yor process, exchangeable stick-breaking processes, and other random discrete mixing distributions.

The ordered allocation sampler works with **order-of-appearance** labels. If distinct component values appear in the latent sequence \((\theta_i)\) in size-biased order, then ordered allocation variables \(d_i\) indicate which discovered component generated \(y_i\). The least-element order constraint requires
\[
\min(D_1) < \min(D_2) < \cdots < \min(D_{k_n}),
\]
where \(D_j=\{i:d_i=j\}\). The paper’s principal contribution is a speed-up of the original OA Gibbs sampler. The modified version updates unordered labels \(c_i\) “as if \(y_i\) were the last observation.” If the currently discovered components are \(\{x_1^*,\ldots,x_k^*\}\) with weights \(\{p_1^*,\ldots,p_k^*\}\), and \(x_{k+1}^*\sim \nu\) is a prospective new component, then
\[
P(c_i=c \mid \cdots)\propto
\begin{cases}
p_c^*\, g(y_i\mid x_c^*), & c=1,\ldots,k,\\[3pt]
\left(1-\sum_{l=1}^k p_l^*\right) g(y_i\mid x_{k+1}^*), & c=k+1.
\end{cases}
\]
After a full scan, the ordered labels \(d_i\) are reconstructed by reading off the distinct values of \(c_i\) in order of appearance.

This change removes admissible-move computations, permits many components to be created or destroyed in a single scan, and yields per-iteration cost \(O(nk)\) when \(k\) components are discovered. Component parameters \(x_j\) are updated from
\[
\pi(x_j \mid \cdots)\propto \nu(x_j)\prod_{i\in D_j}g(y_i\mid x_j),
\]
with Gibbs, Metropolis, or HMC depending on conjugacy. For size-biased stick-breaking priors such as Pitman–Yor,
\[
v_j\mid \cdots \sim \mathrm{Be}(n_j-\sigma,\; \sum_{l>j}n_l+\beta+j\sigma).
\]

The paper also adapts **split-merge moves of Jain and Neal** to the modified sampler. A restricted Gibbs scan updates only the observations in the union of the two affected blocks, and the proposal is accepted with a Metropolis–Hastings ratio on the augmented OA state. Reported simulation studies show that integrated autocorrelation times are roughly **halved** relative to the original OA sampler, and short burn-in with split-merge moves materially reduces total variation distance in density estimation examples.

## 6. The Coordinate Sampler as a PDMP MCMC method

The **Coordinate Sampler** is a non-reversible, continuous-time MCMC algorithm based on a piecewise deterministic Markov process [1809.03388]. Its target density on \(\mathbb{R}^d\) is
\[
\pi(x)\propto \exp\{-U(x)\},
\]
and the state is augmented with a velocity \(v\) from the finite set
\[
\mathcal{V}=\{\pm e_i: i=1,\ldots,d\}.
\]
The invariant distribution on the augmented space is
\[
\rho(dx,dv)=\pi(dx)\,\psi(dv),
\]
where \(\psi\) is uniform on \(\mathcal{V}\).

Between events, the dynamics are deterministic:
\[
\dot X_t = V_t,\qquad \dot V_t = 0.
\]
Events occur with rate
\[
\lambda(x,v)=\langle v,\nabla U(x)\rangle_+ + \lambda^{\mathrm{ref}},
\]
and at an event the new velocity is chosen from
\[
Q(x,v,dv')=\sum_{v^*\in \mathcal{V}} \frac{\lambda(x,-v^*)}{\lambda(x)}\,\delta_{v^*}(dv'),
\]
with
\[
\lambda(x)=2d\,\lambda^{\mathrm{ref}}+\sum_{i=1}^d |\partial_i U(x)|.
\]
The process is therefore Gibbs-like only in the sense that it moves along one coordinate at a time; mathematically it is a PDMP rather than a reversible Gibbs chain.

The paper proves invariance of \(\rho\) by showing \(\int \mathcal{L}f\,d\rho=0\), where \(\mathcal{L}\) is the extended generator, and establishes **\(V\)-uniform geometric ergodicity** under assumptions A.1–A.4 together with either tail regime C.1 or C.2. The Lyapunov function is
\[
V(x,v)=\frac{e^{U(x)/2}}{\sqrt{\lambda^{\mathrm{ref}}+\langle \nabla U(x),-v\rangle_+}}.
\]
If \(\lambda^{\mathrm{ref}}>0\), the process has a unique invariant distribution and is irreducible on \(\mathbb{R}^d\times \mathcal{V}\).

Event times are obtained by solving
\[
\int_0^\eta \lambda(x_0+t v,v)\,dt = -\log u,\qquad u\sim \mathrm{Uniform}(0,1).
\]
For quadratic potentials, this reduces to a quadratic equation because the directional derivative is affine in \(t\). The algorithm is compared numerically with the Zigzag sampler, the Bouncy Particle Sampler, and HMC. On banana-shaped distributions, correlated Gaussians, Bayesian logistic regression, and a log-Gaussian Cox process, it is reported to be more efficient than Zigzag in effective sample size, while HMC remains strongest in the cited Gaussian benchmark.

## 7. Composite ODE/SDE samplers in diffusion models

A further usage of the term appears in diffusion-model inference, where a **CO Sampler** is a composite sampler that mixes different ODE-type and SDE-type update rules across the sampling trajectory [2311.06845]. The motivation is that early reverse-time steps benefit from stochasticity and exploration, whereas late steps benefit from deterministic refinement. The paper generalizes several update rules into a scheduler that chooses different samplers on different step intervals.

The denoiser is written either as noise prediction \(\epsilon_\theta(x_t,t)\) or data prediction \(D_\theta(x_t,t)\), related by
\[
\epsilon_\theta(x_t,t)=\frac{x_t-D_\theta(x_t,t)}{\sigma_t}.
\]
For the deterministic probability-flow ODE,
\[
d x = \frac{\dot{\sigma}(t)}{\sigma(t)}\big(x_t-D_\theta(x_t,t)\big)\,dt.
\]
A unified ODE-style update has the form
\[
x_{i+1}=\frac{\sigma_{i+1}}{\sigma_i}x_i+\left(1-\frac{\sigma_{i+1}}{\sigma_i}\right)\sum c_j D_\theta(x_j),
\]
while a unified SDE-style update adds Gaussian noise:
\[
x_{i+1}=\frac{\sigma_{i+1}^2}{\sigma_i^2}x_i+\left(1-\frac{\sigma_{i+1}^2}{\sigma_i^2}\right)c(i)D_\theta(x_i)+\frac{\sigma_{i+1}}{\sigma_i}\sqrt{\sigma_i^2-\sigma_{i+1}^2}\,\epsilon_i.
\]

The scheduler partitions the global \(\sigma\)-schedule into units. Each unit is assigned a sampler such as Euler a, DPM2 a, DPM++ 2S a, DPM++ SDE, DPM2, Heun, or DPM++ 2M. The reported strong schedules are all two-phase, including **DPM2 a \([N]\rightarrow\) DPM2 \([2N]\)**, **DPM2 a \([N]\rightarrow\) DPM++ 2M \([4N]\)**, **DPM++ 2S a \([N]\rightarrow\) DPM2 \([2N]\)**, and **DPM++ 2S a \([N]\rightarrow\) DPM++ 2M \([4N]\)**. The central empirical claim is that **early SDE and late ODE** mitigates the limitations of using either alone: SDE throughout may cause excessive noise, color oversaturation, or detail loss at low \(\sigma\), whereas ODE throughout may suffer from early drift and weaker exploration.

On CIFAR-10 at **NFE = 24**, the reported **ODE Sampler Scheduler** reaches **FID 1.91**, compared with **2.02** for DPM++ 2M, **1.97** for DPM2, and **11.90** for Heun. The combined **SDE→ODE** schedule reaches **1.899**, compared with **18.63** for Euler a, **3.14** for DPM2 a, and **23.14** for DPM++ SDE. At **NFE = 12**, the integrated scheduler improves FID by **87.58%** over single-step DPM-Solver++ (**36.100** versus **4.484**). In a Stable Diffusion v1.5 setting at \(512\times 512\), the cited configuration uses **31-step Heun** followed by **60-step DPM++ 2M**, for **91 sampling steps** and **121 NFE**.

Taken together, these usages show that **CO Sampler** is a field-dependent name rather than a single theory. In recommendation and video models it denotes adaptive learned sampling modules; in coordinated sampling it denotes overlap-preserving shared-randomness schemes; in Bayesian computation it denotes posterior simulation algorithms; and in diffusion models it denotes a composite integration schedule. The common thread is not a shared mathematics but a shared design goal: replacing naive or uniform sampling with a structure-aware mechanism that improves either statistical efficiency, optimization stability, computational cost, or all three at once.

Source: https://www.emergentmind.com/topics/co-sampler