<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An Architecture for Integrating Large Language Models into Metamodeling Platforms:</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>The Example of MM-AR</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gunakar Challa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aya Gartini</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabian Muf</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hans-Georg Fill</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Fribourg</institution>
          ,
          <addr-line>Boulevard de Pérolles 90, 1700 Fribourg</addr-line>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The large-scale adoption of large language models for the integration of generative artificial intelligence capabilities is occurring across several domains. This also applies to the domain of conceptual modeling, where a number of approaches are currently being investigated for the creation and interpretation of models utilizing this technology. However, a significant number of these approaches are currently limited to a specific modeling language. Accordingly, the current paper proposes an architecture on the level of metamodeling platforms to facilitate the integration of large language models into modeling editors for triggering actions on arbitrary types of models. We describe the underlying concept and report on a first prototypical implementation of the approach for the web-based MM-AR metamodeling platform.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Large Language Models</kwd>
        <kwd>OpenAI</kwd>
        <kwd>Enterprise Modeling</kwd>
        <kwd>MM-AR</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>convey the practical aspects of implementation. In contrast to other approaches, the LLM does
not need to know the context of the entire metamodel, but only some predefined functions to
call. A user’s textual input is then mapped to these predefined functions that can be executed by
the metamodeling platform. This reduces the complexity of the task for the LLM and restricts the
possible output to a controllable set of functions, making the approach flexible and extendable.</p>
      <p>The remainder of the paper is structured as follows. First, we discuss related work in Section 2,
followed by a description of the concept of the approach in Section 3 and the prototypical
implementation of the proposed methodology in Section 4. In Section 5 we illustrate the
approach on two metamodels.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>Several approaches have been explored for the application of large language models to conceptual
modeling and metamodeling. These will be briefly characterized in the following.</p>
      <p>
        In initial experiments, large language models were used to create and interpret entity
