arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2308.03296cs.LGcs.CLstat.ML
收藏

利用影响函数研究大型语言模型的泛化能力

Studying Large Language Model Generalization with Influence Functions

University of Toronto(多伦多大学);Vector Institute(向量研究所)
Roger Grosse, Juhan Bae, Cem Anil, Nelson Elhage, Alex Tamkin, Amirhossein Tajdini, Benoit Steiner, Dustin Li, Esin Durmus, Ethan Perez, Evan Hubinger, Kamilė L… 展开作者

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

AI总结:

本文利用 EK-FAC 近似将影响函数扩展到 520 亿参数 LLM,并结合 TF-IDF 过滤与查询批处理降低计算成本,系统揭示了 LLM 泛化模式及其对关键短语顺序的敏感性局限。

摘要:

为了更好地洞察机器学习模型,从而理解并缓解相关风险,一个具有潜在价值的证据来源是:哪些训练样本对某一给定行为的贡献最大?影响函数旨在回答一个反事实问题:如果将某个给定序列加入训练集,模型的参数(以及由此产生的输出)会如何变化?尽管影响函数已为小型模型提供了洞见,但由于计算逆 Hessian 向量积(IHVP)的困难,它们难以扩展到大型语言模型(LLM)。我们使用特征值校正的 Kronecker 分解近似曲率(EK-FAC)近似方法,将影响函数扩展到参数规模高达 520 亿的 LLM。在我们的实验中,尽管 IHVP 的计算速度快了数个数量级,EK-FAC 仍达到了与传统影响函数估计器相似的准确度。我们研究了两种降低候选训练序列梯度计算成本的算法技术:TF-IDF 过滤和查询批处理。我们利用影响函数研究 LLM 的泛化模式,包括影响模式的稀疏性、随规模增加而增强的抽象能力、数学与编程能力、跨语言泛化以及角色扮演行为。尽管存在许多看似复杂的泛化形式,我们发现了一个令人意外的局限性:当关键短语的顺序被调换时,影响会衰减至接近零。总体而言,影响函数为我们研究 LLM 的泛化特性提供了一种强大的新工具。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