Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Comment
  • Published:

AI chatbots can boost scientific coding

Chatbots powered by artificial intelligence, such as ChatGPT, are ready to speed up monotonous coding tasks and teach you new skills. We highlight, with worked examples, some advantages and limitations of using generative artificial intelligence for scientific coding and argue that if you are willing to debug, you can get a head start on more challenging tasks.

This is a preview of subscription content, access via your institution

Relevant articles

Open Access articles citing this article.

Access options

Buy this article

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: An example query to ChatGPT for a short function, and the result.
Fig. 2: Uses of ChatGPT.

References

  1. van Dis, E. A. M., Bollen, J., Zuidema, W., van Rooij, R. & Bockting, C. L. Nature 614, 224–226 (2023).

    Article  PubMed  Google Scholar 

  2. Liebrenz, M., Schleifer, R., Buadze, A., Bhugra, D. & Smith, A. Lancet Digit. Health 5, e105–e106 (2023).

    Article  CAS  PubMed  Google Scholar 

  3. Thorp, H. H. Science 379, 313 (2023).

    Article  PubMed  Google Scholar 

  4. Mitchell, M. Artificial Intelligence: A Guide for Thinking Humans (Farrar, Straus and Giroux, 2019).

  5. King, M. Revolutionary method of book speed reading with ChatGPT. Medium, https://medium.com/@neonforge/revolutionary-method-of-book-speed-reading-with-chatgpt-108c35bf0aab (8 January 2023).

  6. Hilborn, R. & Mangel, M. The Ecological Detective (Princeton Univ. Press, 2013).

  7. Zobel, J. Writing for Computer Science. (Taylor & Francis, 2004).

  8. Hijmans, R. J. terra: spatial data analysis v.1.7-23, https://CRAN.R-project.org/package=terra (2023).

  9. Pebesma, E. R J. 10, 439–446 (2018).

    Article  Google Scholar 

  10. Wickham, H., Danenberg, P., Csárdi, G. & Eugster, M. roxygen2: in-line documentation for R v. 7.2.3, https://CRAN.R-project.org/package=roxygen2 (2022).

  11. Hahn, S. GPT-4 is coming next week – and it will be multimodal, says Microsoft Germany. heise online, https://www.heise.de/news/GPT-4-is-coming-next-week-and-it-will-be-multimodal-says-Microsoft-Germany-7540972.html (9 March 2023).

Download references

Acknowledgements

C.M. and J.M.S.-D. were supported by NASA award 80NSSC 22K0883. C.M. and B.J.E. were supported by NSF awards 2225078 and 2225076. A.M.W. was supported by NASA awards 80NSSC21K1183 and 80NSSC21K0086. J.M.S.-D. acknowledges funding from ANR-21-CE32-0003

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Cory Merow.

Ethics declarations

Competing interests

The authors declare no competing interests.

Supplementary information

Supplementary Information

Supplementary ChatGPT Examples 1-14

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Merow, C., Serra-Diaz, J.M., Enquist, B.J. et al. AI chatbots can boost scientific coding. Nat Ecol Evol 7, 960–962 (2023). https://doi.org/10.1038/s41559-023-02063-3

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1038/s41559-023-02063-3

This article is cited by

Search

Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing