pith. sign in

A Study of LLMs' Preferences for Libraries and Programming Languages

9 Pith papers cite this work. Polarity classification is still indexing.

9 Pith papers citing it
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.

citation-role summary

background 1

citation-polarity summary

years

2026 8 2025 1

roles

background 1

polarities

support 1

representative citing papers

The software space of science

cs.DL · 2026-04-26 · unverdicted · novelty 7.0

A network analysis of software mentions in 1.3 million papers identifies 520 tools in eight communities and shows disciplines maintain distinct, stable tool portfolios that are crystallizing toward common sets.

citing papers explorer

Showing 9 of 9 citing papers.