arXiv AI

The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion

arXiv:2508. 16131v3 Announce Type: replace-cross Abstract: Code completion entails the task of providing missing tokens given a surrounding context.

arXiv AI
Aug 26

Evaluating Language Models on Cross-Language Code Functional Equivalence

The paper introduces PolyHuman, a dataset of human-written programs in C++, Java, and Python, to test whether large language models can judge functional equivalence across languages. Using this dataset, the authors evaluate several open-weight and proprietary LLMs, finding that models struggle more with harder problems, show language-specific biases, and rely partly on superficial similarity cues. They also observe run‑to‑run instability in GPT‑o4‑mini, concluding that current LLMs do not reliably capture functional equivalence within or across programming languages.

By Hui Sun, Anderson Uch\^oa, Rohit Gheyi, Wesley K. G. Assun\c{c}\~ao
arXiv AI
1d ago

Automatic Detection of LLM-Generated Code: A Comparative Case Study of Contemporary Models Across Function and Class Granularities

The study evaluates how well large language models (LLMs) can be detected when they generate code, comparing GPT‑3.5, Claude 3 Haiku, Claude Haiku 4.5, and GPT‑OSS across function‑ and class‑level code. Using 14,485 functions and 11,913 classes from CodeSearchNet, the authors trained CatBoost classifiers with interpretable software metrics and found that granularity (function vs. class) has a far greater impact on detection than the specific model, with function‑level detection dominated by GPT‑3.5 and class‑level detection dominated by the newer models. SHAP analysis revealed that the Comment‑to‑Code Ratio is the only universal feature, yet its importance varies widely among models, explaining why detectors trained on one LLM often fail on others.

By Musfiqur Rahman, SayedHassan Khatoonabadi, Ahmad Abdellatif, Emad Shihab
arXiv AI
Oct 9

Characterizing Overconfident Failure in LLM-Based Code Generation

The paper investigates how large language models (LLMs) used for code generation can produce syntactically plausible but incorrect programs, a phenomenon termed overconfident failure. By evaluating four open-source code models across three execution-based benchmarks, the authors examine whether token-level uncertainty metrics can predict execution correctness, analyze overconfidence at both global and local levels, and test mitigation strategies such as selective generation and instruction tuning. Their findings show that existing uncertainty signals are only partially reliable, overconfidence persists across models, instruction tuning can increase certainty without improving correctness discrimination, and common mitigation techniques do not fully resolve the issue. "whyItMatters":"The study highlights that current uncertainty metrics and mitigation strategies are insufficient to reliably detect or prevent incorrect code generation, underscoring the need for better reliability signals in LLM-based code synthesis."

By Ravishka Rathnasuriya, Wei Yang
arXiv AI
Sep 2

Predicting Program Exit Code with LLMs and Programming Language Semantics

The paper introduces Program Executability Prediction (PrEx), a task that asks large language models (LLMs) to determine whether a program is semantically valid or invalid and, if invalid, to identify the violated formal rule. To evaluate this, the authors create a dataset of systematically generated invalid programs derived from valid ones and test open‑source coding LLMs across different semantic formalisms, semantic shifts, and program splits (human‑written, LLM‑translated, fuzzer‑generated). Results show that LLMs rely more on pre‑training priors than on the provided semantics, performing poorly on modified semantics and with increasing program complexity.

By Lara Marinov, Aditya Thimmaiah, Jayanth Srinivasa, Junyi Jessy Li, Milos Gligoric
arXiv AI
Nov 14

The Impact of Large Language Models (LLMs) on Code Review Process

The study examines how GPT-assisted pull requests (PRs) influence the GitHub code review workflow. Using a dataset of 25,473 PRs, the authors identified GPT involvement with a 95% accurate heuristic and compared resolution times and phase-specific performance between GPT-assisted and non-assisted PRs. Results show that GPT reduces median resolution time by over 60%, cuts review time by 33%, and shortens pre-acceptance waiting by 87%, with developers mainly using GPT for code optimization, bug fixing, and documentation.

By Antonio Collante, Samuel Abedu, SayedHassan Khatoonabadi, Ahmad Abdellatif, Ebube Alor, Emad Shihab
arXiv AI
Nov 14

Code as Explanations: Executable and Verifiable LLM Explanations

The paper introduces "code explanations"—programs that describe how large language models (LLMs) generate outputs across a dataset, enabling automatic verification through execution. It defines a Consistency metric to assess how often a program reproduces the LLM’s outputs and evaluates this approach on three open‑source code‑capable LLMs across eight tasks, finding that code explanations are significantly shorter than chain‑of‑thought explanations and often better align with model behavior. However, consistency drops on tasks with complex linguistic components, and even with consistency feedback and execution, LLMs struggle to produce reliable explanations for these harder tasks.

By Nhi Nguyen, Shauli Ravfogel, Rajesh Ranganath