arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.04691cs.LGcs.CL
收藏

无需更新即可获得更深刻洞见:上下文学习相较于微调的优势

Deeper Insights Without Updates: The Power of In-Context Learning Over Fine-Tuning

Zhejiang University(浙江大学);Peking University(北京大学);Wuhan University(武汉大学);The Hong Kong Polytechnic University(香港理工大学);Digital Twin Institute(数字孪生研究院);Eastern Institute of Technology(宁波工程学院)

Qingyu Yin, Xuzheng He, Luoao Deng, Chak Tou Leong, Fan Wang, Yanzhao Yan, Xiaoyu Shen, Qiang Zhang

AI总结:

该研究针对含隐含模式的任务,对比大语言模型的微调与上下文学习(ICL)效果,发现ICL捕捉模式的能力远优于微调,并从机制可解释性角度提出回路偏移理论解释该现象。

摘要:

微调与上下文学习(in-context learning, ICL)是为大语言模型注入任务特定知识的两种主流方法。学界普遍认为,只要有足够的训练样本,微调的表现就能超过ICL,因为它能让模型基于数据调整内部参数。然而本文提出了一项反直觉的发现:对于存在隐含模式的任务,ICL对这些模式的捕捉能力远优于微调。我们构建了多个包含隐含模式的数据集,例如通过奇偶性确定答案的序列、识别计算中可约简项的任务等。随后我们在参数规模从0.5B到7B的多个模型上,分别评估了微调与ICL两种方式下模型对这些模式的理解能力。结果显示,采用ICL的模型能快速掌握深层模式,准确率大幅提升;相比之下,尽管微调使用的训练样本数量是ICL的数千倍,取得的提升却十分有限。我们还从机制可解释性的角度提出了回路偏移理论(circuit shift theory),用以解释ICL表现更优的原因。

英文摘要:

Fine-tuning and in-context learning (ICL) are two prevalent methods in imbuing large language models with task-specific knowledge. It is commonly believed that fine-tuning can surpass ICL given sufficient training samples as it allows the model to adjust its internal parameters based on the data. However, this paper presents a counterintuitive finding: For tasks with implicit patterns, ICL captures these patterns significantly better than fine-tuning. We developed several datasets featuring implicit patterns, such as sequences determining answers through parity or identifying reducible terms in calculations. We then evaluated the models' understanding of these patterns under both fine-tuning and ICL across models ranging from 0.5B to 7B parameters. The results indicate that models employing ICL can quickly grasp deep patterns and significantly improve accuracy. In contrast, fine-tuning, despite utilizing thousands of times more training samples than ICL, achieved only limited improvements. We also proposed circuit shift theory from a mechanistic interpretability's view to explain why ICL wins.

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

↑