Manuscript Offprint
arXiv:2611.08155AI-Native Task-Oriented Semantic Communications over a Relay: Benefits and Vulnerabilities
Yalin E. Sagduyu , Tugba Erpek , and Aylin Yener
Nexcepta, Gaithersburg, MD, USA
The Ohio State University, Columbus, OH, USA
Abstract—Semantic communication (SemCom) using a relay node is considered, where the relay assists in conveying task-relevant information from a source to a destination, with meaning defined by classification labels. A joint end-to-end design of the source encoder, relay transformation, and destination decoders is developed to optimize both semantic inference accuracy and perceptual reconstruction quality for image data. Relay-assisted schemes are shown to outperform direct transmission, with gains that become more pronounced in low signal-to-noise ratio (SNR) regimes across different relaying strategies. Alongside these performance benefits, however, a key security vulnerability introduced by the relay is identified, and a Byzantine attack is formulated in which the relay injects structured, learned perturbations into its transmitted signal. The attack operates on intermediate communication representations subject to channel effects, with perturbations generated through a learned mapping applied at test time. It is shown to significantly degrade semantic inference accuracy at the destination. These results reveal a clear trade-off between SemCom gains and security risks in relay-assisted systems, motivating the need for secure relay designs that account for insider threats.
Index Terms—Semantic communications, semantic relaying, deep learning, security, Byzantine adversary.
I. INTRODUCTION
Semantic communication (SemCom) departs from conventional systems by focusing on transmitting task-relevant information rather than exact data reconstruction [1]–[3]. SemCom integrates learning-based representations into system design, enabling more efficient use of limited wireless resources, particularly in bandwidth- and power-constrained environments. By prioritizing semantic meaning over bit-level fidelity, SemCom improves robustness and efficiency for downstream tasks such as classification and perception.
While prior work on SemCom has largely focused on direct source-destination transmission, practical wireless systems often operate under challenging channel conditions where direct links are weak or unreliable. This motivates the incorporation of relay nodes into SemCom systems [4]–[8]. In this paper, we consider relay-assisted SemCom, where the relay processes received signals using a Learn-and-Forward (LF) mechanism before forwarding them to the destination. The LF operation is jointly optimized with the source encoder and destination decoders, enabling diversity gains and semantic-aware processing to mitigate channel impairments. For comparison, we consider Amplify-and-Forward (AF) and Decode-and-Forward (DF) as baseline relay mechanisms operating with learned source encoders and destination decoders. As we will see in the sequel, and as noted in [7] for a slightly different system model, relay-assisted schemes achieve higher semantic accuracy than direct transmission, with larger gains in lower signal-to-noise ratio (SNR) regimes.
These semantic performance gains, however, come with new security vulnerabilities. Since SemCom often relies on deep neural networks (DNNs), it is inherently susceptible to manipulation during both training and inference [9]–[14]. In particular, the relay can itself be an adversary. We present such a Byzantine attack in which the relay injects structured perturbations into its transmitted signals. This attack proves to be especially effective in SemCom, where such perturbations in the latent representation can lead to significant degradation in semantic inference at the destination. Unlike conventional input-space gradient-based attacks that directly perturb the classifier input, the proposed attack operates on intermediate communication signals at the relay. It generates structured perturbations through a learned mapping, without requiring ground-truth labels or gradient-based optimization at test time.
The adversarial perturbation injected by the Byzantine relay is generated by a DNN operating on the relay's received signal. The DNN is trained with the communication model held fixed to degrade semantic inference at the destination by increasing prediction uncertainty while constraining perturbation magnitude. The learned mapping is applied at test time without modifying the communication model, enabling single-pass execution at the relay. We show that this attack is highly effective in reducing semantic accuracy across SNR regimes. This highlights the increased security risks introduced by semantic relaying despite its performance gains, motivating the need for robust SemCom designs.
The remainder of the paper is organized as follows. Sec. II presents the relay-assisted SemCom approach and evaluates its benefits. Sec. III introduces the insider threat model at the relay and demonstrates its impact on the performance of semantic relay communications. Sec. IV concludes the paper.

