Starjob: Dataset for LLM-Driven Job Shop Scheduling

Henrik Abgaryan, Tristan Cazenave, Ararat Harutyunyan · Submission to ICLR 2026 · Rejected

TL;DR

Can a general-purpose Large Language Model solve hard combinatorial problems? This paper introduces Starjob, the first large-scale supervised dataset of 130,000 Job Shop Scheduling Problem (JSSP) instances formatted in structured natural language, and fine-tunes a Llama-3.1 8B model to generate schedules end-to-end. By forcing the LLM to output step-by-step arithmetic verifying start and completion times, the model drastically cuts down invalid schedules and outperforms classical priority heuristics as well as foundational neural baselines like L2D and RASCL.

What Problem Does This Paper Address?

The Job Shop Scheduling Problem (JSSP) is a notorious NP-hard combinatorial problem where multiple jobs—each consisting of ordered operations—must be assigned to specific machines to minimize total completion time (the makespan).

Historically, practitioners relied on fast Priority Dispatching Rules (PDRs) or specialized Graph Neural Networks (GNNs) trained with reinforcement learning. LLMs have typically been written off for this task: they are prone to hallucinations, struggle with strict mathematical constraints, and frequently output infeasible solutions. This paper asks: With the right problem representation and training data, can a fine-tuned LLM reliably solve large-scale JSSP instances end-to-end?

Methods

The authors cast JSSP as a conditional sequence generation task:

  1. Stepwise, Computation-Driven Encoding: Rather than predicting schedules as plain matrices, the authors encode partial schedules using explicit summation equations (e.g., J2-M0: 0+78 -> 78). This requires the autoregressive model to calculate and verify the timing constraints conditioned on prior assignments before scheduling subsequent operations.
  2. Fine-Tuning with RsLoRA: They fine-tune Meta's Llama-3.1-8B-Instruct (4-bit quantized) using Rank-Stabilized LoRA (RsLoRA, $r=64$, $\alpha=64$) across query, key, value, output, and MLP projections. The setup fits within ~30 GB VRAM on a single NVIDIA RTX A6000 GPU across 2 epochs (~70 hours).
  3. Generate-and-Select Inference: At test time, the model samples multiple candidates ($S=20$ or $60$) under temperature-controlled decoding. A lightweight deterministic validator checks precedence, machine exclusivity, non-preemption, and operation completeness. Among all valid candidates, the schedule with the minimal makespan is selected.
  4. Interactive Explanations: Because the scheduler is an LLM, users can query it in natural language to identify critical paths and bottleneck resources.

Datasets

  • Starjob (New): A supervised dataset consisting of approximately 130,000 synthetic JSSP instances ranging from $2 \times 2$ to $20 \times 20$, along with ~1,000 larger/asymmetric problems. Processing times range uniformly from 5 to 500. Ground-truth schedules were computed using Google OR-Tools (with a 300-second search budget across 42 parallel workers). The data is split 98% for training and 2% for evaluation.
  • Evaluation Benchmarks (Out-of-Distribution):
  • Taillard (TAI): Standard JSSP instances ranging from $15 \times 15$ to $50 \times 20$.
  • Demirkol et al. (DMU): Benchmark instances ranging from $20 \times 15$ to $50 \times 15$.

Key Insights and Ideas

  • Representation Unlocks Constraint Satisfaction: When prompted with traditional matrix tables, the LLM achieved poor feasibility rates (~1–8%). In contrast, training the model to emit explicit arithmetic (start + duration -> end) raised feasibility significantly (up to 39.6% on $12 \times 12$ instances). Forcing intermediate calculations directly embeds temporal constraints into the autoregressive generation steps.
  • Model Capacity Threshold: Scaling matters. While Llama 8B succeeded in scheduling up to 1,000 operations, the smaller Llama 1B completely failed (0% feasibility), demonstrating that smaller parameter counts cannot track complex, interwoven precedence constraints.
  • Dual Role as Solver and Explainer: Beyond numerical dispatching, the LLM accurately articulates the primary bottlenecks and contended resources that determine the makespan.

Key Results

Performance was evaluated using the Percentage Gap (PG) relative to best-known or optimal bounds (lower is better):

  • Taillard Benchmark: The fine-tuned Llama model achieved an average gap of 21.69%, outperforming classic PDRs (SPT: 60.57%, MWKR: 55.29%, FDD/WKR: 46.77%, MOPNR: 42.99%) and neural baselines (L2D: 29.54% and RASCLB: 25.16%).
  • DMU Benchmark: The model achieved an average gap of 20.14%, notably improving upon L2D (37.50%) and remaining competitive with the dedicated reinforcement learning baseline RASCLB (20.16%).
  • Scale: Evaluated instances fit within the model's 40,000-token context window (the largest instances consumed ~22,224 to 23,000 tokens for up to 1,000 operations).

Limitations and Future Work

  • Feasibility Overhead: The model still generates invalid candidates, requiring a generate-and-select strategy ($S=20$ to $60$ samples) and external validation filters.
  • Context and Scalability: Processing large token lengths (e.g., ~22k tokens) takes roughly 217 seconds per sample on an RTX A6000, constrained by sequence length rather than combinatorial difficulty.
  • Future Directions: Developing hybrid solvers pairing LLMs with local search or constraint programming, integrating Graph Neural Networks into the LLM latent space via cross-attention, and investigating full fine-tuning on larger model sizes.

Summary updated

Abstract

Large Language Models (LLMs) have shown remarkable capabilities across various domains, but their potential for solving combinatorial optimization problems remains largely unexplored. In this paper, we investigate the applicability of LLMs to the Job Shop Scheduling Problem (JSSP), a classic challenge in combinatorial optimization that requires efficient job allocation to machines to minimize makespan. To this end, we introduce Starjob, the first supervised dataset for JSSP, comprising 120k instances specifically designed for training LLMs. Leveraging this dataset, we fine-tune the LLaMA 8B model with the LoRA method to develop an end-to-end scheduling approach. Our evaluation on standard benchmarks demonstrates that the proposed LLM-based method not only surpasses traditional Priority Dispatching Rules (PDRs) but also achieves notable improvements over state-of-the-art neural approaches like L2D, with an average improvement of 11.28% on DMU and 3.29% on Taillard benchmarks. These results highlight the untapped potential of LLMs in tackling combinatorial optimization problems, paving the way for future advancements in this area.
BibTeX
@inproceedings{abgaryan2024starjob,
  author = {Henrik Abgaryan and Tristan Cazenave and Ararat Harutyunyan},
  title = {{Starjob: Dataset for LLM-Driven Job Shop Scheduling}},
  booktitle = {LM4Plan @ AAAI},
  year = {2024},
  url = {https://openreview.net/forum?id=0oSusu9nE6},
}
Figure