FILM: A Fast, Interpretable, and Low-rank Metric Learning Approach for Sentence Matching

Xiangru Tang, Alan AwarXiv 2020

Abstract

Sentence matching is a critical task in natural language processing, traditionally dominated by complex, computationally expensive deep learning models. This paper introduces FILM (Fast, Interpretable, and Low-rank Metric learning), a lightweight approach that formulates metric learning as a manifold optimization problem. By utilizing the Stiefel manifold and Cayley transformations, FILM achieves competitive accuracy with significantly lower computational overhead and high interpretability. Experiments on the Quora Question Paraphrase and STS datasets demonstrate that FILM can be trained on a standard CPU in under 30 minutes while outperforming several deep learning baselines.

Introduction

Determining semantic similarity between sentence pairs is foundational for search engines, chatbots, and question-answering systems. While deep neural networks (DNNs) have set state-of-the-art benchmarks, they operate as "black boxes" and require substantial GPU resources and training time. This creates a barrier for deployment on memory-limited devices and hinders human auditing of model decisions. FILM addresses these challenges by providing a transparent, linear transformation-based approach that is both fast to train and easy to interpret.

Methodology

FILM learns a low-dimensional, discriminative projection of high-dimensional text data, initially represented via TF-IDF vectors. The core of the approach lies in its optimization strategy:

  1. Triplet Loss Objective: The model minimizes a hinge loss based on triplets (anchor, positive, and negative sentences) to ensure similar sentences are clustered together in the projected space.
  2. Manifold Optimization: The projection matrix is constrained to a Stiefel manifold (the space of orthogonal matrices). This ensures a stable, low-rank representation.
  3. Efficient Solvers: To navigate the manifold, FILM employs the Cayley transformation and the Barzilai-Borwein (BB) step size, which accelerates convergence without the computational cost of traditional line searches.
Figure 1: Training loss convergence over batch iterations, demonstrating the stability of the manifold optimization approach.

For inference, FILM uses a $k$-nearest neighbors (kNN) approach in the learned low-dimensional space to classify sentence pairs.

Experimental Results

Blazing Fast Training

One of FILM's primary advantages is efficiency. While a BERT-based metric learning baseline required 80 minutes on a high-end GPU, FILM completed its training in less than 30 minutes on a standard CPU. This efficiency makes advanced NLP accessible without specialized hardware.

Competitive Performance

On the Quora Question Paraphrase dataset, FILM achieved an accuracy of 86.83%, outperforming Siamese-LSTM (82.58%) and L.D.C (85.55%). On the SemEval-2017 STS task, it reached a Pearson correlation of 57.68, surpassing standard embeddings like Word2vec and GloVe.

True Interpretability

Unlike deep learning models, FILM’s reliance on a linear transformation matrix over TF-IDF features allows for direct inspection. Researchers can examine the learned coefficients to identify which specific words or features are driving the similarity scores.

Figure 2: Learned coefficients for different components, illustrating the model's transparency and ability to highlight influential features.

Conclusion and Future Work

FILM demonstrates that sophisticated mathematical optimization can achieve results comparable to deep learning with a fraction of the compute. Its transparency and speed make it an ideal candidate for resource-constrained environments. Future research will focus on mitigating overfitting caused by dataset selection bias and exploring alternative loss functions, such as N-Pair Loss, to further enhance generalization.

Summary updated

Abstract

Detection of semantic similarity plays a vital role in sentence matching. It requires to learn discriminative representations of natural language. Recently, owing to more and more sophisticated model architecture, impressive progress has been made, along with a time-consuming training process and not-interpretable inference. To alleviate this problem, we explore a metric learning approach, named FILM (Fast, Interpretable, and Low-rank Metric learning) to efficiently find a high discriminative projection of the high-dimensional data. We construct this metric learning problem as a manifold optimization problem and solve it with the Cayley transformation method with the Barzilai-Borwein step size. In experiments, we apply FILM with triplet loss minimization objective to the Quora Challenge and Semantic Textual Similarity (STS) Task. The results demonstrate that the FILM method achieves superior performance as well as the fastest computation speed, which is consistent with our theoretical analysis of time complexity.
BibTeX
@misc{tang2020film,
  author = {Xiangru Tang and Alan Aw},
  title = {{FILM: A Fast, Interpretable, and Low-rank Metric Learning Approach for Sentence Matching}},
  year = {2020},
  eprint = {2010.05523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.05523},
}
Figure