Source-linked AI summary
LLM-Empowered Class Imbalanced Graph Prompt Learning for Online Drug Trafficking Detection
Tianyi Ma, Yiyue Qian, Zehong Wang, Zheyuan Zhang, Chuxu Zhang, Yanfang Ye
TL;DR
Online drug-trafficking detection on social platforms is challenged by class imbalance and scarce labels. LLM-HetGDT combines contrastive heterogeneous-graph pretraining, LLM-generated minority-class nodes, and prompt tuning; on Twitter-HetDrug, it outperforms baselines on both minority and majority classes in the 10% setting.
Problem
Online drug-trafficking detection methods face class imbalance and scarce labeled samples, limiting their practicality in real-world settings.
Source: §1 · pp. 1–2Method
LLM-HetGDT contrastively pre-trains an HGNN, uses an LLM to generate minority-class nodes, and fine-tunes prompts on the augmented heterogeneous graph.
Source: §3.1 · p. 3, §3.2.2 · p. 5, §5 · p. 8Results
On Twitter-HetDrug-10%, LLM-HetGDT outperforms all baseline methods on both minority and majority classes.
Source: §4.4.2 · p. 8Takeaways & Limitations
The paper contributes Twitter-HetDrug, a new Twitter heterogeneous graph dataset for studying drug-trafficking activities.
Source: §5 · p. 8The study uses SentenceBert and open-source Llama3.1 70B, and whether more powerful text encoders or LLMs would improve performance remains uncertain.
Source: §6 · p. 9
Abstract
from arXiv · showhide
As the market for illicit drugs remains extremely profitable, major online platforms have become direct-to-consumer intermediaries for illicit drug trafficking participants. These online activities raise significant social concerns that require immediate actions. Existing approaches to combating this challenge are generally impractical, due to the imbalance of classes and scarcity of labeled samples in real-world applications. To this end, we propose a novel Large Language Model-empowered Heterogeneous Graph Prompt Learning framework for illicit Drug Trafficking detection, called LLM-HetGDT, that leverages LLM to facilitate heterogeneous graph neural networks (HGNNs) to effectively identify drug trafficking activities in the class-imbalanced scenarios. Specifically, we first pre-train HGNN over a contrastive pretext task to capture the inherent node and structure information over the unlabeled drug trafficking heterogeneous graph (HG). Afterward, we employ LLM to augment the HG by generating high-quality synthetic user nodes in minority classes. Then, we fine-tune the soft prompts on the augmented HG to capture the important information in the minority classes for the downstream drug trafficking detection task. To comprehensively study online illicit drug trafficking activities, we collect a new HG dataset over Twitter, called Twitter-HetDrug. Extensive experiments on this dataset demonstrate the effectiveness, efficiency, and applicability of LLM-HetGDT.
1 Introduction
Online platforms have become intermediaries for illicit drug trafficking, while existing approaches face class imbalance and label scarcity. LLM-HetGDT combines heterogeneous graph learning, synthetic minority-class users, and prompt tuning; the paper also introduces Twitter-HetDrug and reports effectiveness against state-of-the-art baselines.
1 Introduction
- Existing LLM-based and graph-based approaches face class imbalance and label scarcity, motivating efficient detection in low-label settings.LLM methods may be inefficient at social-network scale and overlook relationships; graph methods often assume balanced data and sufficient labels.Source: §1 · p. 2
- LLM-HetGDT pre-trains an HGNN with a contrastive task, generates synthetic minority-class user nodes with an LLM, and fine-tunes prompts on the augmented graph.The graph models relationships among users, posts, and keywords.Source: §1 · p. 2
- The authors present LLM-HetGDT as a framework for heterogeneous graph representation learning under class imbalance and label scarcity.They describe it as the first use, to their knowledge, of heterogeneous graph prompt learning and LLMs for online drug-trafficking study with limited labels under class imbalance.Source: §1 · p. 2
- The paper introduces Twitter-HetDrug, a heterogeneous graph dataset collected from Twitter for studying drug-trafficking activities.Source: §1 · p. 2
- Comprehensive experiments on Twitter-HetDrug demonstrate LLM-HetGDT’s effectiveness compared with state-of-the-art baselines.The introduction reports this result without specifying metric values.Source: §1 · p. 2
2 Backgrounds
The background defines heterogeneous graphs and class imbalance, then reviews graph-based approaches to imbalance and motivates text-level synthetic-node generation.
2 Backgrounds
- A heterogeneous graph has typed nodes and typed relations, with attribute feature matrices defined for each node type.Source: §2 · p. 2
- Class imbalance distinguishes majority and minority classes using the class imbalance ratio between class pairs.Source: §2 · p. 2
- Graph imbalance methods include post-hoc correction, loss modification, and re-sampling; examples include synthetic-node generation and re-weighting.The paper motivates generating synthetic nodes from text attributes to seek more accurate, valuable nodes than feature-level oversampling may provide.Source: §2 · p. 3
3 Methodology
LLM-HetGDT combines contrastive HGNN pretraining, LLM-based minority-user graph augmentation, and prompt tuning for drug-trafficking detection. Its prompts adapt node features and representations to the downstream classification task.
3.1 Pre-train HGNN
- Contrastive pretraining maps heterogeneous node attributes into a shared space and uses meta-path and schema views to learn target-node representations from the unlabeled graph.The framework uses contrastive learning to capture contextual and structural information before prompt tuning.Source: §3.1 · p. 3
3.2.1 HG Augmentation via LLM
- For each labeled minority-class user, an LLM generates a synthetic user and selects neighbors from the original user's neighborhood; the augmented graph is used only for prompt tuning.Synthetic users are generated from user text, while neighbor selection addresses the mismatch between synthetic and original users.Source: §3.2.1 · pp. 4–5
3.2.2 HG Prompting Function Design
- Class-specific feature tokens are injected into target-node attributes to reduce majority-class influence and capture class-specific characteristics.Attention combines the feature tokens, and the framework also injects prompts for other node types.Source: §3.2.2 · p. 5
- A structure prompt aggregates neighbors along meta-paths, while participant and benign prototype tokens make classification a similarity comparison aligned with contrastive pretraining.Prototype tokens are initialized from labeled-node embeddings and tuned to represent class characteristics.Source: §3.2.2 · pp. 5–6
3.2.3 Prompt Tuning
- Prompt tuning injects the structure prompt into target-node embeddings and optimizes classification with a contrastive loss and an orthogonality constraint on drug-trafficking prompts.A trade-off hyperparameter appears in the final prompt-tuning objective.Source: §3.2.3 · p. 6
4 Experiments
Experiments evaluate LLM-HetGDT on the imbalanced Twitter-HetDrug dataset across training-label settings, prompt variants, minority-class performance, and a live deployment. The reported comparisons favor LLM-HetGDT over baseline methods.
4.1 New Dataset for Drug Trafficking Detect
- Twitter-HetDrug contains only 11.9% drug-trafficking participants and was collected through the official Twitter API from December 2020 to August 2021.Source: §4.1 · p. 6
4.2 Experimental Setup
- Twenty-one baselines span seven method groups; supervised methods run five times, and evaluation reports Macro-F1 and GMean.Experiments use 500 epochs and Llama3.1 70B as the LLM backbone.Source: §4.2 · pp. 6–7
4.3 Performance Comparison
- LLM-HetGDT achieves the best performance among all baseline models on Twitter-HetDrug across the evaluated training-label settings.Heterogeneous-graph methods outperform graph methods, class-imbalance methods outperform graph representation methods, and the strongest baseline shifts from HGPrompt at low-label settings to PC-GNN at high-label settings.Source: Table 1 · p. 7, §4.3 · p. 7
4.4.1 Prompt Component Analysis
- Removing the prompts reduces performance; removing the drug-trafficking prompt especially highlights the role of participant prototypes, while node and structure prompts also contribute.Source: §4.4.1 · p. 7, Figure 3 · p. 8
4.4.2 Minority Class Analysis
- On Twitter-HetDrug-10%, LLM-HetGDT outperforms every baseline for both drug-trafficking participants and benign users.Source: Table 2 · p. 8, §4.4.2 · p. 8
4.5 Deployment Evaluation
- In a January 2025 live Twitter deployment, LLM-HetGDT outperforms MetaHG and KG-GPT in every reported aspect.Source: Table 3 · p. 8, §4.5 · p. 8
4.6 Case Study
- The synthetic-user example preserves identifying phrases from the original profile while adding new information, including street-name hashtags.The source profile contains phrases such as “online dispensary” and “premium lab-tested psychedelic products.”Source: Table 4 · p. 8, §4.6 · p. 8
5 Conclusion
LLM-HetGDT addresses class imbalance and label scarcity in online drug-trafficking detection by augmenting a heterogeneous graph with synthetic minority-class nodes. The study introduces Twitter-HetDrug and reports experiments demonstrating the framework’s effectiveness, efficiency, and applicability.
5 Conclusion
- LLM-HetGDT augments a heterogeneous graph with synthetic minority-class nodes to help HGNNs learn information about drug-trafficking participants.The framework is proposed for online detection under class-imbalanced and label-scarce conditions.Source: §5 · p. 8
- The authors collect Twitter-HetDrug, a new heterogeneous-graph dataset for studying drug-trafficking activity on Twitter.Source: §5 · p. 8
- Experiments on Twitter-HetDrug demonstrate the framework’s effectiveness, efficiency, and applicability.Source: §5 · p. 8
6 Limitations
The authors identify two limitations: their use of SentenceBert for text encoding and open-source Llama3.1 70B for synthetic-user and edge generation. They leave open whether stronger text encoders or LLMs would improve performance.
6 Limitations
- SentenceBert is used to encode text attributes, following prior studies, although alternatives may perform better.Source: §6 · p. 9
- Synthetic users and edges are generated with open-source Llama3.1 70B, which may have lower capability than closed-source models such as GPT-4o and DeepSeek-R1.Source: §6 · p. 9
- Whether more powerful text encoders or LLMs would further improve performance remains uncertain.Source: §6 · p. 9
7 Ethical Considerations
The ethical discussion flags possible bias or harmful content in generated material and recommends careful prompting and responsible use. The related-work discussion notes that existing graph prompt models overlook class imbalance in heterogeneous graphs.
7 Ethical Considerations
A Detailed Related Works
- Existing graph-prompt models such as GraphPrompt, GPPT, and HGPrompt are described as overlooking class imbalance in heterogeneous graphs.Source: A Detailed Related Works · p. 12
B.1 HG Construction on Social Media Data
Twitter-HetDrug represents social-media trafficking activity with heterogeneous entities, content features, and relations. The section also describes data collection and annotation, prompt templates, and mechanisms used in the graph model.
B.1 HG Construction on Social Media Data
- The graph uses user, tweet, and keyword nodes with six relation types to represent content and connections among social-media entities.The listed relations include following, posting, engagement, profile keywords, tweet keywords, and hashtags.Source: §B.1 · pp. 12–13
B.2 Data Collection on Social Media
- Metadata collected from December 2020 to August 2021 yielded 54,680 users, 326,826 tweets, and 288 valid keywords.Source: §B.2 · p. 13
B.3 Annotation Rules
- Six researchers spent 62 days annotating users under rules that classify trafficking participants using promotion, community connections, overdose or addiction, or evidence of purchases.Source: §B.3 · p. 13
B.4 Drug Types and Keywords
- A keyword list covering 21 drug types is used to filter drug-relevant tweets; the appendix lists drug types and partial keywords.Source: §B.4 · pp. 13–14
C Prompt Templates
- Tables 8 and 9 provide node and edge prompt templates for generating synthetic user information and their neighbors.Source: C Prompt Templates · p. 14, Table 8 · p. 14, Table 9 · p. 14
D.1 Attention Mechanism; D.4 Semantic Attention Mechanisms
- The attention descriptions cover feature-token attention and semantic attention over meta-path representations; the latter uses shared W and b parameters across meta-paths.Source: §D.1 · p. 14, §D.4 · p. 15
D.2 Set Transformer
- The set transformer uses a learnable seed query, layer normalization, an MLP, and multi-head attention to process a set of input tokens.Source: §D.2 · p. 14
D.3 Meta Path
- Twitter-HetDrug specifies the User-Tweet-Keyword-Tweet-User meta-path as one composite relation between node types.Source: §D.3 · pp. 14–15
E Baseline Settings
The baselines span graph, heterogeneous-graph, class-imbalance, graph-prompt, and LLM methods. Table 10 reports mean ± std performance on Twitter-HetDrug, while Tables 11 and 12 cover searched and basic-training hyperparameters.
E Baseline Settings
- Seven baseline groups cover graph representation, heterogeneous graphs, heterogeneous self-supervision, class-imbalance methods, graph imbalance methods, graph prompting, and LLMs.The comparison is on Twitter-HetDrug for drug trafficking detection; Table 10 reports mean ± std performance.Source: E Baseline Settings · p. 15, Table 10 · p. 16
- HetGNN, HAN, and HGT represent heterogeneous-graph baselines, while DMGI, HeCo, HGMAE, and MetaHG represent heterogeneous self-supervised methods.Their listed approaches include neighbor-feature fusion, hierarchical attention, cross-view contrastive learning, masking, and meta-knowledge distillation.Source: E Baseline Settings · p. 15
- The imbalance baselines include re-weighting, over-sampling, and SMOTE, alongside GraphENS, GraphSMOTE, and PC-GNN for graph imbalance.GraphENS synthesizes ego networks, GraphSMOTE adds a re-sampling module and edge predictor, and PC-GNN uses a pick-and-choose strategy.Source: E Baseline Settings · pp. 15–16
- Prompt-learning baselines include GPPT, Self-Pro, GraphPrompt, and HGPrompt; the LLM group uses KG-GPT prompts with three backbone LLMs.The listed backbones are Llama-3.1-70B-Instruct, Mistral-Small-24B-Instruct, and DeepSeek-R1-Distill-Llama-70B; hyperparameters are listed in Tables 11 and 12.Source: E Baseline Settings · pp. 16–17, Table 11 · p. 16, Table 12 · p. 17
F Additional Experimental Settings
The appendix describes hyperparameter selection and a live deployment evaluation. The deployment setting tests detection on an expanded Twitter social circle with a small labeled training set.
F Additional Experimental Settings
- Following Wang et al. (2024a) and Qian et al. (2021), the authors grid-searched each model’s optimal hyper-parameter and report the best performance; searched hyper-parameters appear in Table 11, and their model’s optimal settings in Table 12.Source: F Additional Experimental Settings · p. 17
G Deployment Evaluation Settings
- The deployment evaluation uses an expanded Twitter graph of 416 users, including 61 drug-trafficking participants, with three participants and seven benign users for training.The remaining users are tested, and the three training participants are included as few-shot examples in LLM prompts for a fair comparison.Source: G Deployment Evaluation Settings · p. 17
H Additional Experiment Comparison
The additional comparison reports baseline and proposed-method performance on Twitter-HetDrug and describes a hyperparameter sensitivity test using Macro-F1.
H Additional Experiment Comparison
- Table 10 compares all baseline methods with LLM-HetGDT on Twitter-HetDrug for drug trafficking detection.The table reports performance as mean ± std.Source: H Additional Experiment Comparison · p. 17
- The reported comparison includes all baseline methods and the proposed method, rather than only selected model groups.This scope is stated for Table 10 on Twitter-HetDrug.Source: H Additional Experiment Comparison · p. 17
- Table 13 tests Macro-F1 sensitivity to the number of basis vectors and hidden dimensions.The table caption identifies both hyperparameters as the sensitivity-test variables.Source: Table 13 · p. 17
I Hyper-parameter Sensitivity Analysis
The sensitivity analysis finds good performance with few basis vectors and split-dependent hidden dimensions. A case study shows LLM-selected edges linking synthetic users to behaviorally relevant tweets.
I Hyper-parameter Sensitivity Analysis
- K = 5 basis vectors achieve good Macro-F1, while K = 10 is best for the 10% and 40% training splits and satisfactory for 20%.Table 13 reports the sensitivity test for basis-vector count and hidden dimension.Source: I Hyper-parameter Sensitivity Analysis · p. 17
- 256 is optimal for the 10% training split, while 512 works best for the 20% and 40% splits; 1024 reduces performance.The authors suggest a wider layer may prevent focus on the most relevant information and say 256 or 512 is sufficient.Source: I Hyper-parameter Sensitivity Analysis · pp. 17–18
J Additional Case Study
- The LLM selects three advertising tweets, including a same-day-shipping promotion, as neighbors for a synthetic user while excluding a daily update.The case study says attribute-level edge-generation methods might miss the shipping post’s promotional role; Table 14 shows selected neighbors.Source: J Additional Case Study · p. 18, Table 14 · p. 19
Related papers
This paper cites
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning2025
- Semi-Supervised Classification with Graph Convolutional Networks2016
- How Powerful are Graph Neural Networks?2018
- Class-Balanced Loss Based on Effective Number of Samples2019
- Decoupling Representation and Classifier for Long-Tailed Recognition2019
- Few-shot Object Detection via Feature Reweighting2018