A robot user detection method, system, device and medium based on large language model combined with user relationship network analysis

Through large language models and user relationship network analysis, combined with feature encoding and graph neural networks, the accuracy and efficiency problems of robot user detection in existing technologies are solved, and efficient and accurate social network data analysis and robot account identification are achieved.

CN119669695BActive Publication Date: 2025-09-23XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411790407.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-09-23
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

Existing technologies for detecting robot users on social media platforms suffer from insufficient accuracy, low efficiency, limited data processing capabilities, lack of in-depth analysis and weak generalization capabilities, poor adaptability, and difficulty in purifying user features. In particular, real-time detection is difficult to achieve when faced with massive amounts of social data.

Method used

By combining a large language model with user relationship network analysis, we construct user portraits and automatically identify robot accounts through design prompt engineering, user information preprocessing, feature encoding, and graph neural network training. We use a large language model to generate user description features and posting/comment content, which are then encoded using the RoBERTa model. Graph neural networks are then used to learn the key features that distinguish real users from robot accounts.

Benefits of technology

It improves the accuracy and adaptability of robot user detection, enhances data processing and generalization capabilities, simplifies the feature purification process, and realizes efficient social network data analysis and recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure HDA0005175171230000011
    Figure HDA0005175171230000011
Patent Text Reader

Abstract

A robot user detection method, system, device, and medium based on a large language model combined with user relationship network analysis. The method includes the following steps: first, optimizing the large language model through design prompt engineering and standardizing its output so that it can efficiently process social network data; second, collecting information including user ID, name, location, and profile, and preprocessing it to form a training set; using the large language model to analyze user profiles and published / commented content, extracting features to construct user profiles; then, performing feature encoding on the user information, including normalization, one-hot encoding, and RoBERTa model encoding; using these features to train a graph neural network model to learn key features that distinguish real users from robots; finally, inputting the user information into the model for detection, and automatically identifying robot accounts; the system, device, and medium are used to implement the method; the present invention can improve accuracy, adaptability, and efficiency, enhance data processing and generalization capabilities, and simplify the feature extraction process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing and graph data mining, and in particular to a robot user detection method based on a large language model combined with user relationship network analysis. Background Art

[0002] With the rapid development of social media, including the ubiquity of platforms like Weibo and Xiaohongshu, the speed and scope of information dissemination have reached unprecedented levels. However, this widespread information flow also presents a series of challenges, particularly regarding information authenticity and security, an issue that has garnered widespread attention both domestically and internationally. For example, hundreds of thousands of messages are disseminated on Twitter at any given moment, making ensuring their authenticity and security a significant challenge. Therefore, directly assessing the impact of users disseminating information on social media platforms can help ensure the authenticity and security of disseminated content at the source. Among these users, bots (automated social media accounts) have the greatest negative impact on social media platforms. They rapidly and in bulk send negative messages, contaminating the dissemination of authentic and secure information and making it difficult for users to filter out authentic and secure information.

[0003] The abuse of bots has become a growing problem, with robots often used to spread false information, manipulate public opinion, and commit online fraud.

[0004] Traditional bot detection methods primarily rely on identifying unusual patterns in account behavior, such as posting frequency, link-sharing habits, and interaction patterns with other accounts. However, these methods have significant limitations in accuracy and efficiency. Some advanced bots are able to circumvent these simple detection mechanisms by mimicking human behavior. Furthermore, as bot generation technology advances, they are becoming increasingly sophisticated, better able to adapt to and mimic the behavior of real users. This makes it difficult to parse behavioral patterns that differ from those of real users from their social data, making detection even more difficult. Furthermore, the massive amount of social data collected by bots poses challenges to traditional detection methods.

[0005] Wu et al. published BotTriNet: A unified and efficient embedding for social bots detection via metric learning (J. Wu, X. Ye, and MY Yuet, “BotTriNet: A unified and efficient embedding for social bots detection via metric learning,” in Proc. 11th Int. Symp. Digit. Forensics Secur., 2023, pp. 1–6.), a unified embedding framework for Twitter bot detection using the textual content of accounts. The authors designed a triplet network to adjust the original embeddings generated by traditional natural language processing techniques to improve classification performance. However, because the input user features are only the textual content of the account's posts, the social relationships of users on the social platform are ignored. Processing all the posted textual content is time-consuming and labor-intensive, resulting in insufficient accuracy, low efficiency, lack of deep analysis, and weak generalization ability.

[0006] Feng et al. published Satar: A self-supervised approach to twitter accountrepresentation learning and its application in bot detection (S.Feng, H.Wan, N.Wang, J.Li, and M.Luo, “Satar: A self-supervised approach to twitter accountrepresentation learning and its application in bot detection,” in Proceedings of the 30th ACM International Conference on Information & Knowledge Management, 2021, pp.3808–3817.), which introduced a self-supervised method to detect social robots by aggregating user features into sub-networks based on configuration attributes, follower relationships, and post content. However, it relies on massive data analysis and has the disadvantages of being unable to quickly process and analyze massive data and having poor real-time performance.

[0007] In summary, the existing technology has the following disadvantages:

[0008] (1) Insufficient accuracy: Existing technologies mainly detect robot users by identifying abnormal patterns of account behavior, but this method has difficulty distinguishing between advanced robot users and real users because advanced robots can imitate human behavior.

[0009] (2) Inefficiency: Traditional methods are inefficient in processing massive social data, especially when it is necessary to analyze a large amount of user behavior and social network structure.

