<!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>
      <journal-title-group>
        <journal-title>Corresponding author.
$ katsiaryna.lashkevich@ut.ee (K. Lashkevich); fredrik.milani@ut.ee (F. Milani); maksym.avramenko@ut.ee
(M. Avramenko); marlon.dumas@ut.ee (M. Dumas)</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Redesigning Business Processes to Reduce Waiting Times Using Large Language Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Katsiaryna Lashkevich</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fredrik Milani</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Maksym Avramenko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marlon Dumas</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Tartu</institution>
          ,
          <addr-line>18 Narva mnt, Tartu, 51009</addr-line>
          ,
          <country country="EE">Estonia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2024</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0003</lpage>
      <abstract>
        <p>Reducing waiting times in business processes is crucial for minimizing waste and improving eficiency. To achieve this, analysts need to understand the causes of waiting times and identify relevant redesign options. To support this task, we introduce a conversational interface integrated with the Kronos tool to analyze waiting time causes and suggest process redesigns. The interface uses a Large Language Model (LLM) to query waiting time analysis results and contextual process data based on specific user requests. The tool additionally provides recommendations of redesign options to reduce the identified waiting times, based on a collection of redesign heuristics.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;process mining</kwd>
        <kwd>waiting time</kwd>
        <kwd>large language models</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Understanding where and why waiting times occur in business processes is essential for reducing
