<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Tolga Ustunkok</title>
  <link>http://ustunkok.com.tr</link>
  <description>Personal blog by Tolga Ustunkok</description>
  <language>en</language>
  <lastBuildDate>Mon, 13 Jul 2026 11:37:14 +0000</lastBuildDate>
<item>
  <title>AIOps on Observability and Recent Trends: A Literature Review</title>
  <link>http://ustunkok.com.tr/posts/aiops-on-observability-and-recent-trends-a-literature-review</link>
  <description>AIOps (&quot;Artificial Intelligence for IT Operations&quot;) is the application of machine learning and, increasingly, large language models (LLMs) to observability telemetry — metrics, logs, traces, and events — in order to detect anomalies, reduce alert noise, correlate signals, and localize root causes faster than manual operation sallow. This note surveys the principal method families for anomaly detection, clustering and correlation, and root-cause analysis (RCA), then traces developments from 2021–2025:transformer and foundation models for time series, LLM-based log/telemetry analysis,eBPF-native instrumentation, and the consolidation of OpenTelemetry as the vendor-neutral standard. Each substantive technical claim is tied to a primary source (arXiv ID/DOI orofficial docs). Where a claim could not be verified against a primary source, it is flagged explicitly in the text.</description>
  <pubDate>Mon, 13 Jul 2026 11:37:14 +0000</pubDate>
  <guid isPermaLink="true">http://ustunkok.com.tr/posts/aiops-on-observability-and-recent-trends-a-literature-review</guid>
  <content:encoded><![CDATA[<h2>1. Context and Definition</h2>
<p><strong>Observability</strong> is the property of a system whose internal state can be inferred from its external outputs. In modern distributed/microservice systems these outputs are commonly grouped into the "three pillars" — <strong>metrics</strong> (numeric time series such as CPU, latency,request rate), <strong>logs</strong> (semi-structured text events), and <strong>traces</strong> (causal request paths across services) — with <strong>events</strong> (deployments, config changes, alerts) as afourth, cross-cutting signal. The OpenTelemetry specification defines these signal typesand their data models directly (<a href="https://opentelemetry.io/docs/">OpenTelemetry docs</a>).</p>
<p><strong>AIOps</strong>, a term popularized by Gartner (industry analyst, not a primary technical source — flagged), refers to platforms that apply analytics and ML to operations data to automate detection, correlation, and remediation. The practical driver for applying ML at scale is volume and velocity: cloud-native systems emit telemetry at cardinalities and rates that exceed human triage capacity, and static thresholds generalize poorly across seasonal, multi-tenant, and rapidly-deploying workloads. The AIOps problem is therefore dominated by <strong>unsupervised / weakly-supervised</strong> learning, because ground-truth incident labels are scarce, delayed, and noisy.</p>
<hr />
<h2>2. Anomaly Detection Methods</h2>
<h3>2.1 Statistical / classical</h3>
<p>The oldest and still widely deployed family models the "normal" signal explicitly and
flags deviations.</p>
<ul>
<li><strong>Moving averages / EWMA</strong>: an exponentially weighted mean <span class="arithmatex">\(\hat{x}_t = \alpha x_t + (1-\alpha)\hat{x}_{t-1}\)</span> with residual thresholding.</li>
<li><strong>Holt-Winters</strong> triple exponential smoothing captures level, trend, and seasonality; it underpins many production forecasters (e.g., historically in RRDtool/Graphite).</li>
<li><strong>ARIMA</strong> (<span class="arithmatex">\(ARIMA(p,d,q)\)</span>) models autocorrelation of a differenced series; anomalies are points with large forecast residuals.</li>
<li><strong>Seasonal decomposition</strong> (classical and <strong>STL</strong>, Cleveland et al., 1990, <em>J. Official Statistics</em>) separates <span class="arithmatex">\(x_t = T_t + S_t + R_t\)</span>; anomalies are outliers in the remainder <span class="arithmatex">\(R_t\)</span>. Twitter's <code>AnomalyDetection</code> package built on STL + generalized ESD is a well-known open-source instance (repo, not peer-reviewed — flagged).</li>
<li><strong>3-sigma / MAD</strong>: flag points beyond <span class="arithmatex">\(\mu \pm 3\sigma\)</span>, or robustly beyond a Median Absolute Deviation multiple.</li>
</ul>
<p>These methods are cheap, interpretable, and strong baselines; they struggle with multivariate dependence and non-stationary regime changes.</p>
<h3>2.2 Traditional ML</h3>
<ul>
<li><strong>Isolation Forest</strong> (Liu, Ting, Zhou, ICDM 2008, <a href="https://doi.org/10.1109/ICDM.2008.17">DOI:10.1109/ICDM.2008.17</a>) isolates anomalies via random partitioning; anomalies require fewer splits (shorter path length).</li>
<li><strong>One-Class SVM</strong> (Schölkopf et al., 2001, <em>Neural Computation</em>, <a href="https://doi.org/10.1162/089976601750264965">DOI:10.1162/089976601750264965</a>) learns a boundary enclosing normal data in a kernel feature space.</li>
<li><strong>Clustering-based outlier detection</strong> with <strong>k-means</strong> or <strong>DBSCAN</strong> (Ester et al., KDD 1996) flags points far from any dense cluster; <strong>LOF</strong> (Breunig et al., SIGMOD 2000, <a href="https://doi.org/10.1145/342009.335388">DOI:10.1145/342009.335388</a>) scores local density deviation.</li>
</ul>
<h3>2.3 Deep learning</h3>
<ul>
<li><strong>LSTM/GRU</strong> forecasting + residual thresholding for sequences; the LSTM approach to system-log anomaly detection is exemplified by <strong>DeepLog</strong> (see §2.5).</li>
<li><strong>Autoencoders / VAE</strong>: reconstruction error as anomaly score. <strong>OmniAnomaly</strong> (Su et al., KDD 2019, <a href="https://doi.org/10.1145/3292500.3330672">DOI:10.1145/3292500.3330672</a>) uses a stochastic recurrent VAE for multivariate metrics and popularized the SMD/SMAP/MSL benchmarks.</li>
<li><strong>CNN for time series</strong> (dilated/temporal convolutions) and <strong>Seq2Seq</strong> encoder–decoder models for forecasting-based detection.</li>
<li><strong>LSTM-VAE</strong> and GAN-based detectors (e.g., <strong>MAD-GAN</strong>, Li et al., 2019) extend this reconstruction paradigm.</li>
</ul>
<h3>2.4 Modern / SOTA (2021–2025)</h3>
<p>Transformers dominate long-horizon multivariate forecasting and, adapted, anomaly detection:</p>
<ul>
<li><strong>Informer</strong> (Zhou et al., AAAI 2021, <a href="https://arxiv.org/abs/2012.07436">arXiv:2012.07436</a>) — ProbSparse attention for long-sequence forecasting. <em>(verified)</em></li>
<li><strong>Autoformer</strong> (Wu et al., NeurIPS 2021, <a href="https://arxiv.org/abs/2106.13008">arXiv:2106.13008</a>) — decomposition + Auto-Correlation. <em>(verified)</em></li>
<li><strong>PatchTST</strong> (Nie et al., ICLR 2023, <a href="https://arxiv.org/abs/2211.14730">arXiv:2211.14730</a>) — patching + channel independence ("a time series is worth 64 words"). <em>(verified)</em></li>
<li><strong>TimesNet</strong> (Wu et al., ICLR 2023, <a href="https://arxiv.org/abs/2210.02186">arXiv:2210.02186</a>) — reshapes 1D series into 2D by periodicity for general analysis incl. anomaly detection. <em>(verified)</em></li>
<li><strong>Anomaly Transformer</strong> (Xu et al., ICLR 2022, <a href="https://arxiv.org/abs/2110.02642">arXiv:2110.02642</a>) — association-discrepancy criterion. <em>(verified)</em></li>
<li><strong>TranAD</strong> (Tuli et al., VLDB 2022, <a href="https://arxiv.org/abs/2201.07284">arXiv:2201.07284</a>) — deep transformer with adversarial training for multivariate anomaly detection. <em>(verified)</em></li>
<li><strong>Diffusion / LLM-based</strong>: diffusion models and reprogrammed LLMs are emerging for forecasting/imputation (see §5 foundation models).</li>
<li><strong>Graph neural networks</strong> for multivariate metrics model inter-series dependency; <strong>GDN</strong> (Deng &amp; Hooi, AAAI 2021, <a href="https://arxiv.org/abs/2106.06947">arXiv:2106.06947</a>) learns a graph over sensors and flags edge-deviation. <strong>MTAD-GAT</strong> (Zhao et al., ICDM 2020) uses dual graph-attention.</li>
</ul>
<blockquote>
<p><strong>Caveat on transformer AD benchmarks.</strong> Several works (e.g., "revisiting time-series anomaly detection" critiques, 2022–2023) argue that popular point-adjustment evaluation inflates scores; comparative rankings should be read with this in mind. I have not re-verified individual leaderboard numbers here.</p>
</blockquote>
<h3>2.5 Unsupervised log anomaly detection</h3>
<ul>
<li><strong>Drain</strong> (He et al., ICWS 2017, <a href="https://doi.org/10.1109/ICWS.2017.13">DOI:10.1109/ICWS.2017.13</a>) — fixed-depth parse tree for online log-template extraction. <em>(Venue ICWS 2017 verified via Crossref.)</em></li>
<li><strong>DeepLog</strong> (Du et al., CCS 2017, <a href="https://doi.org/10.1145/3133956.3134015">DOI:10.1145/3133956.3134015</a>) — LSTM over log-key sequences; predicts next key and flags surprises.</li>
<li><strong>LogAnomaly</strong> (Meng et al., IJCAI 2019, <a href="https://doi.org/10.24963/ijcai.2019/658">DOI:10.24963/ijcai.2019/658</a>) — template2vec semantic embeddings + sequential + quantitative modeling.</li>
<li><strong>LogRobust</strong> (Zhang et al., ESEC/FSE 2019, <a href="https://doi.org/10.1145/3338906.3338931">DOI:10.1145/3338906.3338931</a>) — attention-BiLSTM robust to log instability/evolution.</li>
<li><strong>Log-template clustering</strong> (LogCluster, LKE) groups templates to reduce dimensionality before detection.</li>
</ul>
<p><strong>Comparison table.</strong></p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Family</th>
<th>Signal</th>
<th>Supervision</th>
<th>Primary citation</th>
</tr>
</thead>
<tbody>
<tr>
<td>Holt-Winters / ARIMA</td>
<td>Statistical</td>
<td>Metrics</td>
<td>Unsup.</td>
<td>Cleveland et al. 1990 (STL); Box–Jenkins</td>
</tr>
<tr>
<td>Isolation Forest</td>
<td>Traditional ML</td>
<td>Metrics</td>
<td>Unsup.</td>
<td>Liu et al. ICDM 2008</td>
</tr>
<tr>
<td>One-Class SVM</td>
<td>Traditional ML</td>
<td>Metrics</td>
<td>Semi</td>
<td>Schölkopf et al. 2001</td>
</tr>
<tr>
<td>OmniAnomaly (VAE)</td>
<td>Deep</td>
<td>Multivariate</td>
<td>Unsup.</td>
<td>Su et al. KDD 2019</td>
</tr>
<tr>
<td>Informer/Autoformer/PatchTST</td>
<td>Deep (Transformer)</td>
<td>Metrics</td>
<td>Self/Unsup.</td>
<td>2012.07436 / 2106.13008 / 2211.14730</td>
</tr>
<tr>
<td>Anomaly Transformer</td>
<td>Deep (Transformer)</td>
<td>Multivariate</td>
<td>Unsup.</td>
<td>Xu et al. ICLR 2022</td>
</tr>
<tr>
<td>TranAD</td>
<td>Deep (Transformer)</td>
<td>Multivariate</td>
<td>Unsup.</td>
<td>Tuli et al. VLDB 2022</td>
</tr>
<tr>
<td>GDN / MTAD-GAT</td>
<td>GNN</td>
<td>Multivariate</td>
<td>Unsup.</td>
<td>Deng &amp; Hooi 2021</td>
</tr>
<tr>
<td>DeepLog</td>
<td>Deep (LSTM)</td>
<td>Logs</td>
<td>Unsup.</td>
<td>Du et al. CCS 2017</td>
</tr>
<tr>
<td>LogAnomaly / LogRobust</td>
<td>Deep</td>
<td>Logs</td>
<td>Semi/Sup.</td>
<td>IJCAI 2019 / FSE 2019</td>
</tr>
</tbody>
</table>
<hr />
<h2>3. Clustering and Signal Correlation</h2>
<p>Clustering serves two operational goals: <strong>compression</strong> (turn millions of log lines into a few hundred templates) and <strong>noise reduction</strong> (collapse redundant alerts).</p>
<ul>
<li><strong>Log clustering</strong>: Drain (parse-tree), <strong>LogCluster</strong> (Lin et al., ICSE 2016, <a href="https://doi.org/10.1145/2889160.2889232">DOI:10.1145/2889160.2889232</a>) clusters logs to identify problems; <strong>Spell</strong> (Du &amp; Li, ICDM 2016) uses longest-common-subsequence parsing.</li>
<li><strong>Metric clustering</strong>: grouping correlated time series (via correlation/DTW distance) identifies redundant signals and shared failure modes.</li>
<li><strong>Event correlation &amp; alert aggregation</strong>: temporal + topological correlation groups alerts into incidents, reducing "alert storms." Much of this is vendor-implemented; primary technical treatments appear in AIOps-challenge literature rather than product docs.</li>
<li><strong>Trace/span clustering</strong>: clustering trace structures/latency profiles surfaces anomalous request paths in microservice systems.</li>
<li><strong>Incident clustering</strong> — grouping alerts believed to share a root cause — is a bridge to
RCA: a well-formed cluster localizes <em>where</em> to look before <em>why</em> is determined.</li>
</ul>
<hr />
<h2>4. Root Cause Analysis and Fault Localization</h2>
<ul>
<li><strong>Spectrum-based fault localization (SBFL)</strong> ranks components by suspiciousness from pass/fail execution spectra (e.g., Ochiai, Tarantula) — mature in software testing, adapted to services.</li>
<li><strong>Causal inference / causal graphs</strong>: learn a causal DAG over metrics/services (e.g., PC/Granger-based) and trace anomaly propagation. <strong>CloudRanger</strong> (Wang et al., CCGrid 2018, <a href="https://doi.org/10.1109/CCGRID.2018.00076">DOI:10.1109/CCGRID.2018.00076</a>) builds an impact graph for cloud-native RCA.</li>
<li><strong>Microservice dependency graphs</strong>: <strong>MicroRCA</strong> (Wu et al., NOMS 2020, <a href="https://doi.org/10.1109/NOMS47738.2020.9110353">DOI:10.1109/NOMS47738.2020.9110353</a>) localizes anomalous services on an attributed service graph.</li>
<li><strong>GNN-based RCA</strong>: graph neural nets over service/topology graphs propagate anomaly evidence to rank likely culprits.</li>
<li><strong>LLM-assisted RCA</strong>: recent work uses LLMs to summarize evidence, hypothesize causes, and draft mitigations. <strong>RCACopilot</strong> (Chen et al., 2023, <a href="https://arxiv.org/abs/2305.15778">arXiv:2305.15778</a> — <em>ID verified: "Automatic Root Cause Analysis via Large Language Models for Cloud Incidents"</em>) and Microsoft studies on LLMs for incident RCA are representative. Treat efficacy claims cautiously: reported gains depend heavily on retrieval quality and evaluation setup.</li>
</ul>
<hr />
<h2>5. Recent Trends (2023–2025)</h2>
<ul>
<li><strong>LLM / LLM-agent observability.</strong> Domain LLMs and agents parse logs, answer natural-language queries over telemetry, and drive investigation loops. <strong>OWL: A Large Language Model for IT Operations</strong> (Guo et al., 2023, <a href="https://arxiv.org/abs/2309.09298">arXiv:2309.09298</a>) <em>(verified)</em> is an explicit ops-domain LLM with an Ops benchmark. "Observability copilots" are largely commercial (Datadog Bits AI, Grafana/Elastic AI assistants) — product docs, not peer-reviewed.</li>
<li><strong>Foundation / self-supervised models for time series.</strong> Zero-shot forecasters: <strong>TimesFM</strong> (decoder-only foundation model, Das et al., 2023, <a href="https://arxiv.org/abs/2310.10688">arXiv:2310.10688</a>) <em>(verified)</em>, <strong>TimeGPT-1</strong> (Garza et al., 2023, <a href="https://arxiv.org/abs/2310.03589">arXiv:2310.03589</a>) <em>(verified)</em>, and LLM-reprogramming via <strong>Time-LLM</strong> (Jin et al., ICLR 2024, <a href="https://arxiv.org/abs/2310.01728">arXiv:2310.01728</a>) <em>(verified)</em>. These promise few/zero-shot deployment across heterogeneous metrics.</li>
<li><strong>Generative AI for synthetic telemetry</strong>: using generative models to synthesize logs/ traces for augmentation and rare-fault simulation — active but still emerging; strong peer-reviewed baselines are sparse (flagged as low-verification).</li>
<li><strong>eBPF-based observability</strong>: kernel-level, low-overhead instrumentation (Cilium/Hubble, Pixie, Parca) enables auto-generated metrics/traces without code changes. Primary sources are the projects' docs/kernel docs rather than papers.</li>
<li><strong>OpenTelemetry standardization</strong>: OTel (CNCF) is now the de facto vendor-neutral instrumentation and semantic-conventions standard, unifying the pillars (<a href="https://opentelemetry.io/docs/">opentelemetry.io</a>) — a primary spec source.</li>
<li><strong>Causality-driven AIOps</strong>: shift from correlation to intervention/causal models for RCA.</li>
<li><strong>Benchmarks &amp; datasets</strong>:</li>
<li><strong>LogHub</strong> (He et al., collection of system-log datasets; <a href="https://arxiv.org/abs/2008.06448">arXiv:2008.06448</a>).</li>
<li><strong>NAB</strong> — Numenta Anomaly Benchmark (Lavin &amp; Ahmad, 2015, <a href="https://arxiv.org/abs/1510.03336">arXiv:1510.03336</a>).</li>
<li><strong>TSB-AD</strong> — recent reproducible TS-anomaly benchmark (VLDB 2024/2025; associated   reproducibility paper indexed on arXiv — <em>exact ID not cleanly verified in this pass,   flagged</em>).</li>
<li><strong>GAIA</strong> dataset and <strong>AIOps Challenge</strong> datasets (KPI/multi-source) from the AIOps   community — dataset repos, not peer-reviewed papers.</li>
</ul>
<hr />
<h2>6. Production Tooling and Ecosystem</h2>
<table>
<thead>
<tr>
<th>Tool</th>
<th>Role</th>
<th>Primary-source docs</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Prometheus</strong></td>
<td>Metrics TSDB + alerting</td>
<td><a href="https://prometheus.io/docs/">prometheus.io/docs</a> ✅ primary</td>
</tr>
<tr>
<td><strong>Grafana</strong></td>
<td>Visualization, alerting, ML plugins</td>
<td><a href="https://grafana.com/docs/">grafana.com/docs</a> ✅ primary</td>
</tr>
<tr>
<td><strong>OpenTelemetry</strong></td>
<td>Instrumentation standard (all pillars)</td>
<td><a href="https://opentelemetry.io/docs/">opentelemetry.io/docs</a> ✅ primary spec</td>
</tr>
<tr>
<td><strong>Elastic</strong></td>
<td>Logs/search + ML anomaly jobs</td>
<td><a href="https://www.elastic.co/docs">elastic.co/docs</a> ✅ primary</td>
</tr>
<tr>
<td><strong>Datadog</strong></td>
<td>SaaS observability + Watchdog/Bits AI</td>
<td><a href="https://docs.datadoghq.com/">docs.datadoghq.com</a> ✅ primary</td>
</tr>
<tr>
<td><strong>Splunk</strong></td>
<td>Log analytics + ITSI/MLTK</td>
<td><a href="https://docs.splunk.com/">docs.splunk.com</a> ✅ primary</td>
</tr>
</tbody>
</table>
<p>Open-source AIOps frameworks include <strong>Merlion</strong> (Salesforce, <a href="https://arxiv.org/abs/2109.09265">arXiv:2109.09265</a>) and <strong>PyOD</strong>/<strong>TODS</strong> for anomaly-detection pipelines. Vendor "AI" features (Datadog Watchdog, Elastic ML jobs, Splunk MLTK) are documented in product docs but their internal algorithms are only partially disclosed — treat capability claims as vendor-sourced.</p>
<hr />
<h2>7. Open Challenges and Future Directions</h2>
<ul>
<li><strong>Evaluation validity</strong>: point-adjustment and leaky benchmarks inflate AD scores; the field is moving toward stricter protocols (TSB-AD, revisiting-AD critiques).</li>
<li><strong>Label scarcity &amp; concept drift</strong>: production telemetry is unlabeled and non-stationary; online/continual learning remains hard.</li>
<li><strong>Multimodal fusion</strong>: jointly reasoning over metrics + logs + traces + topology is still immature; most methods handle one pillar.</li>
<li><strong>Causality vs. correlation</strong>: reliable causal RCA at scale is unsolved; causal graphs are sensitive to hidden confounders and sampling.</li>
<li><strong>LLM reliability</strong>: hallucination, cost, latency, and reproducibility limit LLM-agent RCA in production; grounding via retrieval and tool use is the current mitigation.</li>
<li><strong>Foundation-model transfer</strong>: zero-shot TS models are promising but under-validated on operational anomaly tasks specifically.</li>
</ul>
<hr />
<h2>References</h2>
<p><em>Verified against arXiv metadata in this pass are marked ✔.</em></p>
<ol>
<li>✔ Zhou et al. <strong>Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting</strong>, AAAI 2021. <a href="https://arxiv.org/abs/2012.07436">arXiv:2012.07436</a></li>
<li>✔ Wu et al. <strong>Autoformer: Decomposition Transformers with Auto-Correlation</strong>, NeurIPS 2021. <a href="https://arxiv.org/abs/2106.13008">arXiv:2106.13008</a></li>
<li>✔ Nie et al. <strong>A Time Series is Worth 64 Words (PatchTST)</strong>, ICLR 2023. <a href="https://arxiv.org/abs/2211.14730">arXiv:2211.14730</a></li>
<li>✔ Wu et al. <strong>TimesNet: Temporal 2D-Variation Modeling</strong>, ICLR 2023. <a href="https://arxiv.org/abs/2210.02186">arXiv:2210.02186</a></li>
<li>✔ Xu et al. <strong>Anomaly Transformer: Time Series Anomaly Detection with Association Discrepancy</strong>, ICLR 2022. <a href="https://arxiv.org/abs/2110.02642">arXiv:2110.02642</a></li>
<li>✔ Tuli et al. <strong>TranAD: Deep Transformer Networks for Anomaly Detection in Multivariate Time Series</strong>, VLDB 2022. <a href="https://arxiv.org/abs/2201.07284">arXiv:2201.07284</a></li>
<li>✔ Guo et al. <strong>OWL: A Large Language Model for IT Operations</strong>, 2023. <a href="https://arxiv.org/abs/2309.09298">arXiv:2309.09298</a></li>
<li>✔ Das et al. <strong>A decoder-only foundation model for time-series forecasting (TimesFM)</strong>, 2023. <a href="https://arxiv.org/abs/2310.10688">arXiv:2310.10688</a></li>
<li>✔ Garza et al. <strong>TimeGPT-1</strong>, 2023. <a href="https://arxiv.org/abs/2310.03589">arXiv:2310.03589</a></li>
<li>✔ Jin et al. <strong>Time-LLM: Time Series Forecasting by Reprogramming Large Language Models</strong>, ICLR 2024. <a href="https://arxiv.org/abs/2310.01728">arXiv:2310.01728</a></li>
<li>Liu, Ting, Zhou. <strong>Isolation Forest</strong>, ICDM 2008. <a href="https://doi.org/10.1109/ICDM.2008.17">DOI:10.1109/ICDM.2008.17</a></li>
<li>Schölkopf et al. <strong>Estimating the Support of a High-Dimensional Distribution (One-Class SVM)</strong>, Neural Computation 2001. <a href="https://doi.org/10.1162/089976601750264965">DOI:10.1162/089976601750264965</a></li>
<li>Breunig et al. <strong>LOF: Identifying Density-Based Local Outliers</strong>, SIGMOD 2000. <a href="https://doi.org/10.1145/342009.335388">DOI:10.1145/342009.335388</a></li>
<li>Ester et al. <strong>A Density-Based Algorithm for Discovering Clusters (DBSCAN)</strong>, KDD 1996.</li>
<li>Cleveland et al. <strong>STL: A Seasonal-Trend Decomposition Procedure Based on Loess</strong>, J. Official Statistics 1990.</li>
<li>Su et al. <strong>OmniAnomaly: Robust Anomaly Detection for Multivariate Time Series through Stochastic Recurrent Networks</strong>, KDD 2019. <a href="https://doi.org/10.1145/3292500.3330672">DOI:10.1145/3292500.3330672</a></li>
<li>Deng &amp; Hooi. <strong>Graph Neural Network-Based Anomaly Detection in Multivariate Time Series (GDN)</strong>, AAAI 2021. <a href="https://arxiv.org/abs/2106.06947">arXiv:2106.06947</a></li>
<li>He et al. <strong>Drain: An Online Log Parsing Approach with Fixed Depth Tree</strong>, ICWS 2017. <a href="https://doi.org/10.1109/ICWS.2017.13">DOI:10.1109/ICWS.2017.13</a></li>
<li>Du et al. <strong>DeepLog: Anomaly Detection and Diagnosis from System Logs through Deep Learning</strong>, CCS 2017. <a href="https://doi.org/10.1145/3133956.3134015">DOI:10.1145/3133956.3134015</a></li>
<li>Meng et al. <strong>LogAnomaly: Unsupervised Detection of Sequential and Quantitative Anomalies in Unstructured Logs</strong>, IJCAI 2019. <a href="https://doi.org/10.24963/ijcai.2019/658">DOI:10.24963/ijcai.2019/658</a></li>
<li>Zhang et al. <strong>Robust Log-Based Anomaly Detection on Unstable Log Data (LogRobust)</strong>, ESEC/FSE 2019. <a href="https://doi.org/10.1145/3338906.3338931">DOI:10.1145/3338906.3338931</a></li>
<li>Lin et al. <strong>Log Clustering Based Problem Identification for Online Service Systems (LogCluster)</strong>, ICSE 2016. <a href="https://doi.org/10.1145/2889160.2889232">DOI:10.1145/2889160.2889232</a></li>
<li>Wang et al. <strong>CloudRanger: Root Cause Identification for Cloud Native Systems</strong>, CCGrid 2018. <a href="https://doi.org/10.1109/CCGRID.2018.00076">DOI:10.1109/CCGRID.2018.00076</a></li>
<li>Wu et al. <strong>MicroRCA: Root Cause Localization of Performance Issues in Microservices</strong>, NOMS 2020. <a href="https://doi.org/10.1109/NOMS47738.2020.9110353">DOI:10.1109/NOMS47738.2020.9110353</a></li>
<li>He et al. <strong>LogHub: A Large Collection of System Log Datasets</strong>, 2020. <a href="https://arxiv.org/abs/2008.06448">arXiv:2008.06448</a></li>
<li>Lavin &amp; Ahmad. <strong>Evaluating Real-Time Anomaly Detection Algorithms — the Numenta Anomaly Benchmark (NAB)</strong>, 2015. <a href="https://arxiv.org/abs/1510.03336">arXiv:1510.03336</a></li>
<li>Bhatnagar et al. <strong>Merlion: A Machine Learning Library for Time Series</strong>, 2021. <a href="https://arxiv.org/abs/2109.09265">arXiv:2109.09265</a></li>
<li>OpenTelemetry Documentation. <a href="https://opentelemetry.io/docs/">opentelemetry.io/docs</a> (primary spec)</li>
<li>Prometheus Documentation. <a href="https://prometheus.io/docs/">prometheus.io/docs</a> (primary)</li>
<li>Grafana Documentation. <a href="https://grafana.com/docs/">grafana.com/docs</a> (primary)</li>
</ol>
<p><strong>Unverified / flagged in text:</strong> TSB-AD exact arXiv ID (VLDB reproducibility paper —not cleanly resolved in this pass); GAIA and AIOps-Challenge dataset provenance (communitydataset repos, not peer-reviewed papers); generative-synthetic-telemetry peer-reviewedbaselines (sparse — emerging area); all vendor "AI" capability claims (Datadog Watchdog/BitsAI, Elastic ML, Splunk MLTK) are product-doc sourced, not peer-reviewed; "AIOps" definitionattributed to Gartner (analyst, not a primary technical source). <em>(Drain ICWS 2017 venue andRCACopilot arXiv:2305.15778 were both verified post-hoc via Crossref/arXiv metadata and areno longer flagged.)</em></p>]]></content:encoded>
</item>
<item>
  <title>Aegis: A Root Cause Engine for Distributed Telemetry</title>
  <link>http://ustunkok.com.tr/posts/aegis-a-root-cause-engine-for-distributed-telemetry</link>
  <description>The Anatomy of a Root Cause Engine: Correlating Hidden Patterns in Distributed Telemetry</description>
  <pubDate>Wed, 08 Jul 2026 16:18:20 +0000</pubDate>
  <guid isPermaLink="true">http://ustunkok.com.tr/posts/aegis-a-root-cause-engine-for-distributed-telemetry</guid>
  <content:encoded><![CDATA[<h2>Preamble</h2>
<p>We operate a distributed system at scale. When it breaks, we know <strong>what</strong> broke and <strong>where</strong> — the affected service, the degraded operation, the time it started. This takes minutes.</p>
<p>We do not know <strong>why</strong>.</p>
<p>The answer exists somewhere in our telemetry — buried in a log line, encoded in a metric curve, hinted at in a trace fragment, or recorded in a change ticket. But these artifacts live in separate systems, speak different languages, and carry no common thread. Bridging them is a human act: an engineer opens half a dozen consoles, triangulates timestamps, forms a mental model of dependencies, and manually reasons backward from symptom to cause. This takes hours. Sometimes days. Every single time.</p>
<p>This is not a tooling gap. It is a reasoning gap. And we intend to close it.</p>
<hr />
<h2>I. The Aegis Thesis</h2>
<blockquote>
<p><strong>Correlation is not causation, but it is the raw material from which causation can be inferred. If we can fuse change records with telemetry signals across all three pillars — logs, metrics, traces — and if we can construct even a partial map of how our services depend on one another and on their infrastructure, then we can automate the hypothesis-generation step of root cause analysis. We can give the operator a ranked, evidence-backed causal timeline in under five minutes, instead of a blank search bar and a prayer.</strong></p>
</blockquote>
<p>Aegis does not aim to replace the engineer. It aims to compress the mechanical, multi-system search-and-correlate phase — the part that burns time without burning insight — so that the engineer starts their investigation already holding a set of plausible explanations, each backed by evidence drawn from the systems they would otherwise query by hand.</p>
<hr />
<h2>II. The Signals We Have</h2>
<p>We possess three families of telemetry, each with different character:</p>
<h3>Logs</h3>
<p>The richest and messiest signal. Some structured, some semi-structured, some nearly free-form text. They carry error messages, latency measurements, status codes, and — where maintained — ownership attribution and caller identity. They are the ground truth of what the application experienced.</p>
<h3>Metrics</h3>
<p>The cleanest signal. System metrics, application metrics, infrastructure metrics, trace-derived metrics. Well-typed, regularly sampled, pre-aggregated. They tell us <em>that</em> something changed and <em>when</em>, with precision. An existing anomaly pipeline already computes per-metric confidence intervals continuously.</p>
<h3>Traces</h3>
<p>The connective tissue — where they reach. Distributed tracing gives us span-level visibility into request flow, service-to-service call graphs, and latency propagation. But instrumentation is incomplete: critical infrastructure components, particularly database systems, are excluded from tracing due to agent stability concerns. The dependency graph has holes where it matters most.</p>
<h3>Beyond Telemetry</h3>
<p>We also possess a rich change record: every database modification, software deployment, and configuration alteration is recorded with precise timestamps through a formal approval pipeline. We know who changed what and when. What we lack is the connection from change to consequence — the blast radius, the dependent services, the expected behavioral signature.</p>
<hr />
<h2>III. The Gaps We Must Bridge</h2>
<p>Aegis is defined as much by what is missing as by what is present:</p>
<ol>
<li>
<p><strong>No universal correlation identifier.</strong> Some signals carry trace IDs, request IDs, or transaction IDs. Most do not. Cross-signal correlation today relies on temporal proximity and manual search.</p>
</li>
<li>
<p><strong>Traces amputated at the infrastructure boundary.</strong> The most critical dependency — the persistence layer — is invisible to our distributed tracing. When a database degrades, we see the symptoms in the services that call it but cannot see inside.</p>
</li>
<li>
<p><strong>A fragmented dependency graph.</strong> No single source maps which services depend on which other services, databases, or infrastructure. Tracing provides partial edges. Logs encode caller-callee relationships in fields that are being deprecated. The configuration management database aspires to centrality but is not yet complete.</p>
</li>
<li>
<p><strong>Change events carry no blast radius.</strong> A database administrator alters a parameter. The change is recorded. But nothing in that record says "this database serves these twelve services." That knowledge lives in human minds, scattered across teams.</p>
</li>
<li>
<p><strong>Ownership decays.</strong> Service ownership fields, where they exist, are populated at creation time and rarely maintained. A field written five years ago may point to a team that no longer exists.</p>
</li>
</ol>
<p>Aegis must work despite these gaps. It cannot wait for all data to be clean, all instrumentation to be complete, or all dependencies to be declared. It must make defensible inferences from partial information and express its uncertainty honestly.</p>
<hr />
<h2>IV. What Aegis Does</h2>
<p>Given a degraded service and a time window, Aegis returns:</p>
<p><strong>A ranked causal timeline.</strong> A chronologically ordered sequence connecting change events to anomaly onset to symptom emergence, with each candidate root cause scored by confidence and accompanied by supporting evidence drawn from logs, metrics, and traces.</p>
<p>The operator receives this as a report — pushed to a communication channel and persisted in our log aggregation system for visualization — within five minutes of trigger.</p>
<p>Aegis is triggered in two ways:</p>
<ul>
<li><strong>Automatically</strong>, when the anomaly pipeline detects a metric exceeding a severity threshold.</li>
<li><strong>Manually</strong>, when a platform operator initiates an investigation during an incident or post-incident review.</li>
</ul>
<p>In its first version, Aegis is non-interactive. It generates a complete report. Drill-down, hypothesis challenging, and iterative refinement are deferred to later iterations.</p>
<hr />
<h2>V. How Aegis Reasons</h2>
<h3>The Engine: Heuristics First</h3>
<p>Aegis v1 uses explicit, auditable rules. Each rule encodes a causal pattern: a type of change event, a temporal window, an expected signature in telemetry, and a scoring function. Rules compete against each other for explanatory power. Aegis ranks candidates; it does not pronounce a single verdict.</p>
<p>We begin with rule-based reasoning because it is transparent, debuggable, and requires no training data. It can be deployed immediately. Statistical and machine learning approaches are natural extensions when we have accumulated a labeled corpus of resolved incidents.</p>
<h3>Candidate Rule Families</h3>
<p><strong>Change-Induced Degradation.</strong> A change occurs on an entity. Within a bounded temporal window, dependent services exhibit anomaly onset, error rate increases, and novel error patterns in logs that were absent before the change.</p>
<p><strong>No-Change Degradation.</strong> An anomaly with no proximate change event. Suggests gradual resource exhaustion, external dependency failure, or traffic anomaly. Evidence is drawn from metric saturation curves and upstream correlation.</p>
<p><strong>Cascading Failure.</strong> Service A degrades. Service B, which depends on A, degrades with a temporal lag consistent with propagation. Service C follows. Evidence is drawn from trace spans and temporal ordering across the dependency graph.</p>
<p><strong>Infrastructure Event.</strong> Multiple unrelated services degrade simultaneously. Correlated with a host-level or network-level anomaly. Evidence is drawn from infrastructure metrics and network flow data.</p>
<h3>The Dependency Graph: Synthesized, Not Discovered</h3>
<p>Since no single source provides a complete dependency graph, Aegis constructs one from fragments:</p>
<ul>
<li>Trace spans from distributed tracing systems, where instrumented.</li>
<li>Caller-callee relationships inferred from log fields.</li>
<li>Application-to-host mappings from the configuration management database.</li>
<li>Network flow data, mapped to services.</li>
<li>Operator-declared known dependencies, weighted as high-confidence edges.</li>
</ul>
<p>The graph is constructed lazily, scoped to the investigation at hand. It is never expected to be complete — only useful. Every edge carries a confidence weight, and Aegis propagates uncertainty through its inferences.</p>
<h3>Correlation vs. Causation</h3>
<p>Aegis employs multiple strategies to avoid conflating coincidence with cause:</p>
<ul>
<li><strong>Rank, do not decide.</strong> All plausible candidates are presented. The operator retains judgment.</li>
<li><strong>Intervention analysis.</strong> If a changed entity serves N dependent services and all N degrade, the causal link is strong. If only one degrades, the link is weak.</li>
<li><strong>Temporal precedence.</strong> Changes that occurred after symptom onset are excluded as causes.</li>
<li><strong>Counterfactual weakening.</strong> If the same or similar change occurred previously without degradation, the hypothesis is discounted.</li>
<li><strong>Signal convergence.</strong> Hypotheses supported by multiple independent telemetry pillars gain confidence; those supported by only one are penalized.</li>
</ul>
<hr />
<h2>VI. What Aegis Does Not Do</h2>
<p>Clarity about scope is as important as clarity about function.</p>
<p>Aegis does not:</p>
<ul>
<li><strong>Replace the on-call engineer.</strong> It gives them a head start, not a final answer.</li>
<li><strong>Automate remediation.</strong> It identifies probable causes; it does not trigger rollbacks or configuration reversions.</li>
<li><strong>Require perfect data.</strong> It is designed to degrade gracefully with partial information, expressing lower confidence when signals are sparse.</li>
<li><strong>Operate continuously in v1.</strong> Investigations are triggered on-demand; continuous pre-computation of causal indices is a future optimization.</li>
<li><strong>Provide interactive drill-down in v1.</strong> The initial report is a complete artifact; iterative questioning comes later.</li>
</ul>
<hr />
<h2>VII. The Measure of Success</h2>
<p>Aegis v1 is successful if:</p>
<ol>
<li>Platform operators receive a ranked causal hypothesis list in <strong>under five minutes</strong> from trigger.</li>
<li>The true root cause appears in the <strong>top three candidates</strong> in the majority of investigations, as measured against post-incident review outcomes.</li>
<li>Incidents <strong>resolved during the event</strong> increase, because root cause is identified while the incident is still active — reducing the volume of formal post-incident reviews.</li>
<li>Operators adopt Aegis as their <strong>first investigation step</strong>, displacing manual multi-system querying as the default workflow.</li>
</ol>
<hr />
<h2>VIII. The Path Forward</h2>
<p>This manifesto describes intent, not implementation. The next steps are concrete:</p>
<ol>
<li><strong>Ratify the scope.</strong> Confirm the heuristic-first approach, trigger modes, output format, and latency target.</li>
<li><strong>Design the initial rule catalog.</strong> Convene domain experts — service owners, database administrators, incident commanders — to articulate the causal patterns they recognize today.</li>
<li><strong>Prototype the dependency graph construction.</strong> Build a throwaway integration against real data sources and measure coverage against a sample of known service dependencies.</li>
<li><strong>Define data contracts.</strong> Formalize the query interfaces and response schemas for each source system.</li>
<li><strong>Establish an evaluation baseline.</strong> Instrument current manual investigation workflows to capture time-to-root-cause for a representative set of historical incidents, so we can measure Aegis against reality.</li>
</ol>
<hr />
<blockquote>
<p><em>Aegis is not a dashboard. It is not an alerting system. It is a reasoning prosthesis — a machine that does the mechanical correlation work so that the human can do the thinking work. Our operators deserve to start their investigations with a hypothesis, not a blank page.</em></p>
</blockquote>]]></content:encoded>
</item>
<item>
  <title>What Is Information Gain in Information Theory?</title>
  <link>http://ustunkok.com.tr/posts/what-is-information-gain-in-information-theory</link>
  <description>Information gain is a very important concept in information theory. In the most simplest case, it is the reduction in entropy. If you are not familiar with entropy, check out my [entropy post](https://tolga.ustunkok.com.tr/posts/what-is-entropy-in-information-theory). Information gain is used in decision trees. A decision tree is a classification algorithm. Decision tree splits the given feature from specific points with specific questions by branching. By doing that, it tries to maximize information gain. In other words, it tries to minimize the entropy in each branch. To sum up, information gain tells us the reduction in entropy in each split.</description>
  <pubDate>Mon, 06 Jul 2026 16:44:11 +0000</pubDate>
  <guid isPermaLink="true">http://ustunkok.com.tr/posts/what-is-information-gain-in-information-theory</guid>
  <content:encoded><![CDATA[<p>Here is the table from the image, converted into Markdown and translated into English:</p>
<p><strong>Picnic Decision Dataset:</strong></p>
<table>
<thead>
<tr>
<th>ID</th>
<th>Wind</th>
<th>Picnic</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>none</td>
<td>no</td>
</tr>
<tr>
<td>2</td>
<td>yes</td>
<td>no</td>
</tr>
<tr>
<td>3</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>4</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>5</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>6</td>
<td>yes</td>
<td>no</td>
</tr>
<tr>
<td>7</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>8</td>
<td>none</td>
<td>no</td>
</tr>
<tr>
<td>9</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>10</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>11</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>12</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>13</td>
<td>none</td>
<td>yes</td>
</tr>
<tr>
<td>14</td>
<td>yes</td>
<td>no</td>
</tr>
</tbody>
</table>
<p>A simple dataset.</p>
<p>The above toy dataset contains 14 samples of wind measurements and their respected picnic/no-picnic records. The first thing to do is to find the how much information does <code>Picnic</code> column have. There is 9 Evet and 5 Hayır records, total of 14 measurements. Thus, the entropy of Picnic variable is following.</p>
<div class="arithmatex">\[-\frac{9}{14}\log_2\left(\frac{9}{14}\right)-\frac{5}{14}\log_2\left(\frac{5}{14}\right)=0.9403\]</div>
<p>Entropy of picnic.</p>
<p>Now, if we split the <code>Picnic</code> variable by the wind situation <code>yes</code>/<code>none</code>, the average reduction in the entropy would be the information gain. To do that, let's put the <code>yes</code> and <code>no</code> measurements next to each other in a row, and split it by the wind measurements.</p>
<pre class="mermaid">
graph TD
    Root[YYYYYYYYNNNNN] -->|Yes| Left[YYYNNNN]
    Root -->|None| Right[YYYYYYYYNN]
</pre>
<p>Split by wind.</p>
<p>Here, we should find the entropy in each leaf node. Then, we are going to calculate the weighted average of entropy by taking account of the E/H count in each node.</p>
<p>In the left most leaf node, the entropy is 1 since picking a letter results with the probability of 0.5 of Y and 0.5 of N. For the right node, we can calculate the entropy as follows.</p>
<div class="arithmatex">\[-\frac{6}{8}\log_2\left(\frac{6}{8}\right)-\frac{2}{8}\log_2\left(\frac{2}{8}\right)=0.8113\]</div>
<p>Entropy of the right node.</p>
<p>Now, we can calculate the weighted average of entropy. There is 6 samples in the left, and 8 samples in the right. The following equation calculates the weighted average.</p>
<div class="arithmatex">\[\frac{6}{14}\times1+\frac{8}{14}\times0.8113=0.8922\]</div>
<p>Weighted average of the entropies.</p>
<p>The last part is the calculating the reduction in the entropy. We just need to extract the average entropy from the first one.</p>
<div class="arithmatex">\[0.9483-0.8922=0.0561\]</div>
<p>Reduction in entropy.</p>
<p>This result tells us if we split the Picnic variable by the wind situations, there will be a 0.0561 reduction in the entropy. In another words, there will be a 0.0561 of information gain in this split.</p>
<p>In a decision tree, we do that for all of the independent variables. We calculate the each individual information gain for all of the independent variables. Then, we choose the feature that causes the largest reduction in entropy and split the tree into branches. We continue to the process until there is no split to make (entropy is 0) or to meet a stop condition (maximum split count or maximum depth of the tree). There are multiple ways to calculate the information gain for different purposes. Information gain is only one of them. Maybe, in another post I will write about some of them. Until then, see you in another day. Bye...</p>]]></content:encoded>
</item>
<item>
  <title>What Is Entropy in Information Theory?</title>
  <link>http://ustunkok.com.tr/posts/what-is-entropy-in-information-theory</link>
  <description>Entropy is one of the key concepts of information theory, data science and machine learning. Understanding the math behind it is crucial for designing solid machine learning pipelines. Therefore, in this post, I try to explain the entropy as simple as possible.</description>
  <pubDate>Sun, 05 Jul 2026 11:50:53 +0000</pubDate>
  <guid isPermaLink="true">http://ustunkok.com.tr/posts/what-is-entropy-in-information-theory</guid>
  <content:encoded><![CDATA[<p>When I first saw the name entropy in decision trees, I really didn't think about it. I couldn't get the importance of this concept. So, I moved on to my machine learning (ML) adventure without it. However, almost every time I tried to learn a new ML concept, entropy was on my way. I couldn't escape from it. Then, I (with the encouragement of my graduate advisor who is an excellent mentor for me) decided to confront it. The first few days to understand the entropy was not easy in terms of understanding why it was created in the first place. We already have the probability, haven't we? But, no. It is very useful, fix some problems that the probability can't, and almost every concept in ML make use of it due to some computational reasons.</p>
<p>In this first story of mine, I will try my best to clear out the concepts of entropy and some other related concepts such as information gain and information gain ratio. I also want to suggest a video about entropy by Luis Serrano. You can find the video here. While this is an excellent video, it is not enough to fully understand the entropy. You need to make lots of reading sessions and maybe implement it with a programming language. Now, let's get back to the subject.</p>
<p>I am not a physicist but as far as I know, entropy in physics corresponds to the energy of particles in a media. If we give an example, the four phases of matter would be a good candidate.</p>
<p><img alt="" src="/images/1" /></p>
<p>The leftmost image (ice) has the lowest entropy since the particles are not moving as fast as the other two. The middle (water) has more energy than ice. So the entropy is higher than ice. The rightmost (water vapor) has the highest entropy since the particles move fastest.</p>
<p>This idea applies to the information theory in the sense of probability. Claude Shannon is the man who brings the idea in information theory. Suppose you have a computer. This computer can only output a sequence of characters. But some characters are permitted to repeat. The list of all possible characters that can present in the output is the dictionary of the computer. The question is here how much information do you have about the output of the computer?</p>
<p><img alt="" src="/images/2" />
A computer with a dictionary consists of the only letter "A" outputs a string of "AAAAAAAAAAAA".</p>
<p>The above computer has a dictionary <span class="arithmatex">\(D = \{ \text{"A"} \}\)</span>. So, we will have a guaranteed output of "A", right? This means that we know a lot about the output. We will get into how we will compute entropy, but at this point let's say that this output has an entropy value of 0. Because we are certain about the output. It will consist of nothing else but the letter "A" only.</p>
<p>What if our dictionary consists of more than one letter or even numbers? For example, dictionary <span class="arithmatex">\(D = \{ \text{"A"}, \text{"B"} \}\)</span>. Then the output of the computer might be as follows.</p>
<p><img alt="" src="/images/3" /></p>
<p>A computer with a dictionary consists of letter "A" and "B", outputs a string of "AAAAAABBBBBB".</p>
<p>Let's say from this output we need to pick a letter. Remember that each pick is independent of each other. So, what is the probability of producing an output that has the same order as in the original output sequence? The answer to this question is comes from the probability, right?</p>
<div class="arithmatex">\[\frac{6}{12} \times \frac{6}{12} \times \underbrace{\dots}_{9} \times \frac{6}{12} = \frac{1}{4096} = 0.0002\]</div>
<p>The probability of picking "A" or "B" independently is 0.5. There are 12 letters in the output. So we have multiplied 12 independent probability of picking different letters.</p>
<p>As you can see, the result is very small. This means that producing the same output as the computer is very difficult. We have little information about the output. Our chance to pick a letter and knowing what it is is the same as tossing a coin. This result suggests us we have a higher entropy value here.</p>
<p>But why do we need the entropy? We have the probability and it tells us something about the information amount of the data. Here is the reason. Actually, you can see it yourself, too. If we have fewer letters in the sequence, let's say 4 instead of 12; two for "A" and two for "B", the result will be 0.0625. But the entropy will still be high. So, what's change? You see that the amount of letters in the data affects the output of the probability exponentially. This is a problem for our computers, right? Smaller the floating point number, smaller the precision. You may be heard of the vanishing gradient problem in Recurrent Neural Networks (RNN). This is the reason for it and this is the starting point of entropy.</p>
<p>We need a way to not reducing the output that much but at the same time take care of all the letters in the sequence. What if we try to get rid of the exponential function (the repeated multiplication) by converting it to a linear function. How do we do that? Maybe the answer is in the summation. Because repeated summation is just a linear function, unlike multiplication. So, the conversion can be easily made by logarithms. Then let's take the logarithm of the above equation. There is only a little problem here. Which number should be used as the base of the logarithm? You can pick whatever number you want. However, we are from the area of computation. We love to express numbers and information as bits. A bit is a 1 or 0. So, a bit can be expressed in base 2. This means that we want to express the data with two symbols. Therefore, it is natural that we choose 2 as the base for the logarithm. Now, let's take the logarithm at base 2.</p>
<div class="arithmatex">\[\log_{2} \left( \frac{6}{12} \times \frac{6}{12} \times \underbrace{\dots}_{9} \times \frac{6}{12} \right) = -12\]</div>
<p>Logarithm base 2 of the above equation.</p>
<p>What a beautiful number here. But, hmm…, you see there are two little problems here. First, we have 12 letters in the sequence and the result is 12. Will this number increase as the letter count increases? Yes, it will increase. So we can normalize it with the letter count by dividing it to 12 in this case.</p>
<div class="arithmatex">\[\frac{1}{12} \times \log_{2} \left( \frac{6}{12} \times \frac{6}{12} \times \underbrace{\dots}_{9} \times \frac{6}{12} \right) = -1\]</div>
<p>The result is normalized with the letter count.</p>
<p>This is much better. But, why the number is negative? There is no point to proceed with a negative number while trying to measure the information in a sequence. So, let's multiply the expression with -1.</p>
<div class="arithmatex">\[-\frac{1}{12} \times \log_{2} \left( \frac{6}{12} \times \frac{6}{12} \times \underbrace{\dots}_{9} \times \frac{6}{12} \right) = 1\]</div>
<p>The previous expression is multiplied by -1 to get rid of the redundant negative sign.</p>
<p>This is it. We made to the end. Almost. We still haven't converted the multiplication into the summation.</p>
<div class="arithmatex">\[\frac{1}{12} \left( -\log_2\left(\frac{6}{12}\right) - \log_2\left(\frac{6}{12}\right) - \underbrace{\dots}_{9} - \log_2\left(\frac{6}{12}\right) \right) = 1\]</div>
<p>The multiplication is eliminated by taking advantage of the property of logarithms.</p>
<p>The first six expressions of the sequence are for the letter "A" and the remaining six is for the letter "B". Now, let's make this more obvious and distribute the multiplication over the whole expression.</p>
<div class="arithmatex">\[-\frac{6}{12} \log_2\left(\frac{6}{12}\right) - \frac{6}{12} \log_2\left(\frac{6}{12}\right) = 1\]</div>
<p>The coefficient at the beginning of the whole expression is distributed. In the meantime, the summations are grouped together each for a letter (6 for A and 6 for B).</p>
<p>This is the entropy. For this sequence, as we change the number of letters, the probability of producing the exact same output will change. However, the entropy will never change as the proportion of letter counts are constant regardless of the total number of letters in the sequence. If we generalize the entropy, the following expression can be obtained.</p>
<div class="arithmatex">\[\text{Entropy} = -\sum_{i=1}^{n} P_i \log_2(P_i)\]</div>
<p>The general formula for entropy.</p>
<p><span class="arithmatex">\(P\)</span> is the probability of picking <em>ith</em> distinct element from the sequence. The knowledge and entropy are opposites. If we have high knowledge about a sequence, the entropy is lower, and vice versa. Let's make another example with a different sequence.</p>
<p><img alt="" src="/images/4" /></p>
<p>An example sequence with a dictionary of D = {"A", "B", "C"}.</p>
<p>Here we have 3 distinct letters in a 12 letter sequence. Let's calculate the entropy with the above formula.</p>
<div class="arithmatex">\[-\frac{2}{12} \log_2\left(\frac{2}{12}\right) - \frac{4}{12} \log_2\left(\frac{4}{12}\right) - \frac{6}{12} \log_2\left(\frac{6}{12}\right) = 1.4591\]</div>
<p>The entropy of the previous sequence.</p>
<p>Ok, we have calculated the entropy. But, what's the result even means? Actually, the result is the average number of yes/no questions to guess the next letter in the sequence. Be careful about that. You need to ask the questions in the smartest way possible.</p>
<p>Entropy is used in many ML methods. One of the popular ML methods is Decision Tree. In the decision tree, we try to find the independent variable that splits another dependent variable in the best way possible. How to find that variable? The answer is we split the target (dependent) variable with each of the other independent variables and check the reduction in entropy after each of the splits. The variable that causes the most reduction is the winner. This reduction is called information gain.</p>
<p>There are other types of entropy reduction metrics. For example, information gain ratio. It is a very close concept to information gain. I am planning to write about each of them later in separate stories. I hope this post is helpful. If I made a mistake in the post, please let me know. See you soon. Bye…</p>]]></content:encoded>
</item>
</channel>
</rss>
