Skip to main content
QUICK REVIEW

[Paper Review] Chinese Sentences Similarity via Cross-Attention Based Siamese Network

Zhen Wang, Xiangxie Zhang|arXiv (Cornell University)|Apr 18, 2021
Topic ModelingComputer Science11 references4 citations
TL;DR

This paper proposes CATsNet, a cross-attention based siamese neural network that improves Chinese sentence similarity by modeling dependencies between two sentences using cross-attention mechanisms and enhancing feature extraction with Bi-LSTM layers. The model achieves 83.15% accuracy on the LCQMC dataset, outperforming prior siamese models including those based on self-attention, LSTM, and CNN architectures.

ABSTRACT

Measuring sentence similarity is a key research area nowadays as it allows machines to better understand human languages. In this paper, we proposed a Cross-Attention Siamese Network (CATsNet) to carry out the task of learning the semantic meanings of Chinese sentences and comparing the similarity between two sentences. This novel model is capable of catching non-local features. Additionally, we also tried to apply the long short-term memory (LSTM) network in the model to improve its performance. The experiments were conducted on the LCQMC dataset and the results showed that our model could achieve a higher accuracy than previous work.

Motivation & Objective

  • To address the challenge of accurately measuring semantic similarity between Chinese sentences, which is complicated by character-level ambiguity and lack of word boundaries.
  • To improve sentence representation learning by modeling cross-sentence dependencies, beyond what self-attention or local feature extractors can achieve.
  • To enhance performance on Chinese sentence similarity by combining global context modeling (via cross-attention) with sequential modeling (via Bi-LSTM).
  • To validate the effectiveness of a siamese architecture with cross-attention and Bi-LSTM components on a large-scale Chinese NLP benchmark.

Proposed method

  • The model employs a siamese network structure with shared weights to process two input sentences simultaneously, enabling comparison of their semantic representations.
  • A cross-attention block computes query, key, and value matrices from the two sentence embeddings, allowing attention to be computed across sentences rather than within a single sentence.
  • The cross-attention mechanism computes context-aware representations by attending to relevant tokens in the other sentence, capturing inter-sentence dependencies.
  • The feed-forward network in the transformer encoder block is replaced with a bidirectional LSTM (Bi-LSTM) to better capture sequential patterns in the sentence representations.
  • The final sentence representations are fed into a classifier to predict similarity, with focal loss used to address class imbalance in the training data.
  • The model is trained and evaluated on the LCQMC dataset, a large-scale Chinese question matching corpus with 238,766 training and 12,500 test pairs.

Experimental results

Research questions

  • RQ1Can a siamese network with cross-attention mechanisms outperform self-attention and traditional RNN/CNN-based models in Chinese sentence similarity?
  • RQ2Does replacing the feed-forward network in the transformer encoder with a Bi-LSTM improve sentence representation learning for similarity tasks?
  • RQ3How effective is the combination of cross-attention and Bi-LSTM in modeling both inter-sentence and intra-sentence dependencies?
  • RQ4Does the use of focal loss improve model performance on imbalanced sentence similarity datasets?

Key findings

  • CATsNet achieved 83.15% accuracy on the LCQMC dataset, significantly outperforming the best baseline model (siamese convolutional network) at 77.31%.
  • The cross-attention siamese model with MLP head achieved 81.99% accuracy, demonstrating that modeling inter-sentence dependencies improves performance over self-attention alone.
  • The self-attention siamese model achieved 78.61% accuracy, showing that attention mechanisms outperform RNN-based models like siamese LSTM (68.63%) and siamese Bi-LSTM (68.64%).
  • The ablation study confirmed that combining cross-attention with Bi-LSTM yields the best performance, indicating that global context and sequential modeling are complementary.
  • The validation accuracy curve showed that CATsNet consistently outperformed other siamese models across all training epochs, indicating robust training dynamics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.