Lune

ACL Findings2024

The Counterfeit Conundrum: Can Code Language Models Grasp the Nuances of Their Incorrect Generations?

Alex Gu, Wen-Ding Li, Naman Jain, Theo Olausson, Celine Lee, Koushik Sen, Armando Solar-Lezama

摘要

While language models are increasingly more proficient at code generation, they still frequently generate incorrect programs. Many of these programs are obviously wrong, but others are more subtle and pass weaker correctness checks such as being able to compile. In this work, we focus on these counterfeit samples: programs sampled from a language model that 1) have a high enough log-probability to be generated at a moderate temperature and 2) pass weak correctness checks. Overall, we discover that most models have a very shallow understanding of counterfeits through three clear failure modes. First, models mistakenly classify them as correct. Second, models are worse at reasoning about the execution behaviour of counterfeits and often predict their execution results as if they were correct. Third, when asking models to fix counterfeits, the likelihood of a model successfully repairing a counterfeit is often even lower than that of sampling a correct program from scratch. Counterfeits also have very unexpected properties: first, counterfeit programs for problems that are easier for a model to solve are not necessarily easier to detect and only slightly easier to execute and repair. Second, counterfeits from a given model are just as confusing to the model itself as they are to other models. Finally, both strong and weak models are able to generate counterfeit samples that equally challenge all models. In light of our findings, we recommend that care and caution be taken when relying on models to understand their own samples, especially when no external feedback is incorporated.

问 Lune

尽管问,回答会引用原文。

Lune 会读完全文和相关的 Paper,每个回答都附上所依据的原文段落。

可以从这些问题问起

Lune 的依据

全文 · 引用它的 5 篇顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

引用它的顶会 Paper5

  1. SemCoder: Training Code Language Models with Comprehensive Semantics ReasoningYangruibo Ding, Jinjun Peng, Marcus J. Min, Gail E. Kaiser 等NeurIPS 2024 · 13 次引用
  2. XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding AssistantsAdam Storek, Mukur Gupta, Noopur Bhatt, Aditya Gupta 等ACL 2026 · 5 次引用
  3. Improving Code Generation via Small Language Model-as-a-judgeGiuseppe Crupi, Rosalia Tufano, Gabriele BavotaICSE 2026 · 1 次引用
  4. CodeCureAgent: Automatic Classification and Repair of Static Analysis WarningsPascal Joos, Islem Bouzenia, Michael PradelFSE 2026
  5. What Makes Large Language Models Reason in (Multi-Turn) Code Generation?Kunhao Zheng, Juliette Decugis, Jonas Gehring, Taco Cohen 等ICLR 2025

它引用的 Paper27

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
  3. Let's Verify Step by StepHunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards 等ICLR 2024 · 3,045 次引用
  4. Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 次引用
  5. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用

相关 Paper

  1. Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code PredicatesAshish Hooda, Mihai Christodorescu, Miltiadis Allamanis, Aaron Wilson 等ICML 2024 · 16 次引用
  2. On LLMs’ Internal Representation of Code CorrectnessFrancisco Ribeiro, Claudio Spiess, Premkumar Devanbu, Sarah NadiICSE 2026
  3. Understanding Programs by Exploiting (Fuzzing) Test CasesJianyu Zhao, Yuyang Rong, Yiwen Guo, Yifeng He 等ACL Findings 2023 · 13 次引用
  4. The Larger they are, the Harder they Fail: Language Models do not Recognize Identifier Swaps in PythonAntonio Valerio Miceli Barone, Fazl Barez, Shay B. Cohen, Ioannis KonstasACL Findings 2023 · 12 次引用
  5. Fault-Aware Neural Code RankersJeevana Priya Inala, Chenglong Wang, Mei Yang, Andrés Codas 等NeurIPS 2022 · 61 次引用
黄昏的海面,两侧是细线勾勒的悬崖