[0010] (3) Limited data processing capabilities: Existing technologies have difficulty coping with the growing amount of social data, especially when data needs to be processed and analyzed quickly to detect robot users in real time.

[0011] (4) Lack of in-depth analysis: Existing technologies do not fully utilize deep learning and social network analysis techniques to deeply understand user behavior and social network structure.

[0012] (5) Weak generalization ability: Existing methods may perform well on a specific dataset, but may perform poorly on new or unknown data, lacking good generalization ability.

[0013] (6) Lack of adaptability: Existing technologies may not be able to adapt to the characteristics and changes of different social platforms and lack flexibility and universality.

[0014] (7) Difficulty in purifying user features: In massive amounts of data, it is a challenge to effectively extract features from user social data that help identify robot users. Summary of the Invention

[0015] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a robot user detection method, system, device and medium based on a large language model combined with user relationship network analysis. By using a large language model and graph neural network, an automated and intelligent detection process, combined with natural language processing and social network analysis technology, through training and regularization methods of a large amount of labeled data, robot users can be more accurately identified, manual intervention can be reduced, the efficiency of processing massive data can be improved, user social data can be more effectively processed and analyzed, user behavior and social network structure can be deeply analyzed, the depth and quality of detection can be improved, the generalization ability of the model on unknown data can be improved, the accuracy, adaptability and efficiency can be improved, the data processing ability and generalization ability can be enhanced and the feature purification process can be simplified.

[0016] In order to achieve the above object, the technical solution adopted by the present invention is:

[0017] A robot user detection method based on a large language model combined with user relationship network analysis includes the following steps:

[0018] S1: First, we design a prompting project for the large language model to perform reasoning and generation, and standardize the output of the large language model to ensure that the model can effectively process and analyze social network data.

[0019] S2: Collect user information, including the user's ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and posted / commented content; pre-process and annotate the user information to form a training set;

[0020] S3: Analyze the profiles and posts / comments collected in step S2 using the large language model prompting project designed in step S1, extract user description features and posts / comments, align the results, and build a user profile.

[0021] S4: Perform feature encoding on the user information collected in step S2, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using the pre-trained RoBERTa model;

[0022] S5: Use the feature encoding produced in step S4 to train the algorithm model of the graph neural network based on the user relationship network, so that the algorithm model of the graph neural network can learn the key features that distinguish real users from robot accounts. Through training data and iterative optimization, the algorithm model of the graph neural network gradually improves its recognition accuracy.

[0023] S6: The actual user information is put into the algorithm model of the graph neural network trained in step S5 for detection. Through intelligent analysis of the algorithm model of the graph neural network, potential robot accounts are automatically identified and marked.

[0024] The step S1 specifically includes:

[0025] Divide the prompt engineering of designing large language models into three modules: instructions, context, and prediction requirements;

[0026] In the instruction module, we define the tasks for the large language model and specify various scenarios and requirements. This section introduces the concept of role-playing, pre-assigning the large language model as a community administrator for the social platform. The subsequent tasks are to summarize user profiles and select the k most representative posts / comments.

[0027] In the context module, define the personal profile of the user and the content of the post / comment;

[0028] In the demand prediction module, the output requirements and format are precisely defined. In addition, combined with the concept of one-shot learning, output examples are designed to help the large language model understand the task content and output format, guiding the large language model to output in JSON format.

[0029] The preprocessing in step S2 includes removing invalid data, filling missing values, and performing text cleaning;

[0030] Removing invalid data: If there is missing or garbled data in the user information of the published / commented content, as well as missing user ID, number of followers, or number of followings, it will be uniformly defined as invalid data and removed;

[0031] Filling missing values: The missing data in the user's personal profile is fed to the large language model through the user's published / commented content, and the large language model outputs the user's personal profile to fill the information;

[0032] Text cleaning: Delete irrelevant characters in user information, including special symbols, numbers, HTML tags, and extra spaces, and uniformly set the data encoding format to UTF-8 format to facilitate subsequent feature extraction and model training;

[0033] The redundant spaces include spaces at the beginning and end of the text, and multiple spaces between words.

[0034] In step S3, user description feature extraction includes the following steps:

[0035] S3.1: The large language model prompting project designed in step S1 is combined with the personal profile and posts / comments in the user information and input into the large language model. The large language model is required to re-summarize the personal profile and select the k most representative posts / comments. The k posts / comments selected by the large language model are then matched one by one with all posts published by the user to accurately identify the original text of the posts / comments. This ensures that the k posts / comments selected by the large language model are aligned with the posts / comments in the original user information.

[0036] S3.2: Use the predicted demand module in step S1 as an example of the output of the large language model. Require the large language model to output the personal profile and k selected posts / comments summarized in step S3.1 in JSON format. Set a JSON format regular expression to filter and match the output of the large language model, and convert the answers to the JSON data format for easy reading.

[0037] S3.3: For the answer of the large language model, select the currently open source large language model for local deployment and the API call of the closed source large language model, and select the k selected posts / comments output from the large language model in step S3.2, where 1≤k≤10.

[0038] The feature encoding of the user information in step S4 includes the following steps:

[0039] The z-score normalization of the numerical features is specifically as follows: the number of followers, number of followings, number of lists, creation time, number of favorites, and verification status in the user information are set as the user's numerical features, and the mean μ and standard deviation σ of each numerical feature are calculated. Each numerical feature is converted into a standardized z-score form using the z-score formula to eliminate the dimensionality effect between different numerical features, so that they can be compared and analyzed on the same scale;