Fig. 1: System model of semantic relay communications.
color images, and . The objective is to transmit a compact representation of such that the destination can both reconstruct the input and infer its label. The input sample is associated with a label , where denotes the number of classes. The pair represents the semantic information to be conveyed to the destination. The source encoder, parameterized by , maps the input into a transmitted representation according to
where denotes the number of channel uses (the latent dimension). The two rows correspond to the in-phase and quadrature (I/Q) components, respectively. The encoder is a DNN with two convolutional blocks. Each block includes two convolutional layers with kernel size , followed by batch normalization and ReLU activations, and a max-pooling layer for spatial downsampling. Dropout with probability 0.25 is applied after each block to regularize training. The convolutional channel dimensions are . The resulting feature map is flattened and passed through two fully connected layers: the first maps to a hidden dimension of size 1024 with ReLU activation, and the second maps to a vector of dimension , which is reshaped into the transmitted representation. For , the source encoder has 8.68M parameters. Prior to transmission, each source or relay output is power-normalized as , where denotes per-sample normalization that enforces unit average squared magnitude per real I/Q component.
The transmitted representation can be viewed as a complex vector of length , namely , whose real and imaginary parts correspond to the I/Q components, respectively. In DNN operations, any complex-valued signal of dimension is represented via its I/Q components as a real-valued tensor of size for processing by the DNNs.
We consider a two-phase transmission scheme. In the first phase, the source broadcasts to the relay and destination. The received signal at the relay is
and the received signal at the destination in the first phase is
where , denote flat-fading channel coefficients for the source-to-relay and source-to-destination links, respectively. The noise terms , are additive circularly symmetric complex Gaussians. The wireless channels follow a block-fading model, where channel coefficients remain con-
stant over the channel uses of each sample and vary independently across samples. The coefficients and follow Rayleigh fading. With the transmitted signals normalized, the noise variance is set according to the specified link SNRs. The relay and destination operate directly on the received I/Q samples without explicit channel state information.
In the second phase, which is orthogonal to the first phase (for example, using a separate time slot or frequency band), the relay processes its received signal using a relay transformation , where denotes trainable parameters when applicable, and transmits
The transmitted signal is normalized to satisfy the same average power constraint as the source. This relay mapping provides a common abstraction that captures different relaying strategies as special cases, including LF, AF, and DF. In all cases, the relay function (whether learned in LF and DF or fixed in AF) is incorporated into the end-to-end training of the source and destination DNNs.
(i) Amplify-and-forward (AF): Using a fixed mapping with no trainable parameters, the relay transmits a normalized version of its received signal:
(ii) Decode-and-forward (DF): The relay mapping consists of a relay-side decoder and a relay-side encoder. The relay first maps its received latent signal to the original image dimensions using a relay-side decoder parameterized by ,
where denotes the resulting image-domain representation. The relay then re-encodes this estimate into a transmitted latent representation using a relay-side encoder parameterized by ,
where denotes the relay transmit signal.
The relay-side decoder maps from the latent representation of dimension to the original image dimension , while the relay-side encoder maps from the image domain back to the latent representation of dimension . In the numerical results, the relay-side decoder uses the same architecture as the reconstruction decoder at the destination, with its input dimension adjusted to the relay observation, while the relay-side encoder uses the same architecture as the source encoder.
(iii) Learn-and-forward (LF): The relay mapping in (4) is realized as a direct latent-to-latent transformation. The relay processes its received signal and produces , where . Thus, in the LF case corresponds to a mapping from latent dimension to latent dimension. In DNN operations, the input is represented in its I/Q form. The mapping is implemented as a one-dimensional convolutional DNN operating across the latent dimension. Specifically, the input is processed by an initial one-dimensional convolutional layer that maps the two input channels (I/Q) to a
128-channel hidden representation. This is followed by two residual blocks, each consisting of two convolutional layers with kernel size 3 and ReLU activations. Residual connections are used to stabilize training and enable effective denoising. A final convolutional layer maps the hidden representation back to two channels, producing the relay transmit signal. The output is then normalized to enforce a fixed average transmit power across channel uses.
Unlike DF, LF does not reconstruct the input in the image domain and instead learns a direct transformation in the latent space. For , DF employs 26.17M DNN parameters (17.49M at the decoder and 8.68M at the encoder), while the lightweight LF uses 199K parameters.
In each of the relay modes, the destination receives the relay transmission in the second phase as
where the relay-to-destination channel coefficient follows Rayleigh fading and is additive Gaussian noise. Since the two transmission phases are orthogonal, the overall signal received at the destination is:
The concatenated representation serves as the input to the semantic and reconstruction decoder DNNs at the destination. In DNN operations, is represented in its I/Q form as a real-valued tensor of size .
(i) The semantic decoder applies the mapping
parameterized by , where is the predicted class-probability vector, is the predicted class label, and K is the number of classes. The decoder is a multilayer perceptron that takes the flattened latent representation as input and passes it through two fully connected layers of sizes 512 and 256, each followed by ReLU activation and dropout with probability 0.5. The final layer outputs class logits, which are converted to probabilities via the softmax function, yielding . For n = 16, the semantic decoder has 167K parameters.
(ii) The reconstruction decoder applies the mapping
parameterized by , where denotes the reconstructed input. The decoder first flattens the input into a vector of dimension 4n, passes it through two fully connected layers (mapping to 1024 and then to a feature tensor of size ), and then applies two transposed convolutional layers with channel dimensions , kernel size 4, stride 2, and padding 1 to recover the original spatial resolution. A final convolutional layer with sigmoid activation produces the reconstructed image . For , the reconstruction decoder has 17.52M parameters.
The system is trained end-to-end using a multi-task loss function. The semantic loss is defined as the cross-entropy between the true label and the predicted class probabilities,
The per-sample reconstruction mean squared error (MSE) is defined as
where the MSE is averaged over all image elements. The reconstruction loss is then given by
This loss is complemented by a structural similarity loss that captures perceptual quality. The structural similarity loss is based on the Structural Similarity Index Measure (SSIM). For input s and reconstruction , SSIM(s, ) evaluates the similarity between the two images by jointly comparing their local luminance, contrast, and structural information. A higher SSIM value indicates greater perceptual similarity. The corresponding loss is defined as
Peak signal-to-noise ratio (PSNR) is incorporated as a complementary reconstruction metric and is defined as
where denotes the maximum possible image intensity. Although derived from MSE, PSNR expresses reconstruction error on a logarithmic decibel scale. The corresponding loss term is defined as
The total loss is formed as a weighted combination of losses,
where all weights are non-negative and control the trade-off between semantic accuracy, reconstruction fidelity, and perceptual quality. In the numerical results, we set , , , and .
Training is performed using the Adam optimizer with a learning rate of , a batch size of 128, and a total of 500 training epochs. During each iteration, mini-batches of input samples are encoded, transmitted through stochastic channel realizations, processed by the relay, and decoded at the destination. Gradients are computed with respect to the total loss and propagated through the network, enabling joint optimization of the source encoder, relay transformation, and destination decoders. This end-to-end framework adapts representations and processing to both channel and task requirements.
For comparison, we consider a baseline where communication occurs directly between the source and destination. The source transmits the representation x in a single phase without a relay, and the destination applies reconstruction and semantic decoders with the same architecture, with input dimensions adjusted to the single observation.
For numerical results, we consider CIFAR-10 images, locate the relay midway between the source and destination, and use distance-dependent path loss with exponent 4 to determine the link SNRs. Fig. 2 shows the semantic accuracy as a function of the direct link SNR. Relay-assisted schemes consistently

