Manuscript Offprint
arXiv:2610.05673LocAttMamba: A Low-Complexity Mamba Framework with Attention-Based Multi-AP Fusion for Indoor Localization
MohammadMahdi Ghadaksaz, Mohammad Farzanullah, Graduate Student Member, IEEE Melike Erol-Kantarci, Fellow, IEEE
Abstract—Accurate and low-complexity indoor localization is important for location-based services in fifth generation (5G) and sixth generation (6G) networks, where positioning devices operate under limited computational budgets and non-line-of-sight (NLoS) conditions. Indoor localization has been studied widely using traditional signal-level localization approaches. However, these techniques often show degraded performance in NLoS scenarios. Recently, artificial intelligence (AI)-based techniques, including transformers, have been applied to address these challenges. While transformer-based architectures can capture the dependencies within the measurements collected from distributed access points (APs), their high computational complexity results in a large number of multiply-accumulate operations and long inference time. In contrast, lightweight recurrent and convolutional models trade this cost for degraded accuracy. In this paper, we propose LocAttMamba, a low-complexity localization framework in which the channel impulse response (CIR) and time-based features of each AP are processed by a separate Mamba encoder with near-linear complexity, and the resulting per-AP embeddings are fused through a multi-head attention layer that weights each AP according to its importance at every time step. The framework jointly predicts the user location and its per-axis uncertainty, which is refined through a post-hoc calibration step. We evaluate the proposed framework using two real-world 5G and ultra-wideband (UWB) measurement datasets. Our numerical results reveal that LocAttMamba obtains a mean two-dimensional (2-D) positioning error of 1.004 m and 0.599 m, respectively, on 5G and UWB datasets, outperforming the second-best benchmark by 9.79% and 5.82%, while requiring the fewest multiply-accumulate operations among all evaluated models and being 4.4–16× faster than the transformer-based benchmarks.
Index Terms—Mamba model, Attention-based fusion, Indoor Localization, Robustness.
I. INTRODUCTION
THE widespread deployment of fifth generation (5G) and the ongoing move toward sixth generation (6G) are pushing wireless communication forward quickly, and they are opening the way for the next generation of location-based use cases, such as extended reality (XR), vehicle-to-everything (V2X) [1], and physical artificial intelligence (AI) [2]. This calls for localization methods that are accurate, efficient, robust, and low in computational cost, so that the strict quality of service (QoS) requirements for the emerging applications can be met. Indoor localization is especially important, since it supports navigation, safety and rescue operations, and personalized services. In addition, most devices have limited computing power and the measurements they collect are affected by noise and changing surrounding conditions.
In this context, while global navigation satellite system (GNSS) is infeasible for indoor localization, and conventional, signal-level localization approaches have poor performance in non-line-of-sight (NLoS)-rich environments, deep learning (DL)-based approaches have drawn attention over the past few years [3]. In particular, multi-layer perceptron (MLP)-based models can capture complex, non-linear relationships within the input features, convolutional neural networks (CNNs) using two-dimensional (2-D) or three-dimensional (3-D) inputs can extract temporal and spatial patterns, and recurrent neural networks (RNNs) and long short-term memory (LSTM) networks can learn the temporal dependencies of a moving user. More recently, transformers [4] have been introduced as a substitute for RNNs and LSTMs for handling long-range dependencies [5]. However, their quadratic complexity in inference can result in high computational costs and memory usage, limiting their practicality in real-time scenarios.
Beyond accuracy and computational cost, a practical challenge for DL-based indoor localization is the degradation of measurement quality. In real deployments, the channel impulse response (CIR) measurements collected by the access points (APs) are affected by interference and blockage, and can even be deliberately perturbed at the physical layer [6]. Prior works have shown that corrupted measurements from even a single source can significantly bias the position estimate of a DL-based model, and that adaptively weighting the measurement sources helps mitigate the impact of anomalous signals [7]. Moreover, even with clean measurements, the localization error can vary significantly across locations due to NLoS propagation and multipath, while a point estimate alone provides no indication of its reliability. To address this, the authors in [8] estimate the uncertainty of each base station and use it to weight their estimates, although the Monte Carlo dropout variant requires multiple forward passes. Closer to our framework, [9] predicts an uncertainty alongside each estimate within an attention-based fusion network to reject unreliable ones. However, this uncertainty is not calibrated, which means the predicted uncertainty may not match the actual error.
To overcome the drawbacks of transformers, Mamba [10] has been introduced as an efficient alternative, which has recently been used in several wireless communication-related problems [11]–[13]. Mamba is based on the state-space models (SSMs), which offer near-linear time complexity. Mamba relies on a selection mechanism in which the state matrices and the time step become functions of the input, allowing the model to keep the relevant parts of the sequence and
MohammadMahdi Ghadaksaz, Mohammad Farzanullah, and Melike Erol-Kantarci are with the School of Electrical Engineering and Computer Science, University of Ottawa, Ottawa, ON K1N 6N5, Canada (e-mail: mghad017@uottawa.ca; mfarz086@uottawa.ca; melike.erolkantarci@uottawa.ca).
discard the rest. Furthermore, Mamba considers a hardware-aware selective scan algorithm instead of standard sequential approach, which keeps the training and inference cost low.
Nonetheless, a single Mamba processes a single sequence along the time dimension, which can limit its ability to capture spatial dependencies from multiple measurement sources. In this case, to capture both temporal and spatial dependency, Mamba can be combined with multi-head attention-based fusion technique [14] to fuse the information from multiple measurement sources.
In this paper, we propose a low-complexity framework in which each AP is processed by a distinct bidirectional Mamba encoder, and the per-AP embeddings are fused through a multi-head attention layer that adaptively down-weights distorted APs. Following [9], we also predict the uncertainty of each estimate, which, unlike [8], [9], is obtained from a single forward pass of a single model and is calibrated through a post-hoc step.
Due to these limitations, DL-based indoor localization approaches have been proposed over the past few years [17]–[20]. In particular, the authors in [17] propose an MLP-based indoor localization approach using MLP and one-dimensional (1-D) CNN and having RSS and channel state information (CSI) as input features, where they show that their proposed approach obtains sub-meter localization error. Similarly, in [18], the authors introduce an MLP-Mixer architecture for CSI-fingerprinting localization in massive multiple-input multiple-output (mMIMO) orthogonal frequency-division multiplexing (OFDM) systems, where they show the effectiveness and robustness of their proposed algorithm. The authors in [19] consider a bidirectional LSTM architecture with temporal modeling for indoor localization, using magnetic data collected by a smartphone. The authors show that their proposed approach obtains lower localization error compared to unidirectional LSTM, MLP, and gated recurrent unit (GRU) benchmarks. In [20], the authors investigate an autoencoder-based CNN (ACNN) framework for indoor localization using Wi-Fi signals. Here, the authors consider multiple-APs measurement data, where they show the superiority of their design compared to several existing benchmarks, including standard CNNs.
Several recent works explore attention-based [9], [21] and transformer-based [22], [23] indoor localization-based solutions. In [21], the authors introduce secure CNN-attention-based solution for indoor localization, where they consider CIR, TDoA, and APs' position as input features. In this work, the authors compare their proposed solution against KNN-based and conventional geometric TDoA multilateration-based solutions, confirming the superiority of their framework. The authors in [9] introduce an uncertainty-aware multi-modal localization framework using vision and LiDAR modalities and CNN-attention mechanism, where predicted uncertainties are used to reject unreliable pose estimates, improving accuracy on real-world robot datasets. The authors in [23] investigate a heavy-weight transformer-based approach for indoor localization, obtaining lower root mean square error (RMSE) over several DL-based solutions. Likewise, in [22], the authors explore light to medium weight transformers to reduce the computational complexity of the heavy-weight transformer architecture, while maintaining the indoor localization performance.
More recently, Mamba has also been explored for indoor localization [24]–[27]. The authors in [24] propose a Mamba-based indoor localization framework for unmanned vehicles (UVs), where a transformer teacher trained on ultra-wideband (UWB) data distills its knowledge into a CSI-based Mamba student, yielding lower mean absolute error (MAE) than a plain Mamba while reducing multiply-accumulate operations and inference time with respect to the transformer. In [25], the authors investigate transformer- and Mamba-based models for on-device indoor localization using Bluetooth and Wi-Fi RSS measurements, where the localization is formulated as a room-level classification task. The authors in [26] propose a Mamba-based framework that learns the ranging patterns of UWB measurements in large-scale environments, obtaining higher accuracy than state-of-the-art approaches. Similarly, the authors in [27] use Mamba for multi-modal sensor fusion, achieving lower error than the baselines on an indoor positioning dataset.
B. Motivations & Contributions
Most existing research on indoor localization has relied on MLP, recurrent, convolutional, and transformer-based architectures, while the potential of Mamba has only recently started to be explored. This observation is evident in several prior works [9], [17]–[23]. In particular, studies such as [17], [18] rely on simple MLP-based solutions, which often fall short in more complex settings with multiple measurement APs. Other works (i.e., [19], [20]) adopt recurrent and convolutional architectures that obtain low inference time; however, they suffer from poor localization performance while still requiring a large number of multiply-accumulate operations and model parameters. On the other hand, although the authors in [21]–[23] employ attention- and transformer-based architectures to improve the accuracy, these solutions come with high computational complexity and multiply-accumulate operations, resulting in longer inference time, which complicates their deployment on positioning devices with limited computational power. Furthermore, most of the aforementioned works provide only a point estimate of the user location without quantifying its confidence, whereas the works [8] and [9], which consider uncertainty, do not calibrate it. Lastly, although Mamba has recently been adopted for indoor localization, the existing works come with several limitations. In particular, [24] considers a cross-modal teacher model during training, which requires synchronized measurements from an additional modality, while [25] formulates the localization as a room-level classification task rather than estimating the user coordinates. Similarly, [26] uses UWB range measurements and does not exploit the multipath information in the CIR, whereas [27] focuses on aligning heterogeneous sensing modalities instead of multiple sources of the same modality, such as distributed APs. More importantly, none of these works provides a mechanism to adaptively weight the contribution of individual APs, which is essential when the measurements of some APs are degraded. To the best of our knowledge, this is the first time that a Mamba-based encoder combined with attention-based fusion has been explored for indoor localization using real-world 5G and UWB measurements.
The main contributions of this work are as follows:
-
We propose LocAttMamba, a novel low-complexity indoor localization framework in which the measurements from each AP are processed by a dedicated encoder built from stacked forward and reverse Mamba blocks, preserving the near-linear complexity of SSMs and thereby keeping the multiply-accumulate operations and the inference time low. The resulting per-AP embeddings are subsequently fused through a multi-head attention layer using a shared learnable query, which assigns a weight to each AP at every time step according to its importance, rather than treating all APs equally. This is the first work to combine Mamba-based encoders with attention-based AP fusion for indoor localization.
-
We evaluate the robustness of the proposed framework under degraded CIR quality, considering both single-AP and multiple-AP distortions over a wide range of signal to noise ratio (SNR) values. In addition, we analyze the learned attention weights and show that the fusion layer adaptively down-weights the distorted APs, which provides a degree of interpretability to the fusion mechanism and explains the graceful degradation observed under noisy conditions.
-
We conduct an extensive evaluation on two real-world datasets, namely a 5G and a UWB indoor localization dataset, against several benchmarks spanning conventional machine learning (ML), recurrent, convolutional, transformer-, and Mamba-based approaches. Beyond the localization error, we also report the multiply-accumulate operations and the inference time of every benchmark, together with an ablation study over the fusion strategy, the input features, the sequence model, and the training objective, in order to isolate the contribution of each design choice.
Our numerical results validate the effectiveness of the proposed framework. In particular, LocAttMamba achieves a mean error of 1.004 m on the 5G dataset and 0.599 m on the UWB dataset, outperforming the second-best benchmark by 9.79% and 5.82%, respectively, while requiring the fewest multiply-accumulate operations among all evaluated models, i.e., 0.446 M/sample and 0.953 M/sample, and achieving the third-lowest inference time, which is 4.4–16× faster than the transformer-based benchmarks. Moreover, the post-hoc calibration reduces the normalized squared error statistic from 34.6 to 2.15, close to the ideal value of 2 for a two-dimensional Gaussian. Finally, under a fixed SNR of 5 dB with three distorted APs on the 5G dataset, the proposed framework obtains 37.85%, 74.80%, 67.76%, and 9.64% lower mean error compared to [24], [21], [22], and [19], respectively, confirming that the attention-based fusion effectively mitigates the impact of unreliable measurement sources.
C. Organization
The remainder of this paper is organized as follows: Section II presents the discussed problem followed by the methodology in Section III. Section IV provides the numerical results and analysis, and finally Section V concludes the paper with conclusions and future works.
II. PROBLEM DESCRIPTION
In this section, we formulate the user localization problem using CIR and time-related feature measurements from multiple APs. Let us assume a dataset contains T time steps of CIR measurement with APs. We denote the complex CIR at time step t with elements measured by AP i as:
where is the -th element of the measured CIR by AP at time step , for all . Furthermore, we assume the availability of the estimated TDoA and ToA-offset, denoted as and , respectively. A set of time steps of measurement starting at time step for AP , denoted by , is then given by:
(2)
To obtain a real-valued representation, we concatenate the real and imaginary parts of the CIR with the two time-related features into a single feature vector for each time step:
where and are the real and imaginary operators, respectively. Subsequently, the observation matrix , containing the time steps of vectors, starting from time step is expressed as:
In a similar manner, the 2-D location of the user during the W time steps window starting at time step t can be written as:
where and represent the user location at time step t over x-axis and y-axis, respectively.
Equation (4) can be applied to all APs for to construct synchronized matrices for each time step . By aggregating the information from all APs and through the full time steps , the training dataset can be formed as:
(6)
where S is stride, and N can be calculated as follows:
In this case, we introduce a mapping function , with trainable parameters . Using the function , we map the input observation matrices from all APs into the output predicted locations as:
Consequently, the optimal trainable parameters of , denoted by , can be obtained by minimizing the loss function of the predicted and ground-truth locations over as:
The loss function will be discussed in details in next sections. Consequently, during the inference, the optimal parameters is used to predict the output locations as:
In Section III, we discuss our proposed LocAttMamba based solution, representing the mapping function .
III. PROPOSED SCHEME
This section presents the proposed LocAttMamba framework. First, we review the preliminaries of SSMs as the core building block of the Mamba architecture. Subsequently, we introduce the overall architecture of the proposed framework, where each AP is first processed using bidirectional Mamba blocks, and then the resulting per-AP embeddings are fused using a multi-head attention layer to predict the user location and its per-axis uncertainty.
A. Preliminaries: SSMs & Mamba
Structured SSMs (S4s) are a recently developed class of deep learning sequence models derived from SSMs in control theory, which characterize the evolution of a continuous-time system through its internal state. An SSM can be computed either as a recurrence, like a RNN, or as a convolution, like a CNN, combining efficient inference with parallelizable training [28]. It performs sequence-to-sequence transformations through an implicit latent state modeled by first-order differential equations.
As an example, let us denote a continuous input and output sequence and , where and are the number of input features and output variables, respectively. Next, we denote as the implicit state, with representing the dimension. SSMs use three matrices , , and as model parameters, which determine the function-to-function transformation through a continuous-time linear system SSM (A, B, C) ( ) as:
To perform sequence-to-sequence transformation, we discretize the continuous parameters of the system using a step size . By applying zero-order hold (ZOH), the discretized S4 model SSM (X) is expressed as:
Here, , , are the discretized state, input, and output, respectively, for a sequence length of , with and being the -th input and output element. Furthermore, the discretized matrices are written based on simplified ZOH as:
In the S4 model shown in (12)-(15), matrices are assumed to be constant, enabling a linear time-invariant (LTI) system. In particular, the LTI feature enables the computation of these models through a global convolution [28], significantly reducing the inference. However, the input independent structure of this SSM limits its ability in more complex problems.
B. Mamba Block
While the S4 model in Section III-A is efficient, its input-independent parameters limit its expressiveness. Mamba overcomes this by introducing a selection mechanism, in which the matrices B, C, and become functions of the input [10]. A scalar SSM is applied independently to each input channel, so that the discretized parameters, and hence the recurrence, become time-varying. We first describe the block

