Comparing Text Representations: A Theory-Driven Approach

Gregory Yauney, David Mimno

Introduction

In Natural Language Processing (NLP), the transition from simple Bag-of-Words (BOW) models to sophisticated contextual embeddings like BERT has yielded significant empirical gains. However, accuracy—the standard metric for success—is often a "noisy" indicator, sensitive to hyperparameters, random seeds, and specific training regimes. This research introduces a more robust framework to quantify the compatibility between a text representation and a specific task using Data-Dependent Complexity (DDC). By moving beyond empirical performance, we can explain why certain representations succeed and identify where even state-of-the-art models are fundamentally limited.

Quantifying Representation-Task Fit

The core challenge is to measure how well a representation captures the underlying structure of a task without the confounding variables of training a classifier. The authors adapt DDC from computational learning theory to create a "z-score" of alignment.

The DDC Framework

  1. Gram Matrix Construction: A matrix is generated to represent pairwise similarities between all documents in a dataset using a "ReLU kernel."
  2. Eigendecomposition: This matrix is decomposed into its "natural patterns" (eigenvectors). High eigenvalues represent dominant structural patterns, while low eigenvalues represent noise.
  3. Label Projection: The framework measures how task labels project onto these patterns. A "low" DDC indicates that labels align with the data's natural, dominant patterns. A "high" DDC suggests the labels are essentially noise relative to the representation.
  4. Calibration via Randomization: To account for varying noise levels across different embedding spaces (e.g., BOW vs. RoBERTa), the DDC of real labels is compared against the expected DDC of random labels.
Figure 1: Visualizing task-representation alignment across datasets and models. The top row shows 2D projections, while the bottom row quantifies alignment (DDC) relative to random labels.

Key Insights: Alignment and Fine-Tuning

The DDC analysis reveals several critical properties of modern NLP models that were previously understood only through empirical observation.

The "Random Label" Yardstick

Raw DDC values can be deceptive. A complex representation like BERT might have a higher raw DDC than BOW, suggesting it is "harder" to learn. However, when calibrated against random labels, BERT demonstrates a significantly larger gap between real and random patterns. This proves that BERT captures a structural alignment that BOW entirely misses.

Fine-Tuning as an Alignment Engine

One of the most striking findings is the impact of fine-tuning. Rather than just adjusting weights for a specific output, fine-tuning fundamentally reshapes the representation space. On tasks like MNLI, fine-tuned embeddings align more than twice as well with target labels compared to their "frozen" pre-trained counterparts.

Figure 3: A detailed comparison of MNLI alignment. Moving from Bag-of-Words to fine-tuned MLM embeddings dramatically reduces DDC relative to random noise (from 99.6% to 25.2%).

Empirical Results and Task Difficulty

The study applies this framework to several benchmarks, yielding quantitative measures of task difficulty:

  • Representation Power: On difficult inference tasks, pre-trained Masked Language Model (MLM) representations showed a 72 times greater distinction between real and random labels than BOW.
  • Quantifying Semantic Overlap: In Stack Exchange classification, distinguishing "Bicycles" from "CS Theory" (easy) was 375 standard deviations from random noise. In contrast, "CS" vs. "CS Theory" (hard) was only 98 standard deviations away.
  • Identifying "Broken" Benchmarks: The analysis of the Winograd Natural Language Inference (WNLI) dataset revealed that even contextual embeddings are no better aligned with labels than random guessing. This suggests the representation itself fails to capture the logic required for the task, explaining historical model struggles.

Conclusion and Future Directions

DDC provides a theoretically grounded method for evaluating representations that is more stable than accuracy and computationally efficient through subsampling. While currently focused on binary classification and specific kernels, future work could extend this to multi-class tasks and explore kernels that more closely mirror the geometry of deep Transformer architectures.

Summary updated

BibTeX
@inproceedings{yauney2021comparing,
  author = {Gregory Yauney and David Mimno},
  title = {{Comparing Text Representations: A Theory-Driven Approach}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  url = {https://openreview.net/forum?id=BPWQiWru58},
}
Figure