This paper introduces a flexible Transformer-based model for detecting anomalies in system logs. By embedding log templates with a pre-trained BERT model and incorporating positional and temporal encoding, it captures both semantic and sequential context within log sequences. The approach supports variable sequence lengths and configurable input features, enabling extensive experimentation across datasets. The model performs supervised binary classification to distinguish normal from anomalous patterns, using a [CLS]-like token for sequence-level representation. Overall, it pushes the boundaries of log-based anomaly detection by integrating modern NLP and deep learning techniques into system monitoring.This paper introduces a flexible Transformer-based model for detecting anomalies in system logs. By embedding log templates with a pre-trained BERT model and incorporating positional and temporal encoding, it captures both semantic and sequential context within log sequences. The approach supports variable sequence lengths and configurable input features, enabling extensive experimentation across datasets. The model performs supervised binary classification to distinguish normal from anomalous patterns, using a [CLS]-like token for sequence-level representation. Overall, it pushes the boundaries of log-based anomaly detection by integrating modern NLP and deep learning techniques into system monitoring.

Transformer-Based Anomaly Detection Using Log Sequence Embeddings

2025/11/04 01:52

Abstract

1 Introduction

2 Background and Related Work

2.1 Different Formulations of the Log-based Anomaly Detection Task

2.2 Supervised v.s. Unsupervised

2.3 Information within Log Data

2.4 Fix-Window Grouping

2.5 Related Works

3 A Configurable Transformer-based Anomaly Detection Approach

3.1 Problem Formulation

3.2 Log Parsing and Log Embedding

3.3 Positional & Temporal Encoding

3.4 Model Structure

3.5 Supervised Binary Classification

4 Experimental Setup

4.1 Datasets

4.2 Evaluation Metrics

4.3 Generating Log Sequences of Varying Lengths

4.4 Implementation Details and Experimental Environment

5 Experimental Results

5.1 RQ1: How does our proposed anomaly detection model perform compared to the baselines?

5.2 RQ2: How much does the sequential and temporal information within log sequences affect anomaly detection?

5.3 RQ3: How much do the different types of information individually contribute to anomaly detection?

6 Discussion

7 Threats to validity

8 Conclusions and References

\

3 A Configurable Transformer-based Anomaly Detection Approach

In this study, we introduce a novel transformer-based method for anomaly detection. The model takes log sequences as inputs to detect anomalies. The model employs a pretrained BERT model to embed log templates, enabling the representation of semantic information within log messages. These embeddings, combined with positional or temporal encoding, are subsequently inputted into the transformer model. The combined information is utilized in the subsequent generation of log sequence-level representations, facilitating the anomaly detection process. We design our model to be flexible: The input features are configurable so that we can use or conduct experiments with different feature combinations of the log data. Additionally, the model is designed and trained to handle input log sequences of varying lengths. In this section, we introduce our problem formulation and the detailed design of our method.

\ 3.1 Problem Formulation

We follow the previous works [1] to formulate the task as a binary classification task, in which we train our proposed model to classify log sequences into anomalies and normal ones in a supervised way. For the samples used in the training and evaluation of the model, we utilize a flexible grouping approach to generate log sequences of varying lengths. The details are introduced in Section 4

\ 3.2 Log Parsing and Log Embedding

In our work, we transform log events into numerical vectors by encoding log templates with a pre-trained language model. To obtain the log templates, we adopt the Drain parser [24], which is widely used and has good parsing performance on most of the public datasets [4]. We use a pre-trained sentence-bert model [25] (i.e., all-MiniLML6-v2 [26]) to embed the log templates generated by the log parsing process. The pre-trained model is trained with a contrastive learning objective and achieves state-ofthe-art performance on various NLP tasks. We utilize this pre-trained model to create a representation that captures semantic information of log messages and illustrates the similarity between log templates for the downstream anomaly detection model. The output dimension of the model is 384.

\ 3.3 Positional & Temporal Encoding

The original transformer model [27] adopts a positional encoding to enable the model to make use of the order of the input sequence. As the model contains no recurrence and no convolution, the models will be agnostic to the log sequence without the positional encoding. While some studies suggest that transformer models without explicit positional encoding remain competitive with standard models when dealing with sequential data [28, 29], it is important to note that any permutation of the input sequence will produce the same internal state of the model. As sequential information or temporal information may be important indicators for anomalies within log sequences, previous works that are based on transformer models utilize the standard positional encoding to inject the order of log events or templates in the sequence [11, 12, 21], aiming to detect anomalies associated with the wrong execution order. However, we noticed that in a common-used replication implementation of a transformer-based method [5], the positional encoding was, in fact, omitted. To the best of our knowledge, no existing work has encoded the temporal information based on the timestamps of logs for their anomaly detection method. The effectiveness of utilizing sequential or temporal information in the anomaly detection task is unclear.

