TL;DR
Evaluating Large Language Models (LLMs) is costly and time-consuming. AcTracer is a new framework that intelligently selects a small subset of test data to accurately estimate LLM performance, significantly reducing evaluation costs. It achieves state-of-the-art results by leveraging both internal LLM states and external confidence scores.
What Problem Does This Paper Address?
Evaluating LLMs is crucial for understanding their capabilities and identifying limitations. However, the sheer scale of LLMs, their diverse task-handling abilities, and the vast amount of data required for comprehensive testing make traditional evaluation methods inefficient and expensive. This is further complicated by the rapid evolution of LLMs, necessitating frequent re-evaluation. Existing "active testing" methods, which select subsets of data, struggle with the unique challenges posed by LLMs, such as their complex internal mechanisms, the inaccessibility of training data, and the aggregated nature of modern benchmarks. The paper aims to address this by developing a cost-efficient, unsupervised active testing framework specifically for LLMs.
Methods
AcTracer employs a multi-stage sampling strategy that combines internal and external LLM information:
- Internal State-Driven Test Space Partition: The framework first extracts internal neuron states (hidden states) from an intermediate layer of the LLM. These states are then used to partition the test data into clusters, assuming that data points with similar internal reactions exhibit similar behavior. Balanced K-means is used for clustering, and a novel "CluSearch" algorithm automatically determines the optimal number of clusters by analyzing the inertia (sum of squared distances to cluster centers) and identifying the "elbow point" of the cluster number-inertia curve.
- Inter-Cluster Sampling: To efficiently allocate the sampling budget, AcTracer uses a stratified sampling approach. It employs a Monte Carlo Upper Confidence Bound (MC-UCB) strategy to progressively estimate variances within each cluster and select clusters for sampling based on their potential to reduce overall estimation bias.
- Intra-Cluster Sampling: Within each selected cluster, AcTracer aims to maintain a confidence distribution similar to the cluster's overall distribution. It achieves this by transforming confidence scores into a histogram and calculating its entropy to identify informative aggregation methods (e.g., first token confidence, mean confidence). Then, it greedily selects data points that minimize the difference between their confidence distribution and the cluster's distribution, using either the Kolmogorov-Smirnov test or Wasserstein Distance based on the distribution's modality.
Datasets
The paper evaluates AcTracer on seven diverse datasets across eight settings, covering various LLM capabilities:
- Common Knowledge: TriviaQA, NQ-open
- Mathematical Reasoning: GSM8K
- Problem Solving: AGIEval
- Truthfulness: TruthfulQA (evaluated for informativeness and truthfulness separately)
- Code Generation: MBPP, HumanEval
Key Insights and Ideas
- Internal states are key, but not just the last layer: While previous work often focused on the last hidden layer, AcTracer's experiments suggest that intermediate layers can be more informative for guiding LLM evaluation, leading to better performance.
- Clustering is crucial for LLM evaluation: Partitioning the test space based on LLM internal states helps group similar behaviors, enabling more targeted and efficient sampling. The automatic cluster number search (CluSearch) is a vital component.
- Confidence matters, but how you aggregate it is critical: Simply averaging confidence scores might not be optimal. AcTracer's approach of using entropy to select the best aggregation method for confidence scores is important for accurate sampling.
- LLMs are different from classical DNNs: Methods that worked well for traditional deep learning models don't always translate directly to LLMs due to their unique architectures and generative nature.
Key Results
- AcTracer achieves state-of-the-art (SOTA) performance in 26 out of 32 settings across five LLMs (Llama-2, Llama-3, Qwen2.5, Phi-4, and Code Llama) and eight datasets.
- It demonstrates significant performance gains, with improvements of up to 37.18% on NQ-open for Llama-3 compared to baselines.
- Ablation studies show that all three components of AcTracer (CluSearch, inter-cluster sampling, and intra-cluster sampling) are essential, with CluSearch having the most significant impact.
- Switching from the middle layer to the final layer for internal state extraction leads to an average accuracy drop of 21.72% across models.
- The choice of confidence aggregation method can lead to substantial performance variations, with gaps reaching up to 373.52%.
Limitations and Future Work
- Truthfulness evaluation: AcTracer sometimes exhibits suboptimal performance on truthfulness tasks, potentially due to the model-specific nature of truthfulness and the limitations of PCA in capturing nuanced information. Future work could involve specialized techniques for truthfulness-related neurons.
- Dynamic budget adjustment: The current framework assumes a fixed labeling budget. Future work could explore algorithms that dynamically determine the optimal sampling size based on performance estimation curves.
- Task-specific metrics: Developing unsupervised metrics beyond inertia to guide cluster search could improve the process, especially by incorporating task-specific considerations.
- Advanced feature extraction: Exploring more advanced dimension reduction and feature extraction techniques beyond PCA could further enhance the use of internal states.
- Modeling LLM outputs: Representing LLM outputs as Markov chains could offer a structured way to capture token dependencies and provide deeper insights.
- Historical data integration: Leveraging historical LLM performance data could significantly improve evaluation by allowing for cross-task estimations and understanding model evolution.
Summary updated