Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

LLM Priors for ERM over Programs

About

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.

Shivam Singhal, Priyadarsi Mishra, Eran Malach, Tomer Galanti• 2025

Related benchmarks

TaskDatasetResultRank
Algorithmic Program ExecutionFP Algorithmic Task n=100 (test)
Accuracy100
25
Algorithmic Program ExecutionFHP Algorithmic Task n=100 (test)
Accuracy100
14
Algorithmic Program ExecutionPattern1 Algorithmic Task n=100 (test)
Accuracy100
6
Algorithmic Program ExecutionIsPal n=100 (test)
Accuracy100
5
Algorithmic Program ExecutionSHA Algorithmic Task n=100 (test)
Accuracy50.1
4
Showing 5 of 5 rows

Other info

Follow for update