Teach AI New Code Languages Without Breaking It
Based on research by Alessandro Giagnorio, Alberto Martin-Lopez, Gabriele Bavota
Imagine asking an AI to write code in a language it has never seen before. For most developers, this sounds impossible. Yet, in the real world of proprietary software and niche domains, this is a daily reality. Large Language Models excel at Python or Java, but they stumble completely when faced with no-resource languages—those with virtually zero training data. This gap leaves companies struggling to automate their unique coding needs, forcing them to build expensive, custom solutions from scratch.
Researchers have now tackled this blind spot by creating benchmarks for these forgotten languages. They tested various methods to teach models new coding dialects, including simple prompts and heavy-duty pre-training. The results revealed a tricky trade-off. While pre-training on the new language boosted coding accuracy, it often broke the model’s ability to follow instructions. The model became a better coder but a worse assistant, ignoring user prompts and going off-track.
The breakthrough came from a clever workaround. Instead of trying to fix a broken instruction-following model, researchers started with a base model. They pre-trained it on the new language and then injected instruction-following skills using weight diff transfer from an existing instruction-tuned model. This hybrid approach preserved the model’s ability to understand commands while teaching it the new syntax. It allows organizations to deploy specialized coding assistants cheaply, avoiding the massive computational costs of full instruction fine-tuning.
This method bridges the gap between general AI capabilities and specific industry needs. By combining targeted pre-training with efficient skill injection, companies can now equip their teams with powerful code generators for even the most obscure programming languages. The future of automated software engineering is not just about bigger models, but about smarter ways to adapt them to any language, no matter how rare.