Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning

Rem Yang, Julian Dai, Nikos Vasilakis, Martin Rinard
4/7/2025
cs.SEcs.CLcs.LG

No confident code implementation found for this paper. 6 possible matches can be shown below.

Abstract

We assess how the code reasoning abilities of large language models (LLMs) generalize to different kinds of programs. We present techniques for obtaining in- and out-of-distribution programs with different characteristics: code sampled from a domain-specific language, code automatically generated by an LLM, code collected from competitive programming contests, and mutated versions of these programs. We also present an experimental methodology for evaluating LLM generalization by comparing their performance on these programs. We perform an extensive evaluation across 10 state-of-the-art models from the past year, obtaining insights into their generalization capabilities over time and across different classes of programs. Our results highlight that while earlier models exhibit behavior consistent with pattern matching, the latest models exhibit strong generalization abilities on code reasoning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 6 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{yang2025evaluating,
  title  = {Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning},
  author = {Rem Yang and Julian Dai and Nikos Vasilakis and Martin Rinard},
  year   = {2025},
  eprint = {2504.05518},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.05518v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.05518.svg)](https://codeofpaper.com/paper/2504.05518)

Discussion