Preprint · 2023 · Open access

ToolCoder: Teach Code Generation Models to use API search tools

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

arXiv (Cornell University) · Published 6 May 2023 · DOI 10.48550/arxiv.2305.04032

Open PDFView at the publisherCite this paper

In brief

“ToolCoder: Teach Code Generation Models to use API search tools” is a 2023 preprint by Kechi Zhang and 5 co-authors, published in arXiv (Cornell University). OpenAlex counts 88 citations as of 23 November 2026. It is open access: the full text is free to read at arXiv (Cornell University).

Citations
88
Most cited in
2025 (35)
References
23
Authors
6

Abstract

Automatically generating source code from natural language descriptions has been a growing field of research in recent years. However, current large-scale code generation models often encounter difficulties when selecting appropriate APIs for specific contexts. These models may generate APIs that do not meet requirements or refer to non-existent APIs in third-party libraries, especially for lesser-known or private libraries. Inspired by the process of human developers using tools to search APIs, we propose ToolCoder, a novel approach that integrates API search tools with existing models to assist in code generation and API selection. To teach our model to use tools, we introduce an automated data annotation method using ChatGPT to add tool usage information into the source code data and fine-tune code generation models. During inference, we integrate API search tools into the generation process so that our model can automatically use the search tool to get suggestions when selecting an API. Our experimental results demonstrate that ToolCoder exhibits excellent performance and generalization across five public and private library code generation benchmarks, with at least 6.21\% improvement on average pass@1 metrics and 9.64\% improvement on average pass@10 metrics compared to state-of-the-art methods. Furthermore, we show that our relatively small ToolCoder model is comparable to one of the current best models, GPT-3.5, highlighting the potential of incorporating programming tools into the code generation process.

Cite this paper

Formatted from the catalogue record. Check names, capitals and page numbers against the paper before you submit.

APA 7

Zhang, K., Huangzhao, Z., Li, G., Li, J., Li, Z., & Jin, Z. G. (2023). ToolCoder: Teach Code Generation Models to use API search tools. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2305.04032

MLA 9

Zhang, Kechi, et al. “ToolCoder: Teach Code Generation Models to use API search tools.” arXiv (Cornell University), 2023. https://doi.org/10.48550/arxiv.2305.04032.

Chicago

Zhang, Kechi, Zhang, Huangzhao, Ge Li, Jia Li, Zhuo Li, and Zhi Gang Jin. 2023. “ToolCoder: Teach Code Generation Models to use API search tools.” arXiv (Cornell University). https://doi.org/10.48550/arxiv.2305.04032.

Harvard

Zhang, K. et al. (2023) ‘ToolCoder: Teach Code Generation Models to use API search tools’, arXiv (Cornell University). doi:10.48550/arxiv.2305.04032.

IEEE

K. Zhang, Z. Huangzhao, G. Li, J. Li, Z. Li, and Z. G. Jin, “ToolCoder: Teach Code Generation Models to use API search tools,” arXiv (Cornell University), 2023, doi: 10.48550/arxiv.2305.04032.

BibTeX

@misc{zhang2023toolcoder,
  title     = {{ToolCoder: Teach Code Generation Models to use API search tools}},
  author    = {Zhang, Kechi and Huangzhao, Zhang, and Li, Ge and Li, Jia and Li, Zhuo and Jin, Zhi Gang},
  howpublished = {arXiv (Cornell University)},
  year      = {2023},
  doi       = {10.48550/arxiv.2305.04032},
  url       = {https://doi.org/10.48550/arxiv.2305.04032}
}

Download for a reference manager: BibTeX (.bib) · RIS for Zotero, Mendeley and EndNote (.ris)

Citations by year

YearCitationsShare of the best year
202355
20242525
20253535
20262323

Topic and keywords

Physical Sciences › Computer Science › Information Systems › Software Engineering Research

  • code generation
  • API selection
  • automatic annotation
  • ChatGPT
  • private libraries
  • third-party libraries
  • natural language to code

Work with this paper

Most-cited papers in Computer Science

All highly cited Computer Science papers

Questions about this paper

How do I cite this paper in APA style?

Zhang, K., Huangzhao, Z., Li, G., Li, J., Li, Z., & Jin, Z. G. (2023). ToolCoder: Teach Code Generation Models to use API search tools. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2305.04032

How many times has this paper been cited?

88 times, according to OpenAlex on 23 November 2026. Google Scholar and Scopus count different sets of sources, so their numbers differ.

Is this paper free to read?

Yes. It is open access at arXiv (Cornell University): sign in and open the PDF from this page.

Who wrote this paper?

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

What is the DOI of this paper?

10.48550/arxiv.2305.04032, permanently at https://doi.org/10.48550/arxiv.2305.04032. Sign in and open it from this page.

Bibliographic data from OpenAlex (CC0), last checked 23 November 2026. ResearchGuru does not host this paper; once you are signed in, the links open it at the publisher or the repository that does.