[0040] The one-hot encoding of the categorical features is specifically as follows: the public name, nickname, location information, and language setting in the user information are set as the user's categorical features. For each categorical feature, a binary vector is created, and the length of the binary vector is equal to the number of categories of the feature. For each user record, according to the value of the categorical feature, the corresponding binary vector position is marked as 1, and the remaining positions are marked as 0. The categorical features of the user information are one-hot encoded to convert them into a numerical form that can be processed by the machine learning model;

[0041] The encoding of the user's descriptive features and the posting / comment content features is specifically as follows: the user portrait constructed in step S3 is used as the user's descriptive features, the k selected postings / comments are used as the user's posting / comment content features, and the pre-trained RoBERTa is used to encode the user's descriptive features and the posting / comment content features, taking the semantic features of the text to enhance the model's understanding of the posting / comment content.

[0042] The step S5 specifically includes the following steps:

[0043] S5.1: Consider users as nodes and define two types of edges for them: following and follower, representing two different social relationships of users. Combine user numerical features, user category features, user description features, and post / comment content features to form nodes in a heterogeneous graph. Combine user social relationships and category nodes in the heterogeneous graph to form a user relationship network, and obtain a graph neural network model.

[0044] S5.2: By labeling data and training the graph neural network model obtained in step S5.1, learning and reasoning are performed using node features and graph structure information to learn the key features that distinguish real users from robot accounts. During the training process, the model parameters are iteratively optimized through the back-propagation algorithm. The accuracy of the graph neural network model is improved by minimizing the difference between the predicted results and the actual labels. The network learning rate of the graph neural network model is set to θ, the dropout rate is set to σ, and the weight_decay is set to ω. The momentum optimizer is used, the cross-entropy loss function is selected and different regularization methods are added. The model parameters are back-propagated using the results of the cross-entropy loss function, and the gradient of each parameter is calculated. The parameters of the graph neural network model are updated using gradient descent to reduce the value of the cross-entropy loss function. Cross-validation is used, and Accuracy and F1-score are used as evaluation indicators to evaluate the performance of the model to ensure the generalization ability of the model.

[0045] A robot user detection system based on a large language model combined with user relationship network analysis, including:

[0046] The prompt engineering module designs prompt engineering for large language models, performs inference and generation of large language models, and standardizes the output of large language models to ensure that the model can effectively process and analyze social network data;

[0047] The data preprocessing module collects user information, including the user's ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and post / comment content; preprocesses and annotates user information to form a training set;

[0048] The user profile generation module uses a large language model to analyze the user profile and published / commented content, extract user description features and published / commented content, align the results, and construct a user profile.

[0049] The feature encoding module encodes the user information, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using the pre-trained RoBERTa model;

[0050] The model training module uses feature encoding to train the algorithm model of the graph neural network based on the user relationship network, enabling the algorithm model of the graph neural network to learn the key features that distinguish real users from robot accounts. Through training data and iterative optimization, the algorithm model of the graph neural network gradually improves its recognition accuracy;

[0051] The detection execution module puts actual user information into the algorithm model of the graph neural network for detection, and automatically identifies and marks potential robot accounts through intelligent analysis of the algorithm model of the graph neural network.

[0052] A robot user detection device based on a large language model combined with user relationship network analysis, comprising:

[0053] Memory: used to store a computer program for implementing the robot user detection method based on a large language model combined with user relationship network analysis;

[0054] Processor: used to implement the robot user detection method based on a large language model combined with user relationship network analysis when executing the computer program.

[0055] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a robot user detection method based on a large language model combined with user relationship network analysis.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] 1. This paper adopts role-playing and one-shot learning in large language model prompt engineering to achieve precise task specification of user information summarization and representative content selection and standardize the output format of large language models, with enhanced capabilities for processing and analyzing social network data.

[0058] 2. The present invention uses a large language model to generate user portraits, realizes in-depth analysis of user behavior and attributes, has feature purification, and reduces the feature data that needs to be processed by the recognition model.

[0059] 3. The present invention uses z-score normalization and one-hot encoding on user information to achieve the elimination of dimensions between different features and the effective conversion of category features, which has the effect of improving the model comparison and analysis capabilities.

[0060] 4. The present invention uses the pre-trained RoBERTa model to encode user description features and posting / comment content features, realizes the extraction of text semantic features, and has the effect of enhancing the model's ability to understand content.

[0061] 5. This invention uses a technology that combines a large language model with user relationship network analysis to achieve efficient detection of robot users in social networks, significantly improving accuracy and adaptability.

[0062] 6. The present invention adopts a graph neural network model for training, optimization and detection, realizes complex pattern recognition based on user relationship networks, enhances the robot's account recognition ability, and improves its self-learning and adaptability to new situations.

[0063] 7. The present invention implements the detection method through an integrated system, equipment and medium, realizes the integration and convenience of the detection process, and has the convenience of system deployment and maintenance.

[0064] In summary, compared with traditional rule-based detection methods, the present invention has the advantages of strong ability to process and analyze social network data, feature purification, reducing the feature data that the recognition model needs to process, improving the generalization ability of the model on unknown data, accuracy, adaptability, self-learning ability and detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 2 is a comparison chart of the simulation experiment results of the present invention and the baseline.

[0066] Figure 2 These are the network parameters and detection accuracy of the SOTA and the present invention on Cresci-15 and Twibot-20 in the simulation experiments of the present invention.

