Featurization¶
Featurization methods are used to transform textual attributes of entities (e.g. file paths, process command lines, socket IP addresses and ports) into a vector.
Some methods like word2vec and doc2vec learn this vector from the text corpus, while others like hierarchical_hashing compute the vector in a deterministic way.
Other methods like only_type and only_ones simply skip this embedding step and assign either a one-hot encoded type or ones to each entity. Those methods thus do not require any specific argument.
In all methods, the resulting vectors are used as node features during the training task.
The graph2vec method (ProGrapher) embeds each time-window graph as a whole rather than its nodes: the Weisfeiler-Lehman rooted subgraphs of all nodes, built from node and edge types up to depth wl_iterations, are the words of a document embedded with doc2vec (PV-DBOW). The model is trained on the snapshots of training_split, then the embedding of every snapshot is inferred (infer_epochs) and stored in its graph, with the rooted subgraphs of its nodes; nodes only get their type as features. It is used by the textrcnn encoder and the predict_snapshot_embedding objective.
The pretrained method uses an encoder pretrained on provenance data (SPIDER, language models, self-supervised GNNs, …), selected with pretrained.model_type. See Pretrained Encoders.
Network datasets
The nodes of network datasets are hosts, labelled by their name or ID (e.g. C1065 in LANL). Text methods run on them (Velox uses word2vec on LANL), but these labels carry little information: the network systems use only_type or only_ones, and learn the identity of each host in their encoder (node_id_embedding, lares). fasttext stops with an error when no token appears min_count times, which happens with unique host names.
The attributes of events (logon types, ports, protocols, sizes...) are not featurized here: feat_inference encodes them as edge features (one-hot categorical and log-scaled numeric attributes), used with batching.edge_features=edge_attrs and selected with feat_inference.edge_attributes.
Methods¶
- word2vec
- alpha: float
- window_size: int
- min_count: int
- use_skip_gram: bool
- num_workers: int
- epochs: int
- compute_loss: bool
- negative: int
- decline_rate: int
- doc2vec
- include_neighbors: bool (1)
- truncate_process_name: bool (2)
- epochs: int
- alpha: float
- workers: int (3)
- graph2vec
- wl_iterations: int (4)
- negative: int (5)
- min_count: int (6)
- alpha: float (7)
- infer_epochs: int (8)
- num_workers: int (9)
- fasttext
- min_count: int
- alpha: float
- window_size: int
- negative: int
- num_workers: int
- use_pretrained_fb_model: bool
- alacarte
- walk_length: int
- num_walks: int
- epochs: int
- context_window_size: int
- min_count: int
- use_skip_gram: bool
- num_workers: int
- compute_loss: bool
- add_paths: bool
- temporal_rw
- walk_length: int
- num_walks: int
- trw_workers: int
- time_weight: str
- half_life: int
- window_size: int
- min_count: int
- use_skip_gram: bool
- wv_workers: int
- epochs: int
- compute_loss: bool
- negative: int
- decline_rate: int
- flash
- min_count: int
- workers: int
- hierarchical_hashing
- magic
- only_type
- only_ones
- ocrapt_features
- use_lifespan: bool (10)
- use_cumulative_active_time: bool (11)
- pretrained
- model_size: str (12)
- model_type: str (13)
- deepwalk
- window: int (14)
- epochs: int (15)
- min_count: int (16)
- workers: int (17)
- node2vec
- p: float (18)
- q: float (19)
- gnn_distill
- emb_dim: int (20)
- hidden_dim: int (21)
- num_layers: int (22)
- num_heads: int (23)
- n_neighbors_min: int (24)
- n_neighbors_max: int (25)
- diverse_neighbors: bool (26)
- loss_weight: float (27)
- gnn_loss_weight: float (28)
- gnn_lr: float (29)
- ema_momentum: float (30)
- edge_projection: bool (31)
- filter_noisy_edges: bool (32)
- behavior_cluster
- proj_dim: int (33)
- bce_weight: float (34)
- contrastive_weight: float (35)
- temperature: float (36)
- min_signature_size: int (37)
- filter_noisy_edges: bool (38)
- use_contrastive_head: bool (39)
- min_entities_per_class: int (40)
- max_entities_per_class: int (41)
- samples_per_class: int (42)
- bce_mode: str (43)
- contrastive_target: str (44)
- strip_entity_type: bool (45)
- spider
- emb_dim: int (46)
- hidden_dim: int (47)
- proj_dim: int (48)
- num_heads: int (49)
- n_neighbors_min: int (50)
- n_neighbors_max: int (51)
- diverse_neighbors: bool (52)
- filter_noisy_edges: bool (53)
- ema_momentum: float (54)
- supcon_weight: float (55)
- distill_weight: float (56)
- temperature: float (57)
- min_signature_size: int (58)
- min_entities_per_class: int (59)
- max_entities_per_class: int (60)
- samples_per_class: int (61)
- strip_entity_type: bool (62)
- distill_loss: str (63)
- teacher_loss: str (64)
- teacher_data: str (65)
- student_only_mode: str (66)
- graphmae
- num_layers: int (67)
- num_heads: int (68)
- decoder_num_layers: int (69)
- mask_rate: float (70)
- replace_rate: float (71)
- neighborhood_min: int (72)
- neighborhood_max: int (73)
- epochs: int (74)
- lr: float (75)
- gae
- num_layers: int (76)
- num_heads: int (77)
- neighborhood_min: int (78)
- neighborhood_max: int (79)
- epochs: int (80)
- lr: float (81)
- dgi
- num_layers: int (82)
- num_heads: int (83)
- neighborhood_min: int (84)
- neighborhood_max: int (85)
- epochs: int (86)
- lr: float (87)
- training
- pretrain_tokens: int (88)
- warmup_tokens: int (89)
- batch_size: int (90)
- lr: float (91)
- scheduler: str (92)
- mlm
- mask_rate_fixed: float (93)
- mask_rate_min: float (94)
- mask_edge_type: bool (95)
- modernbert
- global_attn_every_n_layers: int (96)
- local_attention_window: int (97)
- ropebert
- rope_theta: float (98)
- llama
- rope_theta: float (99)
- logbert
- hvm_weight: float (100)
- pretrain_datasets: str (101)
- weights_path: str (102)
- graph_context_mode: str (103)
- walks
- walk_length: int (104)
- num_walks: int (105)
- time_weight: str (106)
- half_life: float (107)
- random_walk_start: bool (108)
- diversity_weight: float (109)
- Whether the document of a node also contains the labels of its successors.
- Whether the features of processes are computed from the directory of their executable only, without its name nor the rest of their label (as in R-Caid, whose
predict_process_tagobjective predicts the name). - Number of threads training Doc2Vec. Training is deterministic only with 1.
- Depth D of the Weisfeiler-Lehman rooted subgraphs (RSGs) of each node, built from node and edge types (ProGrapher: 3 on small graphs, 4 on large ones).
- Number of negative RSGs sampled per RSG (PV-DBOW).
- RSGs seen fewer times in the training snapshots are ignored.
- Initial learning rate of doc2vec.
- Epochs to infer the embedding of each snapshot (all splits) from the trained RSG vectors.
- Processes extracting RSGs and inferring embeddings, and threads of doc2vec training (training is only deterministic with 1).
- Off by default, hurts generalization (paper Appendix E).
- Off by default, same reason as use_lifespan.
- SPIDER encoder size preset (selects hidden / layers / heads / FFN). Standard presets: 'tiny' (H=128), 'mini' (H=256), 'med' (H=512), 'baseline' (H=768). HF pretrained model_types use their own size keys (e.g. 'small' / 'medium' / 'large' / 'xl' for gpt2_pretrained, '1b' / '3b' for llama3_pretrained).
- SPIDER pretraining objective + architecture. See config/pretrained/README.md for full descriptions. Families:
MLM walk-based : bert, roberta, modernbert, ropebert, llama, logbert
Walk embedding : deepwalk, node2vec
GNN self-supervised: graphmae, gae, dgi
GNN token-budget : gnn_distill, behavior_cluster, spider
HF pretrained : gpt2_pretrained, llama3_pretrained, opt_pretrained
Available options (one selection):bertrobertamodernbertropebertllamalogbertdeepwalknode2vecgraphmaegaedgignn_distillbehavior_clusterspidergpt2_pretrainedllama3_pretrainedopt_pretrained - Skip-gram context window size. Default: 5.
- Number of Word2Vec training epochs. Default: 10.
- Minimum label frequency to include in vocabulary. Default: 1.
- Number of parallel workers for Word2Vec training. Default: 4.
- Return parameter. Higher p = less likely to revisit previous node. Default: 1.0.
- In-out parameter. q > 1 = BFS-like (local); q < 1 = DFS-like (explore). Default: 1.0.
- GNN edge embedding dimension. Default: 128.
- GNN hidden dimension. Default: 128.
- Number of GNN encoder layers. Default: 1.
- Number of attention heads in GNN layers. Default: 4.
- Min direct neighbors to sample per entity. Default: 5.
- Max direct neighbors to sample per entity. Default: 20.
- Dedup neighbors by (edge_type, node_type, label) and prioritize edge type diversity. Default: True.
- Weight for distillation loss (T5 encoder → GNN alignment). Default: 0.5.
- Weight for GNN masked reconstruction loss. Default: 1.0.
- Learning rate for GNN teacher parameters. Default: 1e-3.
- EMA momentum for teacher update (0.999 = slow-moving). Default: 0.999.
- Apply per-edge-type linear projection to source nodes before GNN message passing. Default: False.
- Remove shared libs, /dev, /proc, /sys, linker cache, common configs from GNN neighborhoods. Default: False.
- Contrastive projection head output dimensionality. Default: 128.
- Weight for multi-label BCE loss. Default: 1.0.
- Weight for contrastive (NT-Xent) loss. Default: 0.5.
- Temperature for InfoNCE cosine similarity scaling. Default: 0.07.
- Skip entities with fewer behavior labels in their signature. Default: 2.
- Remove shared libs, /dev, /proc, /sys, linker cache, common configs from signature extraction. Default: True.
- Use contrastive projection head for inference embeddings (proj_dim) instead of raw encoder (emb_dim). Default: False.
- Floor: oversample small classes to this minimum per epoch. 0 = no floor. Default: 0.
- Cap entities per signature class per epoch. Rotates across epochs. 0 = no cap. Default: 0.
- K in P×K batch sampling: number of entities per class per batch. Guarantees every entity has at least K-1 positives for contrastive learning. Default: 4.
- Classification head mode: 'multilabel' = BCE over behavior labels, 'class' = cross-entropy over entity classes. Default: multilabel.
- Contrastive positive definition: 'signature' = entities with identical behavior signatures are positives, 'entity_class' = entities with the same coarse functional class are positives. Default: signature.
- Remove entity type prefix tokens ([PROC], [FILE], [SOCK]) from tokenized sequences. Forces the model to learn identity from behavior rather than type. Default: False.
- GNN edge embedding dimension. Default: 256.
- GNN encoder hidden dimension. Default: 256.
- Contrastive projection dimension (teacher). Default: 256.
- Number of attention heads in GNN TransformerConv. Default: 4.
- Min direct neighbors to sample per entity. Default: 5.
- Max direct neighbors to sample per entity. Default: 20.
- Dedup neighbors by (edge_type, node_type, label) and prioritize edge type diversity. Default: True.
- Remove shared libs, /dev, /proc, /sys from GNN neighborhoods. Default: True.
- EMA momentum for teacher T5 update. Default: 0.999.
- Weight for supervised contrastive loss on GNN teacher. Default: 1.0.
- Weight for distillation loss (student → GNN targets). Default: 0.5.
- SupCon temperature. Default: 0.07.
- Skip entities with fewer behavior labels (for entity class assignment). Default: 2.
- Floor: oversample small classes to this minimum per epoch. Default: 100.
- Cap entities per class per epoch. Default: 2000.
- K in P×K batching. Default: 4.
- Remove entity type prefix tokens from inputs. Default: False.
- Distillation loss: sce or mse. Default: sce.
Available options (one selection):scemse - Teacher loss: contrastive (SupCon) or bce (cross-entropy). Default: contrastive.
Available options (one selection):contrastivebce - Teacher data modalities (comma-separated): signature, gnn_emb, or both. Default: signature,gnn_emb.
- Student-only ablation: none, student_signature, or student_class. Default: none.
Available options (one selection):nonestudent_signaturestudent_class - Number of GAT encoder layers. Default: 2.
- Number of attention heads in GAT layers. Default: 4.
- Number of GAT decoder layers. Default: 1.
- Fraction of nodes to mask during pretraining. Default: 0.5.
- Fraction of masked nodes replaced with random tokens (rest get [MASK]). Default: 0.1.
- Minimum number of neighbors in temporal neighborhood. Default: 5.
- Maximum number of neighbors in temporal neighborhood. Default: 20.
- Number of training epochs. Default: 100.
- Learning rate. Default: 0.001.
- Number of GAT encoder layers. Default: 2.
- Number of attention heads in GAT layers. Default: 4.
- Minimum number of neighbors in temporal neighborhood. Default: 5.
- Maximum number of neighbors in temporal neighborhood. Default: 20.
- Number of training epochs. Default: 100.
- Learning rate. Default: 0.001.
- Number of GAT encoder layers. Default: 2.
- Number of attention heads in GAT layers. Default: 4.
- Minimum number of neighbors in temporal neighborhood. Default: 5.
- Maximum number of neighbors in temporal neighborhood. Default: 20.
- Number of training epochs. Default: 100.
- Learning rate. Default: 0.001.
- Total number of tokens to process during pretraining (controls training duration).
- Number of tokens for learning rate warmup at the start of pretraining.
- Mini-batch size during pretraining. Interpretation depends on model_type: walks per batch (MLM), entities per batch (GNN token-budget), labels per batch (HF pretrained), neighborhoods per batch (GNN-SSL).
- Peak learning rate for pretraining (after warmup).
- Learning rate scheduler shape after warmup. Only consumed by MLM and HF pretrained; GNN token-budget hardcodes cosine.
Available options (one selection):cosinelinear - Initial fixed mask rate (fraction of nodes masked). Decays to mask_rate_min.
- Minimum mask rate after decay.
- Enable structured masking of edge types during pretraining and edge-type scoring at inference.
- Use global attention every N layers. Other layers use local sliding window attention. Default: 3.
- Sliding window size for local attention layers. Default: 128 tokens.
- Base frequency for rotary position embeddings. Default: 10000.0.
- Base frequency for rotary position embeddings. Default: 10000.0.
- Weight for hypersphere volume minimization loss relative to MLM loss. Default: 0.1.
- Comma-separated list of dataset names to use for multi-dataset pretraining.
- Path to a folder of pretrained weights (e.g. the SPIDER weights). May contain any subset of: corpus.pt (sampler states + indexid2msg), tokenizer.pt (BPE vocabulary), pretrain_*.pt (model checkpoint), behavior_vocab.txt. Present artifacts are loaded; missing ones are computed from scratch. Works with any model_type.
- Graph context scope for walk sampling at both pretraining and inference time. 'window' = each time-window snapshot independently; 'day' = merge all snapshots from the same calendar day; 'all' = merge all snapshots in the relevant split (train split at pretrain time; val or test split at inference time — no training data leaks into inference context).
Available options (one selection):windowdayall - Number of nodes per random walk during pretraining.
- Number of random walks to sample per node per epoch during pretraining.
- Temporal weighting for neighbor selection: 'uniform', 'exponential', or 'linear'.
- Half-life (in seconds) for exponential time weighting of neighbor selection.
- Randomize the temporal entry point for each walk. When True, the first hop picks a random edge instead of always starting from the earliest/latest timestamp.
- Edge-type diversity bias for random walks during pretraining. 0 = no bias (default), higher values increasingly favor edges whose type is underrepresented in the current walk. Only affects pretraining; finetuning/inference use natural distribution.
Tokenization¶
Methods that learn from text first split the label of each entity into tokens. The tokenization is set in featurization.tokenization, independently of the featurization method:
used_method selects the tokenizer and the sub-dict of the same name sets its arguments. Each system config sets its own tokenization, so it is reproduced exactly, and any featurization method can use the tokenization of another system.
| Tokenization | Splits labels into | Used by |
|---|---|---|
nltk |
words, with NLTK, after separating paths on / and IPs on : and . (type_aware: True), or every label on /, : and . (type_aware: False) |
Orthrus, R-Caid, NodLink (type_aware: True), FLASH (type_aware: False) |
hierarchical |
each level of the path or IP: /usr/bin/ls → /usr, /usr/bin, /usr/bin/ls |
Kairos |
whole_label |
a single token per entity (type and label) | DeepWalk, Node2Vec |
bpe |
domain-specific pieces (path components, flags, ports, IP categories, …) and BPE subwords learned on the training labels | SPIDER and the other pretrained encoders |
huggingface |
the subwords of a HuggingFace tokenizer (model_name) |
GPT-2, Llama and OPT pretrained encoders |
none |
no tokens | methods that do not read labels: only_type, only_ones, magic, ocrapt_features, alacarte, graph2vec |
For example, Orthrus with the BPE tokenization of SPIDER:
doc2vec, temporal_rw, flash and hierarchical_hashing accept every tokenization except none. word2vec and fasttext also exclude whole_label, since they learn from one sentence per label.
The BPE vocabulary is learned on the same labels as the featurization method and saved with it.
The pretrained encoders are built around one tokenization, which must match pretrained.model_type.
Substitutions¶
Some values change between otherwise identical entities: hashes, UUIDs, random temporary file names, PIDs, ephemeral ports.
Each tokenization sets in substitutions which of them are replaced by a placeholder token before tokenizing, so that such entities share their tokens.
It is a comma-separated list, or none:
| Substitution | Replaces | Placeholder |
|---|---|---|
hash |
hexadecimal strings of 7+ characters (MD5, SHA, commit ids) | [HASH] |
guid |
GUIDs / UUIDs, also inside a word | [GUID] |
random |
random-looking strings (mixed case and digits) and Windows SIDs | [RANDOM] |
version |
version numbers (1.2.3, v2.0-rc1) |
[VER] |
timestamp |
words starting with a date (2019-05-08...) |
[TIMESTAMP] |
env_var |
environment variables ($HOME, ${PATH}, %APPDATA%) |
[ENV] |
number |
numbers above 255 (PIDs, inodes); smaller ones like IP octets are kept | [NUM] |
ip |
IP addresses of netflow entities | [PRIVATE_IP], [PUBLIC_IP], [LOCALHOST_IP] |
port |
ports of netflow entities | [PORT_HTTPS], [PORT_SSH], … or [PORT_LOW], [PORT_REG], [PORT_EPH] |
The original systems use none, except SPIDER and the other BPE-based pretrained encoders, which use all of them. For example, Orthrus with hashes, random strings and large numbers replaced:
The bpe tokenization applies them during its domain-specific pre-tokenization (mode: domain_bpe), where they are checked on each path component and argument.
The other tokenizations apply them to whole words of the label, separated by spaces and by / \ : = , & (by spaces and ip:port in netflow labels), before tokenizing it; placeholders are kept as single tokens.
- none
- nltk
- type_aware: bool (1)
- substitutions: str (2)
- hierarchical
- substitutions: str (3)
- whole_label
- substitutions: str (4)
- bpe
- vocab_size: int (5)
- max_seq_len: int (6)
- mode: str (7)
- substitutions: str (8)
- canonicalize_neighbors: bool (9)
- huggingface
- model_name: str (10)
- max_seq_len: int (11)
- substitutions: str (12)
- NLTK word tokenization. If True, process and file labels are split on '/' and netflow labels on ':' and '.' (Orthrus, R-Caid, NodLink). If False, all labels are split on '/', ':' and '.' (FLASH).
- Variable values replaced by a placeholder token before tokenization, or
none.hash: hex strings of 7+ chars -> [HASH];guid: GUIDs/UUIDs -> [GUID];random: random-looking strings and Windows SIDs -> [RANDOM];version: 1.2.3 -> [VER];timestamp: words starting with a date -> [TIMESTAMP];env_var: $HOME, %APPDATA% -> [ENV];number: numbers above 255 -> [NUM];ip: netflow IPs -> [PRIVATE_IP]/[PUBLIC_IP]/[LOCALHOST_IP];port: netflow ports -> [PORT_HTTPS], [PORT_SSH], ... or [PORT_LOW]/[PORT_REG]/[PORT_EPH].
Available options (multi selection):hashguidrandomversiontimestampenv_varnumberipportnone - Variable values replaced by a placeholder token before tokenization, or
none.hash: hex strings of 7+ chars -> [HASH];guid: GUIDs/UUIDs -> [GUID];random: random-looking strings and Windows SIDs -> [RANDOM];version: 1.2.3 -> [VER];timestamp: words starting with a date -> [TIMESTAMP];env_var: $HOME, %APPDATA% -> [ENV];number: numbers above 255 -> [NUM];ip: netflow IPs -> [PRIVATE_IP]/[PUBLIC_IP]/[LOCALHOST_IP];port: netflow ports -> [PORT_HTTPS], [PORT_SSH], ... or [PORT_LOW]/[PORT_REG]/[PORT_EPH].
Available options (multi selection):hashguidrandomversiontimestampenv_varnumberipportnone - Variable values replaced by a placeholder token before tokenization, or
none.hash: hex strings of 7+ chars -> [HASH];guid: GUIDs/UUIDs -> [GUID];random: random-looking strings and Windows SIDs -> [RANDOM];version: 1.2.3 -> [VER];timestamp: words starting with a date -> [TIMESTAMP];env_var: $HOME, %APPDATA% -> [ENV];number: numbers above 255 -> [NUM];ip: netflow IPs -> [PRIVATE_IP]/[PUBLIC_IP]/[LOCALHOST_IP];port: netflow ports -> [PORT_HTTPS], [PORT_SSH], ... or [PORT_LOW]/[PORT_REG]/[PORT_EPH].
Available options (multi selection):hashguidrandomversiontimestampenv_varnumberipportnone - Target BPE vocabulary size.
- Maximum number of tokens per label (and per walk for the pretrained MLM models). Longer sequences are truncated.
- 'domain_bpe' splits labels with domain-specific rules before BPE; 'bpe_only' applies BPE directly on whitespace-separated words.
Available options (one selection):domain_bpebpe_only - Variable values replaced by a placeholder token before tokenization, or
none.hash: hex strings of 7+ chars -> [HASH];guid: GUIDs/UUIDs -> [GUID];random: random-looking strings and Windows SIDs -> [RANDOM];version: 1.2.3 -> [VER];timestamp: words starting with a date -> [TIMESTAMP];env_var: $HOME, %APPDATA% -> [ENV];number: numbers above 255 -> [NUM];ip: netflow IPs -> [PRIVATE_IP]/[PUBLIC_IP]/[LOCALHOST_IP];port: netflow ports -> [PORT_HTTPS], [PORT_SSH], ... or [PORT_LOW]/[PORT_REG]/[PORT_EPH].
Available options (multi selection):hashguidrandomversiontimestampenv_varnumberipportnone - Enable multi-level neighbor canonicalization. When True, decoder targets keep only structural/categorical tokens ([] special tokens + OS-agnostic category tokens like [CAT_WEBSERVER], [FCAT_LOG_WEB]) while encoder input gets full detail + category tokens prepended. During continue_pretrain, neighbors keep all tokens with category tokens prepended.
- HuggingFace id of the tokenizer (e.g. openai-community/gpt2). 'auto' uses the tokenizer of the HuggingFace pretrained model set in
featurization.pretrained(gpt2_pretrained, llama3_pretrained, opt_pretrained). - Maximum number of tokens per label. Longer labels are truncated.
- Variable values replaced by a placeholder token before tokenization, or
none.hash: hex strings of 7+ chars -> [HASH];guid: GUIDs/UUIDs -> [GUID];random: random-looking strings and Windows SIDs -> [RANDOM];version: 1.2.3 -> [VER];timestamp: words starting with a date -> [TIMESTAMP];env_var: $HOME, %APPDATA% -> [ENV];number: numbers above 255 -> [NUM];ip: netflow IPs -> [PRIVATE_IP]/[PUBLIC_IP]/[LOCALHOST_IP];port: netflow ports -> [PORT_HTTPS], [PORT_SSH], ... or [PORT_LOW]/[PORT_REG]/[PORT_EPH].
Available options (multi selection):hashguidrandomversiontimestampenv_varnumberipportnone