Explore the research collection
1 entry · Follow this search
- Paper
dattri-LLM: A Unified and Efficient Library for Training Data Attribution at LLM Scale
dattri-LLM is an open-source PyTorch library for gradient-based training data attribution (TDA) at LLM scale, from TRAIS-Lab (Shixuan Liu et al.). Efficiency comes from two exact per-example gradient representations - factorized (input-activation/output-gradient pairs) and materialized (dense per-sample weight gradients) - with a FLOP-aware cost model routing each layer and operation to the cheaper one, so 'ghost' inner products score samples without ever forming weight gradients when that is cheaper. Compatibility comes from non-invasive capture: autograd hooks assemble per-sample gradients from any training loop that calls backward(), with no changes to the loop, optimizer, or trainer - demonstrated on HuggingFace Trainer, TRL (SFT/GRPO trainers), and OLMo, under DDP and FSDP, with per-rank sharded gradient stores merged afterwards; gradients can be offloaded to disk during training and re-attributed by any method without the model. Extensibility comes from two interfaces: Attributor (plug-in attribution methods over one shared gradient stream) and HookManagerCallback (training-time applications acting on captured gradients, e.g. online data selection). Built-in attributors: TracIn, Grad-Dot/Grad-Cos, K-FAC and EK-FAC influence, DVEmb, LESS, AdamW-influence, plus a DataSelectionCallback for online data selection. Benchmarks on four H200s (512 training sequences, Qwen2.5 0.5B-72B plus Qwen1.5-110B; 1 query through 32B, 4 queries at 72B/110B) against Bergson, Kronfluence, and LogIX: dattri-LLM averages 3.2x the throughput of the fastest competing library per configuration across GradDot/K-FAC/EK-FAC, and is the only library besides Bergson to complete 72B/110B runs (Kronfluence OOMs beyond 7B on K-FAC; LogIX beyond 32B). Fidelity-cost trade-offs (LDS/LOO-style TSLOO on GPT-2, Qwen2.5-1.5B, OLMo-3-7B) favor dattri-LLM's EK-FAC and AdamW-influence. Code: MIT-licensed at github.com/TRAIS-Lab/dattri-llm (9 stars at catalog time; the library is the LLM-scale companion of the earlier dattri package). Paper license: arXiv non-exclusive distribution 1.0 (not CC).