---
title: Content-Adaptive Mamba LIC (CMIC)
url: https://www.emergentmind.com/topics/content-adaptive-mamba-based-lic-model-cmic
type: topic
---

# Content-Adaptive Mamba LIC (CMIC)

Searching arXiv for the cited CMIC-related papers to ground the article in current literature.
CMIC, short for **Content-Adaptive Mamba for Learned Image Compression**, is a learned image compression (LIC) model built around **Content-Adaptive Mamba (CAM)**, a dynamic state-space model (SSM) designed to address two limitations of vanilla Mamba in image compression: fixed and predefined selective scans, and the restricted ability to exploit content dependencies under strict causality and long-range decay. In CMIC, CAM introduces **content-aware token reorganization** and **global priors via a prompt dictionary**, with the stated goal of better capturing global dependencies while preserving computational efficiency. Within the reported evaluation, CMIC surpasses VTM-21.0 by **\(-15.91\%\), \(-21.34\%\), and \(-17.58\%\) BD-rate on Kodak, Tecnick, and CLIC benchmarks**, respectively [2508.02192].

## 1. Variational codec structure and placement of CAM

CMIC follows the standard **variational-autoencoder-based learned image compression pipeline**. The analysis transform is
\[
\mathbf{y} = g_a(\mathbf{x};\theta_a),
\]
followed by scalar quantization
\[
\hat{\mathbf y} = Q(\mathbf{y} - \boldsymbol\mu) + \boldsymbol\mu.
\]
The synthesis transform reconstructs the image by
\[
\hat{\mathbf x} = g_s(\hat{\mathbf y};\theta_s).
\]
The hyperprior path computes
\[
\mathbf{z} = h_a(\mathbf{y};\phi_a),
\]
quantizes \(\mathbf z\) to \(\hat{\mathbf z}\), and decodes the side information through
\[
(\boldsymbol\mu,\boldsymbol\sigma) = h_s(\hat{\mathbf z};\phi_s).
\]
For entropy modeling, CMIC uses a Gaussian likelihood,
\[
p_{\hat{\mathbf y}}(\hat{\mathbf y}\mid \boldsymbol\mu,\boldsymbol\sigma,\boldsymbol\varphi)
= \mathcal{N}(\hat{\mathbf y};\boldsymbol\mu,\boldsymbol\sigma),
\]
with spatial context \(\boldsymbol\varphi\). The rate–distortion objective is
\[
\mathcal{L}_{\mathrm{RD}}
= \mathbb{E}[-\log_2 p_{\hat{\mathbf y}}(\hat{\mathbf y}) - \log_2 p_{\hat{\mathbf z}}(\hat{\mathbf z})]
+\lambda\,\mathcal{D}(\mathbf{x},\hat{\mathbf x}).
\]

The architectural intervention is explicit: **each stage of the nonlinear transform (six stages overall) replaces standard blocks with a CAM block**. A CAM block wraps a **1-D Mamba state-space model** with two added components: **Content-Adaptive Token Aggregation** and **Global-Priors Prompting**. Vanilla Mamba is described as processing a fixed, causal 1-D scan of the flattened 2-D feature map, which leads to long-range decay and ignores content similarity; CAM extends that design by dynamically reordering tokens so that similar tokens become neighbors in the scan and by injecting a small, learnable prompt per token conditioned on global latent priors [2508.02192].

## 2. Content-aware token reorganization

A central mechanism in CAM is **content-aware token reorganization**, which clusters and reorders tokens based on content similarity so that proximity in feature space is prioritized over Euclidean space. Let the flattened tokens be \(\{\mathbf x_i\}_{i=1}^N\subset\mathbb R^d\), and let \(\{\mathbf c_j\}_{j=1}^K\) be learnable, normalized cluster centers. In each training step, CAM runs \(T\) iterations of cosine-based K-Means:
\[
D_{i,j}
= \frac{\mathbf x_i^\top \mathbf c_j}
{\lVert\mathbf x_i\rVert_2\,\lVert\mathbf c_j\rVert_2},
\]
then assigns each token by
\[
g_i = \arg\max_j D_{i,j},
\]
recomputes provisional centers
\[
\mathbf c_j^*
= \frac{\sum_{i: g_i=j}\mathbf x_i}
{\left\lVert\sum_{i: g_i=j}\mathbf x_i\right\rVert_2},
\quad
(\text{if no }i,\; c_j^*=c_j),
\]
and updates the centers through EMA:
\[
\mathbf c_j \leftarrow \lambda_{\mathrm{EMA}}\mathbf c_j
+(1-\lambda_{\mathrm{EMA}})\mathbf c_j^*.
\]

