TL;DR
This paper introduces HYPERINF, a novel and efficient method for approximating influence functions, crucial for understanding individual data point contributions in large language models (LLMs). By combining Schulz's iterative matrix inversion with a low-rank Hessian approximation (GFIM), HYPERINF significantly reduces computational costs and memory requirements while maintaining high accuracy, enabling practical data attribution on massive models.
What Problem Does This Paper Address?
Influence functions are a powerful tool for understanding which training data points are most influential for a model's predictions. However, their direct computation involves inverting the Hessian matrix, which is computationally prohibitive for large-scale models and datasets common today. Existing approximation methods often sacrifice accuracy for efficiency or lack rigorous convergence guarantees. This paper tackles the challenge of making influence function computation practical and accurate for modern LLMs and large datasets.
Methods
The core of HYPERINF lies in two key innovations:
- Schulz's Iterative Method for Matrix Inversion: Instead of direct matrix inversion, HYPERINF employs Schulz's method, a hyperpower iterative algorithm known for its rigorous convergence guarantees and stability. This method iteratively refines an approximation of the matrix inverse.
- Generalized Fisher Information Matrix (GFIM) for Low-Rank Hessian Approximation: To address the computational burden of matrix multiplications within Schulz's method, HYPERINF uses GFIM as a low-rank approximation of the Hessian. This significantly reduces memory and computational overhead, making it constant with respect to LoRA ranks.
The paper also leverages a block-wise diagonal approximation of the Hessian for transformer networks and connects the Fisher Information Matrix (FIM) to the Hessian through Bartlett's identity.
Datasets
The paper evaluates HYPERINF on various datasets for different tasks:
- Mislabeled Data Detection: GLUE benchmark tasks (COLA, MRPC, QNLI, QQP, RTE, SST2).
- LLM Finetuning (Data Selection): Reasoning tasks including QASC, HellaSwag, PIQA, and LogiQA.
- VLM Pretraining (Data Selection): Multimodal datasets including LLaVa Synthetic Data, Standard VQA Data, OK-VQA, OCR-VQA, and Captioning Data.
Key Insights and Ideas
- Schulz's Method is a Stable Workhorse: The paper demonstrates that Schulz's iterative method for matrix inversion is not only accurate but also remarkably stable, consistently converging to a low error rate across various matrix dimensions and sample sizes, unlike some other iterative methods.
- GFIM is a Practical Hessian Proxy: Using GFIM as a low-rank approximation of the Hessian is a key enabler for HYPERINF's efficiency. It effectively reduces computational complexity without sacrificing significant accuracy, especially in the context of LoRA-tuned models.
- Influence Functions Shine in Data Attribution: HYPERINF's effectiveness is showcased across critical data attribution tasks like identifying mislabeled data and selecting optimal subsets for LLM/VLM finetuning, leading to improved model performance and efficiency.
- GPU Acceleration is Key: The paper highlights that HYPERINF leverages modern GPU capabilities effectively, achieving lower time costs compared to other methods on GPUs, despite potentially higher CPU costs for some baselines.
Key Results
- Accuracy and Stability: HYPERINF demonstrates superior accuracy and stability in matrix inversion convergence tests compared to baselines like LISSA and DATAINF.
- Mislabeled Data Detection: HYPERINF consistently outperforms baselines on GLUE benchmark tasks for mislabeled data detection, achieving significant accuracy improvements (e.g., 7-25% higher than baselines).
- LLM Data Selection: For LLM finetuning, HYPERINF-selected data leads to superior downstream performance, with notable accuracy improvements (e.g., 2.0% above random selection for LoRA, and 12.9% average accuracy improvement over random selection for dense finetuning).
- VLM Data Selection: HYPERINF also shows strong performance in VLM instruction-tuning data selection, achieving significant average accuracy improvements (e.g., 2.3% over random selection with 20% data).
- Computational Efficiency: HYPERINF achieves comparable or better performance than FIM-based methods while being significantly more efficient in computation and memory, especially for LoRA models. On GPUs, HYPERINF is shown to have the lowest time costs for Hessian-vector product approximation.
Limitations and Future Work
- GFIM Assumptions: The paper acknowledges that the idealized i.i.d. assumption for GFIM might not always hold in realistic LLM training scenarios, though empirical results suggest it doesn't significantly impact performance.
- FIM Limitations: The paper discusses limitations of FIM approximation, such as the need for near-convergence and specific label distributions, which are not always met in practice.
- Future Work: The authors suggest that deriving more accurate low-rank Hessian approximations within tractable computations remains an important research direction. They also hint at the potential for further improvements in GPU utilization.
Summary updated