% This must be in the first 5 lines to tell arXiv to use pdfLaTeX, which is strongly recommended.
\pdfoutput=1
% In particular, the hyperref package requires pdfLaTeX in order to break URLs across lines.

\documentclass[11pt]{article}

% Change "review" to "final" to generate the final (sometimes called camera-ready) version.
% Change to "preprint" to generate 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}
% For Vietnamese characters
% \usepackage[T5]{fontenc}
% See https://www.latex-project.org/help/documentation/encguide.pdf for other character sets

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

% This is not strictly necessary, and may be commented out,
% but it will improve the layout of the manuscript,
% and will typically save some space.
\usepackage{microtype}

% This is also not strictly necessary, and may be commented out.
% However, it will improve the aesthetics of text in
% the typewriter font.
\usepackage{inconsolata}

%Including images in your LaTeX document requires adding
%additional package(s)
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{amsmath}  % 数学公式
\usepackage{amssymb}  % 数学符号
\usepackage{mathtools} % 提供multlined等环境
\usepackage{enumitem} % 支持自定义编号格式
\usepackage{stfloats}
% If the title and author information does not fit in the area allocated, uncomment the following
%
%\setlength\titlebox{<dim>}
%
% and set <dim> to something 5cm or larger.

%\title{Instructions for *ACL Proceedings}

% Author information can be set in various styles:
% For several authors from the same institution:
% \author{Author 1 \and ... \and Author n \\
%         Address line \\ ... \\ Address line}
% if the names do not fit well on one line use
%         Author 1 \\ {\bf Author 2} \\ ... \\ {\bf Author n} \\
% For authors from different institutions:
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \And  ... \And
%         Author n \\ Address line \\ ... \\ Address line}
% To start a separate ``row'' of authors use \AND, as in
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \AND
%         Author 2 \\ Address line \\ ... \\ Address line \And
%         Author 3 \\ Address line \\ ... \\ Address line}

\title{PuerAI at SemEval-2026 Task 5: Homograph Appropriateness Assessment via DeBERTa Contrastive Regression and Contextual Grouping}



\author{
	\textbf{Jiaxu Dao, Zhuoying Li, Hangchao Ma,} \\
	\textbf{Jinli Tong, Xiaoli Lan, Yifan Lu, Zhanji Yang} \\
	School of Technology \\
	Pu'er University \\
	\texttt{Contact:\{daojiaxu, lizhuoying\}@peu.edu.cn} 
}		

%\author{
%  \textbf{First Author\textsuperscript{1}},
%  \textbf{Second Author\textsuperscript{1,2}},
%  \textbf{Third T. Author\textsuperscript{1}},
%  \textbf{Fourth Author\textsuperscript{1}},
%\\
%  \textbf{Fifth Author\textsuperscript{1,2}},
%  \textbf{Sixth Author\textsuperscript{1}},
%  \textbf{Seventh Author\textsuperscript{1}},
%  \textbf{Eighth Author \textsuperscript{1,2,3,4}},
%\\
%  \textbf{Ninth Author\textsuperscript{1}},
%  \textbf{Tenth Author\textsuperscript{1}},
%  \textbf{Eleventh E. Author\textsuperscript{1,2,3,4,5}},
%  \textbf{Twelfth Author\textsuperscript{1}},
%\\
%  \textbf{Thirteenth Author\textsuperscript{3}},
%  \textbf{Fourteenth F. Author\textsuperscript{2,4}},
%  \textbf{Fifteenth Author\textsuperscript{1}},
%  \textbf{Sixteenth Author\textsuperscript{1}},
%\\
%  \textbf{Seventeenth S. Author\textsuperscript{4,5}},
%  \textbf{Eighteenth Author\textsuperscript{3,4}},
%  \textbf{Nineteenth N. Author\textsuperscript{2,5}},
%  \textbf{Twentieth Author\textsuperscript{1}}
%\\
%\\
%  \textsuperscript{1}Affiliation 1,
%  \textsuperscript{2}Affiliation 2,
%  \textsuperscript{3}Affiliation 3,
%  \textsuperscript{4}Affiliation 4,
%  \textsuperscript{5}Affiliation 5
%\\
%  \small{
%    \textbf{Correspondence:} \href{mailto:email@domain}{email@domain}
%  }
%}

