HackerPapers

arXiv:2308.03296cs.LG

Studying Large Language Model Generalization with Influence Functions

Roger Grosse, Juhan Bae, Cem Anil, Nelson Elhage, Alex Tamkin, Amirhossein Tajdini, Benoit Steiner, Dustin Li, Esin Durmus, Ethan Perez, Evan Hubinger, Kamilė Lukošiūtė, Karina Nguyen, Nicholas Joseph, Sam McCandlish, Jared Kaplan, Samuel R. Bowman

Abstract

When trying to gain better visibility into a machine learning model in order to understand and mitigate the associated risks, a potentially valuable source of evidence is: which training examples most contribute to a given behavior? Influence functions aim to answer a counterfactual: how would the model's parameters (and hence its outputs) change if a given sequence were added to the training set? While influence functions have produced insights for small models, they are difficult to scale to large language models (LLMs) due to the difficulty of computing an inverse-Hessian-vector product (IHVP). We use the Eigenvalue-corrected Kronecker-Factored Approximate Curvature (EK-FAC) approximation to scale influence functions up to LLMs with up to 52 billion parameters. In our experiments, EK-FAC achieves similar accuracy to traditional influence function estimators despite the IHVP computation being orders of magnitude faster. We investigate two algorithmic techniques to reduce the cost of computing gradients of candidate training sequences: TF-IDF filtering and query batching. We use influence functions to investigate the generalization patterns of LLMs, including the sparsity of the influence patterns, increasing abstraction with scale, math and programming abilities, cross-lingual generalization, and role-playing behavior. Despite many apparently sophisticated forms of generalization, we identify a surprising limitation: influences decay to near-zero when the order of key phrases is flipped. Overall, influence functions give us a powerful new tool for studying the generalization properties of LLMs.

arXiv comments
119 pages, 47 figures, 22 tables
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.CLComputation and Language stat.MLMachine Learning (Statistics)

On Hacker News

Linked by 3 identifiable commenters in 4 comments across 4 threads, from Nov 2023 to Jul 2026. Found in 1 HN submission from Apr 2024 to Apr 2024. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments4 threads

    • > LLMs (I believe) _can_ be trained to not plagiarize. They do not have to be original, nor to use public domain training-data, they just have to give attribution (which, as far as I can tell, requires little more than a corpus and a stack of similarity-measures). And something…

      986aignanView on HNParent context

    • And ideally if someone is proposing new prompting techniques they should test it across both the most capable models (which are unfortunately proprietary) and the best open models. The problem is that what works on small LLMs does not necessarily scale to larger ones. See page…

      sebzim4500View on HNParent context

    • Some work, yeah. It's still an open problem to do it well, but I think the folks at Anthropic have made a reasonable start with their work[1] on influence functions ("tracing model outputs to the training data"). Basically their work attempts to answer the question "what…

      JoshuaDavidView on HNParent context

    • Anthropic has a recent paper that talks about this [1]. See figure 16 in particular. The larger the model, the more it generalizes between languages. On the other hand, no matter how large the model they struggle to generalize between sentences of the form "George Washington was…

      sebzim4500View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.