We present an empirical evaluation of Large Language Models (LLMs) in understanding semantic-preserving code transformations such as copy propagation and constant folding. Our results show that LLMs fail to recognize semantic equivalence in approximately 41% of cases without additional context, and in 29% of cases even when provided with a simple, generic context. To improve performance, we propose to integrate LLMs with code optimization tools – both to enhance training and to support deeper program comprehension.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Assessing Code Understanding in LLMs

  • C. Laneve,
  • A. Spanò,
  • D. Ressi,
  • S. Rossi,
  • M. Bugliesi

摘要

We present an empirical evaluation of Large Language Models (LLMs) in understanding semantic-preserving code transformations such as copy propagation and constant folding. Our results show that LLMs fail to recognize semantic equivalence in approximately 41% of cases without additional context, and in 29% of cases even when provided with a simple, generic context. To improve performance, we propose to integrate LLMs with code optimization tools – both to enhance training and to support deeper program comprehension.