Introduction
Training Data Attribution (TDA) aims to identify which specific training examples influenced a model's prediction on a given test sample. Despite its potential for model debugging and data auditing, the field remains fragmented, lacking standardized implementations and evaluation protocols. quanda is an open-source Python toolkit designed to unify TDA methods and provide a comprehensive suite of evaluation metrics, enabling systematic benchmarking of explanation utility.
The Fragmentation of Training Data Attribution
The current landscape of TDA is characterized by a "Wild West" problem. Popular methods such as Influence Functions, TracIn, and TRAK are often implemented in isolated repositories with incompatible interfaces. Furthermore, evaluating these methods is computationally expensive; traditional "ground truth" approaches like Leave-One-Out (LOO) retraining are often infeasible for large-scale models. Without a unified framework, researchers cannot easily compare methods or assess their reliability in high-stakes scenarios.
The Quanda Framework
Built on PyTorch, quanda standardizes the TDA workflow into three modular components: Explainers, Metrics, and Benchmarks. This modularity allows for seamless integration of new methods and evaluation strategies.
- Explainers: Wrappers for TDA methods that provide a consistent API.
quandaintegrates existing implementations from libraries like Captum and official method repositories into a single interface. - Metrics: A diverse set of evaluators including ground truth metrics (e.g., Linear Datamodeling Score), downstream task evaluators (e.g., mislabeling detection), and heuristic sanity checks like model randomization.
- Benchmarks: Pre-configured environments (datasets and models) designed to test specific TDA properties under controlled conditions without requiring complex experimental setup.
Evaluation and Benchmarking
To demonstrate the toolkit's utility, the authors evaluated several TDA methods using a modified Tiny ImageNet dataset and a ResNet-18 architecture. They designed specific "perturbed" scenarios to test functional utility:
- Subclass Detection: Identifying underlying sub-groups within merged classes.
- Shortcut Detection: Pinpointing samples where the model relies on spurious correlations (e.g., a yellow box added to specific images).
- Mislabeling Detection: Ranking intentionally flipped labels to assess data cleaning capabilities.
- Mixed Datasets: Identifying out-of-distribution influencers, such as panda sketches labeled as "basketball."
Results and Insights
Initial benchmarking reveals that no single TDA method is universally superior. Performance varies significantly depending on the specific task, highlighting the importance of multi-faceted evaluation.
Key findings include:
- Functional Utility: The authors argue that TDA methods should be judged by their ability to assist developers in practical tasks like debugging, rather than just matching theoretical influence scores.
- Efficiency: The toolkit's "stateful" design allows for memory-efficient, incremental evaluation, which is critical for large datasets where generating all explanations at once is impractical.
- Post-Hoc Practicality: While some methods are designed for ensembles,
quandafocuses on the practical "post-hoc" scenario where only a single trained model is available, making it more applicable to real-world engineering.
Conclusion and Future Directions
quanda provides a much-needed foundation for standardized TDA research. While currently focused on image classification and single-model attribution, future work will expand the toolkit to include Natural Language Processing (NLP) domains, support for multi-model ensembles, and optimized internal implementations of core TDA methods directly within the library.
Summary updated