Fig. 2: Semantic accuracy in semantic relay communications.
outperform the direct baseline, with gains most pronounced at low SNR. The proposed approach achieves an absolute improvement of up to 0.4248 in semantic accuracy, along with gains of 2.58 dB in PSNR and 0.1362 in SSIM relative to the direct communication baseline, demonstrating improved semantic and perceptual performance.
III. RELAY ATTACK ON SEMANTIC COMMUNICATIONS
We consider a threat model in which the relay node is an insider adversary, i.e., a Byzantine node, as shown in Fig. 3. The relay participates in the communication protocol and, as an insider in the jointly deployed system, has access to intermediate signals and knowledge of the destination processing pipeline. The objective of the attack is to degrade the semantic inference capability of the destination while maintaining the relay transmit-power constraint.
The relay receives the signal and is expected to transmit a processed version toward the destination. Under normal operation, the relay applies according to the selected relaying scheme and transmits the resulting signal. Under the Byzantine attack, the relay instead transmits a perturbed signal
where is a trained perturbation function and is a design parameter that controls the relative strength of the perturbation prior to normalization. The normalization enforces unit average squared magnitude per real I/Q component, so determines the relative contribution of the perturbation to the relay signal rather than the absolute transmit power. In the numerical results, is set to 0.2.
The source encoder, relay transformation, and destination decoders are jointly trained to optimize end-to-end communication performance. During attack training, the relay is assumed to have access to the architecture and parameters of the destination semantic decoder and uses them to compute the clean and attacked class probabilities. The perturbation generator is optimized offline using gradient-based training, with its parameters updated after each communication-model epoch and once more before final evaluation, while the communication model is held fixed during each update. Once