relationship diagrams (ERD), business process models, UML class diagrams, and Heraklit models [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
and later also BPMN process models and Petri nets [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. However, the reported experiments
were restricted to these modeling languages and did not target the level of metamodeling.
      </p>
      <p>
        Baumann et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], attempted to generate models for domain-specific languages for which
an LLM had little or no training data. They used a Retrieval Augmented Generation (RAG)
approach to automatically retrieve relevant examples from a knowledge base based on the user’s
query. This permits to a certain extent to target arbitrary modeling languages, but the approach
did not consider the LLM-based manipulation of the models.
      </p>
      <p>
        Subsequently, experiments were conducted in which an LLM was provided with a
metametamodel, several metamodels, and instance models in JSON format created by a metamodeling
platform and accompanied by natural language descriptions [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. On this basis, the LLM was
asked for various outputs that required an understanding of the connections between the
diferent layers. The experiments showed that ChatGPT was not able to interpret the relationships
between meta-metamodels, metamodels and model instances, resulting in unstable and invalid
results, which was mainly due to the large size of input data.
      </p>
      <p>Although previous approaches showed very well the utilization of large language models for
the creation and interpretation of conceptual models, only few investigations have so far been
made that can be applied to any modeling language and are integrated in a model editor.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Concept of the Approach</title>
      <p>The idea of our approach is to build the final model incrementally in small steps. Each step
involves running a few lines of code in the form of a function. When these functions are
triggered they perform a UI action on the existing instance of the model, such as creating an
instance, naming an instance, moving an instance, deleting a relation, etc. Our approach relies
on these functions as the interface to the large language model - see the architecture depicted
in Figure 1. The LLM is provided with all the available functions and input from the modeler.
The function names, descriptions, parameter names, parameter descriptions, and dynamically</p>
      <p>The meta-modelling
specifications are used for
the creation/modification of</p>
      <p>instances of models</p>
      <p>Global
Datastructure The meta meta-modelling
specifications are used for
creation/modification of</p>
      <p>metamodels
Stores and retrieves the instances
of models via internal APIs</p>
      <p>Node Server 1
Node Server 2</p>
      <p>Client
(Aurelia, ThreeJS)
RightNav UiFunctions
prompt createInstance()
reply reply deleteInstance()
onSend() prompt callOpenAI()</p>
      <p>API-Server
(Express)</p>
      <p>Stores &amp; retrieves the</p>
      <p>meta-model and
instances of the model
DB-Server</p>
      <p>Database
(PostgreSQL)
{ "model": "gpt-3.5-turbo-0125",
"m{es"sraoglee"s:"":u[ser",
]",to{}ol}"""sftc"yuo""":pnpndn[ecaaet"tersmi:anoc"emtnr"f"i"up:e::ntt""ie{cCocrtrnrsieeo""aan::tt""{ee.,C_..are}nenatEtitexysc"l,iunssitvaen-cGeatoefwthaey caltaxs=s1",and y=2" TfuJhnSevcOiptaiNoronnpfomsord'orpemdcteeapatslataosctinloiksngagLagwLreeMithisnfeothnret
} ]",to}o,.l._.choice": "auto" OpenAI</p>
      <p>GPT-3.5 Turbo
{ "id": "chatcmpl-9lFq9TPv5UgsRbjc6cUTxpT3XuRHA",
"object": "chat.completion",
"created": 1721049333,
"model": "gpt-3.5-turbo-0125",
"ch{o"icinedse":x[": 0,
"message": {
"role": "assistant",
"content": null,
"to{ol"""_itfcdyu"a"pnnl:eclas""tm"ic:o:a"en[lf"l"u_::nY"{ccetrxieoDanCt"e3,_SecvteJnat6"P,9UZaDvSuXAY", Tchpaeallrefaudmnaceltotieonrngstwaorietbhe
} "arguments": "{\"className\":\"Exclusive-Gateway\",\"x\":1,\"y\":2}" received in JSON</p>
      <p>
        format from LLM
}, ] }
"logprobs": null,
], } "finish_reason": "tool_calls"
"usage": {
"prompt_tokens": 235,
"completion_tokens": 24,
}, "total_tokens": 259
} "system_fingerprint": null
obtained sample values of the parameters are provided to the LLM as context information.
There is no need for the LLM to know specific information about the meta-metamodel or the
underlying metamodels of the platform. Based on the user’s input and context information
provided, the LLM returns the function name to call, including the function parameters to pass
to the function. For example, if the user specifies keywords like create, build, or instantiate in
the prompt and there is a function called "create" in the list of functions provided to the LLM
whose description mentions that it creates an entity, then the LLM chooses this function over
other functions. This chosen function is subsequently executed by the metamodeling platform
for modifying the model instance in the same way as a user would use a mouse and keyboard.
In the next section, we discuss the prototypical implementation of these concepts as integration
into the MM-AR metamodeling platform [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
    </sec>
    <sec id="sec-4">
      <title>4. Prototypical Implementation</title>
      <p>
        As basis for the first prototypical implementation, we used the MM-AR metamodeling
platform [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. It permits to define metamodels in JSON format for which it automatically creates
according model editors that let users interact with the models using mouse and keyboard
actions [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. These actions are implemented as TypeScript functions on the client side of the
platform. Although one can design &amp; view the models in 3D &amp; augumented reality in
MMAR, we will continue with 2D models. Nevertheless, the approach is also extensible to three
dimensions.
      </p>
      <p>As shown in Figure 1, the platform is implemented as Node.js2 web server running Aurelia23
and the JavaScript WebGL visualization framework THREE.js4. Furthermore, the platform relies
on a database server with PostgreSQL5, which is accessed via an API Server running as Node.js
application and express6.</p>
      <p>As an extension to traditional UI interaction methods, the platform has been enhanced with
a prompt field that allows descriptive input. Upon the click of a button, the descriptive input
of the desired modeling task, along with the possible set of UI functions, their parameters and
corresponding descriptions, is sent to the OpenAI API using GPT 3.5 Turbo as the language
model. From the user’s point of view, only descriptive input is considered. The API then returns,
on the basis of the input of the user the most probable function name, as well as the required
parameters in a JSON format. This function is then called, and the according modeling actions
are executed on the model instance. The right side of Figure 1 shows exemplary prompt data
sent to the LLM (top) and received by the LLM (bottom).</p>
    </sec>
    <sec id="sec-5">
      <title>5. Illustrative Scenarios</title>
      <p>To illustrate the generic application of the new approach, two use case scenarios for (1) creating
instances of model elements and (2) renaming existing model elements in the BPMN and the
e3value modeling languages are presented below. Even though these two metamodels are
simplified, the underlying structure is already quite complex 7.</p>
      <p>Figure 2 shows the state of the model after sending a request with the prompt: “Create a
start event” for a BPMN diagram. Figure 3 shows that attributes of instances in a model can be
changed by textual input. In this example, a Boundary Element of an e3-value model is created
and named by stating: “Create a Boundary Element and name it as point”.</p>
      <p>As we can see, the LLM correctly identified which function to invoke in both the cases and
has correctly extracted the parameter value out of the given prompt. This way compound
prompts can also be processed for executing multiple tasks sequentially. Thus, we can also build
and modify large and complex models using multiple simple prompts. We can observe that
this approach works on arbitrary metamodels and is in indeed platform independent. The only
requirement is that UI actions must be accessible via functions, where each function performs a
dedicated UI action and vice versa.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions and Limitations</title>
      <p>In this paper, we introduced a light-weight approach for integrating LLMs directly into
metamodeling platforms, which overcomes the dificulties of LLMs in understanding complex model data
by not relying on specific model information, but using UI interaction features as a proxy. In a
2https://github.com/nodejs/node
3https://github.com/aurelia/aurelia
4https://github.com/mrdoob/three.js
5https://www.postgresql.org/docs/
6https://github.com/expressjs/express
7An illustration of the two metamodels can be found on: https://doi.org/10.5281/zenodo.12920616
ifrst prototypical implementation, we were able to show that the approach works for basic model
actions, e.g., creating instances and renaming instances for two metamodels but is extensible to
all other UI actions as well. Also, it is metamodel-agnostic and platform-independent.</p>
      <p>Nevertheless, this approach is not without some limitations. The prototypical implementation
is reliant upon the names instead of platform’s Universally Unique Identifiers (UUIDs) to
distinguish the diferent concepts. Consequently, it cannot be guaranteed that the correct
metamodel concept is being employed when names are used. We recommend future developers
and researchers to invest suficient time in giving adequate contextual information to the LLM
through descriptions.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>H.</given-names>
            <surname>Fill</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Fettke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Köpke</surname>
          </string-name>
          ,
          <article-title>Conceptual Modeling and Large Language Models: Impressions From First Experiments With ChatGPT, Enterp</article-title>
          .
          <source>Model. Inf. Syst. Archit. Int. J. Concept. Model</source>
          .
          <volume>18</volume>
          (
          <year>2023</year>
          )
          <article-title>3</article-title>
          . doi:
          <volume>10</volume>
          .18417/EMISA.18.3.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>F.</given-names>
            <surname>Muf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Fill</surname>
          </string-name>
          ,
          <article-title>Limitations of ChatGPT in Conceptual Modeling: Insights from Experiments in Metamodeling</article-title>
          , in: Modellierung 2024 - Workshop Proceedings, GI e.V.,
          <year>2024</year>
          , p.
          <fpage>8</fpage>
          . doi:
          <volume>10</volume>
          .18420/MODELLIERUNG2024-WS-008.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>F.</given-names>
            <surname>Muf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Fill</surname>
          </string-name>
          ,
          <article-title>Initial Concepts for Augmented and Virtual Reality-based Enterprise Modeling</article-title>
          ,
          <source>in: ER Demos and Posters</source>
          <year>2021</year>
          , volume
          <volume>2958</volume>
          , CEUR-WS.org,
          <year>2021</year>
          , pp.
          <fpage>49</fpage>
          -
          <lpage>54</lpage>
          . URL: https://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2958</volume>
          /paper9.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>H.</given-names>
            <surname>Kourani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Berti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Schuster</surname>
          </string-name>
          ,
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          ,
          <article-title>Process Modeling with Large Language Models</article-title>
          ,
          <source>in: BPMDS 2024</source>
          , Springer,
          <year>2024</year>
          , pp.
          <fpage>229</fpage>
          -
          <lpage>244</lpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>031</fpage>
          -61007-3\_
          <fpage>18</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>N.</given-names>
            <surname>Baumann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. S.</given-names>
            <surname>Diaz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Michael</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Netz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Nqiri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Reimer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Rumpe</surname>
          </string-name>
          ,
          <article-title>Combining Retrieval-Augmented Generation and Few-Shot Learning for Model Synthesis of Uncommon DSLs</article-title>
          , in: Modellierung 2024 - Workshop Proceedings, GI e.V.,
          <year>2024</year>
          , p.
          <fpage>7</fpage>
          . doi:
          <volume>10</volume>
          .18420/ MODELLIERUNG2024-WS-007.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>F.</given-names>
            <surname>Muf</surname>
          </string-name>
          , H. Fill,
          <article-title>M2AR: A Web-based Modeling Environment for the Augmented Reality Workflow Modeling Language</article-title>
          ,
          <source>in: Proceedings of the MODELS Companion '24</source>
          ,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          ,
          <year>2024</year>
          . doi:
          <volume>10</volume>
          .1145/3652620.3687779.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>