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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Enhancing MATLAB Code Generation with Large Language Models

Xiaoliang Liu, Kai Jin
Engineering and Information Technology
article

Enhancing MATLAB Code Generation with Large Language Models

Xiaoliang Liu, Kai Jin
article en

Abstract

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.

Jiangsu University of Science and Technology (CN)
Openalex Percentile: Top 76%
Engineering and Information Technology
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Enhancing MATLAB Code Generation with Large Language Models — Xiaoliang Liu, Kai Jin · (2025) | TGRS Research Map | TGRS