[0067] Figure 3 The number of posts and detection accuracy of SOTA and the present invention on Cresci-15 and Twibot-20 in the simulation experiment of the present invention. DETAILED DESCRIPTION

[0068] The present invention will be described in detail below with reference to the accompanying drawings.

[0069] The present invention provides a robot user detection method based on a large language model combined with user relationship network analysis, comprising the following steps:

[0070] S1: First, we design a prompting project for the large language model to perform reasoning and generation, and standardize the output of the large language model to ensure that the model can effectively process and analyze social network data.

[0071] S2: Collect user information, including the user's ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and posted / commented content; pre-process and annotate the user information to form a training set;

[0072] S3: Analyze the profiles and posts / comments collected in step S2 using the large language model prompting project designed in step S1, extract user description features and posts / comments, align the results, and build a user profile.

[0073] S4: Perform feature encoding on the user information collected in step S2, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using the pre-trained RoBERTa model;

[0074] S5: Use the feature encoding produced in step S4 to train the algorithm model of the graph neural network based on the user relationship network, so that the algorithm model of the graph neural network can learn the key features that distinguish real users from robot accounts. Through training data and iterative optimization, the algorithm model of the graph neural network gradually improves its recognition accuracy.

[0075] S6: The actual user information is put into the algorithm model of the graph neural network trained in step S5 for detection. Through intelligent analysis of the algorithm model of the graph neural network, potential robot accounts are automatically identified and marked.

[0076] The step S1 specifically includes:

[0077] Divide the prompt engineering of designing large language models into three modules: instructions, context, and prediction requirements;

[0078] In the instruction module, we define the tasks for the large language model and specify various scenarios and requirements. This section introduces the concept of role-playing, pre-assigning the large language model as a community administrator for the social platform. The subsequent tasks are to summarize user profiles and select the k most representative posts / comments.

[0079] In the context module, define the personal profile of the user and the content of the post / comment;

[0080] In the demand prediction module, the output requirements and format are precisely defined. In addition, combined with the concept of one-shot learning, output examples are designed to help the large language model understand the task content and output format, guiding the large language model to output in JSON format.

[0081] The preprocessing in step S2 includes removing invalid data, filling missing values, and performing text cleaning;

[0082] Removing invalid data: If there is missing or garbled data in the user information of the published / commented content, as well as missing user ID, number of followers, or number of followings, it will be uniformly defined as invalid data and removed;

[0083] Filling missing values: The missing data in the user's personal profile is fed to the large language model through the user's published / commented content, and the large language model outputs the user's personal profile to fill the information;

[0084] Text cleaning: Delete irrelevant characters in user information, including special symbols, numbers, HTML tags, and extra spaces, and uniformly set the data encoding format to UTF-8 format to facilitate subsequent feature extraction and model training;

[0085] The redundant spaces include spaces at the beginning and end of the text, and multiple spaces between words.

[0086] Labeling of user information: User information is categorized into two types: robot accounts and human accounts.

[0087] In step S3, user description feature extraction includes the following steps:

[0088] S3.1: The large language model prompting project designed in step S1 is combined with the personal profile and posts / comments in the user information and input into the large language model. The large language model is required to re-summarize the personal profile and select the k most representative posts / comments. The k posts / comments selected by the large language model are then matched one by one with all posts published by the user to accurately identify the original text of the posts / comments. This ensures that the k posts / comments selected by the large language model are aligned with the posts / comments in the original user information.

[0089] S3.2: Use the predicted demand module in step S1 as an example of the output of the large language model. Require the large language model to output the personal profile and k selected posts / comments summarized in step S3.1 in JSON format. Set a JSON format regular expression to filter and match the output of the large language model, and convert the answers to the JSON data format for easy reading.

[0090] S3.3: For the answers from the large language model, we selected the currently open-source large language model for local deployment and the closed-source large language model API call. We also selected the k posts / comments output from the large language model in step S3.2, where 1≤k≤10. We set k to 2, 5, and 10, respectively, and conducted experiments to compare the accuracy of the final classification results. Finally, we selected Vicuna-7b-v1.5 as the optimal large language model, and set k to 5.

[0091] The published / commented content is specifically: all published / commented content data in the user information is input into the large language model, and the large language model is allowed to select k published / commented content that best represent the user characteristics.

[0092] The above alignment process constructs a user profile. Specifically, the large language model selects k posts / comments that best represent the user's characteristics and aligns them with the posts / comments in the user's profile. Tampering with the original text and semantic modification are prohibited. The user profile is then constructed by combining the k posts / comments selected by the large language model with the profile information summarized by the large language model.

[0093] The feature encoding of the user information in step S4 includes the following steps:

[0094] The z-score normalization of the numerical features is specifically as follows: the number of followers, number of followings, number of lists, creation time, number of favorites, and verification status in the user information are set as the user's numerical features, and the mean μ and standard deviation σ of each numerical feature are calculated. Each numerical feature is converted into a standardized z-score form using the z-score formula to eliminate the dimensionality effect between different numerical features, so that they can be compared and analyzed on the same scale;

[0095] The one-hot encoding of the categorical features is specifically as follows: the public name, nickname, location information, and language setting in the user information are set as the user's categorical features. For each categorical feature, a binary vector is created, and the length of the binary vector is equal to the number of categories of the feature. For each user record, according to the value of the categorical feature, the corresponding binary vector position is marked as 1, and the remaining positions are marked as 0. The categorical features of the user information are one-hot encoded to convert them into a numerical form that can be processed by the machine learning model;