\begin{document}
\maketitle
\begin{abstract}
	To assess homograph appropriateness in narrative contexts for SemEval-2026 Task 5, we propose a contrastive regression framework. This approach combines candidate sense definitions with full narrative texts to establish an MSE regression baseline, further enhanced by a contextual grouping ranking loss that models relative rationality among senses. Evaluated on the official AmbiStory dataset, our method consistently outperforms the baseline in accuracy and Spearman correlation. These results validate the efficacy of relative order modeling for capturing fine-grained semantic nuances in complex narratives. The code is available at: \url{https://github.com/daojiaxu/Semeval2026_task5}.

\end{abstract}

\section{Introduction}

Word Sense Disambiguation, as the core task of natural language understanding, has always faced challenges such as fuzzy semantic boundaries and strong context dependence. Traditional tasks assume a "unique correct solution", which differs from the coexistence of polysemy in real language scenarios. SemEval-2026 Task 5 \citep{semeval2026-task-5}focuses on the assessment of the appropriateness of homographs in narrative contexts, requiring models to provide a 1-5 point rationality judgment for candidate senses, which is more aligned with human language cognition habits.

For this task, this study proposes a modeling method based on contrastive regression: first, the specific meanings of candidate senses are combined with complete narrative texts as model inputs, and the semantic matching relationship is directly modeled through the MSE regression baseline; further, a contextual grouping and contrastive sorting strategy is introduced to construct relative rationality constraints between senses within the same narrative framework, in order to enhance the model's ability to distinguish subtle semantic differences. The experiment is conducted based on the official AmbiStory dataset, aiming to verify the added value of relative order modeling to the task and provide new ideas for semantic evaluation in complex contexts.



\section{Related Work}

Pre-trained language models (PLMs) such as BERT, RoBERTa, and DeBERTa have become mainstream solutions for semantic understanding and evaluation tasks \citep{devlin2019bert,liu2019roberta,he2020deberta}. The design of their training objectives is crucial for task performance. Some studies have achieved dual optimization of numerical fitting accuracy and relative order consistency by introducing margin ranking loss within a regression framework. Word sense disambiguation (WSD), as one of the core tasks of semantic understanding, is considered a long-standing challenge in AI due to the inherent ambiguity of word senses. Traditional methods are divided into three categories: supervised, unsupervised, and knowledge-based, and there is still significant room for improvement in overall accuracy \citep{navigli2009word}. In recent years, large language models (LLMs) have brought new breakthroughs to the task of word sense disambiguation. Sumanathilaka et al. combined prompt enhancement mechanisms with knowledge bases and evaluated on the FEWS dataset, finding that models such as GPT-4 Turbo performed excellently. Prompt optimization can improve disambiguation accuracy in complex scenarios  \citep{sumanathilaka2024can}. Kaskov et al. focused on the issue of homonym duplication in diffusion models and proposed an LLM-based prompt word expansion method, effectively reducing duplication rates and semantic ambiguity \citep{kaskov2025doubling}.

In terms of evaluating the ambiguity comprehension ability of LLMs, Keluskar et al. found that off-the-shelf LLMs are prone to misunderstandings and hallucinations when dealing with ambiguity issues, but adding context and other untrained disambiguation methods can effectively improve performance \citep{keluskar2024llms}. Cross-domain research has also provided new ideas, such as Tang et al. proposing a ranking-based contrastive loss function (RCL) to optimize recommendation systems \citep{tang2023ranking}, and Setitra et al. integrating deep models with LLMs to enhance visual polysemy and word sense disambiguation performance \citep{setitra2025leveraging}. Large language models are prone to hallucinations due to ambiguous understanding biases. The LI framework proposed by Oxford University can accurately detect such hallucinations and assess the reliability of model outputs by tracking the flow of information at each layer\citep{kim2025detecting}.


Contrastive learning is a self-supervised representation learning method that trains models by distinguishing between similar and dissimilar samples, and has demonstrated excellent performance across multiple domains\citep{hu2024comprehensive}. Zhang Jing and others proposed the LA-UCL framework, which introduces a large language model to enhance contrastive learning for text classification with limited samples. Through self-enhancement and external enhancement modules, it improves discrimination and mitigates overfitting, achieving experimental results superior to the baseline model \citep{zhang2024la}. Xu Xiaodan and others proposed the CodeGPTSensor model, which is based on a contrastive learning framework and UniXcoder semantic encoder, and outperforms existing baselines \citep{xu2025distinguishing}.

Overall, pre-trained language models have become a core driving force for semantic understanding and evaluation tasks, demonstrating great potential in scenarios such as word sense disambiguation and ambiguous question answering. Future research can further explore directions such as cross-domain knowledge fusion and efficient prompt learning to enhance the model's understanding and processing capabilities in complex semantic scenarios.

\section{Task and Dataset}

SemEval 2026 Task 5 focuses on the semantic rationality scoring of homographs in narrative contexts, requiring the model to provide a relevance judgment on a scale of 1-5 for candidate senses of the target word. Unlike traditional word sense disambiguation tasks that assume a "unique correct solution", this task is more closely aligned with real-life language scenarios, allowing for multiple reasonable interpretations of word senses within the same context.

The experiment utilizes the official AmbiStory dataset, which comprises five short stories consisting of three background sentences, one ambiguous sentence, and an optional ending. The data sample is shown in Figure \ref{fig:data sample}. The core fields of each sample include:

\begin{enumerate}[label=\alph*)] % \alph 表示小写字母，\Alph 表示大写字母
	\item Description of candidate senses (judged\_meaning), clarifying the specific meaning of the target word being evaluated.
	\item Narrative context fields (precontext, sentence, ending) jointly constitute a complete narrative logic.
	\item For annotation data, the training/dev set contains the scoring lists (choices) and their average scores (average) from at least 5 annotators, while the test set does not contain annotation information.