After training-phase updates, and also at inference, CAM computes \(g_i=\arg\max_j D_{i,j}\) and builds a permutation
\[
\pi:\{1,\dots,N\}\to\{1,\dots,N\}
\]
that groups tokens by cluster index in ascending order. The reordered sequence is
\[
\tilde{\mathbf X} = [\,\mathbf x_{\pi(1)},\dots,\mathbf x_{\pi(N)}\,],
\]
and its inverse \(\pi^{-1}\) is cached to restore spatial layout after scanning.

The intended effect is twofold. First, by scanning tokens in cluster order, CAM **privileges content proximity over Euclidean adjacency**, which strengthens semantic interactions. Second, **the original strict causal ordering within each cluster is preserved**, even though clusters may be revisited out of spatial order. A common misunderstanding is to read the reorganization as abandoning causality altogether; the formulation instead remains **1-D causal within each cluster** while attempting to capture non-local dependencies with linear scan complexity [2508.02192].

## 3. Global-priors prompting inside the Mamba recurrence

CAM’s second added mechanism is **Global-Priors Prompting (GPP)**. The model learns a dictionary
\[
\mathbf D\in\mathbb R^{K\times d_s},
\]
where \(d_s\) is the SSM state dimension. For a batch of \(N\) tokens, it constructs a one-hot membership matrix
\[
\boldsymbol\Gamma\in\{0,1\}^{N\times K},\qquad \Gamma_{i,j}=1 \text{ iff } g_i=j.
\]
Instance-specific prompts are then assembled as
\[
\mathbf P = \boldsymbol\Gamma\,\mathbf D,
\]
so that \(\mathbf p_i\in\mathbb R^{d_s}\) is the prompt for token \(i\). These vectors are described as capturing **global category priors**.

The baseline discrete Mamba recurrence is
\[
\begin{cases}
\mathbf h_i = \bar{\mathbf A}\,\mathbf h_{i-1} + \bar{\mathbf B}\,\mathbf x_i,\\[4pt]
\mathbf y_i = \mathbf C\,\mathbf h_i + \mathbf D_{\mathrm{out}}\,\mathbf x_i,
\end{cases}
\]
where \(\bar{\mathbf A}\) and \(\bar{\mathbf B}\) derive from continuous-to-discrete conversion of \((\mathbf A,\mathbf B)\). CAM injects \(\mathbf p_i\) by modulating the read-out matrix:
\[
\mathbf y_i
= \bigl(\mathbf C + \mathrm{diag}(\mathbf p_i)\bigr)\,\mathbf h_i
+ \mathbf D_{\mathrm{out}}\,\mathbf x_i.
\]
Equivalently,
\[
\mathbf C \leftarrow \mathbf C + \mathbf P.
\]

The stated interpretation is that the SSM thereby “queries” hidden state via prompts, **enabling information flow from unscanned (future in spatial order) tokens**. This is presented as a way to relax the strict causality and long-range decay in token interactions of vanilla Mamba. A plausible implication is that CAM does not discard Mamba’s recurrent structure, but instead changes what information the recurrent state is asked to expose at read-out time [2508.02192].

## 4. Complexity, latency, and memory characteristics

The theoretical complexity of the vanilla Mamba 1-D scan is given as
\[
O(N\cdot d_s^2)
\]
per block, which is linear in token length \(N\). CAM adds three overheads: **K-Means clustering** with complexity \(O(T\cdot N\cdot d)\), **token re-ordering** with complexity \(O(N)\), and **prompt lookup** with complexity \(O(N\cdot d_s)\). The overall complexity therefore remains **\(O(N)\) in the number of tokens**. By contrast, the paper states that full 2-D multi-directional scans would be \(O(N\sqrt N)\) or \(O(N^2)\) [2508.02192].

The empirical efficiency claims are specific. **Training overhead** from K-Means is reported as **approximately \(5\%\)** per step. **Inference overhead** is reported as **negligible extra latency for reordering and prompt gathering**. For 2K images, the reported decoding latency and peak GPU memory are as follows:

| System | Reported value |
|---|---|
| CMIC decoding latency | 0.405 s |
| MambaIC (quad-scan) decoding latency | 0.669 s |
| CMIC peak GPU memory | 4.44 GB |
| MambaIC peak GPU memory | 20.32 GB |

These numbers are used to support the claim that the content-adaptive additions are lightweight relative to multi-directional scan alternatives. This suggests that CAM is positioned not merely as an accuracy modification, but also as a reformulation of how global context is acquired under a linear-time budget [2508.02192].

## 5. Objective function, hyperparameters, and optimization