\ In our proposed method, we attempt to incorporate sequential and temporal encoding into the transformer model and explore the importance of sequential and temporal information for anomaly detection. Specifically, our proposed method has different variants utilizing the following sequential or temporal encoding techniques. The encoding is then added to the log representation, which serves as the input to the transformer structure.

\

3.3.1 Relative Time Elapse Encoding (RTEE)

We propose this temporal encoding method, RTEE, which simply substitutes the position index in positional encoding with the timing of each log event. We first calculate the time elapse according to the timestamps of log events in the log sequence. Instead of using the log event sequence index as the position to sinusoidal and cosinusoidal equations, we use the relative time elapse to the first log event in the log sequence to substitute the position index. Table 1 shows an example of time intervals in a log sequence. In the example, we have a log sequence containing 7 events with a time span of 7 seconds. The elapsed time from the first event to each event in the sequence is utilized to calculate the time encoding for the corresponding events. Similar to positional encoding, the encoding is calculated with the above-mentioned equations 1, and the encoding will not update during the training process.

\

3.4 Model Structure

The transformer is a neural network architecture that relies on the self-attention mechanism to capture the relationship between input elements in a sequence. The transformer-based models and frameworks have been used in the anomaly detection task by many previous works [6, 11, 12, 21]. Inspired by the previous works, we use a transformer encoder-based model for anomaly detection. We design our approach to accept log sequences of varying lengths and generate sequence-level representations. To achieve this, we have employed some specific tokens in the input log sequence for the model to generate sequence representation and identify the padded tokens and the end of the log sequence, drawing inspiration from the design of the BERT model [31]. In the input log sequence, we used the following tokens: is placed at the start of each sequence to allow the model to generate aggregated information for the entire sequence, is added at the end of the sequence to signify its completion, is used to mark the masked tokens under the self-supervised training paradigm, and is used for padded tokens. The embeddings for these special tokens are generated randomly based on the dimension of the log representation used. An example is shown in Figure 1, the time elapsed for , and are set to -1. The log event-level representation and positional or temporal embedding are summed as the input feature of the transformer structure.

\ 3.5 Supervised Binary Classification Under this training objective, we utilize the output of the first token of the transformer model while ignoring the outputs of the other tokens. This output of the first token is designed to aggregate the information of the whole input log sequence, similar to the token of the BERT model, which provides an aggregated representation of the token sequence. Therefore, we consider the output of this token as a sequence-level representation. We train the model with a binary classification objective (i.e., Binary Cross Entropy Loss) with this representation.

\

:::info Authors:

  1. Xingfang Wu
  2. Heng Li
  3. Foutse Khomh

:::

:::info This paper is available on arxiv under CC by 4.0 Deed (Attribution 4.0 International) license.

:::

\

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact service@support.mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Little Pepe (LILPEPE) koers, nu investeren in de lopende presale?

Little Pepe (LILPEPE) koers, nu investeren in de lopende presale?

