% acl_latex.tex (English version for SemEval-2026 Task 3 Track A Subtask 1 system paper)
\documentclass[11pt]{article}

% Change "review" to "final" for camera-ready.
% Change to "preprint" for a non-anonymous version with page numbers.
\usepackage[final]{acl}

% Standard package includes
\usepackage{times}
\usepackage{latexsym}

% For proper rendering and hyphenation of words containing Latin characters (including in bib files)
\usepackage[T1]{fontenc}

% This assumes your files are encoded as UTF8
\usepackage[utf8]{inputenc}

% Improves layout and spacing
\usepackage{microtype}
\usepackage{inconsolata}

% Figures / tables / math
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage[section]{placeins}	

% URLs
\usepackage{url}
\newcommand{\code}[1]{\path{#1}}

% Breakable verbatim/code blocks in two-column layout
\usepackage{fvextra}
\DefineVerbatimEnvironment{jsoncode}{Verbatim}{
  fontsize=\footnotesize,
  breaklines=true,
  breakanywhere=true,
  breaksymbolleft={},
  frame=single,
  framesep=2mm
}

% If the title and author information does not fit in the area allocated, uncomment:
% \setlength\titlebox{5cm}

\title{TeleAI at SemEval-2026 Task 3: Large Language Models for Dimensional Aspect-Based Sentiment Analysis}

\author{
  \begin{tabular}{c}
    Yan Zhou\thanks{Work done during an internship at TeleAI.},
    Shicheng Wang\footnotemark[1],
    Shiquan Wang, Mengjiao Bao, \\
    Ruiyu Fang, Shuangyong Song, Yongxiang Li,
    Xuelong Li\thanks{Corresponding author: \texttt{xuelong\_li@chinatelecom.cn}}
  \end{tabular}\\
  Xingchen AGI Lab, China Telecom Artificial Intelligence Technology (Beijing) Co., Ltd\\
  {%
    \footnotesize\ttfamily
    \microtypesetup{expansion=false,protrusion=false}%
    \begin{tabular}{c}
      \detokenize{2065431274@qq.com, 3269317821@qq.com, wangsq23@chinatelecom.cn}\\
      \detokenize{baomj@chinatelecom.cn, fangry@chinatelecom.cn, songshy@chinatelecom.cn}\\
      \detokenize{liyx25@chinatelecom.cn, xuelong_li@chinatelecom.cn}
    \end{tabular}%
  }
}

\begin{document}

\maketitle

\begin{abstract}
We present TeleAI's system for SemEval-2026 Task~3 (Track~A), focusing on Subtask~1 (DimASR): given a text and aspect terms, the system predicts continuous Valence--Arousal (VA) scores under the official $RMSE_{VA}$ metric \cite{yu-etal-2026-semeval}.
Our regression framework uses Qwen2.5-7B as a feature extractor with LoRA-based parameter-efficient fine-tuning, multilingual/multi-domain mixed training, R-Drop-style consistency regularization, embedding-level PGD adversarial training, output interval mapping, and post-hoc linear calibration.
Experimental observations and ablation trends indicate that mixed training and robustness/consistency regularization substantially reduce $RMSE_{VA}$, yielding competitive performance across multiple language--domain settings. We also tried lightweight direct-JSON prompting for Subtasks~2 and~3, but those runs were less competitive, so we focus on Subtask~1.
\end{abstract}

\section{Introduction}
\paragraph{Task background and motivation.}
DimABSA reframes aspect-level sentiment prediction as estimating a point in a two-dimensional affect space: each aspect is assigned Valence (pleasantness) and Arousal (activation/intensity) scores rather than a discrete polarity label.
This finer-grained formulation follows affect-space views in emotion psychology and, in SemEval-2026 Task 3 Track A, is evaluated as multilingual/multi-domain VA regression using $RMSE_{VA}$ \cite{yu-etal-2026-semeval}.

\paragraph{Overall approach.}
We model DimASR as end-to-end regression: the input is formed by concatenating \texttt{[ASPECT]} and \texttt{[TEXT]} segments, and the output is a two-dimensional continuous value $(V,A)$.
Our main system uses Qwen2.5-7B as the backbone (obtaining the final-layer hidden states via \texttt{AutoModel}), applies mask-aware mean pooling to produce a sequence-level representation, and predicts VA using a 2D linear regression head.
To enhance robustness and generalization, we employ LoRA in attention projections, sigmoid-based output interval mapping to $[1.00,9.00]$, Smooth L1 (Huber) loss, R-Drop-style regression consistency, embedding-level PGD adversarial training, post-hoc linear calibration, and differential learning rates with warmup plus linear decay.

\paragraph{AI Flow framework.}
This work is conducted within TeleAI's \textit{AI Flow} framework, which advocates device--edge--cloud collaboration and \emph{familial models} for ubiquitous intelligence under resource and communication constraints \cite{an2026aiflow}.
This context is supported by TeleAI's open model-family reports, including TeleChat, Tele-FLM, TeleChat2/2.5/T1, and TeleChat3-MoE, which document bilingual/multilingual LLM evolution, scaling, post-training, and training infrastructure \cite{TeleChatTechnicalReport2024,wang-etal-2024-telechat,wang2025technicalreporttelechat2telechat25t1,liu2025trainingreporttelechat3moe,li2024teleflmtechnicalreport,li2024teleflm52b1t}.
Here we focus on AI Flow's NLP modeling component by building an aspect-level VA regression module; our LoRA-based adaptation and exploration of backbone scales align with the \emph{familial model} principle, while explicit multi-tier orchestration is left for future work.

\paragraph{Participation in Subtasks 2 and 3.}
We also explored Subtasks~2 and~3 with a minimal instruction-prompting setup for direct JSON generation; because it was less competitive under our tuning budget, we focus on Subtask~1.

\paragraph{Key findings (from ablation trends).}
We observe that \textbf{Qwen2.5 models substantially outperform BERT-style encoders}, \textbf{multilingual/multi-domain mixed training beats single language--domain training}, \textbf{LoRA outperforms full fine-tuning under the same budget}, and \textbf{the 7B model outperforms larger models}, likely because limited data increases overfitting risk.

\paragraph{Code release.}
We will release our Subtask 1 training and inference code for reproducibility:
\url{https://github.com/yanzhou06/SemEval-2026-Task3-subtask1-code}

\section{Background}
\subsection{Task definition and I/O format}
In Track A Subtask 1 (DimASR), each instance consists of a text and one or more aspect terms appearing in the text.
The system must output a pair of real-valued VA scores for each aspect, where each score lies in $[1.00, 9.00]$ and is rounded to two decimals.
The official evaluation primarily uses $RMSE_{VA}$ \cite{yu-etal-2026-semeval}.

\paragraph{Input example. (synthetic)}
\begin{jsoncode}
{
  "ID": "R101",
  "Text": "The screen is crisp and bright, but the battery drains fast and feels unreliable.",
  "Aspect": ["screen", "battery"]
}
\end{jsoncode}

\paragraph{Output example. (synthetic)}
\begin{jsoncode}
{
  "ID": "R101",
  "Aspect_VA": [
    {"Aspect": "screen", "VA": "7.62#4.85"},
    {"Aspect": "battery", "VA": "2.31#6.40"}
  ]
}
\end{jsoncode}

\paragraph{Subtasks 2 and 3 (brief note).}
Subtasks~2 and~3 use a similar JSON-output interface; our direct instruction-following LLM baseline was less competitive, so we mainly report Subtask~1.

\subsection{Data split terminology (dev/test)}
The shared task provides \texttt{dev} and \texttt{test} phases (as named by the organizers). In this paper:
\begin{description}
  \item[dev/test:] refer to the official phase splits and evaluation protocol;
  \item[val:] refers to our locally held-out validation set split from training data for model selection and calibration (different from the official dev set).
\end{description}

\subsection{Related work}
The valence--arousal (VA) affect space is adopted in this task and its dataset construction as a continuous sentiment representation \cite{yu-etal-2026-semeval,lee2026dimabsabuildingmultilingualmultidomain}.
In NLP, related work includes word-level VAD resources and dimensional sentiment analysis frameworks \cite{Mohammad2018}, as well as closely related work on microblog hashtag/category classification, e-commerce sentiment analysis and emotional comfort, concept-level emotion-cause detection, emotion-controlled response generation, empathetic dialogue, and text-based emotion detection \cite{song2015classifyingrankinghashtags,song2020sentimentanalysisalime,song2015detectingconceptemotioncause,song-etal-2021-emotional,song2021emotioncontrolleddynamicvocabulary,zhao2023muse,wang2025emotionalSupportLLM,wang2025empatheticDialogueLLMs,zhao2026mege,wang-etal-2025-teleai}.
For training methods, we integrate LoRA, R-Drop, and PGD, adapting them to VA regression \cite{LoRA2021,RDrop2021,Madry2017,Qwen25TR}.

\paragraph{Broader perspectives.}
Our setting can be viewed as a continuous variant of multi-output prediction, which is broadly related to multi-dimensional (multi-target) learning \cite{jia2024mdc}.
To mitigate language/domain shifts, we adopt multilingual and multi-domain mixed training, which connects to general transfer and representation adaptation considerations surveyed in transfer metric learning \cite{luo2024tml}.
For our lightweight exploration of Subtasks~2--3 via direct JSON generation, we refer to recent surveys on tool learning with language models that summarize structured pipelines and benchmarking practices for LLM-centric task execution \cite{chen2025toollearning}.

\section{System Overview}
\subsection{Pipeline}

\begin{figure}[!htbp]
  \centering
  \includegraphics[width=\linewidth]{pipeline.jpg}
  \caption{Overview of our DimASR system pipeline: unified LoRA training, Chinese-specific refinement, multi-checkpoint fusion, and final VA prediction.}
  \label{fig:pipeline}
\end{figure}

\FloatBarrier

\begin{enumerate}
  \item \textbf{Parsing and instance expansion:} Expand each JSONL sample into row-wise training instances of the form (Text, Aspect, V, A);
  \item \textbf{Input templating:} Concatenate inputs using \texttt{[ASPECT]} and \texttt{[TEXT]} markers;
  \item \textbf{Qwen2.5-7B + LoRA regression:} Apply mean pooling to obtain sequence representations and regress VA;
  \item \textbf{Robust training:} Smooth L1 loss with R-Drop consistency and embedding-level PGD adversarial training;
  \item \textbf{Post-processing and calibration:} Map/clip outputs to $[1,9]$, fit a linear calibrator on \texttt{val}, and apply it to dev/test predictions.
\end{enumerate}

\subsection{Data parsing and instance construction}
Official training files may contain different structures (e.g., \texttt{Aspect\_VA}, \texttt{Triplet}, \texttt{Quadruplet}), so we flatten them into one row per aspect, parse \texttt{VA="V\#A"} into two labels, and keep the first occurrence for duplicate \texttt{(ID, Aspect)} pairs.

\subsection{Input representation: explicit aspect and context markers}
\[
x = \texttt{[ASPECT] } a \texttt{ [/ASPECT] \textbackslash n[TEXT] } t \texttt{ [/TEXT]}
\]
where $a$ is the aspect term and $t$ is the text.

\subsection{Backbone model and LoRA}
We use Qwen2.5-7B final-layer hidden states $H\in\mathbb{R}^{L\times d}$ and attach LoRA adapters to the attention projections (Q/K/V/O and the packed projection), updating only the adapters and regression head \cite{Qwen25TR,LoRA2021}.
LoRA hyperparameters are $r=16$, $\alpha=32$, and dropout $=0.05$.

\subsection{Regression head: mean pooling and interval mapping}
Mask-aware mean pooling:
\[
h = \frac{\sum_{i=1}^{L} m_i \cdot H_i}{\sum_{i=1}^{L} m_i + \epsilon},\quad
z = W h + b \in \mathbb{R}^{2}
\]
Sigmoid-based mapping to $[1.00,9.00]$:
\[
\hat{y} = 1 + 8\cdot \sigma(z)
\]
where $\hat{y}=(\hat{V},\hat{A})$.

\subsection{Training objective: Huber + R-Drop + PGD}
We use Smooth L1 (Huber) as the main loss:
\[
\mathcal{L}_{\text{main}} = \text{SmoothL1}_\beta(\hat{y}, y),\quad \beta=0.5
\]
where $y=(V,A)$ \cite{PyTorchSmoothL1}.

R-Drop-style consistency regularization (regression variant):
\begin{align*}
\mathcal{L}_{\text{rdrop}}
= \tfrac{1}{2}\Big(
&\mathcal{L}_{\text{main}}(\hat{y}^{(1)},y)
+ \mathcal{L}_{\text{main}}(\hat{y}^{(2)},y)
\Big) \\
&+ \alpha \cdot \text{MSE}(\hat{y}^{(1)}, \hat{y}^{(2)}),
\quad \alpha=0.5
\end{align*}
\cite{RDrop2021}

Embedding-level PGD ($\ell_\infty$):
\[
\delta \leftarrow \Pi_{[-\epsilon,\epsilon]}\big(\delta + \eta \cdot \text{sign}(\nabla_\delta \mathcal{L}_{\text{main}}(E+\delta))\big)
\]
where $\epsilon=0.02,\ K=3,\ \eta=\epsilon/K$ \cite{Madry2017}.
The overall loss is:
\[
\mathcal{L} = \mathcal{L}_{\text{clean}} + \lambda \cdot \mathcal{L}_{\text{adv}},\quad \lambda=0.5
\]

\subsection{Multilingual and multi-domain mixed training}
We scan for \texttt{\{lang\}\_\{domain\}\_train\_*.jsonl}, split 10\% of each file as local \texttt{val}, and merge the remaining portions into a multilingual/multi-domain training set.
Our best setting uses mixed training for all epochs (\texttt{pretrain\_ratio=1.0}); multi-stage domain transfer and negative Pearson correlation loss gave no consistent gains and are excluded.

\subsection{Post-hoc linear calibration}
On \texttt{val}, we fit a univariate linear regression calibrator for $\hat{V}$ and $\hat{A}$ separately:
\[
\tilde{y} = \text{clip}(a\hat{y}+b, 1, 9)
\]
and apply it to dev/test predictions.

\section{Experimental Setup}
\subsection{Data usage and splits}
\begin{description}
  \item[Training set:] All \texttt{*\_train\_*.jsonl} files in the training directory (multilingual + multi-domain mixed).
  \item[Validation set (val, local split):] 10\% split from each training file, merged for best checkpoint selection and calibration fitting.
  \item[dev/test (official phases):] Not used for training; used only to generate submission predictions.
\end{description}

\subsection{Hyperparameters and optimization}
We use \code{max_len=128} with right padding.
The per-GPU batch size is \code{per_gpu_bs=4} with \code{grad_accum=1}; using 8-GPU DDP yields an effective batch size of 32.
We optimize with AdamW (weight decay=0.01) and employ differential learning rates: 1e-3 for the regression head and 1e-4 for LoRA parameters, with a warmup ratio of 0.1 followed by linear decay.
We apply gradient clipping at 1.0, use bf16 precision, and set \code{seed=42}.
R-Drop uses $\alpha=0.5$; PGD uses $\epsilon=2\times 10^{-2}$, steps=3, and $\lambda=0.5$.

\subsection{Compute resources}
Training is conducted on a single machine with 8 NVIDIA A100 (40GB) GPUs using DDP (\texttt{torchrun --nproc\_per\_node=8}).
We use bfloat16 and gradient checkpointing to stabilize training.

\subsection{Evaluation metrics}
Let $\mathbf{y}=(V,A)$. The official metric is:
\[
RMSE_{VA}=\sqrt{\frac{1}{N}\sum_{i=1}^{N}\left\lVert \mathbf{y}^{(i)}_p-\mathbf{y}^{(i)}_g\right\rVert_2^2}.
\]
Here $N$ denotes the number of evaluated aspect instances. \cite{yu-etal-2026-semeval}.
On \texttt{val}, we additionally compute $PCC_V$ and $PCC_A$ for analysis, but they are not used for official ranking.

\section{Results and Analysis}

\subsection{Main Results}
On the official Track A Subtask 1 evaluation, our proposed system (Qwen2.5-7B with LoRA and robust training strategies) demonstrated highly competitive performance. Specifically, in the English-Restaurant domain, our system achieved a final $RMSE_{VA}$ of 0.85 during the official \texttt{dev} phase, ranking first on the leaderboard.

\subsection{Ablation Study}
To thoroughly evaluate the contribution of each component in our proposed pipeline, we conducted an ablation study on the official \texttt{dev} set for the English-Restaurant domain. As shown in Table~\ref{tab:ablation}, our baseline model (Qwen2.5-7B using standard full-parameter fine-tuning without specialized techniques) achieved an $RMSE_{VA}$ of 1.03. Our final system significantly reduced the error to 0.85.

\begin{table}[htbp]
\centering
\small
\renewcommand{\arraystretch}{1.1}
% 使用 tabularx 限制表格总宽度为一栏宽度，并让第一列 (X) 自动换行
\begin{tabularx}{\columnwidth}{@{}Xc@{}} 
\toprule
\textbf{Model / Configuration} & \textbf{$RMSE_{VA}$ ($\downarrow$)} \\
\midrule
Baseline: Qwen2.5-7B (Full SFT, standard MSE) & 1.03 \\
\midrule
\textbf{Our Final System (LoRA + All Components)} & \textbf{0.85} \\
\quad \textit{Replace LoRA with Full SFT} & 0.91 \\
\quad \textit{w/o} PGD Adversarial Training & 0.94 \\
\quad \textit{w/o} R-Drop Consistency & 0.92 \\
\quad \textit{w/o} Output Interval Mapping & 0.89 \\
\quad \textit{w/o} Huber Loss (using standard MSE) & 0.88 \\
\quad \textit{w/o} Differential LR \& Warmup/Decay & 0.87 \\
\quad \textit{w/o} Post-hoc Linear Calibration & 0.87 \\
\bottomrule
\end{tabularx}
\caption{Quantitative ablation study on the \texttt{dev} set (English-Restaurant). \textit{w/o} denotes removing a specific component from the final pipeline.}
\label{tab:ablation}
\end{table}

Based on the quantitative results, we summarize the key findings:
\begin{description}
  \item[Robustness techniques are critical:] Removing PGD adversarial training and R-Drop consistency regularization leads to the most significant performance drops (+0.09 and +0.07 $RMSE_{VA}$, respectively), indicating that mitigating overfitting and robustifying the representation space are vital for continuous affect prediction.
  \item[LoRA vs. Full Fine-tuning:] Under the same training budget, replacing LoRA with full-parameter fine-tuning degrades performance from 0.85 to 0.91. This confirms our hypothesis that parameter-efficient fine-tuning (PEFT) is more suitable for this task, as full fine-tuning on limited domain data tends to overfit.
  \item[Model scale and Data composition:] Beyond the table, we observed that the Qwen2.5-7B model consistently outperforms its larger variants (specifically, Qwen2.5-14B and Qwen2.5-72B) in our setup. We attribute this to the increased risk of overfitting when fine-tuning massive models on limited domain-specific data. Furthermore, introducing multilingual and multi-domain mixed training provided a universal foundation that stabilized the above components.
  \item[Optimization and Calibration:] Output interval mapping, Huber loss, differential learning rates, and post-hoc linear calibration collectively contribute to stable convergence and fine-grained error correction, providing a combined gain of approximately 0.05 $RMSE_{VA}$.
  \item[Non-effective components:] Multi-stage domain transfer training and negative Pearson correlation loss did not improve performance in our preliminary experiments, and thus were excluded from the final configuration.
\end{description}

\subsection{Error analysis}
We observe the following major error patterns:
\paragraph{(1) Arousal is harder to predict.}
Arousal depends more on intensity markers, tone, and contrastive structures, and predictions tend to shrink toward mid-range values.
\paragraph{(2) Contrastive structures cause aspect attribution confusion.}
In sentences like ``the food is good, but the service is terrible,''
negative evidence may incorrectly propagate to unrelated aspects.
\paragraph{(3) Truncation removes crucial evidence.}
When texts are truncated under \texttt{max\_len=128}, key trigger words may be dropped; increasing \texttt{max\_len} to 256 did not significantly improve performance but increased VRAM cost and slowed iteration, so we kept \texttt{max\_len=128}.
\paragraph{(4) Fine-grained numerical errors.}
Linear calibration can partially correct global bias, but instance-level fine-grained errors remain.

\section{Conclusion}
We propose a regression framework centered on Qwen2.5-7B with LoRA, combined with multilingual and multi-domain mixed training, sigmoid-based interval mapping, Huber loss, R-Drop consistency regularization, PGD adversarial training, and post-hoc linear calibration.
Our system achieves competitive performance across multiple language--domain settings \cite{yu-etal-2026-semeval}.
Our analysis suggests that multilingual/multi-domain training and robustness/consistency regularization are the primary sources of improvement, while arousal modeling, contrastive attribution, and truncation remain major error sources.

\section*{Limitations}
We select models and fit linear calibrators using a locally split validation set (\texttt{val}), which may differ in distribution from the official dev/test phases.

Our approach is also limited when the same aspect appears multiple times in one sentence with different evidence: because the input contains only \texttt{[ASPECT]} and full \texttt{[TEXT]}, the model outputs one VA value and may miss intra-sentential opinion differences.
A feasible direction is clause-level segmentation at inference time, possibly with LLM-assisted splitting, to strengthen aspect--opinion alignment; we did not implement it due to time constraints.

\section*{Acknowledgments}
We thank the organizers of SemEval-2026 Task 3 for the data, evaluation protocol, and shared task platform; the open-source community for PyTorch, Transformers, PEFT, and related tools; and TeleAI's AI Flow initiative, within which this system was developed \cite{an2026aiflow}.

\clearpage
\bibliographystyle{acl_natbib}
\bibliography{latex/custom}

\appendix

\section{Appendix: Hyperparameters and Pseudocode}
\subsection{Key hyperparameters}

\begin{table}[h]
\centering
\small
\setlength{\tabcolsep}{4pt}
\renewcommand{\arraystretch}{1.05}
\begin{tabularx}{\linewidth}{lX}
\toprule
\textbf{Hyperparameter} & \textbf{Value / Setting} \\
\midrule
Epochs & 10 (\code{pretrain_ratio=1.0} at best config) \\
Max Sequence Length & 128 \\
Batch Size & {per\_gpu=4, grad\_accum=1} \\
Optimizer & AdamW, $\lambda_{\text{wd}}=0.01$ \\
Learning Rate & $\eta_{\text{head}}=10^{-3}$;\ $\eta_{\text{LoRA}}=10^{-4}$; warmup 0.1 + linear decay \\
Precision & bf16 (grad clip=1.0, \code{seed=42}) \\
LoRA Config & $r{=}16,\ \alpha{=}32,\ p_{\text{drop}}{=}0.05$ \\
LoRA Targets & {q\_proj,k\_proj,v\_proj,o\_proj,W\_pack} \\
Loss Function & SmoothL1 ($\beta$=0.5) \\
Regularization & R-Drop ($\alpha$=0.5), PGD ($\epsilon$=2e-2, steps=3, $\lambda$=0.5) \\
Calibration & Univariate linear regression on V and A, clip to [1,9] \\
\bottomrule
\end{tabularx}
\caption{Hyperparameter settings for our best model.}
\label{tab:hyperparams}
\end{table}

\subsection{Training pseudocode (simplified)}

\begin{algorithm}[H]
\small
\caption{Simplified Training Procedure with R-Drop and PGD}
\label{alg:training}
\begin{algorithmic}[1]
\Require Epochs $E$, loader, Model, $\alpha$, $\lambda$, PGD steps $K$, bound $\epsilon$
\For{\text{epoch} $= 1$ \To $E$}
    \For{\text{batch } $(x, y)$ \In $\text{loader}$}
        \State \Comment{1. R-Drop Forward Pass}
        \State $y_1 \gets \text{model}(x)$
        \State $\mathcal{L}_1 \gets \text{SmoothL1}(y_1, y)$
        \State $y_2 \gets \text{model}(x)$
        \State $\mathcal{L}_2 \gets \text{SmoothL1}(y_2, y)$

        \State $\mathcal{L}_{\text{mse}} \gets \text{MSE}(y_1, y_2)$
        \State $\mathcal{L}_{\text{clean}} \gets 0.5 \times (\mathcal{L}_1 + \mathcal{L}_2) + \alpha \times \mathcal{L}_{\text{mse}}$

        \State \Comment{2. PGD Adversarial Steps}
        \State $\delta \gets 0$
        \For{$k = 1$ \To $K$}
            \State $\mathcal{L}_{\text{step}} \gets \text{SmoothL1}(\text{model}(x, E+\delta), y)$
            \State $g \gets \text{sign}(\nabla_{\delta}\mathcal{L}_{\text{step}})$
            \State $\delta \gets \text{clip}(\delta + \text{step} \times g, [-\epsilon, \epsilon])$
        \EndFor
        \State $\mathcal{L}_{\text{adv}} \gets \text{SmoothL1}(\text{model}(x, E+\delta), y)$

        \State \Comment{3. Final Loss and Optimization}
        \State $\mathcal{L} \gets \mathcal{L}_{\text{clean}} + \lambda \times \mathcal{L}_{\text{adv}}$
        \State $\text{backward}(\mathcal{L})$
        \State $\text{optimizer.step()}$
    \EndFor
\EndFor
\end{algorithmic}
\end{algorithm}

\end{document}