用高斯过程分析大模型如何通过少量示例学习连续函数。
In-Context Function Learning in Large Language Models
- 以高斯过程为框架,控制实验验证模型从示例中学习函数的能力。
- 模型表现随示例数量增加趋近最优贝叶斯下界,且对光滑性敏感。
- 微调可调整模型偏好,提升在平滑函数上的样本效率。
大型语言模型(LLMs)可在推理时通过少量示例进行学习。本文从高斯过程(GPs)视角研究这一上下文学习现象。设计受控实验,让模型观察由已知GP先验生成的多元标量函数样本序列,评估预测误差与示例数量的关系,并与两个基准比较:(i) 实证的GP回归学习器(提供误差下界),(ii) 1-最近邻规则的期望误差(提供数据驱动上界)。在不同模型规模下,发现LLM的学习曲线受函数生成核的影响显著,随着示例数增加,性能逼近GP下界。进一步通过似然分析揭示,模型预测最可能对应非光滑的GP核。最后探索训练后调整能否改变这种归纳偏置。结果表明,强化学习和监督微调均可有效引导模型偏好转向训练数据分布,提升对平滑函数的样本效率。本框架量化了LLM作为GP学习者的程度,并提供了调节其归纳偏置的工具,适用于连续函数学习任务。
原文摘要 · Abstract (English)
Large language models (LLMs) can learn from a few demonstrations provided at inference time. We study this in-context learning phenomenon through the lens of Gaussian Processes (GPs). We build controlled experiments where models observe sequences of multivariate scalar-valued function samples drawn from known GP priors. We evaluate prediction error in relation to the number of demonstrations and compare against two principled references: (i) an empirical GP-regression learner that gives a lower bound on achievable error, and (ii) the expected error of a 1-nearest-neighbor (1-NN) rule, which gives a data-driven upper bound. Across model sizes, we find that LLM learning curves are strongly influenced by the function-generating kernels and approach the GP lower bound as the number of demonstrations increases. We then study the inductive biases of these models using a likelihood-based analysis. We find that LLM predictions are most likely under less smooth GP kernels. Finally, we explore whether post-training can shift these inductive biases and improve sample-efficiency on functions sampled from GPs with smoother kernels. We find that both reinforcement learning and supervised fine-tuning can effectively shift inductive biases in the direction of the training data. Together, our framework quantifies the extent to which LLMs behave like GP learners and provides tools for steering their inductive biases for continuous function learning tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。