[0096] The encoding of the user's descriptive features and the posting / comment content features is specifically as follows: the user portrait constructed in step S3 is used as the user's descriptive features, the k selected postings / comments are used as the user's posting / comment content features, and the pre-trained RoBERTa is used to encode the user's descriptive features and the posting / comment content features, taking the semantic features of the text to enhance the model's understanding of the posting / comment content.

[0097] The step S5 specifically includes the following steps:

[0098] S5.1: Consider users as nodes and define two types of edges for them: following and follower, representing two different social relationships of users. Combine user numerical features, user category features, user description features, and post / comment content features to form nodes in a heterogeneous graph. Combine user social relationships and category nodes in the heterogeneous graph to form a user relationship network, and obtain a graph neural network model.

[0099] S5.2: By labeling data and training the graph neural network model obtained in step S5.1, learning and reasoning are performed using node features and graph structure information to learn the key features that distinguish real users from robot accounts. During the training process, the model parameters are iteratively optimized through the back-propagation algorithm, and the accuracy of the graph neural network model is improved by minimizing the difference between the predicted results and the actual labels. The network learning rate of the graph neural network model is set to θ, the dropout rate is set to σ, and the weight_decay is set to ω. The momentum optimizer Adam is used, the cross-entropy loss function is selected and the L2 regularization method is added. The model parameters are back-propagated using the results of the cross-entropy loss function, and the gradient of each parameter is calculated. The parameters of the graph neural network model are updated using gradient descent to reduce the value of the cross-entropy loss function. Cross-validation is used, and Accuracy and F1-score are used as evaluation indicators to evaluate the performance of the model to ensure the generalization ability of the model. In this way, the model can gradually improve its recognition accuracy and effectively distinguish normal users from potential robot accounts.

[0100] A robot user detection system based on a large language model combined with user relationship network analysis, including:

[0101] The prompt engineering module designs a prompt engineering for a large language model, performs inference and generation of the large language model, and standardizes the output of the large language model to ensure that the model can effectively process and analyze social network data, thereby implementing step S1 of a robot user detection method based on a large language model combined with user relationship network analysis.

[0102] A data preprocessing module collects user information, including the user's ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and posted / commented content; preprocesses and annotates the user information to form a training set for implementing step S2 of a robot user detection method based on a large language model combined with user relationship network analysis;

[0103] A user profile generation module analyzes the user profile and published / commented content in the user information through a large language model prompting project, extracts user description features and published / commented content, aligns the results, and constructs a user profile for implementing step S3 of a robot user detection method based on a large language model combined with user relationship network analysis;

[0104] A feature encoding module encodes user information, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using a pre-trained RoBERTa model, for implementing step S4 of a robot user detection method based on a large language model combined with user relationship network analysis;

[0105] A model training module uses feature encoding to train an algorithm model of a graph neural network based on a user relationship network, enabling the graph neural network algorithm model to learn key features that distinguish between real users and robot accounts. Through training data and iterative optimization, the graph neural network algorithm model gradually improves its recognition accuracy, thereby implementing step S5 of a robot user detection method based on a large language model combined with user relationship network analysis.

[0106] The detection execution module puts the actual user information into the algorithm model of the graph neural network for detection. Through the intelligent analysis of the algorithm model of the graph neural network, it automatically identifies and marks potential robot accounts, which is used to implement step S6 of a robot user detection method based on a large language model combined with user relationship network analysis.

[0107] A robot user detection device based on a large language model combined with user relationship network analysis, comprising:

[0108] Memory: used to store a computer program for implementing the robot user detection method based on a large language model combined with user relationship network analysis;

[0109] Processor: used to implement the robot user detection method based on a large language model combined with user relationship network analysis when executing the computer program.

[0110] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the robot user detection method based on a large language model combined with user relationship network analysis.

[0111] Simulation experiment

[0112] 1. Dataset

[0113] Cresci-15 is an early and widely used open-source dataset for social bot detection. The accounts in the Cresci-15 dataset include both human users and fake follower accounts (fake follower accounts) that pay to follow other accounts. In terms of data size, Cresci-15 contains 5,301 users, 2,827,757 tweets, and 14,220 edges. Cresci-15 includes both semantic and attribute information about Twitter users.

[0114] Twibot-20 is a public social bot detection dataset. It serves as a large-scale social bot detection benchmark on Twitter. It contains 229,573 users, 33,488,192 tweets, 8,723,736 user attribute entries, and 455,958 follow relationships. This dataset yields a heterogeneous graph consisting of 229,580 nodes and 227,979 edges. Compared to previous datasets, this dataset not only includes user attributes and semantic information but also adds community relationships among users.

[0115] 2. Baseline comparison

[0116] DeeProBot: DeeProBot uses long short-term memory (LSTM) units and dense layers to specifically extract data features from user profiles and enhances word representations with pre-trained GloVe embeddings.

[0117] BotBuster: BotBuster is a social bot detection system that processes user metadata and textual information and uses a mixture of experts model to enhance cross-platform bot detection.

[0118] RF-GNN: RF-GNN uses graph neural networks (GNNs) as base classifiers to build random forests, and uses different subgraphs to train GNN base classifiers, and finally aggregates them to produce results.

[0119] SATAR

[36] : SATAR introduces a self-supervised approach to detect Twitter bots by aggregating user features into sub-networks based on profile attributes, follower relationships, and tweet content.

