That's an intriguing idea about model specialization! The concept of selectively removing capabilities to enhance others touches on some fascinating aspects of how LLMs work.
In practice, "making a model forget" specific languages while retaining others is quite challenging. The knowledge in these models isn't stored in neat, separable compartments - language understanding, coding ability, and reasoning are deeply intertwined throughout the neural network's parameters. When a model learns multiple languages, it often develops shared representations for concepts that actually help with tasks like coding.
Interestingly, multilingual training often improves rather than hurts coding performance. Many programming concepts, variable names, and documentation span multiple languages, and the diverse linguistic training seems to enhance the model's ability to understand patterns and structures - skills that transfer well to code.
If you wanted to create a specialized coding model, more effective approaches might include:
- Continued pre-training on code-heavy datasets starting from a base multilingual model
- Fine-tuning specifically for coding tasks while keeping the underlying multilingual foundation
- Training from scratch on a curated dataset that's primarily English and code
The most successful coding-focused models (like Codex variants) typically build on top of strong general language models rather than trying to subtract capabilities from them. The broad language understanding seems to provide a valuable foundation for understanding code structure, documentation, and programming concepts.
Have you considered what specific coding tasks you'd want to optimize for? That might influence which approach would work best.