logix-project / logix

AI Logging for Interpretability and Explainability🔬
Apache License 2.0
74 stars 6 forks source link

Modularize influence computations #83

Closed sangkeun00 closed 8 months ago

sangkeun00 commented 8 months ago

In essence, influence functions amount to computing dot product on a gradient space. If we adopt this interpretation, we can think about different measures such as L2 or cosine distance. For instance, computing cosine similarity is explored as RelatIF. To flexibly support various metrics, we implement some primitives like dot and norm, and construct influence computations using these primitives. For the user interface,

if_computer.compute_influence_all(test_log, log_loader, mode="dot") # mode in ["dot", "cosine", "l2"]