[0120] BotRGCN: BotRGCN is a Twitter bot detection framework that uses relational graph convolutional networks to address community challenges by constructing a heterogeneous graph consisting of attention relations.

[0121] LMBot: LMBot is a robot detection framework based on pre-trained language models, suitable for deployment environments without graphs.

[0122] BotCS: BotCS introduces a simple multi-layer perceptron (MLP)-based model without using graph neural networks (GNN) to detect Twitter bots, integrates social graph features, and adopts custom rules based on local bot-human interactions for prediction.

[0123] RGT: RGT introduces a user-based framework that uses edge-heterogeneous graphs to model multi-dimensional relationships and influences, effectively learning user features and interactions.

[0124] BIC: BIC is a Twitter bot detection framework with text-graph interaction and semantic consistency.

[0125] like Figure 1 As shown in the figure, the evaluation indicators of the model of this method, namely Ours, are compared with the existing advanced models.

[0126] Among recent research methods, our method surpasses most models with an accuracy of 86.81% and an F1-score of 88.48%. After introducing a large model, our method significantly surpasses models like BotRGCN and LMBot, with an accuracy slightly lower than RGT and BIC. Experimental results demonstrate that our method surpasses most optimal values ​​of other methods, and that it requires simpler data preprocessing and fewer data features.

[0127] 2. Efficiency comparison

[0128] We have observed a significant trend in recent social robot detection research, which involves constructing and computing more data feature attributes to improve the accuracy of detection models. These methods typically use machine learning or deep learning techniques to learn the underlying distribution of various feature information. Although theoretically able to improve the predictive ability of the model, they have not yet considered the associated cost issues. As the number of data feature attributes increases, the computational burden and number of parameters of the model also increase, making deployment more challenging. Figure 2 As shown in the figure, compared with high-precision SOTA methods such as SATAR, RGT and LMBot, Ours is the method of the present invention, which requires fewer model parameters while maintaining higher effectiveness.

[0129] In contrast, the method of the present invention achieves excellent performance with fewer parameters, which shows that the present invention achieves superior performance while reducing parameters and training costs.

[0130] Furthermore, to demonstrate that selectively selecting and generating the most representative and unique user data can improve the accuracy of the model compared to relying on extensive and complex social data processing, the present invention is compared with related model (SOTA) methods such as BotRGCN, LMBot, BotBuster and BotCS. Figure 3 As shown, Ours, i.e., the present invention, can achieve SOTA results using only 5 posts.

[0131] By generating high-quality user data, the present invention achieves top-level results with only 5 posts, outperforming other SOTA methods for optimizing data or models in terms of effectiveness and operability.

[0132] 3. Ablation Experiment

[0133] In this part of the experiment, we will demonstrate the advantages of each module. This study will respectively demonstrate (1) the role of the large language model; (2) the role of the prompt engineering; and (3) the impact of different k values ​​in the large language model's selection of the k most representative tweets.

[0134] 3.1 The Role of Large Language Models

[0135] This study uses a large language model (LLM) to summarize and filter features from the original dataset, known as a LLM summarization and screening module. Experiments in this paper investigated the performance of the social bot detection model with and without the LLM summarization and screening module. Accuracy and F1-score were used to measure the effectiveness of the LLM module in selecting the most representative and discriminative tweets and generating appropriate user descriptions, i.e., user profiles, for social bot detection. The comparative results with and without the LLM are shown in Table 1 below.

[0136] Table 1: Comparison of experimental results with and without large language model enhancement

[0137] Accuracy F1-score With LLMs 0.8681 0.8848 Without LLMs 0.8462 0.8707

[0138] In Table 1, we can see that on the Twibot20 dataset, the accuracy of using large model enhancement is 86.81%, and the accuracy of not using large model enhancement is 84.62%, an improvement of about 2%. This proves that large language models play a positive role in the social robot detection task and that user portraits are effective for social robot detection.

[0139] 3.2 The role of prompt engineering

[0140] In the design of the prompt project, we primarily utilize a contextual learning framework to improve the performance of large language models. Specifically, we combine the concepts of role-playing and one-shot learning to standardize the output style of large language models. Customized task instructions and examples are then added to guide the large language model to complete tasks that meet both generation and centralized selection requirements. Through experiments, we will discuss the necessity of role-playing and one-shot learning in prompt design.

[0141] 3.2.1 The role of role playing in the project

[0142] Role-playing in Prompt Engineering: Role-playing, also known as role-specific prompts, is the process of guiding a large language model to complete a task by assuming a specific role. This involves not only assigning a name or title to the model but also deeply constructing a virtual persona with unique perspectives, expertise, and behavioral patterns. Through this approach, the large language model can more accurately simulate the mindset of a specific persona, thereby providing answers that are more realistic in real-life scenarios. Different personas influence the content and style of the large language model's responses. In this experiment, a large language model was given the role of a social platform community assistant to improve its performance on social networking-related tasks while also avoiding situations where the model would refuse to generate user personas due to privacy concerns. Experimental operators explored the impact of role-playing in prompts on the final detection task, measuring the effectiveness using accuracy and F1 score. Table 2 shows the impact of role-playing in prompt design on the enhanced performance of the large language model on Twibot-20, where "W" stands for "With" and "O" stands for "Without."

[0143] Table 2: Effects of prompt engineering on the final detection task with and without role-playing

[0144] Accuracy F1-score Prompt W Role-Playing 0.8681 0.8848 Prompt O Role-Playing 0.8521 0.8685