Fig. 1. Block diagram of the Mamba block.
that produces these input-dependent parameters, and then the resulting selective recurrence.
Fig. 1 shows the block diagram of the Mamba block [10]. Let be the block input. The input is projected into dimension using weight as:
Using , two branches are created. In the SSM branch, a linear projection is applied to as:
where is the projection weight, and is the dimension to which the input is projected.
The output is passed through depthwise 1-D Convolution with weight as:
which is then passed through a SiLU function:
where .
Subsequently, rows of the obtained
with being the -th element, are used to form input-dependent vectors , , and as:
(21)
where are the projection weights of the state matrices, and is the projection weight for the time step. This yields and , and the softplus function is defined as:
which guarantees .
Since a scalar SSM is applied per channel, the state matrix is diagonal and stored per channel, where each row contains the diagonal entries of one channel. The ZOH in (13)–(15) is then applied per time step, so that the discretized matrices become input-dependent:
where and denotes element-wise multiplication with broadcasting over the state dimension. Consequently, the recurrence in (12) becomes time-varying for Mamba as:
where is the state matrix, is the output. Here, remains a static learned parameter and the time-variation is introduced solely through , , and . Notably, the state converts to a matrix from a vector, due to the fact that Mamba considers independent SSMs for each of the input features, resulting in having independent state vectors, and thus, having a state matrix at each time step. The full SSM output is then written as:
In the gating branch, the matrix is first projected using the weight as:
which is then passed through a SiLU function:
Finally, the outputs from the SSM and gating branch are combined using element-wise multiplication as:
which is passed through the linear weight to obtain the Mamba model output:
It is important to note that since Mamba uses input-dependent model parameters, the resulting system is no longer LTI, and thus, it cannot be evaluated as a global convolution; instead, Mamba employs a hardware-aware selective scan to compute (26) efficiently instead of the normal sequential one [10]. We will demonstrate the impact of using parallel scan in the next section.
C. Proposed LocAttMamba Framework
In this section, we will explain the proposed architecture of the mapping function for the user localization problem.
Fig. 2 illustrates the proposed architecture. Specifically, we consider encoders, each receiving an input sequence from the training dataset , where

