NobleBlocks

Research indexPreprint

SimLLM: Fine-Tuning Code LLMs for SimPy-Based Queueing System Simulation

Chen, Zhang, Zheng and 1 other

arXiv (Cornell University)10 Jan 2026Open access

NobleIDark:/48914/w1/20261006/479D2AC6DOI10.48550/arxiv.2601.06543

Free to read at the publisher

You can read the abstract here, or the full text at the publisher.

Read at the publisher

Abstract

The Python package SimPy is widely used for modeling queueing systems due to its flexibility, simplicity, and smooth integration with modern data analysis and optimization frameworks. Recent advances in large language models (LLMs) have shown strong ability in generating clear and executable code, making them powerful and suitable tools for writing SimPy queueing simulation code. However, directly employing closed-source models like GPT-4o to generate such code may lead to high computational costs and raise data privacy concerns. To address this, we fine-tune two open-source LLMs, Qwen-Coder-7B and DeepSeek-Coder-6.7B, on curated SimPy queueing data, which enhances their code-generating performance in executability, output-format compliance, and instruction-code consistency. Particularly, we proposed a multi-stage fine-tuning framework comprising two stages of supervised fine-tuning (SFT) and one stage of direct preference optimization (DPO), progressively enhancing the model's ability in SimPy-based queueing simulation code generation. Extensive evaluations demonstrate that both fine-tuned models achieve substantial improvements in executability, output-format compliance, and instruct consistency. These results confirm that domain-specific fine-tuning can effectively transform compact open-source code models into reliable SimPy simulation generators which provide a practical alternative to closed-source LLMs for education, research, and operational decision support.

Topics

More

Suggest a correction or report