Enhancing MATLAB Code Generation with Large Language Models
Large language models (LLMs) have made significant progress in the field of natural language processing, but research on MATLAB code generation remains relatively scarce. As a programming language widely used in numerical computation, signal processing, and control system design, MATLAB's complex syntax and specific application scenarios pose greater challenges for code generation models. This paper proposes an optimization approach based on supervised fine-tuning (SFT), utilizing a high-quality MATLAB question-answer dataset to fine-tune pre-trained LLMs and enhance their performance in MATLAB code generation tasks. The study employs two powerful pre-trained models, Qwen2.5-Coder and DeepSeek-Coder, and demonstrates that SFT significantly improves code generation quality and functional correctness. Experimental results show that the optimized models perform exceptionally well on BLEU, ROUGE-L, and functional correctness metrics, with the Qwen2.5-MATLAB model achieving top-tier performance in MATLAB code generation tasks. The findings of this study validate the importance of highquality datasets in supervised fine-tuning and further emphasize the necessity and feasibility of optimizing models for domain-specific tasks.
Authors
- Xiaoliang Liu (ORCID: https://orcid.org/0000-0003-2258-8813)
- Kai Jin (ORCID: https://orcid.org/0000-0003-2489-2173)
Institutions
- Jiangsu University of Science and Technology (CN)
Publication Details
- Published
- 2025-06-28
- DOI
- https://doi.org/10.1109/icipca65645.2025.11138499
- Primary Topic
- Engineering and Information Technology
- Type
- article
- Field-Weighted Citation Impact
- 0.00