Fig. 2. Block diagram of the proposed LocAttMamba approach.
. For notational simplicity, we omit the superscript in the following discussion. Each input sequence is then processed by its corresponding encoder through a stack of Mamba blocks, shown in Fig. 1, as follows:
where is an anti-diagonal matrix with the elements along the anti-diagonal being 1, and all other elements being 0, forming the reverse Mamba. Projecting the input into and adding that as a residual branch, the outputs are added up to obtain as:
where is the input projection weight. Subsequently, is passed through several linear projection layers as:
where is the output, and are the projection weights, the ReLU function is defined as:
and Norm represents the root mean square normalization which can be written for a vector as:
where is a vector with trainable elements, for each Norm layer.
This sequence is repeated for , and the output is passed through a Norm layer to obtain the embedding .
Subsequently, first, the embeddings are stacked into a single tensor as:
where denotes the stacked embedding for the -th time step within the window .
To this point, we have obtained the output embeddings of the Mamba blocks and stacked them into . To combine these embeddings across the APs and obtain an accurate track estimate, we use an attention mechanism [4], [14] that weights each AP according to its importance at every time step. To do so, the learnable projections map a shared query and the stacked embedding into the query , key , and value at each time step :
For multi-head attention, these matrices are split into heads, where each head works on a subspace of dimension (assuming is divisible by ). Splitting , and along their feature dimension gives the per-head slices as:
Subsequently, we compute the attention score for each head as follows:
(42) which is normalized using Softmax function to obtain normalized attention weights as:
which is used to compute the context vector as:
Next, the obtained context vectors are concatenated and projected using projection weight as:
Notably, the contribution of each AP’s embeddings in the fusion is determined by the average normalized attention weight across attention heads as:
Consequently, the predicted 2-D location and uncertainty are obtained as:
where and denote the predicted location along the - and -axes, and and are the first and second projection weights of the location head. Similarly, and denote the predicted uncertainty along the two axes, with and the corresponding projection weights. Eventually, by stacking the predicted location and uncertainty over all time steps, we obtain the following:
The discussed architecture works as the mapping function written in (8), with representing the parameters of the proposed LocAttMamba. The summary of this approach is shown in Algorithm 1.
D. Loss Functions
To optimize the trainable parameters by minimizing the loss in (9), we first use mean square error (MSE) loss as:
which is used during the warm-up training. After warm-up, the model parameters are optimized using -negative log likelihood (NLL) loss as [29]:
which is used to simultaneously optimize and uncertainty head , where denotes the stop-gradient operator [29].
Algorithm 1: Proposed LocAttMamba algorithm
Input: Per-AP feature sequences , .
Output: Predicted locations and per-axis log-variances .
1 for each AP do 2 for each encoder layer do 3 Process in forward temporal direction 4 Process in reverse temporal direction 5 Merge both directions through a residual connection: 6 Update via a normalized feed-forward block with residual connection 7 end 8 AP embedding: 9 end 10 Stack the per-AP embeddings into 11 Project the shared learnable query: 12 for each time step do 13 Project the AP embeddings at time step into keys and values: , 14 for each attention head do 15 Compute the importance weight of each AP: 16 Aggregate the AP values: 17 end 18 Concatenate and project heads to obtain 19 Predict and from via separate heads 20 end 21 Collect the predictions over all time steps into and 22 return ,
E. Post-hoc Uncertainty Calibration
Since models trained with the -NLL objective tend to be overconfident, we apply a post-hoc calibration step to the predicted per-axis variance. Let denote the prediction error at time step and the predicted standard deviations. The calibration is measured by the mean normalized squared error:
where indicates a well-calibrated two-dimensional Gaussian, with larger values indicating overconfidence. To correct any miscalibration, we apply per-axis temperature scaling [30], with scales fit on the validation set as:
TABLE I MODEL AND TRAINING HYPER-PARAMETERS.
| Hyperparameter | Value | Hyperparameter | Value |
|---|---|---|---|
| Number of Layers () | 2 | Learning Rate () | 0.003 |
| State Dimension () | 16 | Batch Size () | 16 |
| Inner Dimension () | 32 | Model Dimension () | 32 |
| Attention heads () | 4 | Weight Decay () | 0.05 |
| Window Size () | 25 | Stride () | 5 |
| Warm-up Epochs | 6 | Total Epochs | 15 |
| 0.5 | Optimizer | AdamW |
yielding calibrated uncertainties and , which are applied unchanged to the test set. The closed form in (53) is the exact minimizer of the Gaussian negative log-likelihood over a per-axis scale.
IV. NUMERICAL RESULTS
In this section, we present the numerical results obtained from our simulations. We investigate a real-world 5G indoor localization dataset in [31], which includes APs and CIR elements in addition to TDoA and ToA-offset features. The dataset is publicly available and was collected with a bandwidth of 100 MHz and a carrier frequency of 3.7 GHz. Notably, the dataset provides separate train and test sets with and , where the test set is held out until the final evaluation. From the training set, the last 20% of time steps are used as the validation set, where the split is applied before windowing so that no window spans the train–validation boundary.
To improve the reliability of the results, all simulations are conducted over 4 independent runs, and the reported performance metrics are averaged across these runs. Furthermore, we consider validation distance as the key evaluation metric defined as:
where and are the ground-truth and predicted locations along the x-axis (y-axis), respectively.
We conduct experiments using the Kaggle computing platform with an Intel Xeon CPU running at approximately 2.2 GHz and two NVIDIA Tesla T4 GPUs with 16 GB memory each. For training, we use AdamW optimizer [32] with weight decay parameter for 15 epochs in total and 6 warm-up epochs. The input features are first normalized using Z-score normalization, where both the validation and test set use the statistics obtained from the training set for later normalization. Moreover, we use window size and stride for all the results presented in this paper.
A. Fine-Tuning & Analysis
First, we fine-tune the hyper-parameters of the proposed LocAttMamba with a single AP (i.e., a single Mamba block and no attention for fusion) for a faster tuning. We initialize the hyper-parameters based on [33], and then tune several architectural and training hyper-parameters. Fig. 3 shows the validation loss and validation distance across different learning rates , batch sizes , , and regularization parameter . In particular, Fig. 3a illustrates that and obtain the lowest validation distance, while offers lower variance for more stable performance. Similarly, Fig. 3b shows the performance across various batch sizes, where both and show an almost comparable performance, with having a slightly lower variance. Additionally, training with a results in a longer training time without substantial improvement. Subsequently, we tune the dimension , shown in Fig. 3c. Notably, to avoid prolonged tuning, we consider . Fig. 3c demonstrates that achieves the lowest validation loss and distance, while increasing the to 32 not only increases the complexity of the model but also does not lead to any improvement. Finally, Fig. 3d shows the sweep over weight decay . It can be seen that this parameter has the lowest impact on the performance compared to previous one, with obtaining a slightly lower error overall. The summary of the hyper-parameters are shown in Table I. These hyper-parameters are used symmetrically for all Mamba blocks.
Next, we analyze the impact of adding more APs on the validation distance. Fig. 4 shows the obtained validation distance with different number of APs in addition to the training and validation time. As it is expected, adding the information from more APs leads to performance enhancement. For instance, from 1 AP to 2 APs we observe lower validation distance while increasing the training time by and validation time by . Similarly, from 5 APs to 6 APs, the improvement is with training and validation time increasing by and , respectively. Fig. 4 also shows the impact of using selective scan [10] instead of standard sequential computation of the states inside the Mamba blocks. For instance, using the selective scan can reduce the training and validation for 6 APs by and , respectively.
B. Ablation Study
In this subsection, we conduct an ablation study— using the validation set— on fusion, model, training, and data features of the proposed model as:
-
Average Fusion: Using average instead of attention.
-
No Fusion: 6 Mamba blocks are trained separately, and the final location is the average of their prediction.
-
CIR-Only: Using only the CIR as the input.
-
CIR + TDoA: dropping the ToA-offset.
-
Unidirectional Mamba: Instead of having both Mamba and Reverse Mamba, we only keep the Mamba.
-
1D CNN/RNN: Using 1-D CNN/RNN instead of the Mamba blocks.
-
Warm-up Only: Training only with the MSE loss.
Table II shows the performance of the above-mentioned ablations with the associated performance degradation. For instance, replacing the attention layer with the Average Fusion leads to an almost degradation, while with No Fusion the performance drops substantially by . Similarly, removing TDoA and ToA-offset feature results in a

