Diff-eRank: A Novel Rank-Based Metric for Evaluating Large Language Models

Lai Wei, Zhiquan Tan, Chenghai Li, Jindong Wang, Weiran Huang

Introduction

As Large Language Models (LLMs) grow in size and capability, evaluating them becomes increasingly complex. Traditional metrics like accuracy, BLEU, or ROUGE are "extrinsic"—they compare a model's final output to a ground-truth label. While useful, these metrics treat the model as a black box and reveal little about how information is processed internally.

To address this, researchers have introduced Diff-eRank, a novel information-theoretic metric that evaluates LLMs by analyzing their internal "hidden" representations. Diff-eRank quantifies a model's "noise reduction" capability: its ability to strip away redundant data and uncover structured patterns. The findings suggest that as models scale up, they become significantly more efficient at organizing this internal information.

The Problem: Measuring Internal States

Evaluating the internal state of an LLM requires an "intrinsic" metric. A popular theory in deep learning posits that training is essentially a process of noise reduction. A raw, untrained model processes data as a chaotic, high-dimensional mess. As it trains, the model compresses this data, discarding redundant "noise" to reveal the underlying structural "signal."

Until now, the field has lacked a robust, quantitative way to measure this specific geometric transformation. Other intrinsic metrics, like cross-entropy loss, are prediction-based and can be overly sensitive to the specific vocabulary or classification head used, rather than the fundamental quality of the learned representations.

Methodology: Introducing Diff-eRank

The core of this new evaluation method is the Effective Rank (eRank). Standard matrix rank—which counts mathematically independent dimensions—is highly sensitive to tiny amounts of noise. In contrast, eRank is a continuous measure grounded in Shannon entropy and quantum information theory. It effectively measures the "degree of freedom" or "effective dimensionality" of a model's hidden representations.

The researchers define Diff-eRank as the difference in eRank between an untrained version of a model ($M_0$) and a trained version ($M_1$):

$$\Delta \text{eRank} = \text{eRank}(\text{Untrained}) - \text{eRank}(\text{Trained})$$

A higher Diff-eRank indicates that the model has successfully "shrunk" its representation space by eliminating redundant information.

Extension to Multi-modal LLMs

For Multi-modal LLMs (MLLMs), the authors extend this concept to measure Modality Alignment. By comparing the eRank of image representations against text representations at various stages of the network, they can assess how well the model aligns different data types.

Architecture diagram showing eRank calculation points in a Multi-modal LLM

If the eRanks of the visual and textual pathways are similar, it suggests the model processes both modalities with a comparable level of "structured-ness," indicating strong alignment.

Key Insights: Scaling and Performance

The researchers validated Diff-eRank across a variety of tasks (e.g., Wikipedia, OpenWebText2, Dolly-15k) and model families (OPT, Cerebras-GPT, OpenELM), ranging from 125 million to 13 billion parameters.

  • The Scaling Connection: Diff-eRank scales predictably. As models increase in parameter count, their Diff-eRank reliably increases. This implies that larger models do not merely memorize more data; they are fundamentally superior at "denoising" the information they process.
  • Correlation with Performance: Diff-eRank correlates strongly with traditional performance metrics. Models with a higher Diff-eRank consistently exhibit lower loss and higher accuracy on downstream benchmarks.
Graphs showing Diff-eRank and Reduced Loss scaling with model size across four datasets
  • The "Last Layer" Phenomenon: The noise-reduction trend is most pronounced in the final hidden layer of the model. Early layers do not exhibit the same clear pattern, suggesting that denoising is a cumulative process that culminates just before the final output.
  • Visualizing Alignment: In multi-modal tests, introducing confusing spatial information (like rotating an image) increases the eRank and decreases alignment scores. This demonstrates that Diff-eRank is sensitive to how well the model genuinely understands the relationship between visual inputs and text.

Results and Robustness

The upward trend of Diff-eRank with model size was confirmed across three distinct model families, proving it is not an artifact of a specific architecture. In multi-modal evaluations, LLaVA-1.5 achieved a higher "Image-Text Alignment" score (0.8566) compared to MiniGPT-v2 (0.7084), aligning with the broader community consensus regarding LLaVA-1.5's superior multi-modal capabilities. Furthermore, ablation studies confirmed that Diff-eRank remains stable regardless of the sampling strategy used to calculate the average rank.

Limitations and Future Directions

While promising, Diff-eRank has limitations. Calculating covariance matrices for hidden states across large datasets is computationally expensive, requiring significant GPU memory and time (e.g., about an hour for a 1.3B model on an A800 GPU). Additionally, the current study focuses on the "before and after" of training, leaving the fluctuation of Diff-eRank during intermediate training stages for future work.

Looking ahead, the authors note that because Diff-eRank excels at identifying "redundant dimensions," it could become a vital tool for model compression. By highlighting which dimensions carry the least structural signal, Diff-eRank could guide future research in model pruning and quantization, helping engineers build smaller, faster models without sacrificing performance.

Summary updated

BibTeX
@inproceedings{wei2024diff,
  author = {Lai Wei and Zhiquan Tan and Chenghai Li and Jindong Wang and Weiran Huang},
  title = {{Diff-eRank: A Novel Rank-Based Metric for Evaluating Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=nvn80cscVm},
}
Figure