Automatic code generation is crucial in modern software development, yet large language models struggle with real-world challenges like code versioning and multi-API invocation. Existing approaches, including direct generation and retrieval-augmented methods, often fail to ensure precise API usage. This paper introduces a simple yet effective two-step framework: rough code generation or retrieval followed by fine code editing. Experiments on VersiCode and BigCodeBench show significant performance gains in version-specific code completion and function-level programming. These results demonstrate the framework’s practicality in enhancing LLM-based code generation systems.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Two Steps to Precision: Enhancing Reliable API Invocation in Code Generation

  • Yanming Li,
  • Ziye Tang,
  • Siyi Wang,
  • Guilin Qi

摘要

Automatic code generation is crucial in modern software development, yet large language models struggle with real-world challenges like code versioning and multi-API invocation. Existing approaches, including direct generation and retrieval-augmented methods, often fail to ensure precise API usage. This paper introduces a simple yet effective two-step framework: rough code generation or retrieval followed by fine code editing. Experiments on VersiCode and BigCodeBench show significant performance gains in version-specific code completion and function-level programming. These results demonstrate the framework’s practicality in enhancing LLM-based code generation systems.