Pith. sign in

REVIEW 5 cited by

CodeCoT: Tackling Code Syntax Errors in CoT Reasoning for Code Generation

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2308.08784 v2 pith:7VPGDM4M submitted 2023-08-17 cs.SE cs.AI

classification cs.SEcs.AI
keywords codecodecotsyntaxerrorgeneratedgenerationreasoningself-examination
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Chain-of-thought (CoT) has emerged as a groundbreaking tool in NLP, notably for its efficacy in complex reasoning tasks, such as mathematical proofs. However, its application in code generation faces a distinct challenge, i.e., although the code generated with CoT reasoning is logically correct, it faces the problem of syntax error (e.g., invalid syntax error report) during code execution, which causes the CoT result's pass@1 in HumanEval even lower than the zero-shot result. In this paper, we present Code Chain-of-Thought (CodeCoT) that integrates CoT with a self-examination process for code generation. CodeCoT begins with the LLMs using CoT for initial code development to ensure the generated code follows the correct logic flow. Then, CodeCoT will generate test cases to validate whether the code has syntax errors during the execution. CodeCoT then employs a self-examination phase, in which the generated code is executed against these test cases in the local environment. If the local environment raises error information (e.g., invalid syntax error), CodeCoT will iteratively refine the code based on the feedback information. Within this loop, CodeCoT can make sure their generated codes not only follow the logic flow of the code description, but the syntax error will also be addressed with the self-examination process. Our evaluation results reveal that CodeCoT improves the effectiveness of code generation. For example, CodeCoT increases pass@1 from 75.6% to 79.3% for the HumanEval dataset.

Discussion (0). Sign in to comment.

Forward citations

Cited by 5 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Developer-LLM Conversations: An Empirical Study of Interactions and Generated Code Quality

    cs.SE 2025-09 conditional novelty 6.0 of 10

    Analyzing 82,845 real ChatGPT coding chats shows generated code frequently has language-specific issues, with some quality problems persisting or worsening over multiple turns.

  2. Benchmarking LLMs for Unit Test Generation from Real-World Functions

    cs.SE 2025-08 conditional novelty 6.0 of 10

    A new decontaminated benchmark of complex Python functions shows LLMs generate far fewer correct, covering, and bug-killing unit tests than on older benchmarks.

  3. Are They All Good? Evaluating the Quality of CoTs in LLM-based Code Generation

    cs.SE 2025-07 reject novelty 6.0 of 10

    An empirical study of 1,023 CoT-code pairs shows that 76.4% of LLM-generated CoTs are low quality and that CoT correctness does not guarantee code correctness.

  4. Rethinking Verification for LLM Code Generation: From Generation to Testing

    cs.CL 2025-07 reject novelty 6.0 of 10

    SAGA, a human-LLM workflow, generates tests that catch 90.62% of known human bugs on a new benchmark, though those bugs also helped create the tests.

  5. Code Reasoning for Software Engineering Tasks: A Survey and A Call to Action

    cs.SE 2025-06 conditional novelty 5.0 of 10

    A survey of test-time reasoning methods for code tasks, with a taxonomy and comparisons showing that structure-aware and execution-aware approaches tend to outperform plain chain-of-thought.

Pith tools