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.

Laneve, C., Spano, A., Ressi, D., Rossi, S., Bugliesi, M. (2025). Assessing Code Understanding in LLMs. GEWERBESTRASSE : SPRINGER INTERNATIONAL PUBLISHING AG [10.1007/978-3-031-95497-9_13].

Assessing Code Understanding in LLMs

Laneve C.;
2025

Abstract

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.
2025
Coordination Models and Languages - 27th IFIP WG 6.1 International Conference, COORDINATION 2025
202
210
Laneve, C., Spano, A., Ressi, D., Rossi, S., Bugliesi, M. (2025). Assessing Code Understanding in LLMs. GEWERBESTRASSE : SPRINGER INTERNATIONAL PUBLISHING AG [10.1007/978-3-031-95497-9_13].
Laneve, C.; Spano, A.; Ressi, D.; Rossi, S.; Bugliesi, M.
File in questo prodotto:
Eventuali allegati, non sono esposti

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11585/1032311
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? 0
social impact