(a) Learning rate ()

(b) Batch size ()

(c) State dimension ()

(d) Weight decay ()
Fig. 3. Validation loss and distance for (a) learning rate (), (b) batch size (), (c) state dimension (), and (d) weight decay ().

Fig. 4. Obtained validation distance with different number of APs.
performance loss, whereas only removing the ToA-offset has a small 1.03% degradation. Notably, since ToA-offset is a single scalar feature, we keep that as the input feature since it will have minimum impact on the complexity. Subsequently, using only unidirectional Mamba or replacing the whole block with 1-D CNN or RNN can result in the performance degradation by 15.79%, 12.73%, and 12.73%, respectively. Finally, only using the MSE loss shows a small degradation as low as 4.00% compared to the full MSE + NLL training.
C. Performance on The Test Set
In this subsection, we evaluate the trained model on the unseen test set. Fig. 5 illustrates the predicted locations against the ground-truth locations, where each point's color shows the prediction error. For instance, the points with darker colors have lower prediction errors, whereas the points with brighter colors close to yellow have higher prediction errors. The mean error on the test set obtained by the proposed LocAttMamba is 0.999 m with median error of 0.865 m .
TABLE II ABLATION STUDY (6-APS SETTING)
| Ablation | Approach | Avg. Val. Dist. | Performance Degradation |
|---|---|---|---|
| Fusion | Average Fusion | 1.06 ± 0.01 m | 9.43% |
| No Fusion | 1.99 ± 0.06 m | 51.76% | |
| Data | CIR only | 1.30 ± 0.04 m | 26.15% |
| CIR + TDoA | 0.97 ± 0.04 m | 1.03% | |
| Model | Unidirectional Mamba | 1.14 ± 0.03 m | 15.79% |
| 1D CNN | 1.10 ± 0.02 m | 12.73% | |
| RNN | 1.10 ± 0.03 m | 12.73% | |
| Training | Warmup only | 1.00 ± 0.01 m | 4.00% |
| LocAttMamba | 0.96 ± 0.03 m | — | |
Furthermore, we evaluate the calibration of the predicted uncertainty using the normalized squared error in (52). Before calibration, the model is substantially overconfident, with and per-axis ratios of 13.43 and 21.12 along the x- and y-axes, respectively. Applying the per-axis temperature scaling of (53), with scales and fit on the validation set, reduces the test-set statistic to , close to the ideal value of 2. Here, the residual per-axis error-to-variance ratios are 1.11 and 0.75, indicating that the gross over-confidence is removed while the y-axis becomes mildly under-confident. The scales generalize well, where the validation-fitted values match the test-optimal scales within approximately 10%, confirming that the correction transfers to unseen data rather than overfitting the evaluation set. It is important to note that the post-hoc calibration does not impact the location head , and the temperature scaling is only applied to the uncertainty head.
To understand the contribution of each AP in each region, the average attention weight in (46) over all test time steps is illustrated in Fig. 6. It can be seen that APs have different levels of impact in different regions, based on their proximity
This number is obtained from a single run to visualize the predicted locations.

