Code for Out-of-Distribution Detection via LLM-Guided Outlier Generation for Text-attributed Graph.
- ID: ID node embedding
- Our: Our generated high-quality OOD node
- Random: Randomly generated OOD node
-
$\color{black}{Bold Black}$ : Phrases showing semantic similarity between ID and OOD content -
$\color{red}{Red}$ : Content exhibiting distinctive OOD characteristics
# 1. Generate Hard OOD Nodes
bash scripts/get_ood_nodes.sh
# 2. Obtain OOD-ID, OOD-OOD edge dataset
bash scripts/get_new_edges.sh
# 3. fintune local LLM for node distinction
bash scripts/train_lora.sh
# 4. train light-weight edge predictors and predict other potential edges
bash scripts/edge_train_and_predcit.sh
# 5. Combine OOD sample with ID graph to enhance OOD detection
cd gnnsafe
bash ood_detect.sh

