<!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>Workshop on Artificial Intelligence and Formal Verification, Logic, Automata, and Synthesis,
November</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards Machine Learning Enhanced LTL Monitoring</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Geatti</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Angelo Montanari</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nicola Saccomanno</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>University of Udine</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>7</volume>
      <issue>2023</issue>
      <fpage>0000</fpage>
      <lpage>0002</lpage>
      <abstract>
        <p>In this work, we outline an extension of a recently proposed framework for failure detection that additionally supports the detection of anomalies and drops of performance of a given system. The extended framework is based on a tight integration of monitoring with unsupervised learning techniques, that are used to generate formulas able to capture possible deviations from the normal behaviour of the system or early signs of degradation phenomena. Other improvements to the framework are proposed like, for instance, the use of canonical forms for the safety and cosafety (monitorable) fragments of temporal logics and the support for assumption-based runtime verification.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Runtime verification</kwd>
        <kwd>Monitoring</kwd>
        <kwd>Anomaly detection</kwd>
        <kwd>Machine learning</kwd>
        <kwd>Interpretability</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        bugs. To overcome these limitations, a framework has been recently proposed with the objective
of automatically discovering new relevant properties to be used to detect system’s failures
by means of a monitoring algorithm [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Specifically, machine learning is relied upon to
automatically synthesize, in an iterative fashion, new relevant properties, starting from the
verdicts of the monitors built from a pool of already considered formulas. This pairing of
monitoring with machine learning proved itself to be very efective, making it possible to learn
properties that characterize failures and their prelude increasingly in advance. Most importantly,
being (temporal) formulas, the new properties that are discovered are inherently interpretable:
this allows the system experts to easily understand what characterizes each failure event even
in the case of properties automatically synthesized by the framework.
      </p>
      <p>
        In this contribution, we conceptually extend the framework introduced in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] along the
following lines: (i) the new version of the framework must deal with anomalies and drops of performance
instead of only failure events; (ii) being failures treated as catastrophic/trace-terminating while
anomalies and drops of performance are not, the framework shall rely on unsupervised and
self-supervised learning techniques; (iii) the framework shall use specific canonical forms of the
safety and the cosafety fragments of temporal logics so to generate only properties that are
monitorable and accommodate unbounded fragments of temporal logics; and, (iv) the
framework must be modular with respect to the specification language and the backends used for
monitoring and learning tasks, while preserving its key peculiarities, such as, for instance, the
interpretability of the results.
      </p>
      <p>The structure of this extended abstract is as follows: Section 2 gives a short account of the
original framework, Section 3 describes the proposed improvements, and Section 4 concludes
by outlining potential future directions and open problems.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The original framework</title>
      <p>During both phases,  is iteratively refined by (i) adding new formulas which are able to
predict bad behaviors earlier and with increased reliability and coverage, and (ii) removing
formulas that are ill-behaved or redundant. In addition to this automatic refinement process,
at any time, domain experts can, in principle, make changes to the pool , e.g., by manually
specifying a new formula encoding a bad behavior.</p>
      <p>The core of the formula extraction process is a multi-objective evolutionary algorithm (EA),
designed to perform a genetic programming (GP) task. Each time a formula in  triggers,
the currently observed system subtrace is passed to the EA, which splits it into a normal
behavior prefix and failure sufix . Then, after a data augmentation phase, the formula that best
discriminates between good and failure behaviours is generated.</p>
    </sec>
    <sec id="sec-3">
      <title>3. The new framework</title>
      <p>In this section, we discuss the distinctive features of the extended framework we are developing.</p>
      <p>Anomaly detection. Anomalies are events that deviate from the nominal system’s behavior,
but are not catastrophic. Their detection is of utmost importance since it can point out a possible
onset of a catastrophic event (e.g., a failure) to the system expert, who can then take necessary
actions. They are thus of interest in the context of predictive maintenance [9, 10]. It is worth
highlighting that the concept of anomaly is strictly more general and complex than that of
failure. In fact, anomalies can be unbounded in the future, can occur several times in a trace
with a diferent duration, can be of diferent types, and apply to domains beyond predictive
maintenance (e.g., sleep apnea in healthcare [11]). The forthcoming version of the framework, in
addition to failure detection, has to be able to detect anomalies as well as drops of performance.</p>
      <p>Unsupervised and self-supervised learning backends. The original version of the
