从文本到轨迹:GPT-2 作为上下文中的 ODE 求解器
From Text to Trajectories: GPT-2 as an ODE Solver via In-Context
AI总结:
本文探究 GPT-2 在上下文学习框架下求解常微分方程的能力,实验表明其可学习元算法,收敛性优于欧拉法,精度随示例指数增长,并具备分布外泛化能力。
摘要:
上下文学习(ICL)已成为大型语言模型(LLMs)中的一种新范式,使它们能够通过以提示中嵌入的少量示例为条件来执行新任务。然而,ICL 在自然语言处理任务中的高度非线性行为仍鲜为人知。为了揭示其底层机制,本文研究了在 ICL 设置下,大型语言模型能否求解常微分方程(ODEs)。我们将标准 ODE 问题及其解构造为序列化提示,并在这些任务上评估 GPT-2 模型。对两类 ODE 的实验表明,GPT-2 能有效学习一种元 ODE 算法,其收敛行为可与欧拉方法相当或更优,并且随着演示数量的增加,精度呈指数级提升。此外,该模型能泛化到分布外(OOD)问题,展现出强大的外推能力。这些实证发现为 ICL 在 NLP 中的机制及其在求解非线性数值问题上的潜力提供了新的见解。
英文摘要:
In-Context Learning (ICL) has emerged as a new paradigm in large language models (LLMs), enabling them to perform novel tasks by conditioning on a few examples embedded in the prompt. Yet, the highly nonlinear behavior of ICL for NLP tasks remains poorly understood. To shed light on its underlying mechanisms, this paper investigates whether LLMs can solve ordinary differential equations (ODEs) under the ICL setting. We formulate standard ODE problems and their solutions as sequential prompts and evaluate GPT-2 models on these tasks. Experiments on two types of ODEs show that GPT-2 can effectively learn a meta-ODE algorithm, with convergence behavior comparable to, or better than, the Euler method, and achieve exponential accuracy gains with increasing numbers of demonstrations. Moreover, the model generalizes to out-of-distribution (OOD) problems, demonstrating robust extrapolation capabilities. These empirical findings provide new insights into the mechanisms of ICL in NLP and its potential for solving nonlinear numerical problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。