[0145] The accuracy and F1 score of using role-playing in the prompting process reached 86.81% and 88.48%, respectively, which were 1.6% and 1.63% higher than those without role-playing. This demonstrates that using role-playing in the prompting process has a positive effect on the accurate generation of user personas.

[0146] 3.2.2 The role of one-shot learning in prompt engineering

[0147] While large language models demonstrate impressive zero-shot capabilities, they perform poorly on complex tasks when used in the zero-shot setting. In this experiment, simply feeding the large language models a task description and output requirements failed to produce the answers we needed. They often output redundant content and non-compliant output formats, making it difficult to extract the relevant data.

[0148] Few-sample prompts can be used as a technology to enable contextual learning. The present invention only needs to put a small number of samples in the context of the input text to induce the large language model to achieve better performance. In this experiment, the present invention hopes that the large language model will output user_description and the most representative k tweets k_tweets in JSON format to facilitate subsequent input data processing. Therefore, the present invention provides an output example in JSON format for the large language model, requiring the large language model to output according to this example, thereby limiting its output. The experiment explored the impact of prompt engineering statements with or without output examples on the output of the large language model, and measured its effect with the JSON format pass rate, which is calculated as follows:

[0149] θ=Json_num / All_file (1-1)

[0150] The results of the effects of providing prompt engineering sentences with or without output examples on the output of the large language model are shown in Table 3 below:

[0151] Table 3: The impact of prompt engineering sentences with or without output examples on the output of large language models

[0152] θ Prompt W One-shot Learning 0.8164 Prompt O One-shot Learning 0.5203

[0153] Through few-shot learning, the user profile data output in JSON format is 29.61% higher than the data generated without few-shot learning. This shows that few-shot learning significantly improves the ability of large language models to build effective user profiles, playing a key role in generating high-quality user profiles.

[0154] The role of 3.3K value

[0155] To explore the performance of social bot detection models, we conducted experiments on the k value, aiming to find the optimal k value for selecting the most representative tweets for large language models. Accuracy and F1-score were used as evaluation metrics. This study tested three scenarios with k = 2, k = 5, and k = 10, and selected three large language models for testing: Llama2-7b, ChatGLM3-6b, and Vicuna-7b-v1.5, forming nine control experiments.

[0156] These experiments demonstrate that the choice of k significantly impacts the model's detection capabilities. Each setting of k results in different detection accuracies, indicating that the selected number of posts is a key factor in the model's ability to effectively capture user behavior characteristics. Experimental results indicate that when k is low, the model may not fully capture the complexity of user behavior; conversely, when k is high, unnecessary noise may be introduced, potentially impairing the model's judgment. The results show that bot detection models (particularly Vicuna-7b-v1.5) perform best when k is set to 5. This finding emphasizes that, in certain situations, a moderate number of posts is more effective than processing all users' posts at once, as it better helps the model identify and learn user behavior patterns, thereby improving detection accuracy. Vicuna-7b-v1.5's powerful language processing capabilities, combined with an appropriate k value, enable the model to more accurately distinguish between social bots and human users. The number of tweets and evaluation results are shown in Table 4 below.

[0157] Table 4 Precision indicators for different numbers of tweets

[0158]

[0159]

Claims

1. A robot user detection method based on a large language model combined with user relationship network analysis, characterized in that: The following steps are involved: S1: First, we design a prompting project for the large language model to perform reasoning and generation, and standardize the output of the large language model to ensure that the model can effectively process and analyze social network data. The prompt engineering of the large language model is divided into three modules: instructions, context, and predicted needs; In the instruction module, we define the tasks for the large language model and specify various scenarios and requirements. This section introduces the concept of role-playing, pre-assigning the large language model as a community administrator for the social platform. The subsequent tasks are to summarize user profiles and select the k most representative posts / comments. In the context module, define the personal profile of the user and the content of the post / comment; In the demand prediction module, we precisely defined the output requirements and format. Furthermore, incorporating the concept of one-shot learning, we designed output examples to help the large language model understand the task content and output format, guiding it to output in JSON format. S2: Collect user information, including user ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and published / commented content; Preprocess and label user information to form a training set; S3: Analyze the profiles and posts / comments collected in step S2 using the large language model prompting project designed in step S1, extract user description features and posts / comments, align the results, and build a user profile. The user description feature extraction comprises the following steps: S3.1: The large language model prompting project designed in step S1 is combined with the personal profile and posts / comments in the user information and input into the large language model. The large language model is required to re-summarize the personal profile and select the k most representative posts / comments. The k posts / comments selected by the large language model are then matched one by one with all posts published by the user to accurately identify the original text of the posts / comments. This ensures that the k posts / comments selected by the large language model are aligned with the posts / comments in the original user information. S3.2: Use the predicted demand module in step S1 as an example of the output of the large language model. Require the large language model to output the personal profile and k selected posts / comments summarized in step S3.1 in JSON format. Set a JSON format regular expression to filter and match the output of the large language model, and convert the answers to the JSON data format for easy reading. S3.3: For the responses from the large language model, select the currently open-source large language model for local deployment and the closed-source large language model API call, and select the k selected posts / comments output from the large language model in step S3.2, where 1≤k≤10; S4: Perform feature encoding on the user information collected in step S2, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using the pre-trained RoBERTa model; S5: Use the feature encoding produced in step S4 to train the algorithm model of the graph neural network based on the user relationship network, so that the algorithm model of the graph neural network can learn the key features that distinguish real users from robot accounts. Through training data and iterative optimization, the algorithm model of the graph neural network gradually improves its recognition accuracy. S6: The actual user information is put into the algorithm model of the graph neural network trained in step S5 for detection. Through intelligent analysis of the algorithm model of the graph neural network, potential robot accounts are automatically identified and marked.

