Table of Contents
Fetching ...

RepMatch: Quantifying Cross-Instance Similarities in Representation Space

Mohammad Reza Modarres, Sina Abbasi, Mohammad Taher Pilehvar

TL;DR

RepMatch introduces a cross-subset similarity measure by comparing representation spaces learned by models trained on different data subsets. It relies on LoRA to constrain updates to low-rank adaptation matrices and uses Grassmann similarity to quantify subspace alignment across layers, enabling dataset-to-dataset and instance-to-dataset analyses. The approach demonstrates that RepMatch captures task-related dataset similarities, identifies representative subsets that outperform random ones, and uncovers heuristics in dataset construction such as HANS. Across NLP tasks and models, RepMatch remains robust to training randomness and scalable to cross-dataset comparisons, offering a practical tool for data-centric analysis and dataset discovery.

Abstract

Advances in dataset analysis techniques have enabled more sophisticated approaches to analyzing and characterizing training data instances, often categorizing data based on attributes such as ``difficulty''. In this work, we introduce RepMatch, a novel method that characterizes data through the lens of similarity. RepMatch quantifies the similarity between subsets of training instances by comparing the knowledge encoded in models trained on them, overcoming the limitations of existing analysis methods that focus solely on individual instances and are restricted to within-dataset analysis. Our framework allows for a broader evaluation, enabling similarity comparisons across arbitrary subsets of instances, supporting both dataset-to-dataset and instance-to-dataset analyses. We validate the effectiveness of RepMatch across multiple NLP tasks, datasets, and models. Through extensive experimentation, we demonstrate that RepMatch can effectively compare datasets, identify more representative subsets of a dataset (that lead to better performance than randomly selected subsets of equivalent size), and uncover heuristics underlying the construction of some challenge datasets.

RepMatch: Quantifying Cross-Instance Similarities in Representation Space

TL;DR

RepMatch introduces a cross-subset similarity measure by comparing representation spaces learned by models trained on different data subsets. It relies on LoRA to constrain updates to low-rank adaptation matrices and uses Grassmann similarity to quantify subspace alignment across layers, enabling dataset-to-dataset and instance-to-dataset analyses. The approach demonstrates that RepMatch captures task-related dataset similarities, identifies representative subsets that outperform random ones, and uncovers heuristics in dataset construction such as HANS. Across NLP tasks and models, RepMatch remains robust to training randomness and scalable to cross-dataset comparisons, offering a practical tool for data-centric analysis and dataset discovery.

Abstract

Advances in dataset analysis techniques have enabled more sophisticated approaches to analyzing and characterizing training data instances, often categorizing data based on attributes such as ``difficulty''. In this work, we introduce RepMatch, a novel method that characterizes data through the lens of similarity. RepMatch quantifies the similarity between subsets of training instances by comparing the knowledge encoded in models trained on them, overcoming the limitations of existing analysis methods that focus solely on individual instances and are restricted to within-dataset analysis. Our framework allows for a broader evaluation, enabling similarity comparisons across arbitrary subsets of instances, supporting both dataset-to-dataset and instance-to-dataset analyses. We validate the effectiveness of RepMatch across multiple NLP tasks, datasets, and models. Through extensive experimentation, we demonstrate that RepMatch can effectively compare datasets, identify more representative subsets of a dataset (that lead to better performance than randomly selected subsets of equivalent size), and uncover heuristics underlying the construction of some challenge datasets.

Paper Structure

This paper contains 23 sections, 1 equation, 6 figures, 5 tables.

Figures (6)

  • Figure 1: Grassmann similarities of LoRA matrices (and the corresponding RepMatch scores on top) for each of the 12 layers of two BERT$_{base}$ models fine-tuned on SST-2 but (a) with different seeds, and (b) with random baseline (axes are $i$ and $j$ of the corresponding Grassmann similarity). Note the significantly different ranges of the two scales.
  • Figure 2: Grassmann similarities of LoRA matrices (and the corresponding RepMatch scores on top) for each of the 12 layers of two BERT$_{base}$ models: (a) fine-tuned on the same random instance from SST-2 but with different fine-tuning initial seeds, and (b) fine-tuned with the same seed but on two different instances from the dataset (axes are $i$ and $j$ of the corresponding Grassmann similarity). The results are the average of ten runs on different random seeds/instances.
  • Figure 3: The Grassmann similarity (and the corresponding RepMatch scores on top) for three BERT$_{base}$ models (axes are $i$ and $j$ in Grassmann similarity). The first row compares the last four layers of the a pre-trained BERT model fine-tuned on SST-2 and those of the same model fine-tuned on IMDB (see \ref{['sec:appendix1']} for all the layers). The other rows make similar comparisons across SST-2 and SST-5 (middle row) and SNLI (bottom row). As expected, the SST datasets (middle row) are the more similar.
  • Figure 4: Performance variation of a BERT$_{base}$ model, fine-tuned on different subset sizes of SST-2. The top line is for the subset of most representative instances, selected using RepMatch, whereas the other line is for the randomly chosen subset.
  • Figure 5: Grassmann similarities of LoRA matrices (and the corresponding RepMatch scores on top) for each of the 12 layers of two BERT$_{base}$ models fine-tuned on SST-2 and (a) SST-5 / (b) IMDB (axes are $i$ and $j$ of the corresponding Grassmann similarity).
  • ...and 1 more figures