framework relies on a supervised learning paradigm: a dataset of system traces labeled as
failure or good behaviour ones is used to guide the first (so-called warmup) stage of formula
extraction, following a teacher-forcing approach borrowed from the deep learning realm. The
choice of such a learning paradigm is justified by the fact that failures are terminating event,
thus, always detectable. The new version of the framework has to work also in a self-supervised
fashion to deal with anomalies. Characterizing a priori anomalies in modern complex systems
is impractical, given the multitude of heterogeneous sensors to be considered and the fact
that systems evolve continuously over time, leading to previously unobserved anomalies. This
scenario implies that configuring the problem as supervised, i.e., assuming that one may have
a complete and exhaustive dataset of labelled anomalies, would be unrealistic and unfeasible.
To solve such an issue, we plan to use deep learning based state-of-the-art approaches capable
to perform self-supervised anomaly detection [12] as a source of supervision to the algorithm
in charge of learning temporal formulas. It is worth noticing that interpretability is preserved,
since the output of the learning step would still be a formula.</p>
      <p>Specification language. As for the specification language to be used both to encode and to
(automatically) synthesize new properties, we plan to resort to two fragments of Linear Temporal
Logic with Past (LTL+P), namely, the safety and cosafety fragments [13]. In particular, we will
focus on their canonical forms G(pLTL) and F(pLTL) [14]. This has a number of advantages:
• it avoids the specification and synthesis of formulas that are non-monitorable, since all
formulas of G(pLTL) and F(pLTL) belong to the monitorable class [15];
• in contrast to the bounded fragment used in the previous version of the framework,
formulas of G(pLTL) and F(pLTL) can constrain an arbitrary time window of a trace;
• from formulas of G(pLTL) and F(pLTL), it is possible to generate deterministic symbolic
automata that can be used as monitors and that, in the average case, are exponentially
more succinct than classical monitors [16];
• the usage of these fragments can shrink the search space of the learning algorithms,
leading to a faster generation of (better) formulas, acting as an inductive bias [17, 18].</p>
      <p>Assumption-based runtime verification. Recently, Assumption-Based Runtime Verification
(ABRV, [19]) has been introduced as a variant of standard monitoring to deal with systems that
are only partially observable. While classical monitoring restricts itself to observable parts of
the system and treat the non-observable ones as black boxes, ABRV exploits the fact that in
practice one always knows something about the internal (non-observable) parts of the system
in form of assumptions that the domain expert can specify before monitoring. As shown in [19],
ABRV has the advantage to reach conclusive verdicts with shorter trace’s prefixes. It is thus
promising to include the assumption-based variant of monitoring in the framework.</p>
      <p>Modularity. We require the framework to be modular in at least the following dimensions:
(i) the specification language; (ii) the backend implementing the monitoring algorithm; (iii) the
backend for the learning of new properties. As for the specification language, the framework
shall support diferent temporal logics including LTL, STL, and ITL (Interval Temporal Logic),
accommodating for both the qualitative semantics (for tasks like failure detection) and the
quantitative one (for tasks like anomaly detection), where appropriate. Modularity of the
learning backend allows one to seamlessly move across learning paradigms and tasks (e.g.,
failure and anomaly detection). Moreover, it allows one to consider a diferent solution than
GP for formula extraction (which is limited by bloat, huge search space, tree based formula
representation, etc.), like the integration with reinforcement learning or generative AI [20];
alternatively, formulas can be represented as graphs, enabling the usage of Graph Neural
Networks [21]. Finally, a modular monitoring backend is important for implementing new,
modern techniques that have been proposed in the literature [19, 22].</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusions, open problems, and future research directions</title>
      <p>
        In this abstract, we discussed an extension of the framework proposed in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Its cornerstone
features are (i) interpretable failure/anomaly detection, (ii) unsupervised/self-supervised learning,
(iii) theoretically sound formulation, and (iv) modularity.
      </p>
      <p>Besides implementing the described features, future research directions concern: managing