Fig. 3: Attack on semantic relay communications.
trained, it generates each test-time perturbation in a single forward pass based on the current relay observation , without access to ground-truth labels, per-sample gradient computation, or iterative test-time optimization.
The perturbation function is implemented as a lightweight DNN operating on the relay input. The complex-valued signal is represented by its I/Q components as a real-valued tensor of size . The DNN consists of three one-dimensional convolutional layers with channel dimensions , kernel size 3, and padding 1, with ReLU activations after the first two layers. These layers capture local dependencies across consecutive channel uses, while the final layer produces a two-channel perturbation matching the relay signal dimensionality. The perturbation output is normalized to unit root-mean-square magnitude and then scaled according to the relay-input magnitude using a trainable gain. The attack DNN has 51K trainable parameters.
The perturbation network is trained by optimizing an objective that directly degrades semantic inference at the destination while enforcing communication and power constraints. Let denote the semantic decoder's predicted probability for class given destination observation , and let and denote the destination observations under the clean and attacked relay transmissions, respectively.
The untargeted attack encourages prediction uncertainty by maximizing the entropy
Maximizing this term drives the predicted distribution toward uniformity and degrades semantic reliability.
A Kullback–Leibler (KL) divergence term encourages the attacked prediction to differ from the clean prediction of the fixed communication model. The KL divergence is
Maximizing this term drives the attacked prediction away from the clean prediction.
To discourage large perturbations, a power regularization term is imposed,
which penalizes the mean squared perturbation magnitude and controls the perturbation magnitude prior to the normalization