waiting time-related wastes and improving process eficiency. Waiting times occur when a case
transitions from one activity to another [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. For instance, in a procurement process, waiting
time may occur when a purchase order is approved and the order is waiting to be fulfilled or
between receipt of goods and their inspection for approval. Identifying why such waiting times
occur helps analysts to pinpoint ineficiencies and to assess possible redesign options.
      </p>
      <p>
        Process mining techniques support the discovery of waiting times from event logs that
record business process executions [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Existing process mining tools [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], can identify and
analyze waiting times from event logs. For example, Kronos [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] – an open-source web-based
tool – can both analyze waiting times and identify their causes. However, existing tools have
two limitations. First, the results are typically presented through visualizations with basic
interactivity, such as filtering and hiding data, but lack the capability for exploratory interaction
to support customized analyst requests. Second, while these tools efectively analyze waiting
times and their causes, they do not ofer redesign suggestions for reducing waiting times.
      </p>
      <p>
        In this paper, we introduce a tool integrated with Kronos [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] that leverages a Large Language
Model (LLM) to enable users to conversationally query event log data to analyze the causes
of waiting times in a business process, and to obtain redesign suggestions for waiting time
reduction. The tool is designed to discover and to quantify waiting times in a business process
attributable to batching, prioritization, resource contention, and resource unavailability. Users
interact with the tool via a chatbot interface. For each identified cause of waiting time, the tool
provides redesign suggestions based on a catalog of redesign strategies.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Tool Overview</title>
      <sec id="sec-2-1">
        <title>2.1. Architecture</title>
        <p>The tool is based on an existing process mining tool called Kronos and a set of additional
algorithms that, collectively, discover and analyze causes of waiting times from event logs and
provide redesign options. Figure 1 illustrates the architecture of the tool, highlighting the main
components of the conversational interface.</p>
        <p>The interface has the following components. The frontend is developed using TypeScript and
provides a simple chat interface for users to submit their queries. The user inputs their question,
which is then forwarded to the backend for processing. The WebAPI, implemented using Flask
and Gunicorn, acts as the intermediary between the frontend and the LLM. It handles the query
forwarding, data retrieval, and response generation processes. The tool uses OpenAI’s GPT-4
Turbo model for its language processing capabilities.</p>
        <p>The LLM accesses several data sources to provide relevant responses, including waiting time
analysis from Kronos, batching and prioritization strategies, resource working calendars, case
attributes, and redesign strategies. We use OpenAI’s “function calling”1 to set up these data</p>
        <sec id="sec-2-1-1">
          <title>1https://platform.openai.com/docs/guides/function-calling</title>
          <p>sources available for the LLM.</p>
          <p>
            • Kronos Waiting Time Analysis: Kronos is the primary source of information, providing
a detailed analysis of waiting time causes. The analysis results are stored in a database.
Instructions were provided to the LLM to make it aware of the database schema. This
enables the LLM to generate SQL queries, which are executed by the interface on the
database. The retrieved information is sent back to the LLM for further processing.
• Batching Strategies: Given an event log, batching strategies are discovered using an
existing algorithm [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ] that analyzes how activity instances are grouped into batches and
provides insights into the batch size, frequency, and activation rules2.
• Prioritization Strategies are identified using another algorithm [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ], which examines
how tasks are prioritized in the process. This analysis helps in understanding the order
in which tasks are performed and their impact on waiting times3.
• Resource Working Calendars detail the availability schedules of resources. They are
discovered using an existing algorithm [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] that provides information on how resource
availability afects waiting times 4.
• Case Attributes are discovered from the event log by the tool. These attributes provide
additional context about the cases, such as their characteristics and the specific conditions
under which they are processed.
• Redesign Strategies: A compiled file containing diferent redesign strategies, their
applications, examples, and references. The LLM is provided with a structured list of
possible redesign strategies, enabling it to request specific information (description,
example, references) on these strategies as needed.
          </p>
          <p>
            The LLM is provided with pre-configured instructions to enhance its capabilities in
interpreting queries and accessing/reading the data sources. Details of the prompts that the tool
provides to the LLM, including the collection of redesign strategies, can be found in [
            <xref ref-type="bibr" rid="ref7">7</xref>
            ].
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. User Flow</title>
        <p>Figure 2 depicts the steps performed by the tool to respond to user queries. The process begins
with a user submitting a question (step ‘A’), which is forwarded to the LLM (step ‘B’). The LLM
performs a data requirement analysis (step ‘C’) to determine what specific data is required to
generate a response. Next, relevant data is retrieved (step ‘D’), sent back to the LLM (step ‘E’),
which generates a response and presents the final output to the user (step ‘F’).</p>
        <p>The interface has a text input box where users can type their questions (see Figure 3). Once
submitted, the question appears in the chat box, and the “Send” button is disabled to prevent
more questions until a response is provided. The interface dynamically adjusts its size based on
the length of the questions and answers, ensuring that all content is readable.
2https://github.com/AutomatedProcessImprovement/pix-framework/blob/main/src/pix_framework/discovery/
batch_processing
3https://github.com/AutomatedProcessImprovement/pix-framework/tree/main/src/pix_framework/discovery/
prioritization
4https://github.com/AutomatedProcessImprovement/pix-framework/tree/main/src/pix_framework/discovery/
resource_calendar_and_performance</p>
        <p>Upon the first question submission (step ‘A’), a thread is created 5 and an ID is assigned, which
is kept in the session storage. Subsequent questions will use the same thread ID, allowing the
LLM to be aware of the history of previous messages and answers, as well as the data connected
to those interactions. If the user refreshes the page, the thread ID is no longer retained in
memory, prompting the tool to create a new thread upon the next question submission. This
ensures that each session maintains a dialogue history unless manually reset by the user.</p>
        <p>Once a question is submitted (step ‘A’), it is forwarded to the OpenAI GPT-4 Turbo LLM
(step ‘B’) via their API6. To ensure the LLM understands its operational context and meets the
requirements for analyzing event logs and suggesting process improvements, we have provided
it with structured instructions7. The instructions are tiered at three levels to enhance the LLM’s
responsiveness. The first is LLM’s Instructions, which contains general guidelines such as the
LLM’s goals and operational context. The second is General Message Instructions, specifying
preferred data formats, instructions on analyzing waiting time causes and recommending the
redesign options. The last is Direct Message Instructions which refine responses by concatenating
them with user queries, ensuring, e.g., that responses follow a consistent time format. General
and direct message instructions are included in each user message.</p>
        <p>Based on the data request from the LLM, the necessary data is retrieved and provided to the
LLM (step ‘E’), enabling it to proceed with the final response generation (step ‘F’). If an error
occurs during the data retrieval process, an error message is returned to the LLM, allowing it
to adjust the data request accordingly. Having analyzed the initial question from the user, the
available data sources, and the knowledge of the LLM, the LLM generates the final response
(step ‘F’). This response is then presented to the user. The LLM uses markdown, supported by
the interface, to secure that the user receives the answer in a structured and readable format.
After the response is generated, the user can ask additional questions, with the LLM taking into
account the context of previous messages.</p>
        <sec id="sec-2-2-1">
          <title>5https://platform.openai.com/docs/api-reference/threads/object 6https://openai.com/index/openai-api/ 7https://github.com/AutomatedProcessImprovement/waiting-time-backend/blob/main/assistant-instructions.txt</title>
          <p>The conversational LLM interface is a proof-of-concept. An initial user validation has been
conducted with process mining experts. The preliminary results indicate the tool’s usefulness
for conversational exploration of waiting time causes and process redesigns.</p>
          <p>The conversational interface is publicly available at http://kronos.cloud.ut.ee/. To use the
interface, users must first upload an event log to Kronos. The implementation of the interface
logic is available in GitHub repositories: one for the frontend8 and one for the WebAPI9, together
with instructions on usage. An API key from OpenAI is needed to start the tool and generate
answers. A screencast that describes the tool is available on YouTube10.</p>
          <p>The primary limitation of our tool is its reliance on pre-configured LLM instructions, which
may not cover all user queries. The implementation is also constrained by the LLM performance
and the eficiency of data retrieval processes. Response times can afect user experience, and
result accuracy depends on event log data quality and predefined queries.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Conclusion</title>
      <p>The conversational interface integrated with Kronos helps users explore waiting time causes
and obtain redesign suggestions. Using OpenAI’s GPT-4 Turbo model, it provides dynamic
responses to queries about waiting time causes and process redesigns. Structured instructions
and function calling enable data retrieval from multiple sources to generate relevant responses.
The interface supports iterative question-answering, maintaining context across sessions.
Acknowledgments Work funded by the European Research Council (PIX project).</p>
      <sec id="sec-3-1">
        <title>8https://github.com/AutomatedProcessImprovement/waiting-time-frontend</title>
        <p>9https://github.com/AutomatedProcessImprovement/waiting-time-backend
10https://youtu.be/ScxjMnjqPc8</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>K.</given-names>
            <surname>Lashkevich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Milani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chapela-Campa</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Suvorau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <article-title>Why am I waiting? Data-driven analysis of waiting times in business processes</article-title>
          , in: CAiSE, Springer,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>W. M. P. van der Aalst</surname>
          </string-name>
          , Process Mining: Data Science in Action, 2nd ed., Springer,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Ali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Milani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <article-title>Data-driven identification and analysis of waiting times in business processes: A systematic literature review</article-title>
          ,
          <source>Bus. Inf. Syst. Eng</source>
          . (
          <year>2024</year>
          ). In press, https://doi.org/10.1007/s12599-024-00868-5.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>K.</given-names>
            <surname>Lashkevich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Milani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chapela-Campa</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Suvorau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <article-title>Kronos: Discovery and analysis of waiting time causes</article-title>
          .,
          <source>in: ICPM Doctoral Consortium/Demo</source>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>I. Halenok</surname>
          </string-name>
          ,
          <source>Business process simulation with diferentiated resources</source>
          ,
          <year>2023</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>O.</given-names>
            <surname>López-Pintado</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dumas</surname>
          </string-name>
          ,
          <article-title>Business process simulation with diferentiated resources: Does it make a diference?</article-title>
          ,
          <source>in: BPM</source>
          , Springer,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>K.</given-names>
            <surname>Lashkevich</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Milani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Avramenko</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Dumas, LLM-assisted optimization of waiting time in business processes: A prompting approach</article-title>
          ,
          <source>in: BPM 2024</source>
          , Springer,
          <year>2024</year>
          . To appear, preprint available at: https://owncloud.ut.ee/owncloud/s/zy66MaTxQpK7wbk.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>