2. The robot user detection method based on a large language model combined with user relationship network analysis according to claim 1 is characterized in that: The preprocessing in step S2 includes removing invalid data, filling missing values, and performing text cleaning; Removing invalid data: If there is missing or garbled data in the user information of the published / commented content, as well as missing user ID, number of followers, or number of followings, it will be uniformly defined as invalid data and removed; Filling missing values: The missing data in the user's personal profile is fed to the large language model through the user's published / commented content, and the large language model outputs the user's personal profile to fill the information; Text cleaning: Delete irrelevant characters in user information, including special symbols, numbers, HTML tags, and extra spaces, and uniformly set the data encoding format to UTF-8 format to facilitate subsequent feature extraction and model training; The redundant spaces include spaces at the beginning and end of the text, and multiple spaces between words.

3. The robot user detection method based on a large language model combined with user relationship network analysis according to claim 1 is characterized in that: The feature encoding of the user information in step S4 includes the following steps: The z-score normalization of the numerical features is specifically as follows: the number of followers, number of followings, number of lists, creation time, number of favorites, and verification status in the user information are set as the user's numerical features, and the mean μ and standard deviation σ of each numerical feature are calculated. Each numerical feature is converted into a standardized z-score form using the z-score formula to eliminate the dimensionality effect between different numerical features, so that they can be compared and analyzed on the same scale; The one-hot encoding of the categorical features is specifically as follows: the public name, nickname, location information, and language setting in the user information are set as the user's categorical features. For each categorical feature, a binary vector is created, and the length of the binary vector is equal to the number of categories of the feature. For each user record, according to the value of the categorical feature, the corresponding binary vector position is marked as 1, and the remaining positions are marked as 0. The categorical features of the user information are one-hot encoded to convert them into a numerical form that can be processed by the machine learning model; The encoding of the user's descriptive features and the posting / comment content features is specifically as follows: the user portrait constructed in step S3 is used as the user's descriptive features, the k selected postings / comments are used as the user's posting / comment content features, and the pre-trained RoBERTa is used to encode the user's descriptive features and the posting / comment content features, taking the semantic features of the text to enhance the model's understanding of the posting / comment content.

4. The robot user detection method based on a large language model combined with user relationship network analysis according to claim 3 is characterized in that: The step S5 specifically includes the following steps: S5.1: Consider users as nodes and define two types of edges for them: following and follower, representing two different social relationships of users. Combine user numerical features, user category features, user description features, and post / comment content features to form nodes in a heterogeneous graph. Combine user social relationships and category nodes in the heterogeneous graph to form a user relationship network, and obtain a graph neural network model. S5.2: By labeling data and training the graph neural network model obtained in step S5.1, learning and reasoning are performed using node features and graph structure information to learn the key features that distinguish real users from robot accounts. During the training process, the model parameters are iteratively optimized through the back-propagation algorithm. The accuracy of the graph neural network model is improved by minimizing the difference between the predicted results and the actual labels. The network learning rate of the graph neural network model is set to θ, the dropout rate is set to σ, and the weight_decay is set to ω. The momentum optimizer is used, the cross-entropy loss function is selected and different regularization methods are added. The model parameters are back-propagated using the results of the cross-entropy loss function, and the gradient of each parameter is calculated. The parameters of the graph neural network model are updated using gradient descent to reduce the value of the cross-entropy loss function. Cross-validation is used, and Accuracy and F1-score are used as evaluation indicators to evaluate the performance of the model to ensure the generalization ability of the model.

5. A detection system based on the robot user detection method based on a large language model combined with user relationship network analysis according to any one of claims 1 to 4, comprising: The prompt engineering module designs prompt engineering for large language models, performs inference and generation of large language models, and standardizes the output of large language models to ensure that the model can effectively process and analyze social network data; The data preprocessing module collects user information, including the user's ID, public name, nickname, location information, personal profile, account protection status, number of followers, number of followings, number of lists, creation time, number of favorites, verification status, language settings, and post / comment content; Preprocess and label user information to form a training set; The user profile generation module uses a large language model to analyze the user profile and published / commented content, extract user description features and published / commented content, align the results, and construct a user profile. The feature encoding module encodes the user information, including z-score normalization of numerical features, one-hot encoding of categorical features, and encoding the user description features and post / comment content features extracted in step S3 using the pre-trained RoBERTa model; The model training module uses feature encoding to train the algorithm model of the graph neural network based on the user relationship network, enabling the algorithm model of the graph neural network to learn the key features that distinguish real users from robot accounts. Through training data and iterative optimization, the algorithm model of the graph neural network gradually improves its recognition accuracy; The detection execution module puts actual user information into the algorithm model of the graph neural network for detection, and automatically identifies and marks potential robot accounts through intelligent analysis of the algorithm model of the graph neural network.

6. A robot user detection device based on a large language model combined with user relationship network analysis, characterized in that: include: Memory: used to store a computer program for implementing a robot user detection method based on a large language model combined with user relationship network analysis as described in any one of claims 1 to 4; Processor: used to implement the robot user detection method based on a large language model combined with user relationship network analysis as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a robot user detection method based on a large language model combined with user relationship network analysis as described in any one of claims 1 to 4.