Fig. 4: Reduction in semantic accuracy due to relay attack.
step that enforces the relay transmit-power constraint.
The overall attack objective is defined as
Minimizing maximizes to increase prediction uncertainty and to separate the attacked and clean predictions, while minimizing to penalize perturbation power. In the numerical results, we set and , and vary . The perturbation network is trained separately using stochastic gradient-based optimization while the communication-model parameters are frozen, with only the perturbation-network parameters updated. At test time, the perturbation is generated in a single forward pass without access to ground-truth labels.
Unlike standard input-space gradient-based attacks such as the Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD), the proposed attack operates on latent communication signals and uses a learned mapping to generate perturbations in a single forward pass at test time, without per-sample gradient computation or optimization. It is constrained by physical-layer effects, including power normalization and channel impairments, and does not require label access at test time. Rather than manipulating decoder inputs directly, the relay perturbs an intermediate representation that propagates through the wireless channel. The perturbation model is trained over varying channel realizations.
Fig. 4 shows the reduction in semantic accuracy due to the relay attack under the LF strategy. The attack is highly effective across the considered SNR range, causing major degradation in semantic accuracy as the direct source-destination SNR varies. Its impact is governed by the perturbation power weight , which controls the trade-off between attack strength and perturbation magnitude. As increases, the perturbation is more constrained and the attack effect is reduced, primarily at very low SNR where channel noise dominates, but becomes prominent again at moderate and high SNR even under stronger constraints. Across all considered SNRs and values of , the attack reduces semantic accuracy by up to 89.42% relative to the no-attack case and degrades perceptual quality, with PSNR and SSIM reductions of up to 5.75 dB and 0.2317,
respectively, potentially driving performance below the direct transmission baseline. The attack remains effective, with lower amplifying its impact across a wider SNR range.
IV. CONCLUSION
We have studied a two-phase relay-assisted SemCom model, where an intermediate relay processes received wireless signals to improve end-to-end semantic accuracy. Joint optimization of the source encoder, relay processing, and destination decoders improves semantic accuracy over direct transmission, with larger gains at lower SNRs. To examine the associated security risks, we considered the relay as an insider (Byzantine) adversary that exploits access to intermediate signals and knowledge of the destination model to inject structured perturbations. We have shown that a perturbation function trained via deep learning can effectively degrade semantic inference at test time. These results highlight the major security risks introduced by relay-assisted SemCom despite their semantic-accuracy gains, motivating robust defenses against insider threats in learning-enabled relay systems.
REFERENCES
[1] B. Guler and A. Yener, "Semantic index assignment," in IEEE International Conference on Pervasive Computing and Communication Workshops (PERCOM WORKSHOPS), 2014. [2] H. Xie, Z. Qin, G. Y. Li, and B.-H. Juang, "Deep learning enabled semantic communication systems," IEEE Transactions on Signal Processing, vol. 69, pp. 2663–2675, 2021. [3] D. Gündüz, Z. Qin, I. E. Aguerri, H. S. Dhillon, Z. Yang, A. Yener, K. K. Wong, and C.-B. Chae, "Beyond transmitting bits: Context, semantics, and task-oriented communications," IEEE Journal on Selected Areas in Communications, vol. 41, no. 1, pp. 5–41, 2022. [4] X. Luo, B. Yin, Z. Chen, B. Xia, and J. Wang, "Autoencoder-based semantic communication systems with relay channels," in IEEE International Conference on Communications (ICC) Workshops, 2022. [5] W. Lin, Y. Yan, L. Li, Z. Han, and T. Matsumoto, "Semantic-forward relaying: A novel framework toward 6G cooperative communications," IEEE Communications Letters, vol. 28, no. 3, pp. 518–522, 2024. [6] J. Guo, H. Chen, B. Song, Y. Chi, C. Yuen, F. R. Yu, G. Y. Li, and D. Niyato, "Distributed task-oriented communication networks with multimodal semantic relay and edge intelligence," IEEE Communications Magazine, vol. 62, no. 6, pp. 82–89, 2024. [7] E. Arda, E. Kutay, and A. Yener, "Semantic forwarding for next generation relay networks," in IEEE Conference on Information Sciences and Systems (CISS), 2024. [8] Y. E. Sagduyu, T. Erpek, A. Yener, and S. Ulukus, "Semantic leakage and privacy preservation in relay-assisted semantic communications," arXiv preprint arXiv:2606.31973, 2026. [9] Y. E. Sagduyu, S. Ulukus, and A. Yener, "Task-oriented communications for NextG: End-to-end deep learning and AI security aspects," IEEE Wireless Communications, vol. 30, no. 3, pp. 52–60, 2023. [10] Y. E. Sagduyu, T. Erpek, S. Ulukus, and A. Yener, "Is semantic communication secure? A tale of multi-domain adversarial attacks," IEEE Communications Magazine, vol. 61, no. 11, pp. 50–55, 2023. [11] Y. E. Sagduyu, T. Erpek, S. Ulukus, and A. Yener, "Vulnerabilities of deep learning-driven semantic communications to backdoor (Trojan) attacks," in IEEE Conference on Information Sciences and Systems (CISS), 2023. [12] Y. E. Sagduyu, T. Erpek, A. Yener, and S. Ulukus, "Will 6G be semantic communications? Opportunities and challenges from task oriented and secure communications to integrated sensing," IEEE Network, vol. 38, no. 6, pp. 72–80, 2024. [13] Y. E. Sagduyu, A. Yener, and S. Ulukus, "Securing semantic communications against adversarial attacks," Foundations of Semantic Communication Networks, pp. 309–338, 2025. [14] Y. E. Sagduyu, T. Erpek, A. Yener, and S. Ulukus, "Privacy-preserving semantic communications via multi-task learning and adversarial perturbations," IEEE Network, pp. 1–8, 2026.