Fig. 5. Error over the predicted locations on the test set.
and line-of-sight availability. For instance, AP number 5 has a higher attention weight in the lower left regions (shown in Fig. 6f), whereas AP 3 has the lowest average attention weight, due to the presence of an obstacle in front of the AP (shown in Fig. 6d). In Section IV-E, we will discuss the impact of noise on the attention weights to better observe the weighting mechanism in the fusion.
D. Benchmark Comparison
After evaluating the performance of the proposed LocAttMamba, we compare the performance against several existing benchmarks as:
-
Support vector machine (SVM): A conventional ML approach.
-
Bi-LSTM [19]: a Bi-LSTM-based approach for indoor fingerprinting.
-
ACNN [20]: An Autoencoder-based CNN indoor localization.
-
L-SwiGLU-T [22]: A lightweight transformer-based approach for indoor localization.
-
Swin-Loc [23]: A heavy-weight transformer architecture for sensing and localization.
-
Sec5GLoc [21]: A CNN-attention approach for indoor localization.
-
MambaLoc [24]: A Mamba-based indoor localization, trained as a standalone model since the considered datasets do not include the paired modality used for distillation in [24].
For a more reliable output, we also consider the UWB localization dataset in [31], containing TDoA and ToA-offset, and CIR with . This dataset also includes , where the data is collected with a bandwidth of 499.2 MHz and a carrier frequency of 4 GHz with and .
To compare the models, we consider mean, median, 75th percentile (P75), and 90th percentile (P90) error. Additionally, the complexity of each model is evaluated through its inference

