arXiv — NLP / Computation & Language · · 4 min read

A Study of LLMs' Preferences for Libraries and Programming Languages

Mirrored from arXiv — NLP / Computation & Language for archival readability. Support the source by reading on the original site.

Computer Science > Software Engineering

arXiv:2503.17181 (cs)
[Submitted on 21 Mar 2025 (v1), last revised 4 Jun 2026 (this version, v4)]

Title:A Study of LLMs' Preferences for Libraries and Programming Languages

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 for targeted fine-tuning, data diversification, and evaluation benchmarks that explicitly measure language and library selection fidelity.
Comments: 21 pages, 10 tables, 3 figures. Accepted to Findings of ACL 2026
Subjects: Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Computation and Language (cs.CL)
Cite as: arXiv:2503.17181 [cs.SE]
  (or arXiv:2503.17181v4 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2503.17181
arXiv-issued DOI via DataCite
Journal reference: Findings of the Association for Computational Linguistics: ACL 2026
Related DOI: https://doi.org/10.18653/v1/2026.findings-acl.15
DOI(s) linking to related resources

Submission history

From: Lukas Twist [view email]
[v1] Fri, 21 Mar 2025 14:29:35 UTC (715 KB)
[v2] Mon, 21 Jul 2025 12:58:26 UTC (349 KB)
[v3] Wed, 8 Apr 2026 09:48:41 UTC (620 KB)
[v4] Thu, 4 Jun 2026 14:55:07 UTC (620 KB)
Full-text links:

Access Paper:

Current browse context:

cs.SE
< prev   |   next >
Change to browse by:

References & Citations

Loading...

BibTeX formatted citation

loading...
Data provided by:

Bookmark

BibSonomy Reddit
Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle
Bibliographic Explorer (What is the Explorer?)
Connected Papers Toggle
Connected Papers (What is Connected Papers?)
Litmaps Toggle
Litmaps (What is Litmaps?)
scite.ai Toggle
scite Smart Citations (What are Smart Citations?)
Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle
alphaXiv (What is alphaXiv?)
Links to Code Toggle
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub Toggle
DagsHub (What is DagsHub?)
GotitPub Toggle
Gotit.pub (What is GotitPub?)
Huggingface Toggle
Hugging Face (What is Huggingface?)
ScienceCast Toggle
ScienceCast (What is ScienceCast?)
Demos

Demos

Replicate Toggle
Replicate (What is Replicate?)
Spaces Toggle
Hugging Face Spaces (What is Spaces?)
Spaces Toggle
TXYZ.AI (What is TXYZ.AI?)
Related Papers

Recommenders and Search Tools

Link to Influence Flower
Influence Flower (What are Influence Flowers?)
Core recommender toggle
CORE Recommender (What is CORE?)
About arXivLabs

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from arXiv — NLP / Computation & Language