Success is in the Details: Evaluate and Enhance Details Sensitivity of Code LLMs through Counterfactuals
Xianzhen Luo, Qingfu Zhu, Zhiming Zhang, Mingzheng Xu, Tianhao Cheng, Yixuan Wang, Zheng Chu, Shijie Xuyang, Zhiyuan Ma, YuanTao Fan, Wanxiang Che
TL;DR
The paper identifies a critical blind spot in Code LLM evaluation: sensitivity to subtle changes in problem details. It introduces the CTF-Code benchmark to systematically probe this sensitivity via counterfactual problem perturbations, and the CTF-Instruct framework to generate sensitivity-focused data with a three-dimensional completion (difficulty, diversity, sensitivity). Empirical results show that many state-of-the-art Code LLMs exhibit significant drops on CTF-Code, while finetuning with CTF-Instruct data yields meaningful improvements across CTF-Code and broader benchmarks, validating sensitivity optimization as a practical path to more robust code understanding. Overall, the work expands the evaluation paradigm for Code LLMs and provides scalable methods to enhance their sensitivity, with implications for reliability and cross-domain generalization in code tasks.
Abstract
Code Sensitivity refers to the ability of Code LLMs to recognize and respond to details changes in problem descriptions. While current code benchmarks and instruction data focus on difficulty and diversity, sensitivity is overlooked. We first introduce the CTF-Code benchmark, constructed using counterfactual perturbations, minimizing input changes while maximizing output changes. The evaluation shows that many LLMs have a more than 10\% performance drop compared to the original problems. To fully utilize sensitivity, CTF-Instruct, an incremental instruction fine-tuning framework, extends on existing data and uses a selection mechanism to meet the three dimensions of difficulty, diversity, and sensitivity. Experiments show that LLMs fine-tuned with CTF-Instruct data achieve over a 2\% improvement on CTF-Code, and more than a 10\% performance boost on LiveCodeBench, validating the feasibility of enhancing LLMs' sensitivity to improve performance.
