FLeX: Fourier-based Low-rank EXpansion for multilingual transfer
View PDF HTML (experimental) Abstract:Cross-lingual code generation is critical in enterprise environments where multiple programming languages coexist. However, fine-tuning large language models (LLMs) individually for each language is computationally prohibitive. This paper investigates whether parameter-efficient fine-tuning methods and optimizer enhancements can improve cross-lingual transfer from Python to languages like Java. We fine-tune the Code Llama 7B model using low-rank adaptation (LoRA) to optimize a small subset of parameters and compare Adam and Sophia optimizers, while exploring a novel Fourier-based regularization technique. Our contributions include: (1)demonstrating that LoRA fine-tuning on a small, high-quality dataset (MBPP) can exceed the pass@1 performance of the more broadly fine-tuned Code Llama-Python-7B model (40.1% vs. 38.4%); (2) showing that while Sophia achieves faster convergence than Adam, final pass@1 scores show marginal differences; and (3) presenting evidence that Fourier-based regularization during fine-tuning significantly improves cross-lingual transfer, achieving 42.1% pass@1 on Java tasks compared to the 34.2% baseline. These findings suggest that combining LoRA, optimized training methods, and frequency-domain regularization can efficiently adapt single-language LLMs to perform well across multiple programming languages. Comments: 19 pages, 25 figures, Stanford CS224N Custom Project Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Programming Languages (cs.PL) ACM classes: I.2.7 Cite as: arXiv:2604.06253 [cs.LG] (or arXiv:2604.06253v1 [cs.LG] for this version) https://doi.org/10.48550/arXiv.2604.06253 arXiv-issued DOI via DataCite (pending registration) Submission history From: Gaurav Narasimhan [view email] [v1] Mon, 6 Apr 2026 19:26:13 UTC (2,435 KB)
No replies yet. Be first.