## 4 Automatic Constraint Model Generator (ACMG)
### Main Components  
To explain the ACMG, we introduce the following basic terms:  
Message from the user: A message from the user is a prompt written in a natural language consisting of a constraint task and a model. The description in Figure 3 is an example of such a prompt, where the model and constraint task are intertwined (see last paragraph of Section 2.3). Constraint task: A constraint task is the partial instantiation of constraint satisfaction problem (CSP) variables described in natural language. For example, in the Game of 24 model, a constraint task is a set of four numbers, e.g., 3, 5, 7, 9. Constraint model: This model describes the general constraints or rules that apply to the problem. For example, the case of a sudoku model should be described as follows: \begin{table}
\begin{tabular}{l c c c} \hline \hline  & **ACMG** & [17] & [16] \\ \hline Multi-step process & Yes & Yes & No \\ NER & Yes & Yes & No \\ RAG & No & Yes & No \\ Encoder LLM in NER & No & Yes & No \\ Decoder LLM in NER & Yes & Yes & No \\ Fine-tuning LLM & Yes & No & No \\ Multiple LLMs & Yes & No & No \\ Prompting technique & Zero-Shot & Few-Shot & Zero-Shot \\ LLM-guided process & Yes & No & Partially \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Summarized differences between the ACMG engine, constraint modeling with LLMs using in-context learning [17], and an automatic optimization model generator assisted by generative pre-trained transformers [16]. Sudoku is a logic-based number placement puzzle that fills a 9 \(\times\) 9 grid with digits from 1 to 9. Each row, each column, and the nine 3 \(\times\) 3 subgrids must contain all the digits from 1 to 9 without repetition. Note: for reasons of brevity, in the rest of this paper we will use the terms \"model\" and \"constraint model\" interchangeably. Model name: The model name serves as a unique textual identifier for the constraint model. It is automatically generated by the LLM and then manually validated and stored in a catalog for future reference. LLMs: The two different architectural configurations of the ACMG used the following LLMs: GPT-3.5-turbo-0125 and GPT-4o-mini-2024-07-18. In each distinct architectural configuration of the ACMG, we only used one of those two large language models. Vanilla LLM (vLLM) means we used the default LLM without fine-tuning it using our specially created dataset. We did not use a combination of GPT-3.5-turbo-0125 and GPT-4o-mini-2024-07-18 in one distinct configuration of the ACMG, but we did use, as described in Section 5, a combination of the vanilla LLM and one or more fine-tuned LLMs (fLLMs) of the same type (e.g., GPT-3.5-turbo-0125). In the ACMG, LLMs are fine-tuned using OpenAI's supervised learning pipeline [9], with input data formatted as json (JSON Lines), where each entry contains a structured prompt-completion pair (e.g., (\"prompt\": \"...\", \"completion\": \"...\")). Tokenization was handled internally by OpenAI's subword tokenizer (based on Byte-Pair Encoding for GPT-3.5/GPT-4), ensuring consistency across examples. The fine-tuning adhered to OpenAI's default hyperparameters: a batch size of 1 (sequential processing per example), 1 epoch (default setting to balance convergence and computational cost), and a learning rate multiplier of 1 (applied to OpenAI's undisclosed base rate). The optimizer and early stopping criteria were not user-configurable, as these are proprietary to OpenAI's pipeline. Training concluded after 1 epoch with a final loss of 0.057, indicating stable convergence. While an ablation study of the hyperparameters (e.g., epochs, batch size) might further optimize performance, we prioritized reproducibility and cost efficiency by opting for the default settings. Parser: A Parser is a pre-trained foundational LLM that is fine-tuned and instruction-tuned using our dataset [19]. The output from the Parser increases the validity and correctness of downstream tasks, i.e., the generated constraint model. The Parser is used to separate the user's message into two parts: the model and the constraint task.