Reproduce “ToolCoder: Teach Code Generation Models to use API search tools” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Kechi Zhang, Huangzhao Zhang, Ge Li, Jia Li, Zhuo Li, Zhi Jin

Researchers from Peking University developed ToolCoder, an approach that integrates API search tools directly into code generation models to improve API selection accuracy. The method uses automated data annotation and parameter-efficient fine-tuning, demonstrating performance improvements up to 10.11% in pass@1 metrics on public library benchmarks and stable generalization to private libraries.

Key insights

  • Explicitly teaching models to formulate and use search queries through a custom tool-augmented dataset is crucial for effective API selection.
  • Parameter-efficient fine-tuning with LoRA achieves performance nearly identical to full-parameter training while significantly reducing computational costs.
  • Real-time access to external API knowledge from search tools during inference is essential for maximizing accuracy and adapting to unseen or private APIs.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.