arXiv:2409.03662cs.CLcs.LG2024-09NeurIPS被引 21

对比LLM中两种学习方式的内部表示差异

The representation landscape of few-shot learning and fine-tuning in large language models

  • 通过分析隐藏层概率分布,比较ICL与SFT的表征结构
  • 两者在模型中段均出现显著转变,但表征形态截然不同
  • 揭示了不同训练策略下模型的内在计算机制差异

上下文学习(ICL)和监督微调(SFT)是提升大语言模型(LLM)在特定任务上性能的两种常见策略。尽管二者机制不同,却常带来相近的性能提升。然而,它们是否在模型内部产生相似的表征仍不清楚。本文通过分析两种情况下隐藏表示的概率景观,研究了LLM如何解决同一问答任务。结果发现,ICL与SFT在模型内部形成截然不同的结构:前半部分,ICL生成按语义内容分层组织的可解释表示;而SFT则产生更模糊、语义混杂的分布。后半部分,微调后的表示发展出更清晰的答案身份编码模式,而ICL的表示则表现为不明确的峰值。该方法揭示了在不同条件下,模型为完成相同任务所采用的多样化计算策略,为进一步设计信息提取方法提供了依据。

原文摘要 · Abstract (English)

In-context learning (ICL) and supervised fine-tuning (SFT) are two common strategies for improving the performance of modern large language models (LLMs) on specific tasks. Despite their different natures, these strategies often lead to comparable performance gains. However, little is known about whether they induce similar representations inside LLMs. We approach this problem by analyzing the probability landscape of their hidden representations in the two cases. More specifically, we compare how LLMs solve the same question-answering task, finding that ICL and SFT create very different internal structures, in both cases undergoing a sharp transition in the middle of the network. In the first half of the network, ICL shapes interpretable representations hierarchically organized according to their semantic content. In contrast, the probability landscape obtained with SFT is fuzzier and semantically mixed. In the second half of the model, the fine-tuned representations develop probability modes that better encode the identity of answers, while the landscape of ICL representations is characterized by less defined peaks. Our approach reveals the diverse computational strategies developed inside LLMs to solve the same task across different conditions, allowing us to make a step towards designing optimal methods to extract information from language models.

大模型表征上下文学习微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。