arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.14331cs.LG
收藏

程序上经验风险最小化的LLM先验

LLM Priors for ERM over Programs

LLM Priors for ERM over Programs(LLM 优先级用于程序上的经验风险最小化)

Shivam Singhal, Priyadarsi Mishra, Eran Malach, Tomer Galanti

AI总结:

提出LLM-PV方法,利用预训练LLM作为先验,通过提议-验证机制实现程序类上的ERM选择,无需穷举枚举,在算法任务上从少量样本恢复规则并泛化到更长序列。

摘要:

我们研究在样本和计算上都高效的程序学习方法。经典学习理论表明,当目标具有短程序描述(例如短“Python代码”)时,可以通过在程序类上进行经验风险最小化(ERM)从少量样本中学习。然而,这种方法依赖于枚举候选程序,这通常随描述长度呈指数增长;基于梯度的训练避免了这种显式搜索,但对于某些短程序族,可能需要指数级数量的样本才能成功。我们提出LLM-PV,一种提议-验证方案,无需穷举枚举即可在离散程序类上进行ERM风格的选择:预训练LLM在候选程序上诱导一个提议分布,每个提议在保留验证集上执行并评分,然后选择最佳程序,无需梯度更新或验证反馈来调整采样分布。在包括奇偶变体、模式匹配和素性测试的算法任务中,LLM-PV通常能从少量标记样本中恢复确切的基础规则,并泛化到远超出训练序列长度的范围,而SGD训练的Transformer、微调、上下文学习和经典机器学习基线能够拟合训练数据但无法可靠泛化。这些结果共同表明,预训练LLM先验可以作为ERM的有效搜索偏置,缩小统计效率与计算效率之间的差距。

英文摘要:

We study program-learning methods that are efficient in both samples and computation. Classical learning theory suggests that when the target admits a short program description, for example a short piece of ``Python code'', it can be learned from few examples by ERM over the program class. However, this approach relies on enumerating candidate programs, which is typically exponential in the description length; gradient-based training avoids this explicit search but, for some families of short programs, can require exponentially many samples to succeed. We propose \textsc{LLM-PV}, a propose-and-verify recipe that enables ERM-style selection over a discrete program class without exhaustive enumeration: a pretrained LLM induces a proposal distribution over candidate programs, each proposal is executed and scored on a held-out validation set, and the best program is selected, with no gradient updates or validation feedback used to adapt the sampling distribution. Across algorithmic tasks including parity variants, pattern matching, and primality testing, \textsc{LLM-PV} often recovers the exact underlying rule from a small labeled set and generalizes far beyond the training sequence lengths, while SGD-trained transformers, fine-tuning, in-context learning, and classical ML baselines can fit the training data yet fail to generalize reliably. Together, these results suggest that pretrained LLM priors can serve as effective search biases for ERM, narrowing the gap between statistical and computational efficiency.

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

↑