(a)
(b)
(c)

(d)
(e)
(f)
Fig. 6. Average attention weight for all APs.
time and multiply-accumulate operations. All the models are given the same input features as CIR, TDoA, and ToA-offset.
Table III shows the overall performance of the benchmarks on both 5G and UWB test sets, averaged over 4 independent runs. It can be seen that the proposed LocAttMamba obtains the best mean error on both datasets, where it outperforms the second best model by 9.79% (Swin-Loc [23]) in 5G and 5.82% (L-SwiGLU-T [22]) in UWB. On the other hand, the Sec5GLoc [21] obtains a better median performance on 5G dataset by 5.61%, while having higher P75 and P90 error by 1.82% and 13.70%, respectively. Similarly, L-SwiGLU-T [22] has a lower median and P75 error by 13.27% and 4.17%, its P90 error is higher by 9.60%.
In terms of the complexity of benchmarks, the proposed LocAttMamba has the lowest multiply-accumulate operations compared to all other benchmarks, while having third lowest inference time among the benchmarks. In particular, the BiLSTM [19] benchmark has much lower inference time by almost 18 times compared to the proposed LocAttMamba, however, the performance of this benchmark is much worse by almost 34.40% on 5G dataset and 2.76 times on the UWB dataset, completely outweighing its low inference time. Compared to Sec5GLoc [21], which has a 5.61% lower median error on the 5G dataset, the proposed LocAttMamba has 37.10% lower inference time and almost 63 times lower multiply-accumulate operations on the 5G dataset. Similarly, while L-SwiGLU-T [22] has lower median and P75 error in UWB dataset, it has roughly 1.5 times more multiply-accumulate operations and almost 4.4 times higher inference time, making the model inappropriate for real-time deployment. It is important to note that all the models are tested using T4 GPU and batch size = 1 for inference time.
To better illustrate the performance, the cumulative distribution function (CDF) of error of the benchmarks on the 5G test set is shown in Fig. 7. It can be seen that this figure confirms the results in Table III, where for instance, the Sec5GLoc [21] has a lower median with its CDF more leaned towards zero,
TABLE III BENCHMARK COMPARISON ACROSS 5G AND UWB SCENARIOS.
| Dataset | Model | Mean | Median | P75 | P90 | Inf. Time (ms/sample) | Multiply-Acc. (M/sample) | # Params |
|---|---|---|---|---|---|---|---|---|
| 5G | SVM | N/A | ||||||
| Bi-LSTM [19] | ||||||||
| ACNN [20] | ||||||||
| L-SwiGLU-T [22] | ||||||||
| Swin-Loc [23] | ||||||||
| Sec5GLoc [21] | ||||||||
| MambaLoc [24] | ||||||||
| LocAttMamba | ||||||||
| UWB | SVM | N/A | ||||||
| Bi-LSTM [19] | ||||||||
| ACNN [20] | ||||||||
| L-SwiGLU-T [22] | ||||||||
| Swin-Loc [23] | ||||||||
| Sec5GLoc [21] | ||||||||
| MambaLoc [24] | ||||||||
| LocAttMamba |

Fig. 7. Error CDF on 5G test set.
while the proposed LocAttMamba approach has better P75 and P90 errors. Additionally, it can be seen that the SVM baseline has the worst CDF curve compared to other approaches.
E. Noise Robustness
While the proposed LocAttMamba is superior on nearly all complexity and error metrics, it is important to consider real-world scenarios where the input CIR may face SNR degradation. Thus, in this subsection, we evaluate the robustness of the trained models under noisy CIR inputs. The CIR power at time step , for AP is written as:
Subsequently, noise power per complex tap for a target SNR (in dB), and per-component standard deviation:
Then, complex additive white Gaussian noise is added as:

(a) 5G

