Superlog Photon 1.0
Photon is a small log anomaly detection model for CPUs. It reads raw log lines in 100-line windows, flags anomalous windows, and names the suspect log template behind each alert. It is built to sit in front of an investigator (an LLM agent or a person) that checks each suspect template and returns a verdict, fault or benign. Photon learns from those verdicts online, from the first line of a system it has never seen, with no warm-up data.
- Code, runtime and paper: https://github.com/superloglabs/photon
- Weights: https://huggingface.co/superloglabs/photon-1.0
- Version: 1.0.0 (checkpoint tag
v4-frozen-before-rcaeval)
What is in this release
| File | Contents | Parameters |
|---|---|---|
encoder/ |
Fine-tuned 12-layer BERT encoder (HF format, safetensors) + tokenizer. Layers 6-11 are fine-tuned; embeddings and layers 0-5 are unchanged from bge-small-en-v1.5. |
33,360,000 |
heads.safetensors |
Scoring heads: 5-level severity, severe log-odds, fault yes/no log-odds, source-alert direction | 3,083 |
reference_upper.safetensors |
Unmodified layers 6-11 of bge-small-en-v1.5. With the shared bottom half of encoder/, this reconstructs the stock encoder used for similarity features. |
10,646,784 |
adapter/source_fault_anchors.safetensors |
139 source-system fault anchors (384-d embeddings and 2,944-d hybrid features) | (data) |
photon_config.json |
Preprocessing, score standardization, online adapter settings, provenance | |
reproduction/loo_target_*.safetensors |
The four leave-one-system-out fold checkpoints behind the paper's BGL/Liberty/Spirit/Thunderbird numbers (layers 6-11 + heads each). Evaluation only. | 4 ร 10,649,866 |
MANIFEST.json |
sha256 of every file |
Total parameters used at inference: 44,009,867 (33.4M scoring encoder and heads + 10.6M reference upper layers; the 22.6M bottom half is shared). This includes a 0.15M pooler that is not used. Weights are FP32; the core files are about 179 MB.
How it works
- Mask. A C masker (
_fastmask.c) replaces variable fields (numbers, IPs, paths, hex IDs, dates) with<*>and keeps literal zeros as<0>. Each distinct masked string is a template. - Score new templates once. The first time a template appears, the scoring encoder produces severity and fault scores and the reference encoder produces an embedding. Results are cached. Repeated templates are a dictionary lookup.
- Decide per window. The cached score is adjusted by an online Ridge model over embeddings and hashed n-grams, by similarity to templates already judged, and by window repetition signals. The window alerts if the score passes a threshold that rises after false alarms. At most one suspect template is named per alert.
- Learn from verdicts. Each suspect template that has not been judged before is sent to the investigator once. Its verdict is cached permanently and updates the adapter before the next window. Templates confirmed as faults alert on every later appearance without another call.
Without an investigator, Photon runs zero-shot: it still alerts and names suspects, but it does not adapt to the system, and an unjudged suspect keeps alerting.
Quickstart
Requires Python โฅ 3.10, a C compiler (Linux or macOS), and torch, transformers, safetensors, scikit-learn, numpy.
# optional, CPU-only PyTorch (smaller download):
pip install torch --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple
pip install git+https://github.com/superloglabs/photon
python -m photon_runtime build-masker
python -m photon_runtime detect --model superloglabs/photon-1.0 app.log # downloads the weights
from photon_runtime import PhotonDetector
det = PhotonDetector.from_pretrained("superloglabs/photon-1.0") # single thread by default
for res in det.run(lines, investigator=my_investigator): # my_investigator(template) -> True/False/None
if res.is_alert:
print(res.index, res.score, [s.template for s in res.suspects])
Pass only the message body if your lines carry timestamps or host columns, or set header_fields=N to drop the first N whitespace-separated fields.
Intended use
- First-stage screening of high-volume text logs on CPU, in front of an automated or human investigator that can judge a masked log template as fault or benign.
- Systems with an evolving log vocabulary, where labeled fault data for the target system does not exist.
Out of scope:
- Use without any investigator as a standalone alerting system with the accuracy reported below. The reported numbers assume an investigator that answers every escalated template.
- Anomalies made only of routine templates in an unusual order or at normal rates (sequence or timing anomalies).
- Non-English log text; logs where all information is in numeric fields (masked to
<*>). - Safety-critical alerting without human review.
Training data and procedure
- Logs: masked message templates and line labels from four public HPC logs: BGL (4.75M lines), Liberty (10M), Spirit (5M), Thunderbird (10M), from LogHub and the USENIX Computer Failure Data Repository. A template is labeled fault if most of its lines carry the site's alert tag. 6,011 templates counted per system (4,843 distinct across the four).
- Teacher:
Qwen/Qwen3-8B(Apache-2.0), run locally on each template once, with no system names or labels in the prompt. It provides a 5-level severity distribution and a fault yes/no log-odds (prompts in the paper appendix). - Student:
BAAI/bge-small-en-v1.5(MIT) with layers 0-5 frozen, trained 4 epochs on all four systems (27.95 s on an Apple M-series GPU). Loss: KL to the teacher's severity distribution, Huber on teacher log-odds, weighted BCE on the source alert labels, and a cosine anchor to the original embeddings. - Adapter settings (
photon_config.json) were selected on the four HPC systems before any evaluation on microservice data.
Evaluation
All runs: 100-line windows, online from line 1, no warm-up. The investigator is simulated by an exact oracle that returns the ground-truth template label.
1. Cross-system generalization (paper main result; leave-one-system-out fold checkpoints)
These numbers come from the four fold checkpoints in reproduction/, each trained on three systems and tested on the fourth. The release model in encoder/ was trained on all four systems, so these numbers are not a held-out test of the release model. They are reproduced exactly by reproduction/verify_loo.py in the GitHub repository.
| Target | F1 | Recall | Window FDR | Investigator calls (benign) |
|---|---|---|---|---|
| BGL | 0.9751 | 0.9579 | 0.71% | 74 (35) |
| Liberty | 0.9957 | 0.9917 | 0.02% | 19 (13) |
| Spirit | 0.9912 | 0.9833 | 0.08% | 20 (16) |
| Thunderbird | 0.9956 | 0.9923 | 0.10% | 39 (38) |
| Mean | 0.9894 | 0.9813 | 0.23% | 38.0 (152 total vs. 6,011 templates) |
Caveats:
- With 5% of investigator verdicts flipped at random, mean F1 falls to 0.860 (5 seeds); verdicts are cached permanently, so one wrong verdict on a high-volume template persists.
- On Thunderbird and Liberty, most calls are benign (38 of 39, 13 of 19); the HPC labels come from narrow alert scripts, and several severe-looking messages (segfaults, OOM kills) are labeled benign.
- Claude Opus (0-100 severity prompt) ranks templates better zero-shot on all four systems (e.g. BGL AUROC 0.872 vs. 0.754). In the same cached-verdict loop, Opus reaches 0.9893 mean F1 with 555 calls; Photon reaches 0.9894 with 152.
2. Held-out microservices: RCAEval RE3 (release model, frozen)
The release model was frozen and tagged before any RCAEval data was read, and run unchanged on all 90 RE3 code-fault cases (Online-Boutique, Sock-Shop, Train-Ticket; 6.02M lines, 176,028 templates). Fault templates are defined heuristically: templates that first appear after fault injection, or whose rate rises more than 10ร after injection.
| Suite | Cases detected | Median time to detect | Pre-injection window FPR | Calls / case | Mean window F1 |
|---|---|---|---|---|---|
| Online-Boutique | 24/30 | 16.5 s | 0.00% | 1.3 | 0.790 |
| Sock-Shop | 30/30 | 16 s | 0.96% | 5.7 | 0.169 |
| Train-Ticket | 19/30 | 13 s | 0.00% | 1.0 | 0.468 |
| All | 73/90 (81.1%) | 16 s | 0.32% | 2.7 | 0.476 |
Caveats:
- A keyword filter (error/fail/exception/timeout/5xx...) with the same verdict cache has higher mean window F1 on RE3 (0.583 vs. 0.476) using 2.3ร more investigator calls (6.3 vs. 2.7 per case). Photon's advantage here is fewer calls, not higher accuracy.
- Known misses: masking turns HTTP status codes into
<*>, and the HPC-calibrated threshold sits above some gRPC error messages. - These numbers are reproduced exactly from the exported files by
reproduction/verify_rcaeval.pyin the GitHub repository (all suite metrics identical; no case changes detection status). That check uses the evaluation's original Python masker. Run end to end through the released runtime's C masker, which differs from that masker on about 0.2% of RE3 messages (trailing whitespace after truncation,+0000time zones kept as<0>), every metric above is also identical; the only change is one fewer template (176,027).
3. Speed on one CPU thread
Measured with the released runtime (reproduction/benchmark.py in the GitHub repository), one thread (torch.set_num_threads(1), BLAS threads 1), Apple M5 Max, zero-shot (no investigator). End to end: raw line, C masking, cache lookup, new-template encoding, adapter, decision.
| Stream | New templates per line | Lines / s (one thread) | Window of cached templates: mean (p99) | Time spent on new templates |
|---|---|---|---|---|
| BGL, first 1M lines | 0.02% | 426k | 0.065 ms (0.128 ms) | 70% |
| Liberty, first 1M lines | 0.06% | 183k | 0.089 ms (0.173 ms) | 83% |
| Spirit, first 1M lines | 0.08% | 147k | 0.095 ms (0.160 ms) | 86% |
| Thunderbird, first 1M lines | 0.12% | 102k | 0.106 ms (0.196 ms) | 89% |
| RCAEval Online-Boutique (2 cases) | 0.09% | 116k-124k | 0.065 ms (0.131-0.147 ms) | 92% |
| RCAEval Train-Ticket (2 cases) | 0.5-0.8% | 12k-18k | 0.30 ms (0.44-0.53 ms) | 94-96% |
| RCAEval Sock-Shop (2 cases) | 6.6-8.1% | 1.1k-1.4k | 0.29-0.35 ms (0.50-0.59 ms) | >99% |
- A new template costs 9.4 ms when encoded alone, 6.4-11 ms on average when the new templates of a window are encoded together (both encoders plus n-gram hashing).
- Throughput is set by how often new templates appear. Logs with JSON payloads or unmasked IDs (Sock-Shop above) run at about 1,000 lines/s per thread.
- Peak memory: about 630 MB RSS (PyTorch + 179 MB of weights). Startup: about 4 s. The template cache grows by about 13 KB per distinct template and is never evicted in 1.0.
- The paper's 0.068-0.103 ms per window figure is the cached-window case on HPC logs and matches the runtime numbers above.
Limitations
- Querying every new template can be the better choice when the investigator is cheap and the vocabulary is small and static: it catches rare one-line faults at about 40ร more calls.
- Imperfect investigators: verdicts are cached permanently, which amplifies investigator errors on high-volume templates (see above). Expiring or multi-confirmation caches are not implemented in 1.0.
- Contextual anomalies made only of routine templates are out of scope.
- Training data is from 2004-2006 HPC systems with alert-script labels. Severity judgments carry over to modern services only partially (see the RCAEval results).
- Template churn costs time and memory. Logs that embed payloads (JSON bodies, random IDs the masker does not catch) create many templates; each costs one 6-11 ms encoder pass and about 13 KB of cache that 1.0 never evicts.
- English text only. Tested on macOS (arm64, Python 3.11) and Linux (arm64 and x86-64, Python 3.10; x86-64 under emulation), with identical outputs. Speed numbers above are from one Apple M5 Max core only.
License
Apache-2.0 for weights and code (LICENSE). Third-party notices are in NOTICE: bge-small-en-v1.5 is MIT, the tokenizer vocabulary is Apache-2.0, and teacher labels came from Qwen3-8B (Apache-2.0).
Citation
@misc{photon2026,
title = {Superlog Photon 1.0: Matching Frontier LLM Accuracy in Log Anomaly Detection at 65,000{$\times$} Lower Latency on CPU},
author = {Shishaev, Arseniy and Magnante, Nicol{\`o}},
year = {2026},
note = {Superlog Photon 1.0}
}