arXiv AI By Nhi Nguyen, Shauli Ravfogel, Rajesh Ranganath

Code as Explanations: Executable and Verifiable LLM Explanations

Read the original on arXiv AI →

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.

Machine-generated by The Flow from the publisher's headline and feed description — not written or checked by a human. The full article lives at arXiv AI.

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
Oct 1

Making LLMs Say What They Think: Measuring and Improving CoT-Interpretability Alignment

The paper introduces CoT-Interpretability Alignment (CIA), a metric that quantifies how well a large language model’s chain-of-thought (CoT) explanations match its internal reasoning processes. Evaluated on two-hop question answering, hint intervention, and integer multiplication across three LLMs, the study finds limited alignment (44.8–75.9%) and demonstrates that post‑training with a reward combining task accuracy and parametric faithfulness can substantially improve CoT faithfulness without sacrificing accuracy. The authors provide a framework for auditing CoT faithfulness and a pathway to making explicit reasoning more trustworthy, with code and data publicly available.

By Yihuai Hong, Shauli Ravfogel, Chen Zhao, Eunsol Choi
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