The training objective is
\[
\mathcal{L}_{\mathrm{RD}} = R + \lambda\,\mathcal{D}(\mathbf x,\hat{\mathbf x}),
\]
with
\[
R=
\mathbb{E}[-\log_2 p_{\hat{\mathbf y}}(\hat{\mathbf y})
-\log_2 p_{\hat{\mathbf z}}(\hat{\mathbf z})],
\]
and distortion
\[
\mathcal D\in\{\mathrm{MSE},\,1-\mathrm{MS\!-\!SSIM}\}.
\]

Two implementation choices are emphasized. First, there is **no extra clustering loss**; the cosine K-Means is fully unsupervised and updates centers via EMA. Second, the **prompt dictionary is learned end-to-end via standard backprop through the SSM**.

The reported training and model configuration is concrete. The dataset is **Flickr2W** for training, with evaluation on **Kodak (768×512)**, **Tecnick (1200×1200)**, and **CLIC (2K)**. Optimization uses **Adam** with **lr=\(1\times10^{-4}\)**. The \(\lambda\)-values are
\[
\{0.0017,0.0025,0.0035,0.0067,0.013,0.025,0.05\}
\]
for MSE models and
\[
\{3,5,8,16,32,64\}
\]
for MS-SSIM models. The transform channel dimensions are \(\{128,192,256,320\}\), the block depths are \(\{3,2,2,2,2,3\}\), and the clustering hyperparameters are **\(K=64\)**, **\(T=5\)**, and **\(\lambda_{\mathrm{EMA}}\approx0.9\)** [2508.02192].

## 6. Rate–distortion performance, ablations, and qualitative behavior

The primary quantitative result is the **BD-rate relative to VTM-21.0**:

| Benchmark | BD-rate vs VTM-21.0 |
|---|---:|
| Kodak | \(-15.91\%\) |
| Tecnick | \(-21.34\%\) |
| CLIC | \(-17.58\%\) |

The ablation study isolates the two CAM components. Relative to a baseline with **no CTA and no GPP**, the **CTA-only** variant yields approximately **\((-1.95\%, -2.43\%, -2.07\%)\)** on Kodak, Tecnick, and CLIC; the **GPP-only** variant yields **\((-1.27\%, -1.39\%, -1.47\%)\)**; and the full **CTA + GPP** model yields **\((-2.88\%, -3.34\%, -3.54\%)\)**. Within the paper’s framing, this indicates that the two mechanisms are complementary rather than redundant [2508.02192].

The qualitative observations are also specific. **Effective Receptive Field plots** show that CMIC’s analysis network aggregates context from across the full image rather than only local neighborhoods. **Clustering visualizations** are reported to show that semantically similar regions, such as **red doors, sky, and textures**, are grouped into the same cluster and scanned contiguously, reducing cross-cluster redundancy. Reconstructed examples are described as exhibiting **crisper edges and fewer blocky artifacts in textured regions** than both vanilla Mamba-based and CNN/Transformer baselines.

A common misconception is that the content-adaptive machinery only changes token ordering while leaving the entropy-relevant representation unchanged. The reported ablations argue against that reading: both token aggregation and prompt-conditioned read-out contribute measurable BD-rate gains, and the full model improves beyond either component alone [2508.02192].

## 7. Relation to adjacent Mamba-based LIC systems and acronym ambiguity

CMIC emerged within a broader 2025 line of **Mamba-based learned image compression**. **CMamba** introduced a hybrid convolution-and-SSM framework with a **Content-Adaptive SSM (CA-SSM) module** and a **Context-Aware Entropy (CAE) module**, motivated by the observation that SSMs model overall content well while CNNs capture local details [2502.04988]. **MambaIC** emphasized refined context modeling and **window-based local attention** in channel-spatial entropy modeling, and reported strong efficiency-performance trade-offs for high-resolution image compression [2503.12461]. Relative to these systems, CMIC’s distinguishing contribution is not hybrid CNN–SSM fusion or local attention, but **content-aware token reordering** and **prompt dictionary conditioning** within the Mamba SSM itself [2508.02192].

There is also an acronym issue in the surrounding literature summary. The provided material for **CDMamba**, a remote sensing image binary change detection model, labels that system as a **Content-Adaptive Mamba-based Change-Detection model (CMIC, also called CDMamba)** [2406.04207]. This suggests that the acronym **CMIC** is not unique across domains. In the image-compression literature, however, CMIC denotes **“Content-Adaptive Mamba for Learned Image Compression”** [2508.02192].

Taken together, these comparisons place CMIC within a family of SSM-based codecs that seek global receptive fields with linear complexity, while clarifying that its method is specifically centered on reorganizing the scan order by content similarity and augmenting the Mamba recurrence with global-prior prompts.

Source: https://www.emergentmind.com/topics/content-adaptive-mamba-based-lic-model-cmic