contradictions and tautologies in the monitoring pool, e.g., by using solutions from Inductive
Logic Programming [23]; providing estimation for the remaining useful life; supporting the
existence of multiple, parallel pools of formulas; and, investigating the usage of the framework
in other tasks and domains, such as, for instance, detecting biases and inconsistencies in ground
truth labels over temporal data in healthcare, leveraging its interpretability.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>The authors would like to thank Andrea Brunello for many useful discussions about the paper.
All the authors acknowledge the support from the 2023 Italian INdAM-GNCS project “Analisi
simbolica e numerica di sistemi ciberfisici”, ref. no. CUP E53C22001930001. Luca Geatti and
Angelo Montanari also acknowledge the support from the Interconnected Nord-Est Innovation
Ecosystem (iNEST), which received funding from the European Union Next-GenerationEU
(PIANO NAZIONALE DI RIPRESA E RESILIENZA (PNRR) – MISSIONE 4 COMPONENTE 2,
INVESTIMENTO 1.5 – D.D. 1058 23/06/2022, ECS00000043) (the manuscript reflects only the
authors’ views and opinions, neither the European Union nor the European Commission can be
considered responsible for them). Finally, Angelo Montanari acknowledge the support from
the MUR PNRR project FAIR - Future AI Research (PE00000013) also funded by the European
Union NextGenerationEU.
volume 12302 of Lecture Notes in Computer Science, Springer, 2020, pp. 564–571. URL:
https://doi.org/10.1007/978-3-030-59152-6_34. doi: 10.1007/978-3-030-59152-6_34.
[9] R. K. Mobley, An introduction to predictive maintenance, Elsevier, 2002.
[10] T. Zonta, C. A. Da Costa, R. da Rosa Righi, M. J. de Lima, E. S. da Trindade, G. P. Li,
Predictive maintenance in the industry 4.0: A systematic literature review, Computers &amp;
Industrial Engineering 150 (2020) 106889.
[11] A. Bernardini, A. Brunello, G. L. Gigli, A. Montanari, N. Saccomanno, AIOSA: an approach
to the automatic identification of obstructive sleep apnea events based on deep learning,
Artif. Intell. Medicine 118 (2021) 102133. URL: https://doi.org/10.1016/j.artmed.2021.102133.
doi: 10.1016/j.artmed.2021.102133.
[12] H. Hojjati, T. K. K. Ho, N. Armanfard, Self-supervised anomaly detection: A survey and
outlook, CoRR abs/2205.05173 (2022). URL: https://doi.org/10.48550/arXiv.2205.05173.
doi: 10.48550/arXiv.2205.05173. arXiv:2205.05173.
[13] A. P. Sistla, On characterization of safety and liveness properties in temporal logic, in:
Proceedings of the fourth annual ACM symposium on Principles of distributed computing,
1985, pp. 39–48. doi: 10.1145/323596.323600.
[14] E. Y. Chang, Z. Manna, A. Pnueli, Characterization of temporal property classes, in:
W. Kuich (Ed.), Proceedings of the 19th International Colloquium on Automata, Languages
and Programming, volume 623 of Lecture Notes in Computer Science, Springer, 1992, pp.
474–486. doi: 10.1007/3-540-55719-9_97.
[15] A. Bauer, M. Leucker, C. Schallhart, Runtime verification for ltl and tltl, ACM
Transactions on Software Engineering and Methodology (TOSEM) 20 (2011) 1–64.
doi: 10.1007/BF01068590.
[16] A. Cimatti, L. Geatti, N. Gigante, A. Montanari, S. Tonetta, Extended bounded response LTL:
a new safety fragment for eficient reactive synthesis, Formal Methods in System Design
(2021) 1–49 (published online on November 18, 2021, doi: 10.1007/s10703–021–00383–3).
[17] D. F. Gordon, M. Desjardins, Evaluation and selection of biases in machine learning,</p>
      <p>Machine learning 20 (1995) 5–22.