i Kennisgeving: Dit artikel bevat inzichten van onafhankelijke auteurs en valt buiten de redactionele verantwoordelijkheid van BitcoinMagazine.nl. De informatie is bedoeld ter educatie en reflectie. Dit is geen financieel advies. Doe zelf onderzoek voordat je financiële beslissingen neemt. Crypto is zeer volatiel er zitten kansen en risicos aan deze investering. Je kunt je inleg verliezen. Little Pepe (LILPEPE) is dit jaar uitgegroeid tot een van de meest besproken meme coins. Het project ontwikkelt een eigen Layer 2 blockchain die speciaal is ontworpen voor meme projecten. De presale van LILPEPE startte op 10 juni 2025 en haalde sindsdien meer dan $ 25,9 miljoen bij investeerders op. Tot nu toe was elke fase van de presale ruim voor tijd uitverkocht. Nu zit het project in fase 13 en kun je de tokens aanschaffen voor een prijs van $ 0,0022 per stuk. Little Pepe combineert heel slim de meme cultuur met geavanceerde blockchain technologie. Het team bouwde een EVM-compatibel Layer 2 netwerk dat razendsnelle transacties en vrijwel geen kosten biedt. Daarmee steekt LILPEPE ver boven de typische meme coins uit die op bestaande netwerken draaien. Het project heeft 26,5% van de totale voorraad van 100 miljard tokens gereserveerd voor de presale. Elke nieuwe fase stijgt de token prijs, waardoor deelnemers worden aangemoedigd sneller toe te slaan. Nu al zijn meer dan 15 miljard tokens verkocht en de presale nadert snel het einde. Little Pepe presale blijft sterk presteren De presale heeft sinds de start in juni een stevige groei laten zien. Zo is in meerdere ronden al meer dan $ 25,9 miljoen opgehaald. Ronde 1 startte met een prijs van $ 0,001 per token en was al binnen slechts 72 uur uitverkocht, goed voor bijna $ 500.000. Tijdens de tweede presale fase kostte de coin tussen $ 0,0011 en $ 0,0015 en haalde het project meer dan $ 1,23 miljoen op voordat alles snel uitverkocht was. In ronde 3 steeg de prijs naar $ 0,0012, met een bevestigde exchange listing prijs van $ 0,003. Wie er vroeg bij was, zag daardoor een potentiële winst van 150%. De eerdere presale rondes trokken zoveel belangstelling dat de tokens sneller uitverkochten dan verwacht. Inmiddels hebben meer dan 38.000 mensen deelgenomen. In ronde 13 van de presale staat de token momenteel geprijsd op $ 0,0022. Doordat de prijs bij elke mijlpaal stapsgewijs stijgt, voelt men er vanzelf een soort urgentie bij. Vroege deelnemers hebben zo veel lagere prijzen kunnen pakken dan de huidige kopers. Dankzij deze gefaseerde aanpak blijft de presale de hele periode door spannend en interessant. Belangrijkste kenmerken van Little Pepe’s technologie Little Pepe is de native currency van een gloednieuwe Layer 2 chain, speciaal voor meme coins. De blockchain is razendsnel, extreem goedkoop en sterk beveiligd en vooral aantrekkelijk voor traders en ontwikkelaars. Het netwerk verwerkt transacties in een oogwenk en de gas fees zijn bijna nul. De trades worden niet belast en dat zie je maar zelden bij meme coins. Bovendien is de blockchain beschermd tegen sniper bots, zodat kwaadaardige bots geen kans krijgen om presale lanceringen te manipuleren. Ontwikkelaars kunnen dankzij EVM-compatibiliteit heel eenvoudig smart contracts en meme tokens bouwen en lanceren. De infrastructuur is opgezet als hét centrale platform voor meme-innovatie, met on-chain communitytools en governance-opties. “Pepe’s Pump Pad” is het launchpad voor de meme tokens van het project. Tokens die hier worden gelanceerd, hebben ingebouwde anti-scam beveiligingen en liquidity locks worden automatisch toegepast om rug pulls te voorkomen. Zo kunnen makers nieuwe meme tokens lanceren zonder zich zorgen te maken over veiligheidsrisico’s. Is LILPEPE de beste crypto presale om nu te kopen? Little Pepe is de allereerste Layer 2 blockchain die volledig draait om memes. Dat geeft het project een unieke plek in de drukke wereld van meme coins. Het doel is om de “meme verse” te worden: een plek waar meme projecten kunnen lanceren, verhandelen en echt groeien. Het succes van de presale laat zien dat er veel interesse is voor deze aanpak. In de vroege fases waren de fase binnen 72 uur uitverkocht en zelfs de latere fases gingen sneller dan gepland. Met meer dan $ 25,9 miljoen dat is opgehaald, is er veel vertrouwen in deze meme coin. Little Pepe staat technisch stevig dankzij zijn Layer 2 infrastructuur. Het project heeft een CertiK security audit doorstaan, wat het vertrouwen van investeerders aanzienlijk versterkt. Als je naar de listings op CoinMarketCap en CoinGecko kijkt, is duidelijk te zien dat het project ook buiten de meme community steeds meer erkenning krijgt. Little Pepe is volgens analisten dan ook een van de meest veelbelovende meme coins voor 2025. De combinatie van meme cultuur en echte functionaliteit, maakt deze meme coin betrouwbaarder en waardevoller dan de meeste puur speculatieve tokens. Dankzij de snelle presale en het innovatieve ecosysteem is Little Pepe klaar om zich als serieuze speler in de wereld van meme coins te vestigen. Het project werkt volgens een roadmap met onder andere exchange listings, staking en uitbreiding van het ecosysteem. Door LILPEPE tokens te listen op grote gecentraliseerde exchanges, wordt het voor iedereen makkelijker om te traden en neemt de liquiditeit flink toe. Mega Giveaway campagne vergroot betrokkenheid community Little Pepe is gestart met een Mega Giveaway om de community te belonen voor hun deelname. De Mega Giveaway richt zich op de deelnemers die tijdens fases 12 tot en met 17 de meeste LILPEPE tokens hebben gekocht. De grootste koper wint 5 ETH, de tweede plaats ontvangt 3 ETH en de derde plaats 2 ETH. Ook worden 15 willekeurige deelnemers elk met 0,5 ETH beloond. Iedereen die LILPEPE bezit kan meedoen. Dat gaat heel handig. Je vult je ERC20-wallet adres in en voert een paar social media opdrachten uit. Deze actie moet gedurende de presale voor extra spanning en een gevoel van urgentie om snel mee te doen gaan zorgen, zowel aan de giveaway als aan de presale. De giveaway loopt dan ook tot fase 17 volledig is uitverkocht. De community blijft op alle platforms hard doorgroeien. Tijdens de giveaway is de activiteit op social media flink omhooggeschoten. Zo’n betrokkenheid is vaak een goed teken dat een meme coin op weg is naar succes. Little Pepe analyse koers verwachting De tokens van Little Pepe gaan tijdens fase 13 voor $ 0,0022 over de toonbank. De listing prijs op de exchanges is bevestigd op $ 0,003 en kan de deelnemers aan de presale mooie winsten kan opleveren. Volgens analisten kan de prijs van LILPEPE tegen het einde van 2025 naar $ 0,01 stijgen. Dit zou het project een marktwaarde van $ 1 miljard kunnen geven. Deze voorspelling gaat uit van een sterke cryptomarkt en van succesvolle exchange listings. Voor 2026 lopen de koers verwachtingen voor LILPEPE sterk uiteen. Als de cryptomarkt blijft stijgen, zou de token $ 0,015 kunnen bereiken. Maar als de markt instort en een bear market toeslaat, kan de prijs terugvallen naar $ 0,0015. Dat is een groot verschil, maar zo werkt crypto nu eenmaal. Zeker bij meme coins, omdat ze sterk reageren op de marktsfeer. Op de lange termijn, richting het jaar 2030, wijzen sommige verwachtingen op prijzen van $ 0,03 in gunstige scenario’s. Dat gaat uit van een succesvolle aanname van Layer 2 en verdere groei van de meme coin sector. Voorzichtige schattingen plaatsen de prijs in 2030 rond $ 0,0095. Zelfs een klein stukje van de marktwaarde van grote meme coins kan volgens experts al voor flinke winsten zorgen. Sommige analisten verwachten dat de opbrengsten zelfs 15.000% tot 20.000% kunnen bereiken als Little Pepe hetzelfde succes haalt als eerdere populaire meme coins. Doe mee aan de Little Pepe presale Wil je erbij zijn? Ga naar de officiële website van de coin om mee te doen aan de presale. Tijdens de huidige fase kost een token $ 0,0022 en je kunt eenvoudig betalen met ETH of USDT via je wallet. Je kunt aan de presale deelnemen met MetaMask of Trust Wallet. Verbind je wallet eenvoudig met de officiële website en zorg dat je voldoende ETH of USDT hebt om het gewenste aantal tokens te kopen. De presale accepteert ERC-20 tokens op het Ethereum netwerk. Na aankoop kun je je tokens claimen zodra alle presale rondes zijn afgerond. Alle informatie over het claimen vind je via de officiële website en communicatiekanalen. NEEM NU DEEL AAN DE LITTLE PEPE ($ LILPEPE) PRESALE Website    |    (X) Twitter    |  Telegram i Kennisgeving: Dit artikel bevat inzichten van onafhankelijke auteurs en valt buiten de redactionele verantwoordelijkheid van BitcoinMagazine.nl. De informatie is bedoeld ter educatie en reflectie. Dit is geen financieel advies. Doe zelf onderzoek voordat je financiële beslissingen neemt. Crypto is zeer volatiel er zitten kansen en risicos aan deze investering. Je kunt je inleg verliezen. Het bericht Little Pepe (LILPEPE) koers, nu investeren in de lopende presale? is geschreven door Redactie en verscheen als eerst op Bitcoinmagazine.nl.
Share
Coinstats2025/09/18 18:50