---
title: TileMambaBlock in MambaRaw Framework
url: https://www.emergentmind.com/topics/tilemambablock
type: topic
---

# TileMambaBlock in MambaRaw Framework

Searching arXiv for the cited paper and topic-specific details.
TileMambaBlock is a lightweight module in MambaRaw, a JPEG-conditioned metadata-based raw image reconstruction framework that uses State Space Models (SSMs) to estimate entropy parameters efficiently [2606.24479]. Within the paper’s Spatial-Energy Coupled Context Modeling mechanism, TileMambaBlock performs Mamba-style selective scanning only on information-dense tiles, while Energy-Aware Refinement (EAR) subsequently adjusts the resulting features to match the long-tail energy distribution of raw signals. In the Level-1 entropy-parameter network, TileMambaBlock sits between an input projection and EAR, and its function is sparse, content-adaptive long-range spatial modeling.

## 1. Architectural placement and functional role

In MambaRaw’s Level-1 entropy-parameter network, the usual convolutional context block is replaced by a three-stage cascade:
\[
\mathbf{F}_{\mathrm{in}} = \psi_{\mathrm{ep}}^{\mathrm{in}}(\tilde{\mathbf{F}}),\qquad
\mathbf{F}_{c} = \mathrm{TileMambaBlock}(\mathbf{F}_{\mathrm{in}}; T,\rho),\qquad
\mathbf{F}' = \mathrm{EAR}(\mathbf{F}_{c}).
\]
Here, \(\tilde{\mathbf{F}}\) is the JPEG-conditioned feature, \(\mathbf{F}_{\mathrm{in}}\) is the projected input to TileMambaBlock, \(\mathbf{F}_{c}\) is the context feature after selective SSM processing, and \(\mathbf{F}'\) is the refined output after EAR [2606.24479].

The module’s specific contribution is not generic spatial filtering. It is responsible for sparse, content-adaptive long-range spatial modeling. Internally, it chops the feature map into \(T \times T\) tiles, scores each tile by its \(L_2\) energy, selects only the top-\(k\) tiles with \(k=\lfloor \rho \cdot N_t \rfloor\) for full SSM processing, and leaves the remainder untouched. This places TileMambaBlock at the point where MambaRaw substitutes selective state-space computation for dense context modeling.

In the broader system description, this design addresses the practical limitation that attention mechanisms scale quadratically with feature maps, which becomes expensive at high resolution, such as 4K raw image. TileMambaBlock is therefore part of the framework’s efficiency-oriented replacement of conventional high-cost context modeling in JPEG-guided raw reconstruction [2606.24479].

## 2. Tile partitioning and selective scanning

Let the input to TileMambaBlock be
\[
\mathbf{F}_{\mathrm{in}} \in \mathbb{R}^{C \times H \times W}.
\]
The feature map is partitioned into
\[
N_t = \lceil H/T \rceil \cdot \lceil W/T \rceil
\]
non-overlapping tiles
\[
\{\mathbf{t}_i\}_{i=1}^{N_t}, \qquad \mathbf{t}_i \in \mathbb{R}^{C \times T \times T}.
\]

Each tile is assigned an \(L_2\) energy score:
\[
S_i = \frac{1}{C\,T^2}\sum_{c=1}^{C}\sum_{h=1}^{T}\sum_{w=1}^{T}\bigl[\mathbf{t}_i[c,h,w]\bigr]^2.
\]
The selected tile index set is then
\[
\mathcal{S} = \mathrm{TopK}\bigl(\{S_i\};\,k\bigr),\qquad
k = \max\bigl(1,\lfloor \rho N_t \rfloor\bigr).
\]
Only these selected tiles undergo SSM-based processing:
\[
\mathbf{t}_i' =
\begin{cases}
\mathrm{MambaBlock}(\mathbf{t}_i), & i \in \mathcal{S},\\
\mathbf{t}_i, & \text{otherwise.}
\end{cases}
\]
The processed and unprocessed tiles are then reassembled into \(\mathbf{F}_c\) [2606.24479].

This mechanism makes the selectivity explicit: TileMambaBlock is not a uniformly applied tilewise Mamba layer. A common misreading is that tiling merely localizes the SSM computation; in the described formulation, the decisive step is the top-\(k\) selection by energy, and the non-selected tiles are passed through unchanged. The data also gives a binary-mask formulation,
\[
M_i = 1 \iff i \in \mathcal{S},
\]
so that
\[
\mathbf{t}_i' = M_i \cdot \mathrm{MambaBlock}(\mathbf{t}_i) + (1-M_i)\cdot \mathbf{t}_i.
\]
This expresses the module as a hard routing mechanism over tiles rather than a soft attention map.

The paper’s summary characterizes this as a content-adaptive compromise between computation and fidelity by scoring tiles via simple \(L_2\) energy, running the linear-time SSM only where it is most needed, and then relying on EAR to restore fine-grained, energy-guided detail. A plausible implication is that the tile score serves as a computational proxy for spatial informativeness within the entropy-parameter network.

## 3. State space formulation and two-dimensional scanning

TileMambaBlock applies a MambaBlock to each selected tile. That MambaBlock is built upon the discrete SSM
\[
h_{t+1} = A\,h_t + B\,x_t,\qquad
y_t = C\,h_t,
\]
where \(x_t\) is the \(t\)-th input token, \(h_t \in \mathbb{R}^d\) is the hidden state, and \(A\), \(B\), and \(C\) are learned, in practice input-dependent, matrices. No explicit \(D\) term is used here, or \(D=0\) [2606.24479].

Because this SSM is inherently one-dimensional, the block uses a cross-scan strategy to process two-dimensional tiles:
\[
\mathrm{SS2D}(\mathbf{t}) =
\mathrm{CrossMerge}\bigl(
\mathrm{SSM}(\text{scan\_LR}(\mathbf{t})),\,\dots
\bigr).
\]
The description specifies four directional scans: left\(\rightarrow\)right, right\(\rightarrow\)left, top\(\rightarrow\)bottom, and bottom\(\rightarrow\)top, followed by a merge. This is the mechanism by which a 1D sequence model is adapted to \(C \times T \times T\) tile tensors.

An important implementation property is that the same \(A\), \(B\), and \(C\) parameters are shared across all tiles and across all spatial positions within a tile, so the selective mechanism does not blow up the parameter count. That statement delimits the role of selectivity: it changes where the SSM is executed, but not the parameterization of the SSM itself. This suggests that TileMambaBlock reduces compute and peak SSM memory through sparse execution rather than through per-tile specialization.

## 4. Computational characteristics

The complexity analysis in the description distinguishes dense SSM processing on the full feature map from selective SSM processing on only a fraction of tiles. Let \(H \times W\) denote the total spatial size, \(C\) the number of channels, \(T\) the tile size, \(N_t=(H/T)(W/T)\) the number of tiles, \(\rho\) the keep ratio, and \(S\) the per-pixel cost constant of one cross-scan SSM.

For a full-feature-map dense SSM, the work is approximately
\[
S \cdot H \cdot W.
\]
The memory must hold at least \(O(C \cdot H \cdot W)\) for the feature map and SSM intermediate states of comparable size [2606.24479].

For TileMambaBlock selective SSM, the analysis is decomposed into two parts. Energy scoring costs
\[
O(C \cdot H \cdot W),
\]
and SSM processing on \(\rho \cdot N_t\) tiles costs approximately
\[
S \cdot (\rho \cdot N_t \cdot T^2) = S \cdot \rho \cdot H \cdot W.
\]
The total work is therefore approximately
\[
(1+\rho S)\cdot H \cdot W.
\]
If \(\rho \ll 1\), this is roughly a \(1/\rho\) speedup over dense SSM, neglecting constant overhead. For memory, the input feature still requires \(O(C \cdot H \cdot W)\), but the per-tile SSM scratch is only \(O(C \cdot T^2)\) at any one time, so the peak SSM memory is \(O(C \cdot T^2)\) rather than \(O(C \cdot H \cdot W)\).

These expressions formalize the module’s design target. TileMambaBlock does not eliminate the cost of reading or scoring the full feature map, but it restricts the expensive cross-scan SSM to a selected subset. In the context of MambaRaw, whose abstract emphasizes efficiency for high-resolution JPEG-guided raw reconstruction and reports that the full framework reduces end-to-end coding latency by about \(9\%\), TileMambaBlock is one of the two lightweight modules supporting that efficiency-oriented context model [2606.24479].

## 5. Coupling with Energy-Aware Refinement

After TileMambaBlock produces
\[
\mathbf{F}_c \in \mathbb{R}^{C \times H \times W},
\]
EAR computes a spatial energy map,
\[
\mathbf{e} = \frac{1}{C}\sum_{j=1}^{C}\bigl[\mathbf{F}_{c,j}\bigr]^2
\in \mathbb{R}^{1 \times H \times W},
\]
then a gating tensor,
\[
\mathbf{g} = \sigma\bigl(\mathrm{Conv}_{1\times1}(\mathbf{e})\bigr)
\in \mathbb{R}^{C \times H \times W}.
\]
Its residual branch is
\[
\Delta\mathbf{F} =
\mathrm{Conv}_{1\times1}\!\bigl(
\mathrm{ReLU}(\mathrm{Conv}_{1\times1}(\mathbf{F}_c))
\bigr),
\]
and the final refinement is
\[
\mathbf{F}' = \mathbf{F}_c + \mathbf{g}\odot \Delta\mathbf{F}.
\]
The description states that, in this way, EAR “polishes” the sparse SSM outputs by re-introducing local, energy-guided variations [2606.24479].

The interaction between the two modules is structurally specific. TileMambaBlock provides sparse, selected long-range modeling; EAR then modulates a residual correction using an energy-derived gate. The abstract defines EAR as an identity-initialized residual module that enhance feature representation to match the long-tail energy distribution of raw signals. Read together, these details indicate a division of labor inside the Spatial-Energy Coupled Context Modeling mechanism: TileMambaBlock allocates SSM computation to information-dense tiles, while EAR repairs or enriches the resulting feature field using local energy-aware modulation.

A plausible implication is that the pair is designed to mitigate the principal trade-off introduced by selectivity. Because unselected tiles bypass the SSM unchanged, subsequent refinement is needed to recover local variations that may still matter for entropy-parameter estimation.

## 6. Forward-pass behavior and operational regimes

The step-by-step forward pass is defined for input
\[
\tilde{\mathbf{F}} \in \mathbb{R}^{C_0 \times H \times W},
\]
tile size \(T\), and keep ratio \(\rho\), with output \(\mathbf{F}'\). First,
\[
\mathbf{F}_{\mathrm{in}} = \psi_{\mathrm{ep}}^{\mathrm{in}}(\tilde{\mathbf{F}}).
\]
Second, there is a dense fallback condition:
if \(H \le T\) and \(W \le T\), or \(\rho \ge 1\), then
\[
\mathbf{F}_c = \mathrm{MambaBlock}(\mathbf{F}_{\mathrm{in}}).
\]
Otherwise, the block pads and reshapes \(\mathbf{F}_{\mathrm{in}}\) into tiles, computes \(S_i\), sets \(k=\max(1,\lfloor \rho N_t \rfloor)\), selects top-\(k\) tile indices \(\mathcal{S}\), applies MambaBlock only on selected tiles, and reassembles and crops padding to obtain \(\mathbf{F}_c\). Third, EAR is applied:
\[
\mathbf{e} = \tfrac{1}{C}\sum_j (\mathbf{F}_{c,j})^2,\qquad
\mathbf{g} = \sigma(\mathrm{Conv}_{1\times1}(\mathbf{e})),
\]
\[
\Delta\mathbf{F}= \mathrm{Conv}_{1\times1}(\mathrm{ReLU}(\mathrm{Conv}_{1\times1}(\mathbf{F}_c))),
\qquad
\mathbf{F}' = \mathbf{F}_c + \mathbf{g}\odot\Delta\mathbf{F}.
\]
The returned output is \(\mathbf{F}'\) [2606.24479].

This operational description makes clear that TileMambaBlock is not defined solely by its sparse case. The dense fallback preserves a conventional full MambaBlock path when the spatial extent is already tile-bounded or when the keep ratio implies no sparsification. Thus, the module spans two regimes: a degenerate dense regime and a sparse tile-selection regime. That detail is important for implementation fidelity, because it determines when the tile machinery is bypassed entirely.

Within MambaRaw, this forward path serves the entropy-parameter estimation pipeline used for JPEG-guided raw reconstruction. The paper reports extensive experiments on three camera datasets—Sony, Olympus, and Samsung—and states that MambaRaw shows consistent improvements over strong metadata-based baselines, setting a new state of the art for JPEG-guided raw reconstruction with great efficiency. Notably, at low metadata bitrates, the framework increases PSNR by \(1.2\)--\(1.4\) dB and reduces end-to-end coding latency by about \(9\%\) [2606.24479]. The article-level evidence is reported for the complete framework rather than for TileMambaBlock in isolation; however, TileMambaBlock is one of the two lightweight modules identified as the key contribution of the Spatial-Energy Coupled Context Modeling mechanism.

Source: https://www.emergentmind.com/topics/tilemambablock