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:
- 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.
- Manifold Optimization: The projection matrix is constrained to a Stiefel manifold (the space of orthogonal matrices). This ensures a stable, low-rank representation.
- 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.
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.
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