[2503.17181] A Study of LLMs' Preferences for Libraries and Programming Languages
About this article
Abstract page for arXiv paper 2503.17181: A Study of LLMs' Preferences for Libraries and Programming Languages
Computer Science > Software Engineering arXiv:2503.17181 (cs) [Submitted on 21 Mar 2025 (v1), last revised 8 Apr 2026 (this version, v3)] Title:A Study of LLMs' Preferences for Libraries and Programming Languages Authors:Lukas Twist, Jie M. Zhang, Mark Harman, Don Syme, Joost Noppen, Helen Yannakoudakis, Detlef Nauck View a PDF of the paper titled A Study of LLMs' Preferences for Libraries and Programming Languages, by Lukas Twist and 5 other authors View PDF HTML (experimental) Abstract:Despite the rapid progress of large language models (LLMs) in code generation, existing evaluations focus on functional correctness or syntactic validity, overlooking how LLMs make critical design choices such as which library or programming language to use. To fill this gap, we perform the first empirical study of LLMs' preferences for libraries and programming languages when generating code, covering eight diverse LLMs. We observe a strong tendency to overuse widely adopted libraries such as NumPy; in up to 45% of cases, this usage is not required and deviates from the ground-truth solutions. The LLMs we study also show a significant preference toward Python as their default language. For high-performance project initialisation tasks where Python is not the optimal language, it remains the dominant choice in 58% of cases, and Rust is not used once. These results highlight how LLMs prioritise familiarity and popularity over suitability and task-specific optimality; underscoring the need f...