The proposed framework for Near-Field Channel Modeling and Beamforming in XL-IMS-enabled 6G systems combines physics-based modeling with machine learning optimization to overcome the limitations of conventional far-field approaches. A near-field channel model incorporating spherical-wave propagation and spatial non-stationarity is developed and validated using the DeepMIMO dataset. Channel information is represented as a graph to capture spatial dependencies between metasurface elements and users, and an end-to-end GNN-attention network is employed to learn beamforming weights for near-field beam focusing. Unlike conventional iterative optimization methods, the learning-based framework directly predicts beamforming solutions, reducing computational complexity while maintaining high accuracy and adaptability to dynamic channel conditions. Performance is evaluated in terms of achievable rate, beamforming gain, and energy efficiency, demonstrating superior results compared with traditional far-field beamforming methods. Figure 1 illustrates the overall framework.
The following are the proposed steps:
Step 1: Configure the DeepMIMO environment
The DeepMIMO v3.x platform is first set up through the O1 Outdoor setup that uses 28 GHz of carrier frequency and 100 MHz of bandwidth. In the simulation, the XL-IMS is represented by a 16×16 uniform planar array of 256 reflecting elements, spaced λ/2 apart. The propagation model chosen is a spherical wave with LoS and NLoS paths.
Step 2: Define XL-IMS geometry and user locations
Design the XL-IMS as a 16×16 planar metasurface that comprises 256 reconfigurable reflective elements. The user terminal devices were randomly distributed within the near-field range, from 0.5m to 10m from the XL-IMS, based on the Rayleigh distance criterion.
Step 3: Generate near-field channels using spherical wave propagation
Model the channels between each reconfigurable metasurface element and the user using spherical wave propagation, which considers distance-induced phase variation.
Step 4: Generate near-field channel data
User Terminals were uniformly distributed within the near-field zone (0.5-10 m) from the XL-IMS panel. Both LoS and NLoS propagation paths generated by the DeepMIMO O1 Outdoor Scenario were used to generate the channels.
Step 5: Prepare the dataset for training and testing
The generated dataset comprised 20,000 samples, of which 16,000 (80%) were used for training and 4,000 (20%) for testing.
Step 6: Normalize input features and prepare model inputs
The final stage of the preparation process involved performing Min-Max scaling on all input features, such as channel magnitude, phase, distance, and user coordinates. This process scaled the data and converted it into tensors, which were fed into the GNN-attention network. The model was optimized using the Adam optimizer with a learning rate of 0.001 and 50 epochs.
Step 7: Apply the attention mechanism
Add an attention mechanism to consider global graph information and capture long-range dependencies between graph nodes. This helps the model to focus on important spatial features.
Step 8: Predict beamforming weights
Predict the beamforming weights and phase shift values using GNN-attention embedding. The intricate, laborious, iterative beamforming procedures are replaced by the prediction method.
Step 9: Evaluate performance metrics
To assess how well communication and beamforming are working, calculate KPIs such as the achievable rate, beamforming gain, spectrum efficiency, energy efficiency, and SINR.
Step 10: Compare against benchmark methods
Compare the proposed algorithm to traditional algorithms, including ZF, MMSE, SDR, and AO.
System model definition
The proposed system considers a 6G wireless network enabled by an XL-IMS comprising 256 reconfigurable reflecting elements that control electromagnetic wave propagation through adjustable phase shifts. As users operate in the near-field region, the conventional far-field planar-wave assumption becomes invalid, requiring consideration of spherical-wave propagation, distance-dependent attenuation, and spatial non-stationarity. The boundary between the near- and far-field regions is determined by the Rayleigh distance, which depends on the metasurface size and the carrier wavelength, and marks the transition from spherical wavefront effects to plane-wave propagation. This is described as follows:
(1)
Here, D is the metasurface size, λ is the wavelength, and R is the Rayleigh distance. A near-field phenomenon occurs in the communication channel when a user is present in a position that is closer to R than its real value. As the signal travels through different metasurface components, it undergoes distinct phase and amplitude variations.
The channel from the n-th meta-surface to the user uses a spherical wave model for near-field propagation, which is represented by the channel coefficient equation as follows:
(2)
Here, α refers to the path loss parameter, λ refers to the carrier wavelength, and dn is the user's distance from the component.
In this case, βn is the path loss factor for the nth XL-IMS element and can be expressed as βn = dn−α, where α stands for the path loss exponent. It should be noted that dn is the Euclidean distance from the position of the user to the nth metasurface element. Channel changes with regard to space are caused by the significant differences in dn between various meta-surfaces, in contrast to the situation with far-field channels. In general, the channel vector can be explained as follows:
(3)
The input signal received by the user depends on the phase tuning of the XL-IMS system. Consider θ = [θ1, θ2, …., θN] to represent the phase shift realized using the metasurface. Then, the input signal can be expressed as:
(4)
where Φ = diag(ejθ1, ….., ejθN) is the transmitted signal, w is the base coding precoding vector, and n stands for noise. The near-field channel vector is defined as h ∈ ℂN×1, the diagonal phase-shift matrix of the XL-IMS as Φ ∈ ℂN×N, the beamforming vector as x ∈ ℂN×1, and the received signal as y ∈ ℂ. The additive noise term is defined as n ∼ CN (0, σ2). These dimensions maintain the mathematical correctness of the formulation.
In this case, ws is the base-station precoding vector that is used to precode the transmitted symbol (s). During performance benchmarking, common digital precoding approaches such as ZF and MMSE are implemented at the base station using similar near-field channel realizations. However, the new approach seeks to optimize the XL-IMS phase-shift matrix (θ) through the GNN-attention learning mechanism.
To concentrate the energy in the near-field region, a design θ where constructive interference occurs, for the user, should be achievable. The beamforming strategy aims to maximize the spectral efficiency or received signal power. Figure 2 describes the architecture of the near-field communication system model based on the XL-IMS approach.
Near-field channel modeling
The proposed XL-IMS-based 6G communication networks near-field model was specifically designed to mimic the propagation conditions near the Rayleigh distance from the metasurface. In the near-field region, propagation is spherical, with changing phase values and non-homogeneous spatial parameters across the metasurface, in contrast to conventional far-field propagation models that assume planar waves. In the current study, a physics-based spherical wave model was used to design an accurate channel impulse response matrix that accounts for the physical locations of both the metasurface elements and user terminals.
Channel representation based on distance
The distance between each metasurface component and the user is a crucial factor in constructing the channel model in the near-field regime. The length pn among the user locations pu and the n-th XL-IMS component is provided by:
(5)
This value varies significantly across the metasurface owing to its extremely large area, leading to unequal propagation times and phase shifts that must be accounted for in the model.
Spherical wave channel model
The channel coefficient between the n-th element and the user is determined using the spherical-wave model described in Equation (2), which captures distance-dependent phase and amplitude variations. For dataset generation and model training, channel coefficients are obtained from the DeepMIMO ray-tracing framework, which incorporates both line-of-sight (LoS) and non-line-of-sight (NLoS) multipath propagation based on realistic environmental structures. From the above, it can construct the channel response matrix from the channel responses for all N meta-surface elements as in Equation (3).
Spatial non-stationarity of near-field channels and model importance
Unlike far-field channels, near-field channels exhibit spatial non-stationarity, where received signals vary across the metasurface, enabling location-dependent beam focusing. This spatial information is embedded in the channel response matrix and is captured by the GNN-attention model. Supplementary Figure 1 illustrates the proposed near-field channel modeling framework for the XL-IMS-based 6G communication system and the generation of realistic channel data for deep learning-based beamforming.
Dataset generation
Data generation was performed using the DeepMIMO framework, which provides realistic ray-tracing-based channel simulations incorporating environmental geometry, spatial consistency, and user mobility. Channel responses for multiple near-field user locations were generated using the O1 outdoor scenario at a carrier frequency of 28 GHz and a bandwidth of 100 MHz. The XL-IMS consisted of 256 uniformly distributed reflective elements, and user locations were selected within the near-field region based on the Rayleigh criterion. Channel coefficients, path gains, and spatial information were extracted using the DeepMIMO Python library. Supplementary Table 1 summarizes the simulation and reproducibility parameters. The model was trained using supervised learning, with channel-state features as inputs and physics-based optimized beamforming weights as target labels.
Input features creation and dataset structure
Next, the raw channel data were converted into features for input to deep learning models. These features included channel response magnitudes and phases as separate components. Other input parameters could also be included depending on the problem requirements. For instance, users' coordinates, distances, and some spatial parameters could also be considered as features. The dataset was split into training and test sets at an 80:20 ratio.
Preparation of the dataset for training
The last step involved normalizing the prepared dataset and converting it into tensors suitable for input into the GNN-attention architecture for training. The training dataset was used to learn the mapping from channel state to the optimal beamforming weights, while the test dataset was used to assess the model's effectiveness. This well-prepared dataset made the learning process easier and more effective. Supplementary Table 2 shows the Dataset Description Details of DeepMIMO.
Feature representation
The feature representation stage transformed complex-valued near-field channel data into a format suitable for deep learning. Channel responses were decomposed into features that capture spatial and propagation characteristics while preserving essential near-field information for learning. Supplementary Figure 2 illustrates the DeepMIMO dataset used in this process. The channel data from the near-field environment were represented as complex numbers hn, with the real and imaginary components that represent the channel coefficients' phase and amplitude information. To allow for effective use in machine learning algorithms, the coefficients were decomposed into their real (Rehn) and imaginary (Imhn) parts. The data could also be represented as the magnitude hn and the phase of the coefficients ∠hn.
Spatial feature extraction
In addition to the channel coefficient, spatial features were included to account for the geometric nature of the near-field environment. This included the distance dn from each metasurface element to the receiver, along with the receiver's coordinates (x, y, z). In this way, the model accounted for the fact that the signal characteristics can depend on the spatial position of the transmitter-receiver pair, a property important to near-field propagation.
Normalization and model input preparation
As a preliminary step before providing the model with its inputs, a normalization process was performed to avoid numerical instability and accelerate convergence. The structured vectors were divided into training and test data sets, denoted by (Xtrain, Xtest). In this way, the inputs were then provided to the GNN and attention models.
Based on the feature representation in Supplementary Figure 2, different kinds of features were used in this dataset, including channel coefficients hn which indicated the complex signal response of all metasurface elements. Another feature was distance dn which indicated propagation effects in this case. Although the imaginary and real components provide a numeric description of the signal, the magnitude and phase parts give an explicit description of the signal strength and phase shift, respectively. User position coordinate (x, y, z) was another important feature that enhanced the model's spatial awareness.
Deep learning design using GNN for spatial dependency modeling integrates with a hybrid attention mechanism for global context learning
This learning algorithm was developed to efficiently train the complex near-field XL-IMS channel, with its spatial and propagation characteristics, using GNNs and an attention mechanism. As the metasurface elements are highly correlated with each other and their interactions are non-uniform within the near-field zone, a fully connected network is not appropriate for properly representing the channel. Hence, in this approach, the metasurface is represented as a graph, with each element acting as a node and the interactions between them as edges. The GNN captured localized spatial dependencies between neighboring nodes, while the attention mechanism improved the learning of global dependencies.
Graph representation of XL-IMS
The XL-IMS is created as a graph G = (V, E), with each vertex vn ∈ V representing one meta-surface element, while edges eij ∈ E represent the spatial relations between the elements. Each vertex has a feature vector xn, which is obtained via the feature representation phase. The adjacency matrix A captures the connectivity among vertices that are close together or within certain distance constraints. Such a graph formulation is used to incorporate the spatial information existing in near-field propagation.
To achieve reproducibility, graph connectivity is determined using the K-Nearest Neighbors approach with k set to 8. Let pi and pj represent the location vectors of the i-th and j-th XL-IMS cells, respectively. The distance between any two vertices is measured via the Euclidean metric as follows: dij = ||pi − pj||2. will be an edge between the vertices i and j if vertex j is included in the group of the eight closest neighbors to the vertex i. Therefore, the adjacency matrix is constructed with the following rule: Aij = 1 if j ∈ Nk(i) and Aij = 0 otherwise.
In the proposed GNN, updates for each node are calculated based on information from other neighboring nodes. In particular, the propagation of the layer l can be given as follows:
(6)
where hi(l) represents the feature vector of the vertex i in layer l, N(i) is the neighborhood of the vertex i, W(l) is the learnable weight matrix, and σ(·) symbolizes a nonlinear activation function.
The GNN-attention model consisted of three graph convolutional layers with hidden dimensions set to 128, and Rectified Linear Unit (ReLU) was used as an activation function. Graph generation was performed using the k-nearest neighbors’ method (k=8). Each XL-IMS feature acts as a node, while edges are formed based on the Euclidean distance between adjacent nodes. To extract global spatial dependencies, we used a multi-head self-attention network with 4 heads. The dropout probability was set to 0.3 to prevent overfitting.
Attention mechanism
To model long-distance dependencies that existed beyond the local neighborhood range, attention was introduced in the model, which works as follows:
(7)
where eij = LeakyReLU(aT[Whi | Whj]) is the importance of the nodes i and j. With this model, one can assign different levels of importance to nodes based on their roles, making it easier for the model to understand the global context across the metasurface. The hybrid framework captures both local and global spatial information, and the learned features are processed through fully connected layers to generate beamforming weights. As shown in Supplementary Figures 3 and 4, the GNN models local spatial dependencies through message passing and feature aggregation, while the attention mechanism captures global interactions among metasurface elements, enabling effective near-field beamforming. Attention weights are computed to quantify the relevance of node pairs, assigning higher importance to more informative interactions. Using these weights, each node aggregates information from all other nodes, enabling the model to capture global dependencies beyond local neighborhoods. The resulting weighted feature fusion generates an optimized feature representation that emphasizes important spatial characteristics while suppressing less relevant information, supporting effective beamforming optimization and energy focusing.
Beamforming optimization
The beamforming optimization stage determined the XL-IMS phase shifts and beamforming weights to focus energy on near-field users. Unlike conventional far-field beam steering, near-field beamforming concentrates energy at specific spatial locations. In the proposed framework, a GNN-attention model learned optimal beamforming parameters directly from channel characteristics, reducing the complexity of iterative optimization methods. The received user signal is given in Equation (4).
Training data were obtained from DeepMIMO for each channel realization, and the corresponding XL-IMS phase shifts were determined using the AO algorithm. The near-field channel matrix h and the XL-IMS phase shift matrix was used to compute the phase shift vector θ by maximizing the received signal power:
(8)
(9)
The AO optimizer was run for 100 iterations until it reached the desired convergence threshold of 10−4. These optimized values served as the training labels for our GNN-attention model. The objective was to achieve constructive interference for effective near-field beam focusing and enhanced received signal power. Instead of conventional optimization methods such as SDR or AO, the problem was solved using a learning-based approach. Specifically, the beamforming optimization problem was approximated by a deep learning model fΘ(⋅).
Supervised learning was adopted to train the GNN-attention model, with optimal beamforming phase-shift vectors provided by the AO algorithm serving as the training targets. Specifically, let us denote the AO-generated optimal phase-shift vector as θAO,i and the network predictions as
. Then, the training criterion was formulated as follows:
(10)
where N is the number of training samples.
Algorithm 1: Near-Field Beamforming using GNN-attention Model is presented in the Supplementary File 1. In this Algorithm, the first step was to set up the system parameters and the DeepMIMO database to create realistic channel conditions. The near-field channel feature for each sample was calculated using the spherical wave model, and the important features, such as channel coefficients and spatial features, were then extracted from the database. The extracted features were converted to a structured form and then represented as a graph, with the metasurface elements as nodes. The deep learning model was generated using GNN layers to capture local spatial dependencies, and an attention mechanism was introduced to learn global dependencies. The deep learning framework was trained using supervised learning with MSE loss between the predicted phase shifts and the AO-generated optimal phase-shift labels.
This implementation was performed with Python and PyTorch. Samples for the DeepMIMO channel were obtained from the O1 outdoor scenario. These channel coefficients were converted into graphs and processed using a GNN with three layers and a multihead attention mechanism. The model was trained using the Adam optimizer with an MSE loss function. This model generated phase shifts and weights for beamforming at near-field users, and the results were evaluated in terms of rate, efficiency, and SINR.