\end{enumerate}

\begin{figure}[t]
	\includegraphics[width=\columnwidth]{data_sample}
	\caption{data sample}
	\label{fig:data sample}
\end{figure}


To directly model the matching relationship between candidate senses and contexts, we construct the input as a sentence pair: (judged\_meaning, full\_context), where full\_context is the concatenated text of precontext+sentence+ending, and the maximum input length is set to 512. This design allows the model to simultaneously capture the semantic features of senses and contextual information, enabling precise judgment of the rationality of senses in a specific narrative.

\section{Methods}
\subsection{MSE regression baseline}
The baseline treats SemEval 2026 Task 5 as a regression problem, adopting the classic architecture of attaching a regression head on top of a pretrained encoder. During the training phase, the mean squared error (MSE) is used as the loss function to fit the average of the manually annotated scores for the samples. The input is constructed as a sentence pair combining the specific meaning of the candidate senses with the complete narrative text. After encoding with pretrained models such as DeBERTa-v3-large, a single output regression layer is used to predict continuous scores, while monitoring indicators such as Spearman correlation coefficient and accuracy to evaluate model performance.

In the inference stage, the continuous prediction values output by the model need to be converted into discrete scores that meet the requirements. The specific conversion formula is as follows:

\begin{enumerate}[label=\alph*)] % \alph 表示小写字母，\Alph 表示大写字母
	\item Round to the nearest whole number:
	\begin{equation}
		\hat{y}_{\text{round}} = \mathrm{round}(\hat{y})
	\end{equation}
	\item Truncate to the interval [1,5]
	\begin{equation}
		\hat{y}_{\text{final}} = \mathrm{clip}(\hat{y}_{\text{round}}, 1, 5)
	\end{equation}
\end{enumerate}

The final result is output in JSONL format, with each line containing the sample ID and a prediction result ranging from 1 to 5, in the format of \{"id": "...", "prediction": 1..5 \} . This method directly models the degree of matching between senses and contexts, fits the overall trend of human subjective scoring through a regression task, and provides a basic benchmark model for the task.


\subsection{Contextual grouping, comparison, and sorting enhancement}

In response to the characteristic of multiple candidate senses corresponding to the same narrative context in tasks, we propose a context grouping and comparative sorting enhancement strategy. Samples sharing the same precontext+sentence+ending are divided into the same context group. During training, paired samples are sampled from within the same group to construct sorting constraints, guiding the model to learn the relative rationality relationships between senses.

Loss function design:
Let the model outputs of two samples within the same group be denoted as $s_i$ and $s_j$, and their corresponding average human annotations as $y_i$ and $y_j$. Define the ranking objective as $t = \mathrm{sign}(y_i - y_j) \in \{+1, -1\}$, where $t = +1$ if $y_i > y_j$ and $t = -1$ if $y_i < y_j$. Note that when $y_i = y_j$, the sample pair is masked out and does not contribute to the ranking loss, which avoids degenerate gradients that would arise from a zero-valued target. The margin-ranking loss is employed:

\begin{equation}
L_{\text{rank}} = \max(0, m - t \cdot (s_i - s_j))
\end{equation}

Where $m$ represents the margin hyperparameter. The final loss function is a weighted combination of regression loss and ranking loss:

\begin{equation}
L = L_{\text{mse}} + \lambda \cdot L_{\text{rank}}
\end{equation}

