Code language models show different programming language roles in transfer tasks
Rethinking Pivot Programming Languages in Code Language Models
Computation and Language
Summary
People use smart computer programs called code language models to understand many programming languages at once. The authors studied whether some languages, like Python or C, are more important as a bridge to learn others. Their findings show that Python stands out mainly when relating code to English, not as the central language connecting all programming languages. This helps us better understand how these models handle different coding languages.
What this means in practice
- •For multilingual code model engineers: Design better code models by selecting pivot languages tailored to English-related tasks versus code-to-code tasks.
- •For software localization teams: Improve automated code translations by recognizing different roles languages play in cross-language understanding.
Authors
Andor Diera, Lukas Galke Poech, Matthias Tichy
Abstract
Multilingual code language models transfer skills across programming languages (PLs), but whether any PL occupies a privileged pivot position remains contested: geometric analyses point to C-family languages and Go, while behavioral evidence highlights Python. We revisit this question under controls for representational anisotropy and length variation across PLs, two confounds that compromise prior cosine-based analyses. Across three code models on multilingual competitive-programming data, we study three views of cross-PL organization: pairwise PL geometry, PL-English alignment, and pivoted retrieval through candidate PL representation spaces. The results are relation-dependent. Code-code geometry reveals structured language regions but no universal center; code-English alignment favors high-level scripting languages; and pivoted retrieval favors different intermediate spaces for code-to-code and English-to-code transfer. These findings suggest that Python's special role is better understood as English-facing affinity than as universal geometric centrality.