[18] T. M. Mitchell, The need for biases in learning generalizations (1980).
[19] A. Cimatti, C. Tian, S. Tonetta, Assumption-based runtime verification, Formal
Methods Syst. Des. 60 (2022) 277–324. URL: https://doi.org/10.1007/s10703-023-00416-z.
doi: 10.1007/s10703-023-00416-z.
[20] S. Holt, Z. Qian, M. van der Schaar, Deep generative symbolic regression, in: The Eleventh
International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May
1-5, 2023, OpenReview.net, 2023. URL: https://openreview.net/pdf?id=o7koEEMA1bR.
[21] T. N. Kipf, M. Welling, Semi-supervised classification with graph convolutional networks,
in: 5th International Conference on Learning Representations, ICLR 2017, Toulon, France,
April 24-26, 2017, Conference Track Proceedings, OpenReview.net, 2017. URL: https:
//openreview.net/forum?id=SJU4ayYgl.
[22] X. Qin, J. V. Deshmukh, Clairvoyant monitoring for signal temporal logic, in: N. Bertrand,
N. Jansen (Eds.), Formal Modeling and Analysis of Timed Systems - 18th International
Conference, FORMATS 2020, Vienna, Austria, September 1-3, 2020, Proceedings, volume
12288 of Lecture Notes in Computer Science, Springer, 2020, pp. 178–195. URL: https://doi.
org/10.1007/978-3-030-57628-8_11. doi: 10.1007/978-3-030-57628-8_11.
[23] L. D. Raedt, Inductive logic programming, in: C. Sammut, G. I. Webb (Eds.), Encyclopedia
of Machine Learning and Data Mining, Springer, 2017, pp. 648–656. URL: https://doi.org/
10.1007/978-1-4899-7687-1_135. doi: 10.1007/978-1-4899-7687-1_135.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>I.</given-names>
            <surname>Cassar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Francalanza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Aceto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ingólfsdóttir</surname>
          </string-name>
          ,
          <article-title>A survey of runtime monitoring instrumentation techniques</article-title>
          , in: A.
          <string-name>
            <surname>Francalanza</surname>
            ,
            <given-names>G. J.</given-names>
          </string-name>
          <string-name>
            <surname>Pace</surname>
          </string-name>
          (Eds.), Proceedings Second International Workshop on Pre- and
          <string-name>
            <surname>Post-Deployment Verification</surname>
            <given-names>Techniques</given-names>
          </string-name>
          ,
          <source>PrePost@iFM</source>
          <year>2017</year>
          , Torino, Italy, 19
          <source>September</source>
          <year>2017</year>
          , volume
          <volume>254</volume>
          <source>of EPTCS</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>15</fpage>
          -
          <lpage>28</lpage>
          . URL: https://doi.org/10.4204/EPTCS.254.2. doi:
          <fpage>10</fpage>
          .4204/EPTCS.254.2.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>Aceto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Achilleos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Francalanza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ingólfsdóttir</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lehtinen</surname>
          </string-name>
          ,
          <article-title>An operational guide to monitorability with applications to regular properties</article-title>
          ,
          <source>Softw. Syst. Model</source>
          .
          <volume>20</volume>
          (
          <year>2021</year>
          )
          <fpage>335</fpage>
          -
          <lpage>361</lpage>
          . URL: https://doi.org/10.1007/s10270-020-00860-z. doi:
          <fpage>10</fpage>
          .1007/s10270-020-00860-z.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Leucker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Schallhart</surname>
          </string-name>
          ,
          <article-title>A brief account of runtime verification</article-title>
          ,
          <source>The Journal of Logic and Algebraic Programming</source>
          <volume>78</volume>
          (
          <year>2009</year>
          )
          <fpage>293</fpage>
          -
          <lpage>303</lpage>
          . doi:
          <fpage>10</fpage>
          .1016/j.jlap.
          <year>2008</year>
          .
          <volume>08</volume>
          .004.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Clarke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. A.</given-names>
            <surname>Henzinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Veith</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Bloem</surname>
          </string-name>
          , Handbook of model checking, volume
          <volume>10</volume>
          , Springer,
          <year>2018</year>
          . doi:
          <fpage>10</fpage>
          .1007/978-3-
          <fpage>319</fpage>
          -10575-8.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>A.</given-names>
            <surname>Pnueli</surname>
          </string-name>
          ,
          <article-title>The temporal logic of programs</article-title>
          ,
          <source>in: 18th Annual Symposium on Foundations of Computer Science</source>
          (sfcs
          <year>1977</year>
          ), IEEE,
          <year>1977</year>
          , pp.
          <fpage>46</fpage>
          -
          <lpage>57</lpage>
          . doi:
          <fpage>10</fpage>
          .1109/SFCS.
          <year>1977</year>
          .
          <volume>32</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Donzé</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Maler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Bartocci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Nickovic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Grosu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Smolka</surname>
          </string-name>
          ,
          <article-title>On temporal logic and signal processing</article-title>
          , in: S. Chakraborty, M. Mukund (Eds.),
          <source>Automated Technology for Verification and Analysis - 10th International Symposium, ATVA</source>
          <year>2012</year>
          , Thiruvananthapuram, India, October 3-
          <issue>6</issue>
          ,
          <year>2012</year>
          . Proceedings, volume
          <volume>7561</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2012</year>
          , pp.
          <fpage>92</fpage>
          -
          <lpage>106</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -33386-
          <issue>6</issue>
          _9. doi:
          <fpage>10</fpage>
          .1007/978-3-
          <fpage>642</fpage>
          -33386-
          <issue>6</issue>
          _
          <fpage>9</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Brunello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. D.</given-names>
            <surname>Monica</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Saccomanno</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Urgolo</surname>
          </string-name>
          ,
          <article-title>Monitors that learn from failures: Pairing STL and genetic programming</article-title>
          ,
          <source>IEEE Access 11</source>
          (
          <year>2023</year>
          )
          <fpage>57349</fpage>
          -
          <lpage>57364</lpage>
          . URL: https://doi.org/10.1109/ACCESS.
          <year>2023</year>
          .
          <volume>3277620</volume>
          . doi:
          <fpage>10</fpage>
          .1109/ACCESS.
          <year>2023</year>
          .
          <volume>3277620</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>D.</given-names>
            <surname>Nickovic</surname>
          </string-name>
          , T. Yamaguchi,
          <article-title>RTAMT: online robustness monitors from STL</article-title>
          , in: D. V.
          <string-name>
            <surname>Hung</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          Sokolsky (Eds.),
          <source>Automated Technology for Verification and Analysis - 18th International Symposium, ATVA</source>
          <year>2020</year>
          , Hanoi, Vietnam,
          <source>October 19-23</source>
          ,
          <year>2020</year>
          , Proceedings,
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>