FLeX: Fourier-based Low-rank EXpansion for multilingual transfer
A novel Fourier-based technique achieves 42.1% pass@1 on Java tasks, beating broader fine-tuning with far less compute.
Stanford researcher Gaurav Narasimhan has introduced FLeX (Fourier-based Low-rank EXpansion), a novel method for efficient cross-lingual transfer in code generation models. The research addresses the prohibitive computational cost of fine-tuning large language models individually for each programming language in enterprise environments. By applying parameter-efficient fine-tuning techniques like LoRA (Low-Rank Adaptation) to the Code Llama 7B model and experimenting with optimizer enhancements, the study demonstrates that targeted adaptation can outperform broader training approaches.
The key innovation lies in the Fourier-based regularization technique applied during fine-tuning. While the research compared Adam and Sophia optimizers—finding Sophia achieves faster convergence but similar final performance—the frequency-domain regularization proved most impactful. This approach enabled the model fine-tuned primarily on Python (using the MBPP dataset) to achieve a 42.1% pass@1 score on Java tasks, significantly outperforming the 34.2% baseline and even exceeding the performance of the more broadly fine-tuned Code Llama-Python-7B model (40.1% vs. 38.4%).
The findings suggest that strategic combinations of existing efficiency techniques with novel regularization methods can dramatically improve multilingual capabilities without the computational burden of full model retraining. For enterprises maintaining codebases across multiple languages, this represents a potential breakthrough in making AI-assisted programming more accessible and cost-effective across diverse technical stacks.
- FLeX method combines LoRA fine-tuning with Fourier-based regularization to improve cross-lingual code transfer
- Achieved 42.1% pass@1 on Java tasks—23% better than the 34.2% baseline—using Code Llama 7B
- Outperformed broader fine-tuning (40.1% vs 38.4%) while using far less computational resources
Why It Matters
Enables enterprises to efficiently adapt single-language coding assistants to work across multiple programming languages without expensive retraining.