Where $\lambda$ represents the contrastive loss weight (contrastive\_weight). In implementation, mask processing is applied to paired samples where $y_i=y_j$, since such pairs yield $t=0$ (i.e., no valid ranking direction) and would produce degenerate zero gradients. Excluding these pairs avoids introducing invalid ranking signals and effectively enhances the model's fine-grained differentiation ability for the rationality of senses.




\section{Experiment Setup}

\subsection{Training configurations}
This section reports the key configurations that are consistent with the warehouse script (see the code link for specific implementation). All experiments were conducted on a single NVIDIA GeForce RTX 4090 GPU. The training configuration is shown in Table \ref{tab:Training configurations}.

\begin{table*}
	\centering
	\begin{tabular}{|c|c|}
			\hline
			\textbf{Configuration item}          & \textbf{Parameter value}                                  \\ \hline
			Maximum input length                 & 512                                                       \\ \hline
			Optimizer and learning rate          & AdamW,$2e-5$,weight decay 0.01                              \\ \hline
			Batch size and gradient accumulation & per-device batch size 4,gradient accumulation 4           \\ \hline
			Mixed precision                      & fp16 (automatically enabled when GPU is available)        \\ \hline
			Training epochs:                     & 8 epochs                                                  \\ \hline
			Evaluation strategy:                 & Evaluate every 0.5 epochs and save the optimal checkpoint \\ \hline
			Model selection basis                & Development set Accuracy (metric\_for\_best\_model)       \\ \hline
			Logging system                       & SwanLab (records training process and evaluation metrics) \\ \hline
		\end{tabular}
	\caption{Training configurations}
	\label{tab:Training configurations}
\end{table*}



The contrastive learning experiment consistently employs DeBERTa-v3-large as the base model to ensure fairness and comparability with the baseline experiment. During training, intermediate checkpoints are automatically cleaned up to conserve storage space. The final prediction results are saved in JSONL format, and evaluation metrics are calculated using the official scoring.py script.

\subsection{Contrastive learning model structure}

Our model builds on DeBERTa-v3-large as a shared encoder with a dual-input branch structure. At the input layer, samples sharing the same narrative context (precontext, ambiguous sentence, and optional ending) are grouped, and contrastive pairs are formed from different word-sense candidates within each group, creating ``sense description + full context'' input pairs. These pairs are encoded by the shared DeBERTa encoder, whose disentangled attention captures deep sense--context associations and produces fixed-dimensional representations after pooling. The output layer applies a regression head to predict continuous appropriateness scores, and optimizes via margin-ranking contrastive loss on paired-sample score differences, guiding the model to distinguish fine-grained sense appropriateness under the same context. This shared-encoder design enables efficient cross-sample transfer by unifying contrastive learning with regression. The architecture is illustrated in Figure \ref{fig:Model Structure}.

\begin{figure}[t]
	\includegraphics[width=\columnwidth]{model}
	\caption{Model Structure}
	\label{fig:Model Structure}
\end{figure}

\section{Results}

Our system achieved 20th place in the official SemEval-2026 Task 5 leaderboard. The following subsections detail the experimental results and analysis.

\subsection{Baseline results}

The experimental results show that DeBERTa-v3-large significantly outperforms other baseline models in both accuracy (70.75\%) and Spearman correlation coefficient (0.5934), demonstrating stronger semantic understanding and ranking capabilities. The results are shown in Table \ref{tab:Results}. Our project's performance on the test set is as follows: Spearman Correlation 0.533 and Accuracy 0.688.

\begin{table}[!ht]
	\centering
	\begin{tabular}{|c|c|c|}
		\hline
		\textbf{Model Name} & \textbf{Accuracy} & \textbf{Spearman} \\ \hline
		deberta-v3-large & 0.7075 & 0.5934  \\ \hline
		roberta-base & 0.6327 & 0.4285  \\ \hline
		bert-base-uncased & 0.6241 & 0.3581  \\ \hline
		deberta-v3-base & 0.6224 & 0.3616  \\ \hline
		roberta-large & 0.5748 & 0.0254  \\ \hline
		bert-large-uncased & 0.5272 & - \\ \hline
	\end{tabular}
	\caption{Performance Comparison of Baseline Models}
	\label{tab:Results}
\end{table}

\subsection{Hyperparameter tuning for contrastive sorting}