(b) UWB
Fig. 8. Mean error versus degraded SNR in (a) 5G and (b) UWB datasets.
Degraded CIR can be written as:
We consider multiple-AP = CIR degradation over a single SNR = 5 dB, and single-AP CIR degradation over range of SNRs.
TABLE IV ROBUSTNESS EVALUATION: ABSOLUTE MEAN ERROR (M) AT A FIXED DEGRADED SNR = 5 DB UNDER VARYING AP CIR DISTORTIONS
| Model | 5G | UWB | ||||||
|---|---|---|---|---|---|---|---|---|
| Clean | 1 AP | 3 APs | 5 APs | Clean | 1 AP | 3 APs | 5 APs | |
| SVM | 3.166 | 8.941 ± 0.000 | 8.974 ± 0.000 | 8.974 ± 0.000 | 1.595 | 3.335 ± 0.005 | 5.501 ± 0.003 | 6.020 ± 0.003 |
| Bi-LSTM [19] | 1.530 | 1.570 ± 0.006 | 1.603 ± 0.014 | 1.641 ± 0.010 | 1.656 | 1.686 ± 0.010 | 1.783 ± 0.012 | 1.873 ± 0.026 |
| ACNN [20] | 2.153 | 2.217 ± 0.005 | 2.395 ± 0.007 | 2.483 ± 0.007 | 0.850 | 0.902 ± 0.003 | 1.016 ± 0.005 | 1.097 ± 0.010 |
| L-SwiGLU-T [22] | 1.467 | 3.107 ± 0.002 | 4.491 ± 0.015 | 5.906 ± 0.013 | 0.636 | 0.775 ± 0.006 | 1.329 ± 0.016 | 2.686 ± 0.012 |
| Swin-Loc [23] | 1.113 | 7.436 ± 0.028 | 17.635 ± 0.009 | 13.717 ± 0.012 | 1.632 | 3.117 ± 0.013 | 3.818 ± 0.011 | 4.734 ± 0.012 |
| Sec5GLoc [21] | 1.122 | 2.886 ± 0.001 | 5.747 ± 0.002 | 9.363 ± 0.001 | 0.781 | 1.274 ± 0.004 | 3.365 ± 0.007 | 6.990 ± 0.003 |
| MambaLoc [24] | 2.012 | 2.142 ± 0.002 | 2.330 ± 0.006 | 2.456 ± 0.010 | 1.953 | 2.099 ± 0.010 | 2.343 ± 0.020 | 2.477 ± 0.015 |
| LocAttMamba | 1.004 | 1.146 ± 0.004 | 1.448 ± 0.006 | 1.736 ± 0.014 | 0.599 | 0.673 ± 0.012 | 0.762 ± 0.015 | 0.849 ± 0.021 |
Table IV shows the performance of the benchmarks under varying AP distortions. For more reliable results, we consider adding 4 different noise seeds and average the results. It can be seen that the proposed LocAttMamba approach maintains its superiority on both datasets under multiple-AP noise degradation. For instance, in 5G dataset and 3-AP distortion, the proposed LocAttMamba obtains 37.85%, 74.80%, 67.76%, and 9.64% lower mean error compared to MambaLoc [24], Sec5GLoc [21], L-SwiGLU-T [22], and Bi-LSTM [19], respectively. Similarly, on the UWB dataset and 5-AP CIR degradation, the proposed LocAttMamba achieves 82.05%, 54.66%, and 22.62% lower mean error than Swin-Loc [23], Bi-LSTM [19], and ACNN [20], respectively. Notably, it can be observed that the Bi-LSTM [19] approach has a lower mean error in 5G dataset and 5-AP distortion by 5.48%, while having an inferior performance in all other settings.
Subsequently, we consider degrading a single AP and sweep over different SNR values = [15 : 2.5 : -10]. Fig. 8 shows the mean error versus obtained SNR for both 5G and UWB datasets. Particularly, the proposed LocAttMamba maintains its performance in almost all SNRs across both datasets. For instance, in a moderate noise of SNR = 7.5 dB, the proposed LocAttMamba has 27.43% lower error than Bi-LSTM [19] in 5G and 11.96% lower error than L-SwiGLU-T [22] in UWB dataset as second best algorithms. Similarly, in an extreme noise of SNR = -10 dB, LocAttMamba obtains a much lower error than L-SwiGLU-T [22] and Bi-LSTM [19] by 73.44% and 47.38%, respectively, in the 5G dataset. However, in the UWB dataset, L-SwiGLU-T [22] and ACNN [20] achieve a lower error after SNR = -2.5 dB than LocAttMamba, where at SNR = -10 dB, they have 50.50% and 16.85% lower error, respectively, compared to LocAttMamba.
Fig. 9 shows the average attention weight with single noisy AP 0 for clean CIR, SNR = 0 dB, and SNR = -10 dB. This figure shows how the attention layer reduces the impact of the distorted AP by reducing its attention weight. In particular, it can be seen that the attention weight for AP 0 has reduced from 0.2267 to 0.2057 when the SNR degrades to 0 dB and further reduces to 0.1784 when the SNR degrades to -10 dB. By reducing the attention weight of the distorted AP, the output predicted location becomes more accurate as other intact APs

