\begin{table*}[!t]\small
\centering
\setlength{\tabcolsep}{2.5mm}{
\begin{tabular}{@{}ccccccc@{}}
\toprule
                                    & \multicolumn{2}{c}{WordNet} & \multicolumn{2}{c}{Oxford} & \multicolumn{2}{c}{Urban} \\ \midrule
                                    & BLEU         & NIST         & BLEU         & NIST        & BLEU        & NIST        \\
\toprule
I-Attention                          & 23.77        & 44.30        & 17.45        & 35.79       & 8.81        & 19.43       \\
Local                          & 24.78        & 40.32        & 17.58        & 31.30       & 8.99        & 17.39       \\
Global                         & 23.59        & 49.70        & 14.95        & 32.79       & 5.15        & 10.45       \\
LOG-CaD                           & 25.19        & 43.54        & 18.57        & 38.22       & 9.93        & 19.29       \\
T5-Reranking      & \bf{32.72}        & 64.57        & 26.52        & 74.17       & 17.71       & 35.53       \\ \bottomrule
T5-Contrast (Ours) &     32.05$_{(-2.1\%)}$         &       \bf{74.71}$_{(+15.5\%)}$       & \bf{27.11}$_{(+2.2\%)}$        & \bf{79.42}$_{(+7.1\%)}$       & \bf{19.44}$_{(+9.8\%)}$       & \bf{41.01}$_{(+15.4\%)}$       \\
T5-Base &     31.72         &      57.35        & 25.44        & 66.92       & 17.66       & 26.86       
\\\bottomrule
\end{tabular}}
\caption{Automatic evaluation results on test sets of three datasets. The best results in each dataset are in bold. We also add the quantitative comparison results between our method and the strongest baseline model T5-Reranking.}
\label{Experimental_Results}
\end{table*}
\subsection{Task Formulation}
\label{Task Formulation}
Given a word or phrase $W = \{w_i,...,w_j\}$ and its surrounding context $C = \{w_0,...,W_k\}(0<i<j<k)$, the task of definition generation is to generate the definition $D = \{d_0,...d_T\}$ to explain the meaning of $W$ under $C$. This process can be formulated as:

\begin{equation}\label{encoder}
\mathbf{H}_0={\rm Emb}({\rm Splice}(W, C))
\end{equation}

Formally, we denote the {target word encoding} generated by the encoder in T5 as $\mathbf{H}_{target}$, and the {definition encoding} generated by the decoder as $\mathbf{G}^{L_D}$. In general, target word encoding $\mathbf{H}_{target}$ is obtained by extracting the encoding of the target word's position in $\mathbf{H}^{L_E}$, and
definition encoding $\mathbf{G}^{L_D}$ is generated by the decoder to decode and get the definition sequence later. 

After encoding, we use a pooling function $\rm f()$ to aggregate the $\mathbf{H}_{target}$ and $\mathbf{G}^{L_D}$ respectively, and obtain {target word representation} $\mathbf{h}$ and {definition representation} $\mathbf{g}$ with the same length:

For evaluation, we follow previous works and acquire three popular datasets, which are ensembled by \citet{ishiwatari2019learning}\footnote{\url{http://www.tkl.iis.u-tokyo.ac.jp/~ishiwatari/naacl_data.zip}}.
Each entry in a dataset consists of three elements: (1) a target word or phrase, (2) the corresponding definition, and (3) one usage example of the target as a local context. If a target has multiple definitions and examples, we treat them as different entries. For fair comparison, each dataset is split into $\textit{train}$, $\textit{dev}$ and $\textit{test}$ sets according to \citet{ishiwatari2019learning}. The statistics of these datasets are shown in Table~\ref{Statistics of datasets}.

\paragraph{WordNet dataset} The Wordnet dataset is collected by \citet{noraset2017definition} from the Wordnet dictionary and the GNU Collaborative International Dictionary of English\footnote{\url{http://wwwgcide.gnu.org.ua}}. In this work, we follow \citet{ishiwatari2019learning} and use the extended version of WordNet dataset, where usage examples for each entry are added and the entries without usage examples are removed.

\subsection{Automatic Metrics}
Following common practice, we adopt two automatic evaluation metrics to assess the quality of the definitions generated by each model.
\paragraph{BLEU}
The metric BLEU \cite{papineni2002bleu} has been widely used in previous works to measure the closeness between the generated results and human reference. It measures the geometric average of the precision over hypothesis n-grams with an additional penalty to discourage short definition.
\paragraph{NIST}
NIST~\cite{doddington2002automatic} is similar to BLEU, but considers up-weighting rare, informative n-grams. We use NLTK\footnote{\url{https://www.nltk.org}} tool to calculate NIST metric.

Table~\ref{Experimental_Results} shows the automatic comparison results of each compared model on the three datasets. Considering the absolute scores, the proposed method T5-Contrast significantly outperforms other 5 models on almost every metric across the three datasets. Although the BLEU score on WordNet dataset obtained by our method is slightly lower (2.09\%) than T5-Reranking \cite{huang2021definition}, the NIST score of our method in WordNet dataset is notably higher (15.70\%) than theirs. This strongly demonstrates the effectiveness and generalization of the proposed method in generating high-quality definitions for a given word under a context. 
{"value": "23.77", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "44.30", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "17.45", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "35.79", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "8.81", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "19.43", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "I-Attention", "model settings": {"xx": "yy"}} {"value": "24.78", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "40.32", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "17.58", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "31.30", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "8.99", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "17.39", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Local", "model settings": {"xx": "yy"}} {"value": "23.59", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "49.70", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "14.95", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "32.79", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "5.15", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "10.45", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "Global", "model settings": {"xx": "yy"}} {"value": "25.19", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "43.54", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "18.57", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "38.22", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "9.93", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "19.29", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "LOG-CaD", "model settings": {"xx": "yy"}} {"value": "32.72", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "64.57", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "26.52", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "74.17", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "17.71", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "35.53", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Reranking", "model settings": {"xx": "yy"}} {"value": "32.05", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "74.71", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "27.11", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "79.42", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "19.44", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "41.01", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Contrast", "model settings": {"xx": "yy"}} {"value": "31.72", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}} {"value": "57.35", "type": "Result", "training data/set": "WordNet", "test data/set": "WordNet", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}} {"value": "25.44", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}} {"value": "66.92", "type": "Result", "training data/set": "Oxford", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}} {"value": "17.66", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "BLEU", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}} {"value": "26.86", "type": "Result", "training data/set": "Urban", "test data/set": "Oxford", "task": "Definition Generation", "metric": "NIST", "experimental settings": {"xx": "yy"}, "model": "T5-Base", "model settings": {"xx": "yy"}}