\section*{Acknowledgments}

The research presented in this paper is supported in part by National Key R\&D Program of China (2018YFC0830500),Shenzhen Basic Research Grant (JCYJ20170816100819428), National Natural Science Foundation of China (61922067, U1736205, 61902305), MoE-CMCC “Artifical Intelligence” Project (MCM20190701), National Science Basic Research Plan in Shaanxi Province of China (2019JM-159), National Science Basic Research Plan in Zhejiang Province of China (LGG18F020016).

\section{Conclusion} \label{sec: conclusion}
In this paper, we present an end-to-end model, LADAN, to solve the issue of confusing charges in LJP.
In LADAN, a novel attention mechanism is proposed to extract the key features for distinguishing confusing law articles attentively.
Our attention mechanism not only considers the interaction between fact description and law articles but also the differences among similar law articles, which are effectively extracted by a graph neural network GDL proposed in this paper.
The experimental results on real-world datasets show that our LADAN raises the F1-score of state-of-the-art by up to $5.79$\%.
In the future, we plan to study complicated situations such as a law case with multiple defendants and charges.
\section{Experiments} \label{sec:experiment}
\subsection{Datasets}
To evaluate the performance of our method,
we use the publicly available datasets of
the \textbf{C}hinese \textbf{AI} and \textbf{L}aw challenge (CAIL2018)\footnote{\url{http://cail.cipsc.org.cn/index.html}}~\cite{xiao2018cail2018}: \emph{CAIL-small} (the exercise stage dataset) and \emph{CAIL-big}  (the first stage dataset).
The case samples in both datasets contain fact description, applicable law articles, charges, and the terms of penalty.
For data processing, we first filter out samples with fewer than 10 meaningful words.
To be consistent with state-of-the-art methods, we filter out the case samples with multiple applicable law articles and multiple charges.
Meanwhile, referring to~\cite{zhong2018legal}, we only keep the law articles and charges that apply to not less than 100 corresponding case samples and divide the terms of penalty into non-overlapping intervals.
The detailed statistics of the datasets are shown in Table~\ref{tab:data}.

\setlength{\abovecaptionskip}{0.1cm}
\setlength{\belowcaptionskip}{-0.2cm}
\begin{table}[htp]
\small
\centering
\begin{tabular}{@{}lrr@{}}
\toprule
Dataset & CAIL-small & CAIL-big \\
\midrule
\#Training Set Cases  & 101,619    & 1,587,979   \\
\#Test Set Cases  & 26,749    & 185,120  \\
\#Law Articles  & 103   & 118  \\
\#Charges     & 119     & 130  \\
\#Term of Penalty     & 11    & 11  \\
\bottomrule
\end{tabular}
\caption{Statistics of datasets.}\label{tab:data}
\end{table}

\subsection{Baselines and Settings}
\paragraph{Baselines.} We compare LADAN with some baselines, including:
\begin{itemize}
\item \textbf{CNN~\cite{kim2014convolutional}:} a CNN-based model with multiple filter window widths for text classification.
\item \textbf{HARNN~\cite{yang2016hierarchical}:} an RNN-based neural network with a hierarchical attention mechanism for document classification.
\item \textbf{FLA~\cite{luo2017learning}:} a charge prediction method that uses an attention mechanism to capture the interaction between fact description and applicable laws.
\item \textbf{Few-Shot~\cite{hu2018few}:} a discriminating confusing charge method, which extracts features about ten predefined attributes from fact descriptions to enforce semantic information.

\item \textbf{TOPJUDGE~\cite{zhong2018legal}:} a topological multi-task learning framework for LJP, which formalizes the explicit dependencies over subtasks in a directed acyclic graph.
\item \textbf{MPBFN-WCA~\cite{yang2019legal}:} a multi-task learning framework for LJP with multi-perspective forward prediction and backward verification, which is the state-of-the-art method.
\end{itemize}

Similar to existing works~\cite{luo2017learning,zhong2018legal}, we train the baselines CNN, HLSTM and FLA using a multi-task framework (recorded as MTL) and select a set of the best experimental parameters according to the range of the parameters given in their original papers.
Besides, we use our method LADAN with the same multi-task framework (i.e., Landan+MTL, LADAN+TOPJUDGE, and LADAN+MPBFN) to demonstrate our superiority in feature extraction.

\paragraph{Experimental Settings.} We use the THULAC~\cite{Thulac2016} tool to get the word segmentation because all case samples are in Chinese.
Afterward, we use the Skip-Gram model~\cite{mikolov2013distributed} to pre-train word embeddings on these case documents, where the model's embedding size and frequency threshold are set to 200 and 25 respectively.
Meanwhile, we set the maximum document length as 512 words for CNN-based models in baselines and set the maximum sentence length to 100 words and maximum document length to 15 sentences for LSTM-based models.
As for hyperparameters setting, we set the dimension of all latent states (i.e., $d_w$, $d_s$, $d_l$ and $d_f$) as 256 and the threshold $\tau$ as $0.3$.
In our method LADAN, we use two graph distillation layers, and a Bi-GRU with a randomly initialized attention vector $u$ is adopted as the basic document encoder.
For training, we set the learning rate of Adam optimizer to $10^{-3}$, and the batch size to 128.
After training every model for 16 epochs, we choose the best model on the validation set for testing.\footnote{Our source codes are available at \url{https://github.com/prometheusXN/LADAN}}

\begin{table*}[t]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{lcccccccccccc}
\toprule
 Tasks              & \multicolumn{4}{c}{Law Articles}                     & \multicolumn{4}{c}{Charges}                          & \multicolumn{4}{c}{Term of Penalty}                   \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13}
 Metrics            & Acc.        & MP          & MR          & F1          & Acc.        & MP          & MR          & F1          & Acc.        & MP          & MR          & F1          \\
 \midrule
 FLA+MTL            & $77.74$     & $75.32$     & $74.36$     & $72.93$     & $80.90$     & $79.25$     & $77.61$     & $76.94$     & $36.48$     & $30.94$     & $28.40$     & $28.00$     \\
 CNN+MTL            & $78.71$     & $76.02$     & $74.87$     & $73.79$     & $82.41$     & $81.51$     & $79.34$     & $79.61$     & $35.40$     & $33.07$     & $29.26$     & $29.86$     \\
 HARNN+MTL          & $79.79 $    & $75.26$     & $76.79$     & $74.90$     & $83.80$     & $82.44$     & $82.78$     & $82.12$     & $36.17$     & $34.66$     & $31.26$     & $31.40$     \\
 Few-Shot+MTL       & $79.30$     & $77.80$     & $77.59$     & $76.09$     & $83.65$     & $80.84$     & $82.01$     & $81.55$     & $36.52$     & $35.07$     & $26.88$     & $27.14$     \\
 TOPJUDGE           & $79.88$     & $79.77$     & $73.67$     & $73.60$     & $82.10$     & $83.60$     & $78.42$     & $79.05$     & $36.29$     & $34.73$     & $32.73$     & $29.43$     \\
 MPBFN-WCA          & $79.12$     & $76.30$     & $76.02$     & $74.78$     & $ 82.14$    & $82.28$     & $80.72$     & $80.72$     & $36.02$     & $31.94$     & $28.60$     & $29.85$     \\
 \midrule
 \bf{LADAN+MTL}      & $\bf 81.20$ & $\bf 78.24$ & $\bf 77.38$ & $\bf 76.47$ & $\bf 85.07$ & $\bf 83.42$ & $\bf 82.52$ & $\bf 82.74$ & $\bf 38.29$ & $\bf 36.16$ & $\bf 32.49$ & $\bf 32.65$ \\
 \bf{LADAN+TOPJUDGE} & $\bf 81.53$ & $\bf 78.62$ & $\bf 78.29$ & $\bf 77.10$ & $\bf 85.12$ & $\bf 83.64$ & $\bf 83.57$ & $\bf 83.14$ & $\bf 38.34$ & $\bf 36.39$ & $\bf 32.75$ & $\bf 33.53$ \\
 \bf{LADAN+MPBFN}    & $\bf 82.34$ & $\bf 78.79$ & $\bf 77.59$ & $\bf 76.80$ & $\bf 84.83 $ & $\bf 83.33$ & $\bf 82.80$ & $\bf 82.85$ & $\bf 39.35$ & $\bf 36.94$ & $\bf 33.25$ & $\bf 34.05$ \\
 \midrule
 \bottomrule
\end{tabular}%
}
\caption{Judgment prediction results on CAIL-small.}\label{tab:CAIL-small}
\end{table*}

\begin{table*}[t]
\centering
\resizebox{\textwidth}{!}{%
\begin{tabular}{lcccccccccccc}
\toprule
 Tasks              & \multicolumn{4}{c}{Law Articles}                     & \multicolumn{4}{c}{Charges}                          & \multicolumn{4}{c}{Term of Penalty}                   \\ \cmidrule(lr){2-5} \cmidrule(lr){6-9} \cmidrule(lr){10-13}
 Metrics            & Acc.        & MP          & MR          & F1          & Acc.        & MP          & MR          & F1          & Acc.        & MP          & MR          & F1          \\
 \midrule
 FLA+MTL   &   $93.23 $ & $ 72.78 $ & $64.30 $ & $66.56$ & $92.76$ & $76.35$ & $68.48$ & $70.74$ & $57.63$ & $48.93$ & $45.00$ & $46.54$ \\
 CNN+MTL   & $95.84$ & $83.20$ & $75.31$ & $77.47$ & $95.74$ & $86.49$ & $79.00$ & $81.37$ & $55.43$ & $45.13$ & $38.85$ & $39.89$
 \\
 HARNN+MTL &  $95.63$ & $81.48$ & $74.57$ & $77.13$ & $95.58$ & $85.59$ & $79.55$ & $81.88$ & $57.38$ & $43.50$ & $40.79$ & $42.00$
 \\
 Few-Shot+MTL  & $96.12$    & $85.43$   & $80.07$   & $81.49$   & $96.04$   & $88.30$   & $80.46$   & $83.88$   & $57.84$   & $47.27$   & $42.55$   & $43.44$ \\
 TOPJUDGE &  $95.85$ & $84.84$ & $74.53$ & $77.50$ & $95.78$ & $86.46$ & $78.51$ & $81.33$ & $57.34$ & $47.32$ & $42.77$ & $44.05$
 \\
 MPBFN-WCA & $96.06$ & $85.25$ & $74.82$ & $78.36$ & $95.98$ & $89.16$ & $79.73$ & $83.20$ & $58.14$ & $45.86$ & $39.07$ & $41.39$ \\
 \midrule
 \bf LADAN+MTL & $\bf 96.57$ & $\bf 86.22$ & $\bf 80.78$ & $\bf 82.36$ & $\bf 96.45$ & $\bf 88.51$ & $\bf 83.73$ & $\bf 85.35$ & $\bf 59.66$ & $\bf 51.78$ & $\bf 45.34$ & $\bf 46.93$ \\
 \bf LADAN+TOPJUDGE & $\bf 96.62$ & $\bf 86.53$ & $\bf 79.08$ & $\bf 81.54$ & $\bf 96.39$ & $\bf 88.49$ & $\bf 82.28$ & $\bf 84.64$ & $\bf 59.70$ & $\bf 51.06$ & $\bf 45.46$ & $\bf 46.96$ \\
\bf LADAN+MPBFN &  $\bf 96.60$ & $\bf 86.42$ & $\bf 80.37$ & $\bf 81.98$ & $\bf 96.42$ & $\bf 88.45$ & $\bf 83.08$ & $\bf 84.95$ & $\bf 59.85$ & $\bf 51.75$ & $\bf 45.59$ & $\bf 47.18$ \\
\midrule
 \bottomrule
\end{tabular}%
}
\caption{Judgment prediction results on CAIL-big.}\label{tab:CAIL-big}
\end{table*}

\subsection{Experimental Results}
To compare the performance of the baselines and our methods,
we choose four metrics that are widely used for multi-classification tasks, including accuracy (Acc.), macro-precision (MP), macro-recall (MR), and macro-F1 (F1).
Since the problem of confusing charges often occurs between a few categories, the main metric is the F1 score.
Tables~\ref{tab:CAIL-small} and~\ref{tab:CAIL-big} show the experimental results on datasets CAIL-small and CAIL-big, respectively. Our method LADAN performs the best in terms of all evaluation metrics.
Because both CAIL-small and CAIL-big are imbalanced datasets, we focus on comparing the F1-score, which more objectively reflects the effectiveness of our LADAN and other baselines.
Compared with the state-of-the-art MPBFN-WCA,
LADAN improved the F1-scores of law article prediction, charge prediction, and term of penalty prediction on dataset CAIL-small by $2.02$\%, $2.42$\% and $4.20$\% respectively,
and about $3.18$\%, $1.44$\% and $5.79$\% on dataset CAIL-big.
Meanwhile, the comparison under the same multi-task framework (i.e., MTL, TOPJUDGE, and MPBFN) shows that our LADAN extracted more effective features from fact descriptions than all baselines.
Meanwhile, we can observe that the performance of Few-shot on charge prediction is close to LADAN, but its performance on the term of penalty prediction is far from ideal. It is because the ten predefined attributes of Few-Shot are only effective for identifying charges, which also proves the robustness of our LADAN.
The highest MP- and MR-scores of LADAN also demonstrates its ability to distinguish confusing law articles.
Note that all methods' performance on dataset CAIL-big is better than that on CAIL-small, which is because the training set on CAIL-big is more adequate.

\subsection{Ablation Experiments}
To further illustrate the significance of considering the difference between law articles, we conducted ablation experiments on model \textit{LADAN+MTL}  with dataset CAIL-small.
To prove the effectiveness of our graph construction layer (\textbf{GCL}), we build a LADAN model with the GCL's removing threshold $\tau=0$ (i.e., ``-no GCL'' in Table ~\ref{tab:ablation_exp}), which directly applies the GDO on the fully-connected graph $G^*$ to generate a global distinction vector $\beta_g$ for re-encoding the fact description.
To verify the effectiveness of our graph distillation operator (\textbf{GDO}), we build a no-GDO LADAN model (i.e., ``-no GDO'' in Table ~\ref{tab:ablation_exp}), which directly pools each subgraph $g_i$ to a distinction vector $\beta_i$ without GDOs.
To evaluate the importance of considering the difference among law articles, we remove both GCL and GDO from LADAN by setting $\tau=1.0$ (i.e., ``-no both'' in Table ~\ref{tab:ablation_exp}), i.e., each law article independently extracts the attentive feature from fact description.
In Table~\ref{tab:ablation_exp},
we see that both GCL and GDO effectively improve the performance of LADAN.
GCL is more critical than GDO because GDO has a limited performance when the law article communities obtained by GCL are not accurate.
When removing both GCL and GDO, the accuracy of LADAN decreases to that of HARNN+MTL, which powerfully demonstrates the effectiveness of our method exploiting differences among similar law articles.

\begin{table}[t]
\centering
\resizebox{\linewidth}{!}{%
\begin{tabular}{@{}lrrrrrr@{}}
\toprule
Tasks & \multicolumn{2}{c}{Law} & \multicolumn{2}{c}{Charge} & \multicolumn{2}{c}{Penalty} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} \cmidrule(lr){6-7}
Metrics & \multicolumn{1}{c}{Acc.} & \multicolumn{1}{c}{F1} & \multicolumn{1}{c}{Acc.} & \multicolumn{1}{c}{F1} & \multicolumn{1}{c}{Acc.} & \multicolumn{1}{c}{F1} \\ \midrule
LADAN+MTL & $ 81.20 $ & $ 76.47 $ & $ 85.07 $ & $ 83.14 $ & $ 38.29 $ & $ 32.65 $ \\
-no GCL & $ 80.46 $ & $ 75.98 $ & $ 84.04 $ & $ 82.33 $ & $ 37.80 $ & $ 31.85 $ \\
-no GDO & $ 80.82 $ & $ 76.19 $ & $ 84.65 $ & $ 82.50 $ & $ 36.69 $ & $ 31.62 $ \\
-no both & $ 79.79 $ & $ 74.97 $ & $ 83.72 $ & $ 82.02 $ & $ 34.87 $ & $ 31.34 $ \\ \bottomrule
\end{tabular}%
}
\caption{Ablation analysis on CAIL-small.}\label{tab:ablation_exp}
\end{table}

\begin{figure*}[t]
\centering
\includegraphics[width=0.98\linewidth]{fig/Case_study.pdf}
\caption{The attention visualization on case examples for Article 185 and Article 163.}
\label{fig:case_study}
\end{figure*}

\subsection{Case Study} \label{sec:case_study}
To intuitively verify that LADAN effectively extracts distinguishable features, we visualize the attention of LADAN's encoders.
Figure~\ref{fig:case_study} shows two law case examples, each for \textit{Article 385} and \textit{Article 163}, respectively, where the darker the word is, the higher the attention weight it gets in the corresponding encoder, i.e., its information is more important to the encoder.
For the basic encoder, we see that the vital information in these two cases is very similar, which both contain the word like \textit{``use position''} \textit{``accept benefit''} \textit{``accept ... cash''}, etc. Therefore, when using just the representation of basic encoder to predict acceptable law articles, charges and terms of penalty, these two cases tend to be misjudged.
As we mentioned in Sec.~\ref{sec:re_encoder}, with the distinction vector, our fact re-encoder focuses on extracting distinguishable features like defendants' identity information (e.g., \textit{``company manager'' ``working in the Cadastral Unit of Luocheng Branch of Luohe City Land and Resources Bureau''} in our examples), which effectively distinguish the applicable law articles and charges of these two cases.

\section{Introduction} \label{sec:introduction}
Exploiting artificial intelligence techniques to assist legal judgment has become
popular in recent years.
Legal judgment prediction (\textbf{LJP})
aims to predict a case's judgment results, such as applicable law articles,
charges, and terms of penalty, based on its fact description, as illustrated in
Figure~\ref{fig:0}.
LJP can assist judiciary workers in processing cases and offer legal consultancy
services to the public.
In the literature, LJP is usually formulated as a text classification problem, and
several rule-based methods~\cite{liu2004case,lin2012exploiting} and neural-based
methods~\cite{hu2018few,luo2017learning,zhong2018legal} have been proposed.

\begin{figure}[t]
\centering
\includegraphics[width=1.0\linewidth]{fig/LJP_problem.pdf}
\caption{An illustration of the LJP. Generally, a judge needs to conduct professional analysis and reasoning on the fact description of the case, and then choose reasonable law articles, charges and the term of penalty to convict the offender.}
\label{fig:0}
\end{figure}

The main drawback of existing methods is that they cannot solve the {\em confusing
  charges issue}.
That is, due to the high similarity of several law articles, their corresponding law
cases can be easily misjudged.
For example, in Figure~\ref{fig:law_artices}, both \textit{Article 385} and
\textit{Article 163} describe offenses of accepting bribes, and their subtle
difference is whether the guilty parties are state staffs or not.
The key to solving the confusing charges issue is how to capture essential but rare
features for distinguishing confusing law articles.
Hu et al.~\shortcite{hu2018few} defined ten discriminative attributes to
distinguish confusing charges.
However, their method relies too much on experts to hinder its applications
in a large number of laws.
In practice, we desire a method that can automatically extract textual features
from law articles to assist JLP.
The most relevant existing work to this requirement is~\cite{luo2017learning}, which used an attention mechanism to extract features from fact descriptions with respect to a specific law article.
As shown in Figure~\ref{fig:attention_frameworks}a, for each law article, an
attention vector is computed, which is used to extract features from the fact description of a law case to predict whether the law article is applicable to the case.
Nevertheless, the weakness is that they learn each law article's attention vector
independently, and this may result in that similar attention vectors are learned
for semantically close law articles; hence, it is ineffective in distinguishing
confusing charges.

\begin{figure}[t]
\centering
\includegraphics[width=1.0\linewidth]{fig/article_new_2.pdf}
\caption{Examples of confusing charges.}
\label{fig:law_artices}
\end{figure}

To solve the confusing charges issue, we propose an end-to-end framework, i.e.,
Law Article Distillation based Attention Network (LADAN).
LADAN uses the difference among similar law articles to attentively extract
features from law cases' fact descriptions, which is more effective in
distinguishing confusing law articles, and improve the performance of LJP.
To obtain the difference among similar law articles, a straightforward way is to
remove duplicated texts between two law articles and only use the
leftover texts for the attention mechanism.
However, we find that this method may generate the same leftover texts for
different law article, and generate misleading information to LJP.
As shown in Fig.~\ref{fig:law_artices}, if we remove the duplicated phrases
and sentences between Article 163 and Article 385 (i.e., the red text in
Fig.~\ref{fig:law_artices}), and between Article 164 and Article 389 (i.e., the pink
text in Fig.~\ref{fig:law_artices}), respectively, then Article 385 and Article
389 will be almost same to each other (i.e., the blue text in
Fig.~\ref{fig:law_artices}).

We design LADAN based on the following observation: it is usually easy to
distinguish dissimilar law articles as sufficient distinctions exist, but challenging to
discriminate similar law articles due to the few useful features.
We first group law articles into different communities, and law articles in the
same community are highly similar to each other.
Then we propose a graph-based representation learning method to automatically
explore the difference among law articles and compute an attention vector for each
community.
For an input law case, we learn both macro- and micro-level features.
Macro-level features are used for predicting which community includes the
applicable law articles.
Micro-level features are attentively extracted by the attention vector of the
selected community for distinguishing confusing law articles within the same
community.
Our main contributions are summarized as follows:

(1) We develop an end-to-end framework, i.e., LADAN, to solve the LJP task.
It addresses the confusing charges issue by mining similarities between fact
descriptions and law articles as well as the distinctions between confusing law articles.

(2) We propose a novel graph distillation operator
(GDO) to extract discriminative features for effectively distinguishing confusing law articles.

(3) We conduct extensive experiments on real-world datasets.
The results show that our model outperforms all
state-of-the-art methods.

\begin{figure}[t]
\centering
\includegraphics[width=1.0\linewidth]{fig/graph_new.pdf}
\caption{\textbf{a.}~The fact-law attention model in ~\cite{luo2017learning}.
  \textbf{b}.~Our framework.
  \textit{Variables $\mathbf{\alpha}$ and $\mathbf{\beta}$ represent the encoded
    vectors learned for attentively extracting features from fact
    descriptions.}}
\label{fig:attention_frameworks}
\end{figure}

\section{Our Method} \label{sec:method}

\subsection{Overview}\label{sec:overview}
In our framework LADAN (cf.~Fig.~\ref{fig:3}a), the fact description of a case is
represented by two parts: a \emph{basic representation}, denoted by $\mathbf{v}_f^{\text{b}}$, and a
\emph{distinguishable representation}, denoted by $\mathbf{v}_f^{\text{d}}$.
The basic representation $\mathbf{v}_f^{\text{b}}$ contains basic semantic information for matching a group of law articles that may apply to the case.
In contrast, the distinguishable representation $\mathbf{v}_f^{\text{d}}$ captures features that can effectively distinguish confusing law articles.
The concatenation of $\mathbf{v}_f^{\text{b}}$ and $\mathbf{v}_f^{\text{d}}$ is fed into subsequent classifiers to predict the labels of the JLP task.

As we mentioned, it is easy to distinguish dissimilar law articles as sufficient distinctions exist, and the difficulty in solving confusing charges lies in extracting distinguishable features of similar law articles.
To obtain the basic representation $\mathbf{v}_f^{\text{b}}$, therefore, we use one of the popular document encoding methods (e.g., CNN encoder \cite{kim2014convolutional} and Bi-RNN encoder \cite{yang2016hierarchical}).
To learn the distinguishable representation $\mathbf{v}_f^{\text{d}}$, we use a \emph{law distillation module} first to divide law articles to several communities to ensure that the law articles in each community are highly similar, and then extract each community $i$'s distinction vector (or, distinguishable features) $\mathbf{\beta}_i$ from the basic representation of law articles in community $i$.
Given the case's fact description,
from all communities' distinction vectors,
we select the most relevant one (i.e., $\mathbf{\beta}_{\hat{c}}$ in Fig.~\ref{fig:3}(a)) for attentively extracting the distinguishable features $\mathbf{v}_f^{\text{d}}$ in the \emph{fact re-encode module}.
In the follows, we elaborate law distillation module (Sec.~\ref{sec:law_interaction}) and fact re-encode module (Sec.~\ref{sec:re_encoder}) respectively.

\subsection{Distilling Law Articles} \label{sec:law_interaction}
A case might be misjudged due to the high similarity of some law articles.
To alleviate this problem, we design a law distillation module (cf. Fig.~\ref{fig:3} b) to extract distinguishable and representative information from all law  articles.
Specifically, it first uses a \emph{graph construction layer} (\textbf{GCL}) to divide law articles into different communities.
For each law article community,
a graph distillation layer is applied to learn its discriminative representation, hereinafter, called \textit{distinction vector}.

\subsubsection{Graph Construction Layer}
To find probably confusing law articles, we first construct a fully-connected graph $G^*$ for all law articles $\mathcal{L}$,
where the weight on the edge between a pair of law article $L_i, L_j\in \mathcal{L}$ is defined as the cosine similarity between their TF-IDF (Term Frequency-Inverse Document Frequency) representations $\mathbf{tf\_idf}_i$ and $\mathbf{tf\_idf}_j$.
Since confusing law articles are usually semantically similar
and there exists sufficient information to distinguish dissimilar law articles, we remove the edges with weights less than a predefined threshold $\tau$ from graph $G^*$.
By setting an appropriate $\tau$, we obtain a new graph $G = \{g_i\}_{i = 1}^{M}$ composed of several disconnected subgraphs $g_1, \ldots, g_M$ (or, communities),
where each $g_i, i=1,\ldots, M$ contains a specific community of probably confusing articles.
Our later experimental results demonstrate that this easy-to-implement method
effectively improves the performance of LADAN.

\subsubsection{Graph Distillation Layer}
To extract the distinguishable information from each community $g_i$, a straightforward way is to delete duplicate words and sentences presented in law articles within the community (as described in Sec.~\ref{sec:introduction}).
In addition to introducing significant errors, this simple method cannot be plugged into end-to-end neural architectures due to its non-differentiability.
To overcome the above issues, inspired by the popular graph convolution operator (\textbf{GCO})~\cite{kipf2016semi,hamilton2017inductive,velivckovic2017graph}, we propose a \emph{graph distillation operator} (\textbf{GDO}) to effectively extract distinguishable features.
Different from GCO, which computes the message propagation between neighbors and aggregate these messages to enrich representations of nodes in the graph, the basic idea behind our GDO is to learn effective features with distinction by removing similar features between nodes.

Specifically, for an arbitrary law article $L_i$, GDO uses a trainable weight matrix $\Psi$ to capture similar information between it and its neighbors in graph $G$, and a matrix $\Phi$ to extract effective semantic features of $L_i$.
At each layer $l\ge 0$, the aggregation of similar information between $L_i$ and its neighbors is removed from its representation, that is,
$$
 \mathbf{v}_{L_i}^{(l+1)} = \Phi^{(l)}\mathbf{v}_{L_i}^{(l)} - \sum_{L_j\in N_i}\frac{\Psi^{(l)}[\mathbf{v}_{L_i}^{(l)}, \mathbf{v}_{L_j}^{(l)}]}{|N_i|} + \mathbf{b}^{(l)}
$$
where $\mathbf{v}_{L_i}^{(l)} \in \mathbb{R}^{d_l}$ refers to the representation of law $L_i$ in the $l^\text{th}$ graph distillation layer, $N_i$ refers to the neighbor set of $L_i$ in graph $G$, $\mathbf{b}^{(l)}$ is the bias, and $\Phi^{(l)} \in \mathbb{R}^{d_{l+1} \times d_{l}}$ and $\Psi^{(l)} \in \mathbb{R}^{d_{l+1} \times 2d_{l}}$ are the trainable self weighted matrix and the neighbor similarity extracting matrix respectively. Note that $d_l$ is the dimension of the feature vector in the $l^\text{th}$ graph distillation layer.
We set $d_0 = d_s$, where ${d_s}$ is the dimension of basic representations $\mathbf{v}_f^{\text{b}}$ and $\mathbf{v}_{L_i}$. Similar to GCO, our GDO also supports multi-layer stacking.

Using GDO with $H$ layers, we output law article representation of the last layer, i.e., $\mathbf{v}_{L_i}^{(H)} \in \mathbb{R}^{d_H}$, which contains rich distinguishable features that can distinguish law article $L_i$ from the articles within the same community.
To further improve law articles' distinguishable features,
for each subgraph $g_i, i = 1,2, \dots, M$ in graph $G$,
we compute its distinction vector $\beta_i$
by using pooling operators to aggregate the distinguishable features of articles in $g_i$. Formally, $\beta_i$ is computed as:
$$
 \beta_i = [\text{MaP}(\{\mathbf{v}_{L_i}^{(H)}\}_{L_j\in g_i}), \text{MiP}(\{\mathbf{v}_{L_i}^{(H)}\}_{L_j\in g_i})]
$$
where $\text{MaP}(\cdot)$ and $\text{MiP}(\cdot)$ are the element-wise max pooling and element-wise min pooling operators respectively.

\subsection{Re-encoding Fact with Distinguishable Attention}
\label{sec:re_encoder}
To capture a law case's distinguishable features from its fact description $f$, we firstly define the following linear function,
which is used to predict its most related community $g_{\hat{c}}$ in graph $G$:
\begin{equation}\label{eq:graph_selection}
\hat{\mathbf{X}} = \text{softmax}(\mathbf{W}_g\mathbf{v}_f^{\text{b}} + \mathbf{b}_g)
\end{equation}
where $\mathbf{v}_f^{\text{b}}$ is the basic representation of fact description $f$,
$\mathbf{W}_g \in \mathbb{R}^{M \times d_s}$ and $\mathbf{b}_g \in \mathbb{R}^M$ are the trainable weight matrix and bias respectively. Each element $\hat{X}_i \in \hat{\mathbf{X}}$, $i=1,...,M$ reflects the closeness between fact description $f$ and law articles community $g_i$.
The most relevant community $g_{\hat{c}}$ is computed as
$$\hat{c} =\arg\max_{i=1,\ldots, M} \hat{X}_i.$$
Then, we use the corresponding community's distinction vector $\beta_{\hat{c}}$ to attentively extract distinguishable features from fact description $f$.

Inspired by~\cite{yang2016hierarchical}, we attentively extract distinguishable features based on word-level and sentence-level Bi-directional Gated Recurrent Units (Bi-GRUs).
Specifically, for each input sentence $S_i = [w_{i,1}, \cdots, w_{i, n_{i}}]$ in fact description $f$,  word-level Bi-GRUs will output a hidden state sequence, that is,
$$ \mathbf{h}_{i,j} = [\overrightarrow{\text{GRU}}(\mathbf{w}_{i,j}),  \overleftarrow{\text{GRU}}(\mathbf{w}_{i,j})],\ \ j = 1,..., n_i,$$
where $\mathbf{w}_{i,j}$ represents the word embedding of word $w_{i.j}$ and
$\mathbf{h}_{i,j} \in \mathbb{R}^{d_w}$.
Based on this hidden state sequence and the distinction vector $\beta_{\hat{c}}$, we calculate an attentive vector $[\alpha_{i,1},\ldots,\alpha_{i,n_i}]$,
where each $\alpha_{i,j}$ evaluates the discrimination ability of word $w_{i,j} \in S_i$. $\alpha_{i,j}$ is formally computed as:
$$\alpha_{i,j} =\frac {\exp(\text{tanh}(\mathbf{W}_w{\mathbf{h}}_{i,j})^\mathsf{T}(\mathbf{W}_{gw}\beta_{\hat{c}}))} {\sum_{j}\exp(\text{tanh}(\mathbf{W}_w{\mathbf{h}}_{i,j}) ^\mathsf{T}(\mathbf{W}_{gw}\beta_{\hat{c}}))},$$
where $\mathbf{W}_{w}$ and $\mathbf{W}_{gw}$ are trainable weight matrices.
Then, we get a representation of sentence $S_i$ as:
$$\mathbf{v}_{s_i} = \sum_{j = 1}^{n_i}\alpha_{i,j}\mathbf{h}_{i,j},$$
where $n_i$ denotes the word number in sentence $S_i$.

By the above word-level Bi-GRUs, we get a sentence representations sequence $[\mathbf{v}_{s_1}, \ldots, \mathbf{v}_{s_{n_f}}]$,
where $n_f$ refers to the number of sentences in the fact description $f$.
Based on this sequence, similarly, we build sentence-level Bi-GRUs and calculate a sentence-level attentive vector $[\alpha_{1},\ldots,\alpha_{n_f}]$ that reflects the discrimination ability of each sentence, and then get the fact's distinguishable representation $\mathbf{v}_f^{\text{d}} \in \mathbb{R}^{d_s}$.
Our sentence-level Bi-GRUs are formulated as:
$$ \mathbf{h}_{i} = [\overrightarrow{\text{GRU}}(\mathbf{v}_{s_i}),  \overleftarrow{\text{GRU}}(\mathbf{v}_{s_i})],\ \ i = 1,2,..., n_f, $$
$$\alpha_{i} =\frac {\exp(\text{tanh}(\mathbf{W_s}{\mathbf{h}}_{i})^\mathsf{T}(\mathbf{W}_{gs}\beta_{\hat{c}}))} {\sum_{i}\exp(\text{tanh}(\mathbf{W_s}{\mathbf{h}}_{i})^\mathsf{T}(\mathbf{W}_{gs}\beta_{\hat{c}}))},$$
$$
\mathbf{v}_f^{\text{d}} = \sum_{i}\alpha_{i}\mathbf{h}_{i}.
$$

\subsection{Prediction and Training}\label{sec:training}
We concatenate the basic representation $\mathbf{v}_f^{\text{b}}$ and the distinguishable representation $\mathbf{v}_f^{\text{d}}$ as the final representation of fact description $f$, i.e., $\tilde{\mathbf{v}}_f = [\mathbf{v}_f^{\text{b}}, \mathbf{v}_f^{\text{d}}]$.
Based on $\tilde{\mathbf{v}}_f$,
we generate a corresponding feature vector $\tilde{\mathbf{v}}_f^j$ for each subtask $t_j$, $j=1,2,3$ mentioned in Sec.~\ref{sec:problem}, i.e., $t_1$: \textbf{law article prediction}; $t_2$: \textbf{charge prediction}; $t_3$: \textbf{term of penalty prediction}.
To obtain the prediction for each subtask,
we use a linear classifier:
$$ \hat{y}_{j} = \text{softmax}(\mathbf{W}_p^j \tilde{\mathbf{v}}_f^j + \mathbf{b}_p^j), $$
where $\mathbf{W}_p^j$ and $\mathbf{b}_p^j$ are parameters specific to task $t_j$.
For training, we compute a cross-entropy loss function for each subtask and take the loss sum of all subtasks as the overall prediction loss:
$$ \mathscr{L}_p = -\sum_{j=1}^3 \sum_{k=1}^{\lvert Y_j\lvert} {y}_{j,k} \log(\hat{y}_{j,k}),$$
where $\lvert Y_j\lvert $ denotes the number of different classes (or, labels) for task $t_j$ and $[y_{j,1}, y_{j,2}, \dots, y_{j,\lvert Y_j\lvert}]$  refers to the ground-truth vector of task $t_j$.
Besides, we also consider the loss of law article community prediction (i.e., Eq.~\ref{eq:graph_selection}):
$$ \mathscr{L}_{c} = -\lambda \sum_{j=1}^{M} {X}_{j}\log({\hat{X}_{j}}),$$
where $[X_1, X_2,\dots, X_M]$ is the ground-truth vector of the community including the correct law article applied to the law case.
In summary, our final overall loss function is:
\begin{equation}\label{eq:loss}
 \mathscr{Loss} = \mathscr{L}_p + \mathscr{L}_{c}
\end{equation}

\section{Problem Formulation} \label{sec:problem}

\begin{figure*}[t]
\centering
\includegraphics[width=0.98\linewidth]{fig/overview_of_LIAN_3.pdf}
\caption{\textbf{a.} Overview of our framework \textit{LADAN}: it takes the fact descriptions of cases and the text definitions of law articles as inputs, then extracts the basic representation $\mathbf{v}_f^{\text{b}}$ and distinguishing representation $\mathbf{v}_f^{\text{d}}$ of the fact descriptions through the basic encoder and the re-encoder, and finally combines this two representations for the downstream prediction tasks;
    \textbf{b.} Law Distillation Module: this module communizes law articles and distills the distinguishable features of each community for attention calculation of the re-encoder.}
\label{fig:3}
\end{figure*}

In this section, we introduce some notations and terminologies, and then formulate the LJP task.

\paragraph{Law Cases.}
Each law case consists of a \textit{fact description} and several \textit{judgment results} (cf.~Figure~\ref{fig:0}).
The fact description is represented as a text document, denoted by $f$.
The judgment results may include \textit{applicable law articles}, \textit{charges}, \textit{terms of penalty}, etc.
Assume there are $t$ kinds of judgment results, and the $i$-th judgment result is
represented as a categorical variable $y_i$ which takes value from set $Y_i$.
Then, a law case can be represented by a tuple $(f, y_1, \ldots, y_t)$.

\paragraph{Law Articles.}
Law cases are often analyzed and adjudicated according to a legislature's \textit{statutory law} (also known as, \textit{written law}).
Formally, we denote the statutory law as a set of \textit{law articles} $\mathcal{L}\triangleq\{L_1,\ldots,L_m\}$ where $m$ is the number of law articles.
Similar to the fact description of cases, we also represent each law article $L_i$ as a document.

\paragraph{Legal Judgment Prediction.}
In this paper, we consider three kinds of judgment results: \textit{applicable law articles}, \textit{charges}, and \textit{terms of penalty}.
Given a training dataset $D\triangleq \{(f, y_1, y_2, y_3)_z\}_{z=1}^{q}$ of size $q$,
we aim to train a model $\text{F}(\cdot)$ that can predict the judgment results for any test law case with a fact description $f_{test}$, i.e., $\text{F}(f_{test}, \mathcal{L}) = (\hat{y}_1, \hat{y}_2, \hat{y}_3)$, where $\hat y_i\in Y_i$, $i=1,2,3$.
Following~\cite{zhong2018legal,yang2019legal}, we assume each case has only one applicable law article.

\section{Related Work} \label{sec:related}
Our work solves the problem of the confusing charge in the LJP task by referring to the calculation principle of graph neural network (GNN).
Therefore, in this section, we will introduce related works from these two aspects.
\subsection{Legal Judgment Prediction}
Existing approaches for legal judgment prediction (LJP) are mainly divided into three categories.
In early times, works usually focus on analyzing existing legal cases in specific scenarios with mathematical and statistical algorithms~\cite{kort1957predicting,nagel1963,keown1980mathematical,lauderdale2012supreme}. However, these methods are limited to small datasets with few labels.
Later, a number of machine learning-based methods \cite{lin2012exploiting,liu2004case,sulea2017exploring} were developed to solve the problem of LJP, which almost combine some manually designed features with a linear classifier to improve the performance of case classification.
The shortcoming is that these methods rely heavily on manual features, which suffer from the generalization problem.

In recent years, researchers tend to exploit neural networks to solve LJP tasks.
Luo et al.~\shortcite{luo2017learning} propose a hierarchical attentional network to capture the relation between fact description and relevant law articles to improve the charge prediction.
Zhong et al.~\shortcite{zhong2018legal} model the explicit dependencies among subtasks with scalable directed acyclic graph forms and propose a topological multi-task learning framework for effectively solving these subtasks together.
Yang et al.~\shortcite{yang2019legal} further refine this framework by adding backward dependencies between the prediction results of subtasks.
To the best of our knowledge, Hu et al.~\shortcite{hu2018few} are the first to study the problem of discriminating confusing charges for automatically predicting applicable charges.
They manually define 10 discriminative attributes and propose to enhance the representation of the case fact description by learning these attributes.
This method relies too much on experts
and cannot be easily extended to different law systems.
To solve this issue, we propose a novel attention framework that automatically extracts differences between similar law articles to enhance the representation of fact description.

\subsection{Graph Neural Network}
Due to its excellent performance in graph structure data, GNN has attracted significant attention~\cite{kipf2016semi, hamilton2017inductive, DSE2019exploring}.
In general, existing GNNs focus on proposing different aggregation schemes to fuse features from the neighborhood of each node in the graph for extracting richer and more comprehensive information:
Kipf et al.~\shortcite{kipf2016semi} propose graph convolution networks which use mean pooling to pool neighborhood information;
GraphSAGE~\cite{hamilton2017inductive} concatenates the node's features and applies mean/max/LSTM operators to pool neighborhood information for inductively learning node embeddings;
MR-GNN~\cite{xu2019mr} aggregates the multi-resolution features of each node to exploit node information, subgraph information, and global information together;
Besides, Message Passing Neural Networks~\cite{gilmer2017neural} further consider edge information when doing the aggregation.
However, the aggregation schemes lead to the over-smoothing issue of graph neural networks~\cite{li2018deeper}, i.e., the aggregated node representations would become indistinguishable, which is entirely contrary to our goal of extracting distinguishable information.
So in this paper, we propose our distillation operation, based on a distillation strategy instead of aggregation schemes, to extract the distinguishable features between similar law articles.


\section{Introduction}

We place ourselves in the context of a multi-agent setting where the agents need to reach consensus regarding the description of their jointly observed environment.
The applications for this of setting are numerous stemming from autonomous drones to driver-less cars.
Existing work address this problem either using trust mechanisms \cite{ramchurn_trust_2004,gopal_selfish_2016} or using opinion spreading techniques \cite{degroot_reaching_1974}.
However, these approaches make the assumption that the information exchanged by the agents and used to describe the environment is seen as a black box.
This is an unrealistic simplification since, in many of the aforementioned applications, the information exchanged between agents may be inconsistent due to the incomplete nature of the agents' viewpoint.
As a consequence, certain information might weaken others, or, contrary, might reinforce them. Furthermore, the agents communicate amongst each other with various degrees of communication trust.

We propose to combine two techniques to address the aforementioned problem and study its theoretical and empirical properties. To model the information interaction, we propose to use argumentation-based ranking semantics \cite{besnard_logic-based_2001,leite_social_2011,amgoud_ranking-based_2013,cayrol_graduality_2005,matt_game-theoretic_2008}. These semantics allow for ``attacked'' pieces of information to have a lower ranking than the non-attacked ones. Such ranking semantics are used directly w.r.t.\ their application desirable properties \cite{bonzon_comparative_2016,leite_social_2011,matt_game-theoretic_2008,cayrol_graduality_2005,amgoud_ranking-based_2013}. Then, to model the information spreading based on the trust model, we use Degroot's model \cite{degroot_reaching_1974}.

Our contributions lie in the proposal and analysis of the first trust-based consensus finding framework based on argumentative ranking semantics.
This advances the state-of-the-art by a finer grained consideration of the exchanged information by the agents.
The framework is shown to converge under certain conditions. We unveil a property that allows for the modification of the agent trust matrix without ``losing'' the convergence. In our empirical study, we show that the framework is scalable for real world applications.

\section{Aggregation Framework}

\subsection{Background notions}

An argumentation framework (AF) \cite{dung_acceptability_1995} is $\mathcal{AS} = (\mathcal{A},\mathcal{C})$ where $\mathcal{A}$ is a set of arguments and $\mathcal{C} \subseteq \mathcal{A} \times \mathcal{A}$ is a set of directed attacks. The set of attackers of an argument $a$ is denoted by $Att(a)$. Namely, $Att(a) = \{ b \in \mathcal{A}$ s.t.\ $(b,a) \in \mathcal{C}\}$.
A weighting function on $\mathcal{A}$ is a function $w$ that associates a positive number to each element of $\mathcal{A}$, i.e.\ $w: \mathcal{A} \to \mathbb{R}^+$. The set of all possible weighting functions over $\mathcal{A}$ is denoted by $\mathcal{W}_{\mathcal{A}}$.
A property on a set of weighting functions $\mathcal{W}$ is a function $\rho: \mathcal{W} \to \{0, 1\}$ s.t.\ for every $w \in \mathcal{W}, \rho(w) = 0$ if the property is not satisfied and $\rho(w) = 1$, otherwise.
The set of all possible properties on $\mathcal{W}$ is defined by $\Omega(\mathcal{W})$.
These functions (such as void precedence or cardinality precedence) are defined and thoroughly analysed in the literature \cite{bonzon_comparative_2016,leite_social_2011,matt_game-theoretic_2008,cayrol_graduality_2005,amgoud_ranking-based_2013}.

\begin{example}
\label{ex:graph-args}
Let $\mathcal{AS} = (\mathcal{A}, \mathcal{C})$ be an AF representing the arguments exchanged by four traffic drones, with $\mathcal{A} = \{ a,b,c,d,e\}$ and $\mathcal{C} = \{ (a,e), (d,a), (b,a),$ $(e,d),$ $(b,c), (c,e) \}$. We have $Att(a) = \{b,d\}$ and $Att(b) = \emptyset$.
Let us consider the following weighting functions $\{w_1, w_2, w_3, w_4,w_5  \} \subset \mathcal{W}_{\mathcal{A}}$ s.t.\
$w_1(a) = 0.38, w_1(b) = 1, w_1(c) =  0.5, w_1(d) = 0.65, w_1(e) = 0.53$,
$w_2(a) = 0.07, w_2(b) = 0.91  , w_2(c) = 0.08 , w_2(d) =  0.2, w_2(e) = 0.78$,
$ w_3(a) = 0.2, w_3(b) = 1, w_3(c) = 0.62, w_3(d) =  0.7 , w_3(e) =  0.40$,
$ w_4(a) = 0.17, w_4(b)=  1, w_4(c) =  0.25, w_4(d) = 0.25 , w_4(e) = 0.5$,
 $w_5(a) =  1, w_5(b) =  0.21, w_5(c) = 0.75 , w_5(d) =  0.32$ and $w_5(e) = 0.40$.

$\rho_{void}$ is satisfied by $w_1, w_2, w_3$ and $w_4$ but not by $w_5$.
$\rho_{card}$ is only satisfied by $w_3$ and $\rho_{self}$ is satisfied by $w_1, w_2, w_3, w_4$ and $w_5$.

\end{example}

\subsection{Framework's Elements}

We now introduce a three step framework for $k$ agents in $Ind = \{ A_1, A_2, \dots, A_k\}$ to reach a consensus about what can be the possible weights of the arguments in an AF $\mathcal{AS} = (\mathcal{A},\mathcal{C})$.

\begin{enumerate}
\item \textbf{(Deciding the Weighting Library)}
Once the agents agree on a set of desirable properties of the weighting functions $\Omega^* \subseteq \Omega(\mathcal{W}_{\mathcal{A}})$, we use the set of properties $\Omega^*$ for obtaining the filtered set $\mathcal{W}_1 \subseteq \mathcal{W}_{\mathcal{A}}$ that satisfies all of the properties in $\Omega^*$.  The set $W_1$ is called the \textit{weighting library} w.r.t.\ $\mathcal{W}_{\mathcal{A}}$ and $\Omega^*$. The weighting library is populated with weighting functions obtained from ranking-based semantics satisfying the selected properties.

\item \textbf{(Score assignment)}
The agents have to make two choices. First, via the function $P: Ind \to 2^{\mathcal{W}_1}$ that takes as input an individual $A_i \in Ind$ and returns the set of weighting functions considered by $A_i$. Each agent considers a subset of the weighting library $\mathcal{W}_1$. The set of weightings considered by the agents $Ind$ is denoted by $M = \bigcup_{A_i \in Ind} P(A_i)$.
Second, each agent $A_i$ associate a score $0 < s_w \leq 1$ to each of the weighting function $w$ considered (i.e.\ to each element of $P(A_i)$) s.t.\ $\sum_{w \in P(A_i)} s_w =1$. We can thus associate a scoring function $S_i: M \to [0,1]$, to each agent $A_i$ over the weighting function of $M$, defined as for every $A_i \in Ind$ and every $w \in M$: $S_i(w) = s_w$ if $w \in P(A_i)$ and $S_i(w) =0$ otherwise.

\begin{example}[Cont'd Example \ref{ex:graph-args}]
\label{ex:weigting-library}
Let $Ind = \{ A_1, A_2, A_3, A_4 \}$ be a set of four agents. Suppose that the agents of $Ind$ agreed on $\Omega^* = \{\rho_{self}, \rho_{void} \}$, then $\mathcal{W}_1$ w.r.t.\ $\mathcal{W}_{\mathcal{A}}$ and $\Omega^*$ contains $w_1,$ $w_2,$ $w_3,$ $w_4$ but not $w_5$ since $\rho_{void}(w_5) = 0$.

Assume now that $P(A_1) = \{ w_1, w_2, w_3 \}$, $P(A_2) = \{ w_2, w_3 \}$, $P(A_3) = \{ w_3, w_4 \}$ and $P(A_4) = \{ w_2, w_3, w_4\}$. The set of weightings considered by the agents is  $M=\{ w_1, w_2, w_3, w_4 \}$. In the rest of this paper, we consider $S_1,$ $S_2,$ $S_3$ and $S_4$ depicted in Table \ref{tabl:f4}.

\begin{table}
\centering
\parbox{.45\linewidth}{
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
& $w_1$ & $w_2$ & $w_3$ & $w_4$ \\
\hline
$S_1$ & 0.4 & 0.3 & 0.3 & 0\\
$S_2$ & 0 & 0.5 & 0.5 & 0\\
$S_3$ & 0 & 0 & 0.7 & 0.3\\
$S_4$ & 0 & 0.2 & 0.1 & 0.7\\
\hline
\end{tabular}
\caption{The scoring function $S_1, S_2, S_3$ and $S_4$.}
\label{tabl:f4}
}
\quad
\parbox{.45\linewidth}{
\centering
\begin{tabular}{|c|c|c|c|c|}
\hline
$Ind$ & $A_1$&  $A_2$ & $A_3$ & $A_4$ \\
\hline
$A_1 $ & 0.75 & 0.15 & 0.1 & 0 \\
\hline
$A_2$ & 0.2 & 0.7& 0.1 & 0 \\
\hline
$A_3$ & 0.35 & 0.15 & 0.5 & 0 \\
\hline
$A_4$ & 0.3 & 0.3 & 0.3& 0.1 \\
\hline
\end{tabular}
\caption{Agent trust matrix $V$}
\label{tabl:influences}}
\end{table}

\end{example}

\item \textbf{(Preference Propagation)} This phase takes into account the trust between agents to reach a consensus on the weightings. We define the trust of agent $A_j$ for agent $A_i$ by the number $v_{i,j}$ with $\sum_{j=1}^{j=k} v_{i,j} = 1$ (with $v_{i,j}=0$ either when agent $A_i$ does not know of the existence of agent $A_j$ or when $A_i$ does not trust the opinion of $A_j$). One way of representing the trust between the agents is a $k \times k$ agent trust matrix $V$ (see Table \ref{tabl:influences}).

\end{enumerate}

\subsection{Weightings Aggregation}

Within this framework, we can chose many propagation methods. In this paper, due to its large popularity and simplicity, we follow the DeGroot model \cite{degroot_reaching_1974} where the scoring functions are updated over time so that $S_w^{(n)} = V \times S_w^{(n-1)} = V^n \times S_w^{(0)}$, where $S_w^{(0)}$ is the column vector $(S_1(w), \dots, S_k(w))^T$.
A consensus is reached iff for every $w \in M,$ all the $k$ elements of $S^{(n)}_w$ converge toward the same limit as $n \to +\infty$ \cite{golub_naive_2010,berger_necessary_1981} and is computed by finding a vector $\pi = (\pi_1, \dots, \pi_k)$ s.t.\ $\sum_{i=1}^{k} \pi_i= 1, \pi V = \pi$ and for every $i \in \{1, \dots, k \}, \pi_i \geq 0$. The score function $S^*$ of all the agents in the consensus is $S^*(w) = \sum_{i=1}^{i=k} S_i(w) \times \pi_i$.

\begin{example}[Cont'd Example \ref{ex:weigting-library}]
\label{ex:convergence}
The initial score for $w_1$ across all the agents is the vector $S^{(0)}_{w_1} = (S_1(w_1),$ $S_2(w_1),$ $S_3(w_1),$ $S_4(w_1))^T = (0.4,0,0,0)^T$. In the agent trust matrix, $A_1$ weights himself more than agents $A_2$ and $A_3$ and ignores agent $A_4$. We get that the updated scores for $w_1$ is $S_{w_1}^{(1)}= V \times S_{w_1}^{(0)} = (0.3, 0.08, 0.14, 0.12)^T$.
Multiple iterations of this process leads to a consensus on the score of $w_1$, i.e.\
$S_{w_1}^{(n)} = V^n \times S_{w_1}^{(0)} \rightarrow (0.2, 0.2, 0.2, 0.2 )^T$.
In our example, there is a unique vector $\pi = (\frac{1}{2}, \frac{1}{3}, \frac{1}{6}, 0)$ s.t.\ $\pi V = \pi$. We have $S^* (w_1) = \frac{1}{2} \times 0.4 = 0.2$, $S^*(w_2) = \frac{1}{2} \times 0.3 + \frac{1}{3} \times 0.5 \approx 0.32$, $S^*(w_3) = \frac{1}{2} \times 0.3 + \frac{1}{3} \times 0.5 + \frac{1}{6} \times 0.7 \approx 0.43$ and $S^*(w_4) = \frac{1}{6} \times 0.3 = 0.05$.

\end{example}

\subsection{Practical Use Case}
Before proceeding to analyse the framework, we provide a practical use case within the traffic monitoring inspired example.
We consider three driver-less cars (A, B and C) that are simultaneously arriving at a very narrow roundabout. The roundabout is monitored by four traffic drones. Each of the traffic drones has different opinions on the weights of the arguments depending on their geographical positions. For instance $A_1$ and $A_2$ are drones that both have high-ground positions and a clear view of the roundabout, $A_3$ is a drone with a ground level vision and $A_4$ has an obstructed vision of the situation. $A_1$ and $A_2$ are confident about their own judgement whereas $A_4$ has low trust about his own opinion. Moreover, $A_1, A_2, A_3$ can communicate with each others whereas the opinion of $A_4$ is not taken into account by the other agents.
The drones, depending on their position, attempt to model the following conflicting arguments:
$\textbf{(a)}$ A will enter the roundabout first and it means that B will not enter.
$\textbf{(b)}$ There is a pedestrian crossing in front of the car A and the speed of car B is fast which means that car A will not enter the roundabout first and that the speed of B is not slow.
$\textbf{(c)}$ The speed of car B is slow which means that B will not enter first.
$\textbf{(d)}$ C will enter the roundabout first and it means that A will not enter.
$\textbf{(e)}$ B will enter the roundabout first and it means that C will not enter.

Our framework will output a consensus on the weights allowing to have an unified view of the traffic based on their agent trust network.
Concretely, if we consider the agent trust matrix in Table \ref{tabl:influences} and the initial opinions of the drones in Table \ref{tabl:f4} about the weighting functions of Example \ref{ex:graph-args}, our framework will output an optimal subset of the weightings (in this case $\{w_3\}$) or an aggregated weighting function $w^*$ (see Definition \ref{def:aggregated}).

\section{Framework Analysis}

In this section, we provide a theoretical and empirical evaluation of our framework. The theoretical analysis of the proposed framework and our results will allow to answer the following research questions:
(1) Can agent modify their trust network without losing the convergence?
(2) What are the semantics properties of the weights outputted by the consensus?
(3) Is this approach scalable for a large number of agents and/or arguments?

\subsection{Theoretical Properties}

We first address the question: Can agents modify their trust network without losing the convergence?
The previous work by \cite{golub_naive_2010,berger_necessary_1981} proposed many conditions for a trust network to achieve a consensus.
In the next proposition, we show how the agent trust matrix can be revised without losing the convergence.

\begin{proposition}
\label{prop:revised-consensus}
Let $V$ be a trust matrix s.t.\ a consensus can be reached, $V'$ be right stochastic matrix and $F: \mathbb{R}^{k\times k} \to \mathbb{R}^{k\times k}$ be a matrix function s.t.\:

\begin{multline*}
V = \begin{pmatrix}
v_{1,1} & \dots & v_{1,n} \\
\vdots & \ddots & \vdots \\
v_{k,1} & \dots & v_{k,k}
\end{pmatrix}=
\begin{pmatrix}
f_{1,1}(v'_{1,1}) & \dots & f_{1,n}(v'_{1,n}) \\
\vdots & \ddots & \vdots \\
f_{k,1}(v'_{k,1}) & \dots & f_{k,k}(v'_{k,k})
\end{pmatrix}= F(V')
\end{multline*}

where $f_{i,j}: [0,1] \to [0,1]$ is s.t.\ for every $v \in [0,1], f_{i,j}(v) = 0$ if $v=0$ and $f_{i,j}(v) = v_{i,j}$, otherwise. It holds that a consensus can be reached with $V'$.

\end{proposition}

We now show how the scoring function $S^*$ obtained from the consensus between agents can be used for choosing/creating a weighting function for an AF.
We first define the output of the consensus as an optimal set of weighting functions that should be used for an AF.

\begin{definition}[Output of a consensus]
The output of the consensus is the set of weightings $M^* \subseteq M$ s.t.\ for every $w, w' \in M^*$ and $w'' \in M \setminus M^*$, $S^*(w) = S^*(w')$ and $S^*(w') > S^*(w'')$.
\end{definition}

\begin{example}[Cont'd Example \ref{ex:convergence}]
The output of the consensus is the set of weightings $M^*=\{w_3\}$. $w_3$ is thus the weighting that will be used for the traffic AF.
\end{example}

The shape of the agent trust network determines the influence of each agents and the agents that are not communicating with the only strongly connected component have no influence in the consensus.

\begin{proposition}
If the agent trust network is aperiodic and there is only one strongly connected component $S\subseteq Ind$ that is closed (no edges to the agents outside of the strongly connected component) then for every $A_i \in S, \pi_i >0$ and for every $A_j \in Ind \setminus S, \pi_j = 0$.
\end{proposition}

Furthermore, we can see that an agent that possesses more than half of the total influence of the network can force his opinion to the other agents.

\begin{proposition}
If there exists an agent $A_i \in Ind$ s.t.\ $\pi_i > 0.5$ then it is possible for $A_i$ to choose $w \in M$ s.t.\ $w \in M^*$.
\end{proposition}

The advantage of using this approach is that the output of the consensus is a subset of $M$ and will thus satisfy every property of $\Omega^*$. However, the cons are that the output of the consensus is not always a single weighting function and, in the case where an agent has most of the influence, he can force the choice of one weighting function.
Note that \cite{golub_naive_2010} introduced a condition on the agent trust matrix so that the consensus is ``wise'', i.e.\ there is no agent that retain too much influence in the consensus.

We now suppose that instead of using the scoring function $S^*$ for choosing the best weighting functions in the consensus, we use the scoring function $S^*$ for obtaining an aggregated weighting function.

\begin{definition}[Aggregated weighting function]
The aggregated weighting function w.r.t.\ $S^*$ is $w^*: \mathcal{A} \to \mathbb{R}$ s.t.\ for every $a \in \mathcal{A}, w^*(a) = \sum\limits_{w \in M} S^*(w) \times w(a)$.
\label{def:aggregated}
\end{definition}

\begin{example}[Cont'd Example \ref{ex:converge-limit-scoring}]
The aggregated weighting function is $w^*$ s.t.\ $w^*(a) = 0.38 \times 0.2 + 0.07 \times 0.32 + 0.2 \times 0.43 + 0.17 \times 0.05 \approx 0.19$, $w^*(b) = 0.97, w^*(c) = 0.40, w^*(d) = 0.51$ and $w^*(e) = 0.55$.

\end{example}

\begin{proposition}
Let $a,b \in \mathcal{A}$ be two arbitrary arguments of $\mathcal{A}$. If for every weighting function $w \in M$, it holds that $w(a) > w(b)$ then $w^*(a) > w^*(b)$.
\label{prop-aggreg}
\end{proposition}

If all the weighting functions chosen by the agents satisfy some properties then the aggregated weighting function also satisfies the same properties.

\begin{proposition}
Let us consider the weighting function $w \in M$. It holds that (1) $\rho_{void}(w) = 1$ then $\rho_{void}(w^*) =1 $, (2) $\rho_{card}(w) = 1$ then $\rho_{card}(w^*) =1 $ and (3) $\rho_{self}(w) = 1$ then $\rho_{self}(w^*) =1 $
\label{prop:generalisation}
\end{proposition}

Proposition \ref{prop:generalisation} is important as it shows that the aggregated weighting function $w^*$ keeps the desirable properties of the weighting functions. For readability purposes, we did not include all of the properties but this proposition can be generalised for most of the ranking-based semantics properties of \cite{bonzon_comparative_2016} (quality precedence, counter-transitivity, strict counter-transitivity, defense precedence, distributed defense precedence, etc.).
Please note that it is not true that $w^*$ will satisfy every property of $\Omega^*$ (see Example \ref{ex:counter-ex-omega} for a counter-example).

\begin{example}
\label{ex:counter-ex-omega}

Suppose that $\mathcal{AS}$ has three arguments $a,b$ and $c$, $M = \{ w'_1, w'_2 \},$ $S^*(w'_1) = 0.5, S^*(w'_2) = 0.5$ and $w'_1, w'_2$ are s.t.\ $w'_1(a) = 1, w'_1(b) = 0.5, w'_1(c) = 0$, $w'_2(a) = 0$, $w'_2(b) = 0.5$ and $w'_2(c) = 1$.
If we consider the property \emph{All Different} defined as $\rho_{diff}(w)=1$ iff for every $a,b \in \mathcal{A}, w(a) \neq w(b)$. It holds that $\rho_{diff}(w'_1) = \rho_{diff}(w'_2) = 1$ but $\rho_{diff}(w'^*) = 0$.
\end{example}

The pros of using this approach are that the ranking of arguments is ``preserved'' which leads to the satisfaction of most argumentation properties by the aggregated weighting function $w^*$ and that the aggregated weighting $w^*$ function is unique. However, the disadvantage is that $w^*$ can violate the properties of $\Omega^*$.

\subsection{Empirical Evaluation}

Let us analyse the time and the number of steps needed in practice to achieved the consensus (with a precision $\varepsilon$).
We implemented an algorithm that takes as input the agent trust matrix $V$ and a precision $\varepsilon$ and computes $V' = V^K, K \geq 1,$ s.t.\ all the lines of $V'$ are nearly-equal with a precision $\varepsilon$, i.e. for every two lines $V'_1$ and $V'_2$ of $V'$, ${V'_1}_i$ the $i$-th element of $V'_1$, ${V'_2}_i$ the $i$-th element of $V'_2$, we have $|{V'_1}_i - {V'_2}_i| \leq \varepsilon$.
Then, since all the lines of $V'$ are nearly-equal with a precision $\varepsilon$, we retrieve the first line of $V'$ which is an approximation of the vector $\pi$. The algorithm returns the vector corresponding to $S^*$.

\subsubsection{Data gathering}
\label{sec:generation-mat}
The three-step procedure to follow to generate a random $k \times k$ matrix $V$ that can reach a consensus is: (1) Pick $k$ numbers $n_1, \dots, n_k$ between $0$ and $k$ that we divide by $\sum_{i=1}^{k} n_i$. We thus obtain $n'_1, \dots, n'_k$ where $n'_i = n_i \times \frac{1}{\sum_{i=1}^{k} n_i}$. Note that we make sure that not all the $n_i$ are equal to zero. (2) The numbers $n'_1, \dots, n'_k$ are assigned to the first line of $V$. The step 1 is repeated to obtain all $k$ lines of $V$. At this point, the matrix $V$ is right stochastic, i.e.\ the sum of the elements of each line is $1$. (3) For a fixed positive integer $c$, we check whether any of the matrices $V, V^2, \dots, V^c$ have at least one column s.t.\ every element in that column is positive. If yes, the matrix $V$ can reach a consensus. If not, we repeat the steps (1) and (2).

\subsubsection{Experimental results}

We generated square matrices of increasing sizes (from 50 to 2000 with a step of 50) and experimented with two different precisions ($10^{-3}$ and $10^{-5}$). We repeated each run five times to obtain the average time and average number of steps needed to get the vector $\pi$. The results are displayed in Figure \ref{fig:steps-agents} and \ref{fig:time-agent}.
All experiments presented in this section were performed on a Mac machine running with one allocated processor (100\%) of an Intel core i5 2.80 GHz and 8GB of RAM. The all-in-one program for generating and experimenting as well as the results are available online at \url{https://www.dropbox.com/sh/jp62ve810dy3dow/AABKPS3XE-En73_CR4ZeLXsKa?dl=0}.

We can make the following observations: (1) The number of steps needed to reach a consensus decreases with the increase of agents, (2) decreasing the precision (from $10^{-5}$ to $10^{-3}$) decreases the number of steps needed to reach a consensus, (3) decreasing the precision (from $10^{-5}$ to $10^{-3}$) also decreases the total time needed to reach the consensus and (4) the time to reach a consensus follows a polynomial curve w.r.t. the number of agents. This is not surprising as the number of matrix multiplication stays relatively low and the bound for complexity of square matrix multiplication is around $O(n^{2.73})$ \cite{davie_improved_2013,gall_powers_2014}.

\begin{figure}
\subfloat[Average number of steps for reaching a consensus w.r.t.\ the number of agents]{
\begin{tikzpicture}[y=0.8cm, x=0.0020cm,font=\sffamily]

	\draw (0,0) -- coordinate (x axis mid) (2050,0);
    	\draw (0,0) -- coordinate (y axis mid) (0,4);

    	\foreach \i[evaluate= \i as \x using \i+50] in {0,500,...,2000}
     		\draw (\x,1pt) -- (\x,-3pt)
			node[anchor=north] {\x};

    	\foreach \y in {0,1,...,4}
     		\draw (1pt,\y) -- (-3pt,\y)
     			node[anchor=east] {\y};

	\node[below=0.8cm] at (x axis mid) {Number of agents};
	\node[rotate=90, yshift=0.7cm] at (y axis mid) {Average number of steps};

	\draw plot[mark=*, mark options={fill=white}]
		file {div_soft.data};
	\draw plot[mark=triangle*, mark options={fill=white} ]
		file {div_ciu.data};

	\begin{scope}[xshift=2cm, yshift=3cm]
	\draw (0,0) --
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0)
		node[right]{$\varepsilon = 10^{-5}$};
	\draw[yshift=\baselineskip] (0,0) --
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
		node[right]{$\varepsilon = 10^{-3}$};
	\end{scope}
	\end{tikzpicture}
		\label{fig:steps-agents}}
\quad
\subfloat[Average time needed to reach a consensus as a function of the number of agents]{
\begin{tikzpicture}[y=0.00035cm, x=0.0020cm,font=\sffamily]

	\draw (0,0) -- coordinate (x axis mid) (2050,0);
    	\draw (0,0) -- coordinate (y axis mid) (0,12000);

    	\foreach \i[evaluate= \i as \x using \i+50] in {0,500,...,2000}
     		\draw (\x,1pt) -- (\x,-3pt)
			node[anchor=north] {\x};

    	\foreach \y in {0,1000,...,12000}
     		\draw (1pt,\y) -- (-3pt,\y)
     			node[anchor=east] {\y};

	\node[below=0.8cm] at (x axis mid) {Number of agents};
	\node[rotate=90, yshift=1.2cm] at (y axis mid) {Time (ms)};

	\draw plot[mark=*, mark options={fill=white}]
		file {a.data};
	\draw plot[mark=triangle*, mark options={fill=white} ]
		file {b.data};

	\begin{scope}[xshift=2cm, yshift=3cm]
	\draw (0,0) --
		plot[mark=*, mark options={fill=white}] (0.25,0) -- (0.5,0)
		node[right]{$\varepsilon = 10^{-5}$};
	\draw[yshift=\baselineskip] (0,0) --
		plot[mark=triangle*, mark options={fill=white}] (0.25,0) -- (0.5,0)
		node[right]{$\varepsilon = 10^{-3}$};
	\end{scope}
	\end{tikzpicture}
\label{fig:time-agent}}
\end{figure}

\section{Discussion}

We introduced a framework for reaching a consensus in a multi-agent setting where agents are arguing about the description of their environment using weighting functions.
The consensus is used to achieve the selection of a subset of the existing weighting functions that are considered or the aggregation of some of the weighting functions.
We provided a mapping to Euclidian space that allows to illustrate the convergence and the distance to the consensus and a property that allows for the modification of the agent trust matrix that conserves the convergence. Since our work is directly applicable for driver-less cars we have also provided an empirical evaluation to test the scalability of the proposed approach. This evaluation is performed on synthetically generated data and future work is currently directed over the practical implementation of such scenario within a multidisciplinary joint project.

\newpage

\bibliographystyle{splncs04}