(a)
(b)
(c)
Fig. 9. Average attention weight in 5G dataset and AP 0 for (a) clean CIR, (b) SNR = 0 dB, and (c) SNR = -10 dB.
take over, though some degradation occurs. In particular, the attention weight of the distorted AP does not go to zero even with extreme noise due to the presence of clean TDoA and ToA-offset features. Table V shows the position of the proposed LocAttMamba across all evaluated metrics.
V. CONCLUSIONS
In this paper, we developed LocAttMamba, a low-complexity localization framework that processes per-AP CIR and time-based features with bidirectional Mamba encoders and fuses them across APs through a learned attention mechanism, jointly predicting the user location and its associated uncertainty. We conducted extensive experiments on two real-world 5G and UWB datasets, where the effectiveness of the proposed design was shown. In particular, the proposed LocAttMamba achieved 1.004 m mean error in 5G and 0.599 m mean error in UWB, outperforming the second-best benchmarks by 9.79% and 5.82%, respectively, while requiring the fewest multiply-accumulate operations among all evaluated models with third-lowest inference time. Furthermore, under noisy CIR conditions, LocAttMamba maintained its superiority in nearly all multiple-AP and single-AP degradation scenarios, where the attention layer was shown to adaptively down-weight distorted APs. Overall, the proposed LocAttMamba obtains the best or near-best performance in accuracy, robustness, and complexity simultaneously, making it well-suited to real-world deployment.
As future work, graph-based fusion techniques can be considered as the spatial relationships among APs naturally admit a graph representation.
The same AP is degraded for all algorithms.
TABLE V SUMMARY OF THE VARIOUS PERFORMANCE CRITERIA.
| Category | Criterion | 5G Best | UWB Best | LocAttMamba Position |
|---|---|---|---|---|
| Accuracy | Mean error | LocAttMamba (1.00 m) | LocAttMamba (0.60 m) | Best on both |
| Median error | Sec5GLoc (0.83 m) | L-SwiGLU-T (0.49 m) | 2nd on both | |
| Tail error (P90) | LocAttMamba (1.84 m) | LocAttMamba (1.03 m) | Best on both | |
| Robustness | Multiple APs Distorted (SNR = 5 dB) | LocAttMamba (5/6 cols) | LocAttMamba | Best except 5G/5-AP |
| Single AP Distorted (Moderate Noise) | LocAttMamba | LocAttMamba | Best on both | |
| Single AP Distorted (Extreme Noise) | LocAttMamba | L-SwiGLU-T | Best on 5G, 3rd on UWB | |
| Complexity | Multiply-Acc. / sample | LocAttMamba (0.45M) | LocAttMamba (0.95M) | Best on both |
| Inference latency | Bi-LSTM | Bi-LSTM | 3rd; 4.4-16× faster than transformers |
ACKNOWLEDGMENTS
This work has been supported by Canada Research Chairs program and NSERC Discovery grant.
REFERENCES
[1] H. Lee et al., “Towards 6G hyper-connectivity: Vision, challenges, and key enabling technologies,” J. Commun. Netw., vol. 25, no. 3, pp. 344–354, 2023.
[2] Y. Li et al., “Physical artificial intelligence (PAI): The next-generation artificial intelligence,” Front. Inf. Technol. Electron. Eng., vol. 24, no. 8, pp. 1231–1238, 2023.
[3] O. Kerdjidj et al., “Uncovering the potential of indoor localization: Role of deep and transfer learning,” IEEE Access, vol. 12, pp. 73 980–74 010, 2024.
[4] A. Vaswani et al., “Attention is all you need,” in Adv. Neural Inf. Process. Syst. (NeurIPS), 2017, pp. 5998–6008.
[5] S. Khan et al., “Transformers in vision: A survey,” ACM Comput. Surv., vol. 54, no. 10S, 2022.
[6] P. Huang et al., “Attacking and defending deep-learning-based off-device wireless positioning systems,” IEEE Trans. Wireless Commun., vol. 23, no. 8, pp. 8883–8895, 2024.
[7] D. Gufran et al., “SENTINEL: Securing indoor localization against adversarial attacks with capsule neural networks,” IEEE Trans. Comput.-Aided Design Integr. Circuits Syst., vol. 43, no. 11, pp. 4021–4032, 2024.
[8] A. Foliadis, M. H. C. Garcia, R. A. Stirling-Gallacher, and R. S. Thomä, "Reliable deep learning based localization with CSI fingerprints and multiple base stations," in Proc. IEEE Int. Conf. Commun. (ICC), 2022, pp. 3214–3219.
[9] H.-M. Won et al., “Localization meets uncertainty: Uncertainty-aware multi-modal localization,” Technologies, vol. 13, no. 9, 2025.
[10] A. Gu and T. Dao, “Mamba: Linear-time sequence modeling with selective state spaces,” arXiv preprint arXiv:2312.00752, 2023.
[11] M. A. Habib et al., “Generative AI for intent-driven network management in 6G RAN: A case study on the Mamba model,” IEEE Wireless Commun., pp. 1–8, 2026.
[12] ——, “Hierarchical decision Mamba meets Agentic AI: A novel approach for RAN slicing in 6G,” pp. 120–124, 2026.
[13] A. Mehrabian and V. W. Wong, “A-Gamba: An adaptive graph-mamba model for traffic prediction in wireless cellular networks,” IEEE Wireless Commun. Lett., vol. 14, no. 6, pp. 1801–1805, 2025.
[14] M. Ilse et al., “Attention-based deep multiple instance learning,” in Int. Conf. Mach. Learn. (ICML), 2018, pp. 2127–2136.
[15] F. Zafari, A. Gkelias, and K. K. Leung, “A survey of indoor localization systems and technologies,” IEEE Commun. Surveys Tuts., vol. 21, no. 3, pp. 2568–2599, 2019.
[16] I. Guvenc and C.-C. Chong, “A survey on TOA based wireless localization and NLOS mitigation techniques,” IEEE Commun. Surveys Tuts., vol. 11, no. 3, pp. 107–124, 2009.
[17] C.-H. Hsieh et al., “Deep learning-based indoor localization using received signal strength and channel state information,” IEEE Access, vol. 7, pp. 33256–33267, 2019.
[18] L. Li et al., “D²-MLoc: Dual-domain MLP-Mixer framework for CSI-fingerprinting indoor localization,” IEEE Trans. Cogn. Commun. Netw., vol. 11, no. 5, pp. 3276–3291, 2025.
[19] M. Zardkoohi et al., “Indoor localization using smartphone magnetic sensor data: A bi-lstm neural network approach,” IEEE Access, vol. 13, pp. 165 795–165 809, 2025.
[20] H. Arslantas and S. Okdem, “Indoor localization with an autoencoder-based convolutional neural network,” IEEE Access, vol. 12, pp. 46 059–46 066, 2024.
[21] I. Alla and V. Loscri, “Sec5GLoc: Securing 5G indoor localization via adversary-resilient deep learning architecture,” in 2025 IEEE Conf. Commun. Netw. Secur. (CNS), 2025, pp. 1–9.
[22] S. Masrur et al., “Transforming indoor localization: Advanced transformer architecture for NLOS dominated wireless environments with distributed sensors,” IEEE Trans. Mach. Learn. Commun. Netw., vol. 4, pp. 161–177, 2026.
[23] X. Xu et al., “Swin-Loc: Transformer-based CSI fingerprinting indoor localization with MIMO ISAC system,” IEEE Trans. Veh. Technol., vol. 73, no. 8, pp. 11 664–11 679, 2024.
[24] M. Bahnassy et al., “MambaLoc: Lightweight indoor localization for unmanned vehicles using cross-modal knowledge distillation,” in Proc. 33rd ACM Int. Conf. Adv. Geogr. Inf. Syst., 2025, p. 1288–1289.
[25] T. Suwannaphong, F. Jovan, I. Craddock, and R. McConville, “Optimising TinyML with quantization and distillation of transformer and Mamba models for indoor localisation on edge devices,” Sci. Rep., vol. 15, p. 10081, 2025.
[26] T.-M. Nguyen, Y. Yang, T.-D. Nguyen, S. Yuan, and L. Xie, “ULOC: Learning to localize in complex large-scale environments with ultrawideband ranges,” in Proc. IEEE Int. Conf. Robot. Autom. (ICRA), 2025.
[27] W. Yang, X. Zhou, J. Guan, H. Du, and T. Bai, “GRAM-MAMBA: Holistic feature alignment for wireless perception with adaptive low-rank compensation,” 2025, arXiv preprint arXiv:2507.13803.
[28] A. Gu et al., “Combining recurrent, convolutional, and continuous-time models with linear state space layers,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 34, 2021, pp. 572–585.
[29] M. Seitzer et al., “On the pitfalls of heteroscedastic uncertainty estimation with probabilistic neural networks,” in Int. Conf. Learn. Represent. (ICLR), 2022.
[30] C. Guo et al., “On calibration of modern neural networks,” in Int. Conf. Mach. Learn. (ICML), 2017, pp. 1321–1330.
[31] Fraunhofer Institute for Integrated Circuits IIS, “Fingerprinting dataset for positioning,” https://www.iis.fraunhofer.de/en/ff/lv/dataanalytics/pos/fingerprinting-dataset-for-positioning.html, 2024.
[32] I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” in Int. Conf. Learn. Represent. (ICLR), 2019.
[33] A. Mehrabian et al., “Mamba meets financial markets: A graph-mamba approach for stock price prediction,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), 2025, pp. 1–5.