We perform a grid search over two key hyperparameters: margin $\in \{0.1, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5\}$ and contrastive weight $\in \{0.1, 0.2, 0.3, 0.5, 0.7, 1.0, 1.5\}$. Table~\ref{fig:Optimal configuration} shows the two best configurations on the development set.

\begin{table*}[!ht]
	\centering
	\begin{tabular}{|c|c|c|c|c|}
		\hline
		Optimization objective & Optimal configuration & Accuracy & Spearman & Baseline improvement \\ \hline
		Accuracy & margin=1.5, weight=0.2 & 0.7228 & 0.5854 & +1.53\% \\ \hline
		Sorting ability & margin=1.5, weight=0.1 & 0.7211 & 0.6144 & +3.54\% \\ \hline
	\end{tabular}
	\caption{Optimal configuration}
	\label{fig:Optimal configuration}
\end{table*}

A large margin (1.5) paired with a small contrastive weight (0.1--0.2) yields the best results, improving accuracy by 1.53\% and Spearman correlation by 3.54\% over the DeBERTa-v3-large baseline. The full tuning landscape is visualized in Figures~\ref{fig:tune_heatmap_accuracy}--\ref{fig:tune scatter accuracy VS spearman}.

\begin{figure}[t]
	\includegraphics[width=\columnwidth]{tune_heatmap_accuracy}
	\caption{tune heatmap accuracy}
	\label{fig:tune_heatmap_accuracy}
\end{figure}


\begin{figure}[t]
	\includegraphics[width=\columnwidth]{tune_heatmap_spearman}
	\caption{tune heatmap spearman}
	\label{fig:tune_heatmap_spearman}
\end{figure}


\begin{figure}[t]
	\includegraphics[width=\columnwidth]{tune_scatter_accuracy_vs_spearman}
	\caption{tune scatter accuracy VS spearman}
	\label{fig:tune scatter accuracy VS spearman}
\end{figure}

\section{Discussion and Analysis}
This study validates the efficacy of modeling semantic matching by pairing sense descriptions with narrative contexts. While DeBERTa-v3-large establishes a robust performance benchmark, our proposed contextual grouping contrastive loss further yields consistent improvements in both accuracy and Spearman correlation. This highlights the value of relative order modeling in mitigating discretization errors within shared narrative frameworks.

The divergence in optimal parameters for accuracy versus Spearman correlation underscores the task's complexity: the former prioritizes absolute point-to-point matching, while the latter emphasizes global ranking consistency. Future research should explore multi-objective optimization to better align loss functions with these dual requirements. Additionally, integrating LLM-based commonsense reasoning and prompt engineering remains a promising avenue for enhancing semantic evaluation in complex narrative scenarios.
%
%
\section*{Acknowledgments}

This work has been supported by the Special Basic Cooperative Research Programs of Yunnan Provincial Undergraduate Universities Association (grant NO. 202401BA070001-049). The authors would like to thank the anonymous reviewers for their constructive comments.
%
%This document has been adapted
%by Steven Bethard, Ryan Cotterell and Rui Yan
%from the instructions for earlier ACL and NAACL proceedings, including those for
%ACL 2019 by Douwe Kiela and Ivan Vuli\'{c},
%NAACL 2019 by Stephanie Lukin and Alla Roskovskaya,
%ACL 2018 by Shay Cohen, Kevin Gimpel, and Wei Lu,
%NAACL 2018 by Margaret Mitchell and Stephanie Lukin,
%Bib\TeX{} suggestions for (NA)ACL 2017/2018 from Jason Eisner,
%ACL 2017 by Dan Gildea and Min-Yen Kan,
%NAACL 2017 by Margaret Mitchell,
%ACL 2012 by Maggie Li and Michael White,
%ACL 2010 by Jing-Shin Chang and Philipp Koehn,
%ACL 2008 by Johanna D. Moore, Simone Teufel, James Allan, and Sadaoki Furui,
%ACL 2005 by Hwee Tou Ng and Kemal Oflazer,
%ACL 2002 by Eugene Charniak and Dekang Lin,
%and earlier ACL and EACL formats written by several people, including
%John Chen, Henry S. Thompson and Donald Walker.
%Additional elements were taken from the formatting instructions of the \emph{International Joint Conference on Artificial Intelligence} and the \emph{Conference on Computer Vision and Pattern Recognition}.

% Bibliography entries for the entire Anthology, followed by custom entries
%\bibliography{anthology,custom}
% Custom bibliography entries only
\bibliography{custom}

\appendix

%\section{Example Appendix}
%\label{sec:appendix}
%
%This is an appendix.

\end{document}
