Geometry matters: Exploring language examples at the decision boundary

Debajyoti Datta, Shashwat Kumar, Laura Barnes, Tom Fletcher

Abstract

State-of-the-art NLP models often rely on "shortcut learning," where predictions are based on superficial linguistic cues rather than deep semantic understanding. This paper introduces a mathematically principled framework using information geometry to quantify the fragility of individual text examples. By analyzing the Fisher Information Matrix (FIM) of a model's output probability space, we identify "difficult" examples located near the decision boundary. We demonstrate that the largest eigenvalue of the FIM ($\lambda_{max}$) serves as a robust indicator of an example's vulnerability to trivial word substitutions, providing a new tool for model diagnostics and the creation of targeted test sets.

Introduction

Modern NLP architectures like BERT and LSTMs achieve high accuracy but remain susceptible to adversarial perturbations. Often, these models exploit dataset biases—shortcuts—rather than learning the underlying task. Identifying which examples are most vulnerable to such failures typically requires manual curation of "contrast sets" or unguided heuristic attacks. This work proposes an automated, geometric approach to pinpointing fragile examples by treating the neural network as a mapping from input embeddings to a statistical manifold.

Methodology: Information Geometry and the Fisher Information Matrix

The core of the proposed method is the use of the Fisher Information Metric (FIM) to measure how sensitive a model's output distribution is to small changes in the input embedding space.

Conceptual mapping from input space $X$ to the statistical manifold $Z$, illustrating how local geometry relates to the decision boundary.

As shown in Figure 3, the model $g$ maps input $X$ to a manifold $Z$. The FIM characterizes the local curvature of this manifold. The authors calculate the largest eigenvalue, $\lambda_{max}$, of the FIM with respect to the input sentence embeddings. A high $\lambda_{max}$ indicates high local distortion: a small shift in the input embedding results in a large change in the output probability, suggesting the example lies on or near the decision boundary.

Experimental Results

The approach was evaluated across multiple datasets (IMDb, Yelp, AG_NEWS, Sogou News) and architectures (CNN, LSTM, FastText, and BERT). A key finding is the strong correlation (r-values between 0.30 and 0.41) between $\lambda_{max}$ and linguistic fragility. Examples with high $\lambda_{max}$ are "difficult" for the model; changing a single, often irrelevant word can flip the predicted label.

Comparison of word substitutions in 'difficult' (high $\lambda_{max}$) vs 'easy' (low $\lambda_{max}$) examples.

As illustrated in Figure 6, in a "difficult" IMDb example ($\lambda_{max} = 4.38$), substituting "exciting" with "boring" flips the sentiment. In contrast, an "easy" example ($\lambda_{max} = 0.013$) remains stable despite multiple antonym substitutions. Quantitatively, perturbing high $\lambda_{max}$ examples caused model accuracy to plummet from over 90% to below 20%.

Discussion and Conclusion

This geometric framework provides a principled way to expose model weaknesses without exhaustive manual testing. While mapping continuous perturbation vectors back to discrete tokens remains a challenge, $\lambda_{max}$ offers a powerful diagnostic for identifying the "knife's edge" examples where models are most likely to fail. Future work will focus on better decoding these geometric signals into human-readable adversarial examples.

Summary updated

BibTeX
@misc{datta2020geometry,
  author = {Debajyoti Datta and Shashwat Kumar and Laura Barnes and Tom Fletcher},
  title = {{Geometry matters: Exploring language examples at the decision boundary}},
  year = {2020},
  eprint = {2010.07212},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.07212},
}
Figure