Behavior prediction method and device in game, electronic equipment and storage medium

By acquiring game account behavior sequences and using a trained behavior prediction model, combined with positive and negative sample data training, the problems of reliance on human features and subjective interference in existing technologies are solved, achieving efficient and reliable game behavior prediction.

CN121731773APending Publication Date: 2026-03-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, game behavior prediction models rely on manually constructed feature sets, which consume a lot of manpower and are easily affected by subjective experience. The numerical prediction results output lack interpretability, making it difficult for the operations team to make credible interventions.

Method used

By obtaining the behavioral sequences of game accounts as input, and using a pre-trained behavior prediction model, the system outputs behavior prediction results and their basis. The model is trained using positive and negative sample data to avoid subjective interference and improve the practicality and credibility of the prediction results.

Benefits of technology

It saves labor costs, avoids interference from subjective experience, improves the objectivity and credibility of behavioral prediction results, outputs clear prediction basis, and enhances the practicality of the results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121731773A_ABST
    Figure CN121731773A_ABST
Patent Text Reader

Abstract

The invention provides a behavior prediction method and device in a game, electronic equipment and a storage medium. The method comprises the steps of obtaining a target behavior sequence of a game account; wherein the target behavior sequence is used for indicating a first account behavior performed by the game account in a first historical time period; inputting the target behavior sequence into a pre-trained behavior prediction model, and outputting a behavior prediction result and a prediction basis of the behavior prediction result; wherein the behavior prediction result indicates whether the game account executes the target account behavior or not; the behavior prediction model is trained through the first training sample, the first positive sample data and the first negative sample data. According to the mode, the behavior prediction result and the corresponding prediction basis can be output by directly extracting the behavior sequence of the game account and inputting the behavior sequence into the pre-trained behavior prediction model, interference of subjective experience on the prediction process is avoided, meanwhile, the origin of the behavior prediction result is clarified through the prediction basis, and the prediction efficiency is improved. And the practicability and credibility of the behavior prediction result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and in particular to a method, apparatus, electronic device, and storage medium for predicting behavior in games. Background Technology

[0002] As the video game industry accelerates towards diversification and refinement, predicting player behavior through training models has become a core element in improving the game experience and updating operational strategies, providing technical support for key business tasks such as intelligent game guidance and user stickiness analysis.

[0003] In related technologies, the model's input relies on a manually constructed set of player behavior features, such as a set of behavioral features composed of numerical sequences of player match count, recharge amount, hero level, etc. This requires first filtering out valuable behavioral features based on experience, and then performing statistical and engineered processing on each behavioral feature, which is labor-intensive and easily influenced by subjective experience. In addition, the model's output is usually a numerical prediction result. For example, in the scenario of predicting whether a player will log in the next day, the model will predict a numerical conclusion such as "75% probability of logging in the next day". The prediction results lack interpretability, making it difficult for the operations team to use the prediction results to implement credible and targeted interventions. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, electronic device and storage medium for predicting behavior in games, which directly extracts the behavior sequence of the game account as the model input and outputs the behavior prediction result and the prediction basis of the behavior prediction result, thereby avoiding the interference of subjective experience on model training and improving the practicality and reliability of the prediction result.

[0005] In a first aspect, embodiments of the present invention provide a behavior prediction method in a game, the method comprising: acquiring a target behavior sequence of a game account; wherein the target behavior sequence indicates a first account behavior performed by the game account within a first historical time period; inputting the target behavior sequence into a pre-trained behavior prediction model, and outputting a behavior prediction result and a prediction basis for the behavior prediction result; wherein the behavior prediction result indicates whether the game account performs the target account behavior; the behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data; the first training sample includes a sample behavior sequence and a sample result label; the sample behavior sequence indicates a second account behavior performed by the game account within a second historical time period; the sample result label indicates whether the game account performs the target account behavior after completing the second account behavior; the first positive sample data is a prediction basis that satisfies a preset rule, generated based on the sample behavior sequence and the sample result label; the first negative sample data is a prediction basis that does not satisfy the preset rule, generated based on the sample behavior sequence and the sample result label.

[0006] Secondly, embodiments of the present invention provide a behavior prediction device for a game, the device comprising: a first acquisition module, configured to acquire a target behavior sequence of a game account; wherein the target behavior sequence indicates a first account behavior performed by the game account within a first historical time period; a first output module, configured to input the target behavior sequence into a pre-trained behavior prediction model, and output a behavior prediction result and a prediction basis for the behavior prediction result; wherein the behavior prediction result indicates whether the game account performs the target account behavior; the behavior prediction model is trained using a first training sample, first positive sample data, and first negative sample data; the first training sample includes a sample behavior sequence and a sample result label; the sample behavior sequence indicates a second account behavior performed by the game account within a second historical time period; the sample result label indicates whether the game account performs the target account behavior after completing the second account behavior; the first positive sample data is a prediction basis that satisfies a preset rule, generated based on the sample behavior sequence and the sample result label; the first negative sample data is a prediction basis that does not satisfy the preset rule, generated based on the sample behavior sequence and the sample result label.

[0007] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the behavior prediction method in the above-mentioned game.

[0008] Fourthly, embodiments of the present invention provide a storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the behavior prediction method in the above-mentioned game.

[0009] The embodiments of the present invention bring the following beneficial effects: This invention provides a method, apparatus, electronic device, and storage medium for predicting behavior in a game. The method includes: acquiring a target behavior sequence of a game account; wherein the target behavior sequence indicates a first account behavior performed by the game account within a first historical time period; inputting the target behavior sequence into a pre-trained behavior prediction model, and outputting a behavior prediction result and a prediction basis for the behavior prediction result; wherein the behavior prediction result indicates whether the game account performed the target account behavior; the behavior prediction model is trained using a first training sample, first positive sample data, and first negative sample data; the first training sample includes a sample behavior sequence and sample result labels; the sample behavior sequence indicates a second account behavior performed by the game account within a second historical time period; the sample result labels indicate whether the game account performed the target account behavior after completing the second account behavior; the first positive sample data is a prediction basis that satisfies preset rules, generated based on the sample behavior sequence and sample result labels; the first negative sample data is a prediction basis that does not satisfy preset rules, generated based on the sample behavior sequence and sample result labels.

[0010] In this method, training samples are pre-built using the behavior sequences of game accounts over historical time periods and the corresponding result labels. Positive sample data that meets preset rules and negative sample data that does not meet preset rules are then generated for these training samples. These training samples and positive and negative sample data are used together to train the behavior prediction model to obtain the trained behavior prediction model.

[0011] By directly extracting the behavioral sequences of game accounts and inputting them into a pre-trained behavior prediction model, the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, by clarifying the origin of the behavior prediction results through the prediction basis, the practicality and credibility of the behavior prediction results are improved.

[0012] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0013] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0014] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0015] Figure 1 A flowchart of a behavior prediction method in a game provided by an embodiment of the present invention; Figure 2 A flowchart of another behavior prediction method in a game provided by an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a behavior prediction device in a game provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] As the video game industry accelerates its diversification and refinement, accurate prediction of player behavior has become a core element in enhancing the gaming experience and optimizing operational strategies, providing crucial support for tasks such as intelligent game guidance and user engagement analysis. However, the complexity of player behavior sequences presents a significant challenge to accurate prediction. On the one hand, player behavior in games exhibits temporal fluctuations and complex coupling relationships, making it difficult to decouple the causal relationship between various types of game behaviors and player preferences. On the other hand, with the continuous expansion of the game user base, the volume of game log data has exploded, easily exceeding tens of millions or even hundreds of millions of records.

[0018] Traditional feature-based models exhibit numerous limitations when processing such massive log data: they require significant manpower for prior feature selection, resulting in low efficiency and susceptibility to subjective influences from human experience. For example, they rely on manually constructing behavioral feature sets composed of numerical sequences such as player match count, recharge amount, and hero level. Furthermore, due to limitations in model architecture and algorithms, the numerical prediction results output by traditional models lack interpretable attribution basis, making it difficult for operations teams to utilize the prediction results for credible and targeted interventions.

[0019] Based on this, the present invention provides a method, apparatus, electronic device and storage medium for predicting behavior in games, which can be applied to scenarios of predicting the behavior of game users.

[0020] To facilitate understanding of this embodiment, a behavior prediction method in a game disclosed in this invention will first be described in detail, such as... Figure 1 As shown, this method includes the following steps: Step S102: Obtain the target behavior sequence of the game account; wherein, the target behavior sequence is used to indicate: the first account behavior performed by the game account within the first historical time period; The aforementioned target behavior sequence refers to an ordered set of account behaviors recorded within the first historical time period. In the target behavior sequence, account behaviors are arranged strictly in chronological order of their actual occurrence, forming a coherent sequence that fully reflects the behavioral trajectory of the game account within the first historical time period. In one approach, the target behavior sequence can be a game log generated by the game account within the first historical time period. The aforementioned first account behavior refers to the account behavior within the target behavior sequence.

[0021] In this step, the target behavior sequence can be determined by the game logs generated by the game account within the first historical time period.

[0022] Step S104: Input the target behavior sequence into the pre-trained behavior prediction model, and output the behavior prediction result and the prediction basis of the behavior prediction result; wherein, the behavior prediction result indicates whether the game account executes the target account behavior. The behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data; the first training sample includes: a sample behavior sequence and a sample result label; the sample behavior sequence is used to indicate: the second account behavior performed by the game account within a second historical time period; the sample result label is used to indicate: whether the game account executes the target account behavior after completing the second account behavior; the first positive sample data is: a prediction basis that meets the preset rules, generated based on the sample behavior sequence and the sample result label; the first negative sample data is: a prediction basis that does not meet the preset rules, generated based on the sample behavior sequence and the sample result label.

[0023] The above behavioral prediction results indicate whether the game account will perform the target account behavior. For example, predicting whether the game account will log in the next day, whether the game account will start the next game, or, for consecutive game tasks, whether the account will immediately start the next game within a specified time threshold. The basis for these behavioral prediction results is the model's concrete explanation of the behavioral prediction results output.

[0024] The first training sample contains a large number of sample behavior sequences and sample result labels. A strict one-to-one correspondence between the sample behavior sequences and sample result labels is required to ensure the effectiveness of model training. Specifically, the sample behavior sequence indicates the second account action performed by the game account within the second historical time period; while the corresponding sample result label clearly indicates whether the game account actually executed the target account action after completing the second account action. In practical applications, binary labels (such as "yes / no", "1 / 0") can be used as sample result labels.

[0025] The aforementioned pre-defined rules can be understood as the standards that must be followed when the target behavior sequence is input into a pre-trained behavior prediction model to determine the basis for the output behavior prediction results. By clarifying what kind of prediction basis is reasonable through pre-defined rules, the behavior prediction model has clear guidance when generating behavior prediction results.

[0026] For example, preset rules can be designed around dimensions such as "data foundation," "analysis logic," and "presentation format," specifically including: Data foundation dimension: The prediction basis must be based on accurate behavioral retrieval from multiple dimensions, such as the number of games played, recharge records, social interactions and other core behavioral data of players. It cannot rely on single or incorrect behavioral information to ensure the objectivity of the basis.

[0027] Analysis of logical dimensions: The generation of prediction basis must be based on rigorous thinking. For example, it is necessary to summarize the overall behavioral characteristics of players, use specific values ​​to illustrate the influence weight of each behavior, and the conclusion must be strongly correlated with the behavioral data to avoid unfounded speculation and ensure the logic of the basis.

[0028] Presentation format dimension: The basis for the prediction must be output in a unified format, such as point-by-point reasoning, using game-related terminology, and avoiding repetitive expressions, so that the basis is clear, easy to understand, and easy to verify, and ensures the readability of the basis.

[0029] After determining the preset rules, targeted prompts can be designed to guide the prediction model to generate two types of prediction criteria: one type, based on the sample behavior sequence and sample result labels, generates prediction criteria that satisfy the preset rules, and this type of prediction criteria determines the first positive sample data; the other type, based on the same sample behavior sequence and sample result labels, generates prediction criteria that do not satisfy the preset rules, and this type of prediction criteria determines the first negative sample data. The behavior prediction model is trained using the first positive sample data and the first negative sample data, strengthening the model's learning tendency towards the first positive sample data and weakening its output tendency towards the first negative sample data.

[0030] In practice, the large language model can be trained using the first training sample to generate a behavior prediction model. Prior to this, the large language model has already completed basic training using training data corresponding to the game's own content. This step allows the large language model to achieve two core objectives: first, to master the game's specific background knowledge, including gameplay rules, terminology definitions, and common behavioral logic, so that the frequency of its output game-related phrases is higher than that of phrases in regular scenarios; second, to learn the prior information of ultra-long texts in game scenarios, such as identifying which key words to focus on in ultra-long behavioral sequences and understanding their significant differences from everyday text in dimensions such as average length, thereby adapting to the special data requirements of game scenarios.

[0031] Then, based on the pre-trained large language model, it is trained a second time using the first training samples to finally generate a behavior prediction model. This behavior prediction model has both game-specific background knowledge and the ability to predict whether the game account will perform the target account behavior based on the behavior sequence of the game account.

[0032] Furthermore, the sample behavior sequence in the first training sample, together with the first positive sample data and the first negative sample data obtained based on the sample behavior sequence, are input into the above behavior prediction model. This allows the behavior prediction model to further learn the difference between "prediction basis that meets the preset rules" and "prediction basis that does not meet the rules". Through the advancement of training, the model can not only gradually improve the accuracy of predicting the behavior of the target account, but also output prediction basis that meets the preset rules.

[0033] Considering that when the behavior prediction model shifts from "directly predicting whether the game account will perform the target account behavior" to "predicting whether the game account will perform the target account behavior and outputting the prediction basis that meets the preset rules", the task complexity will increase significantly, which may easily cause fluctuations in the training of the behavior prediction model or get stuck in a local optimum.

[0034] To mitigate training bias, a second training sample can be constructed for pre-training before inputting the sample behavior sequences, the first positive sample data, and the first negative sample data into the behavior prediction model. This second training sample contains a large number of sample behavior sequences, as well as corresponding second negative and second positive sample data. Here, the sample result labels corresponding to the sample behavior sequences are marked as second negative sample data, and samples with predictive basis are marked as second positive sample data. This second negative sample data, second positive sample data, and sample behavior sequences are then input into the behavior prediction model for an initial training run, laying a more robust foundation for the model's judgments.

[0035] After training the behavior prediction model using the first training sample, the first positive sample data, and the first negative sample data, a trained behavior prediction model is obtained. In practical applications, the target behavior sequence only needs to be input into this pre-trained behavior prediction model, and the model can directly output the behavior prediction result and the prediction basis that meets the preset rules.

[0036] This method eliminates the need for manual data processing, and the entire process generates results based entirely on objective behavioral sequences and model training logic. On the one hand, it significantly reduces labor costs and avoids interference from subjective human experience in the prediction process, effectively improving the objectivity of the prediction. On the other hand, by synchronously outputting the prediction basis, it clearly explains the origin of the behavioral prediction results, making the results traceable and thus enhancing their practicality and credibility in business scenarios.

[0037] This invention provides a behavior prediction method for games, which obtains a target behavior sequence of a game account. The target behavior sequence indicates a first account behavior performed by the game account within a first historical time period. The target behavior sequence is input into a pre-trained behavior prediction model, which outputs a behavior prediction result and the prediction basis for the result. The behavior prediction result indicates whether the game account performs the target account behavior. The behavior prediction model is trained using first training samples, first positive sample data, and first negative sample data. The first training samples include sample behavior sequences and sample result labels. The sample behavior sequence indicates a second account behavior performed by the game account within a second historical time period. The sample result labels indicate whether the game account performs the target account behavior after completing the second account behavior. The first positive sample data is a prediction basis that satisfies preset rules, generated based on the sample behavior sequence and sample result labels. The first negative sample data is a prediction basis that does not satisfy preset rules, generated based on the sample behavior sequence and sample result labels.

[0038] In this method, training samples are pre-built using the behavior sequences of game accounts over historical time periods and the corresponding result labels. Positive sample data that meets preset rules and negative sample data that does not meet preset rules are then generated for these training samples. These training samples and positive and negative sample data are used together to train the behavior prediction model to obtain the trained behavior prediction model.

[0039] By directly extracting the behavioral sequences of game accounts and inputting them into a pre-trained behavior prediction model, the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, by clarifying the origin of the behavior prediction results through the prediction basis, the practicality and credibility of the behavior prediction results are improved.

[0040] The following examples provide specific implementation methods for training behavior prediction models.

[0041] Specifically, the first training sample is determined from the game logs of the game account; the first training sample is input into the preset model, and the preset model is guided to generate the first positive sample data and the first negative sample data based on the preset prompt words. The preset model has more model parameters than the behavior prediction model; the behavior prediction model is trained using the first training sample, the first positive sample data and the first negative sample data to obtain the trained behavior prediction model.

[0042] The sample behavior sequence in the first training sample mentioned above can be the game logs generated by the game account within the second historical time period. The sample result label corresponding to this sample behavior sequence can be determined from the game logs of subsequent time periods within the second historical time period. If the game logs of subsequent time periods detect that the game account has engaged in target account behavior, the sample result label is set to 1; if no target account behavior is detected, the sample result label is set to 0.

[0043] The aforementioned number of model parameters refers to the total number of adjustable parameters used in an artificial intelligence model to learn and store data patterns. It is a core indicator for measuring the model's size and complexity. A larger number of model parameters allows for greater information capacity and a stronger ability to learn complex data patterns. The number of model parameters in the aforementioned preset model must be greater than that in the behavior prediction model to ensure that the preset model more accurately outputs predictions based on prompts, indicating whether the predictions conform to or do not meet the preset rules. For example, the preset model can be a model with 220 bytes or more of parameters.

[0044] The aforementioned preset prompts include a first prompt and a second prompt. The first prompt guides the preset model to generate predictions that satisfy preset rules based on the input sample behavior sequence and sample result labels. The second prompt guides the preset model to generate predictions that do not satisfy preset rules based on the input sample behavior sequence and sample result labels.

[0045] Here, multiple sets of sample behavior sequences are first determined from the game logs of the game account, and the sample result labels corresponding to each set of sample behavior sequences are matched. Finally, they are integrated to form the first training sample.

[0046] Then, the first training sample and the first prompt word are input into the preset model. The preset model outputs the corresponding model result based on the prompt word. The first positive sample data is determined from the model result. The first training sample and the second prompt word are input into the preset model. The preset model outputs the corresponding model result based on the second prompt word. The first negative sample data is determined from the model result.

[0047] Finally, the first training sample, the first positive sample data, and the first negative sample data are input into the behavior prediction model. The model is iteratively trained using the preference learning loss function to update the model parameters, strengthen the model's learning tendency on the first positive sample data, and obtain the trained behavior prediction model.

[0048] Specifically, the first prompt word from the preset prompt words is input into the preset model, and the first model result corresponding to the first training sample is output; wherein, the first prompt word is used to guide the preset model to generate a prediction basis that satisfies the preset rules based on the sample behavior sequence and sample result label; the second prompt word from the preset prompt words is input into the preset model, and the second model result corresponding to the first training sample is output; wherein, the second prompt word is used to guide the preset model to generate a prediction basis that does not satisfy the preset rules based on the sample behavior sequence and sample result label; the first positive sample data is determined from the first model result, and the first negative sample data is determined from the second model result.

[0049] Here, the first prompt can directly contain a preset rule. The second prompt can be a reverse breakdown of the preset rule.

[0050] For example, a preset rule is: it must include core behavioral data such as the number of games played, recharge records, and social interactions of players; it must be reasoned point by point and game-related terminology must be used in the reasoning process.

[0051] The first prompt can be: Please generate a prediction basis that meets the preset rules based on the sample behavior sequence and the corresponding result label. The preset rules are: it must include core behavioral data such as the number of games played, recharge records, and social interactions of players; it must be reasoned point by point and game professional terminology must be used in the reasoning process.

[0052] The second prompt could be: Please generate a prediction basis based on the sample behavior sequence and the corresponding result label. This prediction basis should not include the player's number of games played, recharge records, or social interaction behavior data. Point-by-point reasoning is not necessary, and game-related terminology should not be used during the reasoning process.

[0053] In other words, the first training sample and the first prompt word are input together into the preset model, and the preset model outputs a first model result based on the first prompt word. The first training sample and the second prompt word are input together into the preset model, and the preset model outputs a second model result based on the second prompt word.

[0054] Here, the second model result can be directly used as the first negative sample data. As for the first positive sample data, considering that it cannot be guaranteed that the first model result output by the first prompt word completely conforms to every preset rule, it is necessary to filter the first model result and determine the first model result that conforms to every preset rule as the first positive sample data.

[0055] Specifically, a scoring table is determined; wherein, the scoring table records the correspondence between various preset rules and score content; the score content includes: a first score assigned when the prediction basis meets the preset rules, and a second score assigned when the prediction basis does not meet the preset rules; the first score is higher than the second score; the first model result is scored based on the scoring table, and the first model result is determined as the first positive sample data based on the scoring result.

[0056] In other words, a scoring table is first created based on preset rules. The scoring table records the correspondence between each preset rule and the corresponding score. The result of the first model is then matched against each preset rule in turn. If the result meets the preset rule, it is assigned the first score; if it does not meet the preset rule, it is assigned the second score. The first score is higher than the second score.

[0057] The scores assigned to the first model results are summed, and the result of the first model is determined as the first positive sample data based on the score.

[0058] In practice, the first model result and the third prompt word can be used as inputs to multiple scoring models to obtain the scoring results of the first model result output by each scoring model. The third prompt word is used to guide the scoring model to score the first model result based on the scoring table. The average value of the multiple scoring results is determined, and the first model result whose average value is not less than the score threshold is determined as the first positive sample data.

[0059] The scoring model mentioned above can be a large language model with a large number of parameters, such as LLaMA 2-70B and Bloom-176B. These models have strong semantic understanding and rule matching capabilities, and can accurately parse the scoring table and score the results of the first model.

[0060] Here, the results of the first model and the third prompt word containing the scoring table can be input into multiple scoring models. The scoring models are guided by the third prompt word to score the results of the first model based on the scoring table, and each model independently outputs the score result of the first model.

[0061] The indicator function I( can be pre-set via the program) ),in, The score threshold; The score result for the first model; After obtaining multiple scoring results, the scoring results of the multiple first model results are input into the indicator function. The indicator function first calculates the average of the multiple scoring results, and then compares the average with the score threshold. If the average is not less than the score threshold, the first model result is determined to be the first positive sample data.

[0062] The entire process described above is executed automatically by the program without human intervention. On the one hand, this process effectively dilutes the subjective bias of a single model and improves the objectivity of the scoring results through a collective voting mechanism of multiple model scores. On the other hand, it ensures that the first positive sample data selected fully meets the preset rule standards by using the hard constraint of the score threshold, and finally generates high-quality attribution supervision samples that can be directly used for model training.

[0063] After determining the first training sample, the first positive sample data, and the first negative sample data, the behavior prediction model is trained.

[0064] Specifically, the sample behavior sequence, the first positive sample data, and the first negative sample data in the first training sample are input into the behavior prediction model for training. Based on the preference learning loss function, the model parameters of the behavior prediction model are updated to obtain the trained behavior prediction model.

[0065] It should be noted that the behavior prediction model is generated by training the large language model using the first training sample; the large language model has been pre-trained using training data corresponding to the game content.

[0066] In other words, the large language model is first trained using the initial training samples to generate a behavior prediction model. Prior to this, the large language model has already completed basic training using training data corresponding to the game's own content. This step enables the large language model to achieve two core objectives: first, to master the game's specific background knowledge, including gameplay rules, terminology definitions, and common behavioral logic, so that the frequency of its output game-related phrases is higher than that of phrases in regular scenarios; second, to learn the prior information of extremely long texts in game scenarios, such as identifying which key words to focus on in extremely long behavioral sequences and understanding their significant differences from everyday text in dimensions such as average length, thereby adapting to the special data requirements of game scenarios.

[0067] Then, based on the pre-trained large language model, it is trained a second time using the first training samples to finally generate a behavior prediction model. This behavior prediction model has both game-specific background knowledge and special data requirements adapted to game scenarios, and the ability to predict whether the game account will perform the target account behavior based on the behavior sequence of the game account.

[0068] Finally, the sample behavior sequence from the first training sample, along with the first positive sample data and the first negative sample data obtained based on the sample behavior sequence, are input into the behavior prediction model. This allows the behavior prediction model to further learn the difference between "prediction basis that meets the preset rules" and "prediction basis that does not meet the rules". By using the preference learning loss function, the model parameters of the behavior prediction model are updated, strengthening the model's learning tendency on the first positive sample data. This enables the model to not only gradually improve the accuracy of predicting the target account behavior, but also to output prediction basis that meets the preset rules.

[0069] Specifically, this embodiment provides a preference learning loss function, such as the DPO (Direct Preference Optimization) loss function. The DPO loss function optimizes the model parameters by maximizing the "advantage of positive samples relative to negative samples," as shown in the following formula.

[0070] in, It is a temperature coefficient that controls the sensitivity to differences in preferences; For sample behavior sequences; This is the first negative sample data obtained through the sequence of sample behaviors; This is the first positive sample data obtained through the sequence of sample behaviors; It is a preference dataset composed of sample behavior sequences, first negative sample data, and first positive sample data; Refers to the Sigmoid function; Take the expectation of the sample data in the preference dataset.

[0071] Considering that when the behavior prediction model shifts from "directly predicting whether the game account will perform the target account behavior" to "predicting whether the game account will perform the target account behavior and outputting the prediction basis that meets the preset rules", the task complexity will increase significantly, which may easily cause fluctuations in the training of the behavior prediction model or get stuck in a local optimum.

[0072] To avoid training bias, a second training sample can be constructed for pre-training before inputting the sample behavior sequence, the first positive sample data, and the first negative sample data into the behavior prediction model.

[0073] The second training sample contains a large number of sample behavior sequences, as well as second negative sample data and second positive sample data corresponding to the sample behavior sequences. Here, the sample result labels corresponding to the sample behavior sequences are marked as second negative sample data, and the samples with predictive basis are marked as second positive sample data. The second negative sample data, second positive sample data, and sample behavior sequences are input into the behavior prediction model to perform one round of training on the behavior prediction model, laying a more robust judgment foundation for the model.

[0074] In practice, the first training sample and the fourth prompt word can be input into the preset model to output the third model result. The fourth prompt word is used to guide the preset model to generate prediction basis based on the sample behavior sequence and sample result label. The third model result is determined as the second positive sample data, and the sample result label in the first training sample is determined as the second negative sample data. The sample behavior sequence, the second positive sample data and the second negative sample data are input into the behavior prediction model for training. The model parameters of the behavior prediction model are updated based on the preference learning loss function.

[0075] In other words, the first training sample and the fourth prompt word are input into the preset model. The fourth prompt word guides the preset model to generate prediction criteria based on the sample behavior sequence and sample result label. The third model result output by the preset model is determined as the second positive sample data.

[0076] Then, the sample result labels corresponding to the sample behavior sequences in the first training sample are directly used as the second negative sample data.

[0077] Finally, the second negative sample data, the second positive sample data, and the sample behavior sequence are input into the behavior prediction model. The behavior prediction model is first trained, and the model parameters are updated based on the preference learning loss function to strengthen the model's learning tendency on the second positive sample data and weaken its output tendency on the second negative sample data.

[0078] In one approach, the training data corresponding to the game content is obtained as follows: The game logs are acquired; data cleaning is performed on the game logs, deleting log data corresponding to specified behaviors to obtain cleaned log data; wherein, the specified behaviors include: repetitive behaviors, screen-refreshing behaviors, and event tracking behaviors; the cleaned log data is translated into a target language; the target language log data is recombined according to a preset format to obtain recombined text; the recombined text is split into multiple text units, and these text units are used as the training data corresponding to the game content.

[0079] First, retrieve the game logs for the game account, perform data cleaning operations on the game logs, and delete log data corresponding to specified behaviors, specifically including: Log data corresponding to repetitive behaviors: such as redundant records generated when a player repeatedly clicks the same button or repeatedly performs the same operation; Log data corresponding to spamming behavior: such as players sending the same content frequently in the chat channel, or repeated notifications pushed by the system frequently. Log data corresponding to event tracking testing behavior: such as test data embedded during the development or testing phase to verify functions, and operation records of non-real players.

[0080] The above cleaning operations ensure that the remaining log data retains only the true, valid, and non-redundant core information, avoiding invalid data from interfering with model learning.

[0081] Furthermore, the cleaned log data is uniformly translated into the target language adapted by the large language model, and the translated log data is reorganized according to a preset format, such as the "time-event-event secondary field" format, to form a well-structured reorganized text.

[0082] Finally, the reconstructed text is broken down into multiple text units, which can be refined to the word level. In practice, this splitting can be accomplished using a word segmenter, enabling the large language model to understand the log data at the smallest semantic units. These text units are then used as training data corresponding to the game content and input into the large language model for training. This allows the large language model to acquire the game's specific background knowledge and learn prior information about extremely long texts in the game scenario, thereby adapting to the special data requirements of the game scenario.

[0083] In one embodiment, such as Figure 2 The following describes the process of generating a trained behavior prediction model: Step S202: Determine the training data corresponding to the game content, and train the large language model using the training data corresponding to the game content.

[0084] First, obtain the game logs, perform data cleaning on the logs, translate and reconstruct the cleaned log data to obtain reconstructed text, break the reconstructed text into multiple text units, and use these text units as training data corresponding to the game content.

[0085] Furthermore, the training data corresponding to the game content is used to train a large language model, enabling the large language model to master the game's unique background knowledge and learn prior information about extremely long texts in the game scenario, thereby adapting to the special data requirements of the game scenario.

[0086] Step S204: Determine the first training sample, train the large language model using the first training sample, and obtain the behavior prediction model.

[0087] The first training sample is determined from the game logs of the game account. The first training sample includes: sample behavior sequence and sample result label. The above-mentioned large language model is trained through the first training sample to obtain the behavior prediction model.

[0088] Step S206: Determine positive sample data with prediction basis, mark the sample result labels corresponding to the sample behavior sequence as negative sample data, train the behavior prediction model through positive and negative sample data, and update the model parameters of the prediction model.

[0089] The first training sample is input into the preset model, and the preset model is guided by prompt words to generate prediction basis, thus obtaining a sample with prediction basis.

[0090] Here, the sample result labels corresponding to the sample behavior sequence are marked as negative sample data, and the samples with predictive basis are marked as positive sample data. The negative sample data, positive sample data, and sample behavior sequence are input into the behavior prediction model to train the behavior prediction model once. After training, the behavior prediction model has the ability to output predictive basis.

[0091] Step S208: Determine the positive sample data that meets the preset rules and the negative sample data that does not meet the preset rules, and train the behavior prediction model using the positive and negative sample data so that it has the ability to output prediction basis that meets the preset rules.

[0092] After determining the preset rules, targeted prompts can be designed to guide the prediction model to generate two types of prediction criteria: one type, based on the sample behavior sequence and sample result label, generates prediction criteria that satisfy the preset rules, from which positive sample data is determined; the other type, based on the same sample behavior sequence and sample result label, generates prediction criteria that do not satisfy the preset rules, from which negative sample data is determined. The behavior prediction model is trained using both positive and negative sample data, strengthening its learning tendency towards positive sample data and weakening its output tendency towards negative sample data. By training the behavior prediction model with both positive and negative sample data, it gains the ability to output prediction criteria that satisfy the preset rules.

[0093] By using the above method, a trained behavior prediction model is obtained. The behavior sequence of the game account is directly extracted and input into the pre-trained behavior prediction model, and the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, the origin of the behavior prediction results is clarified by the prediction basis, which improves the practicality and credibility of the behavior prediction results.

[0094] For an embodiment corresponding to the above method, see [link to embodiment]. Figure 3 The diagram shows a behavior prediction device for a game, the device comprising: The first acquisition module 302 is used to acquire the target behavior sequence of the game account; wherein, the target behavior sequence is used to indicate: the first account behavior performed by the game account within a first historical time period; The first output module 304 is used to input the target behavior sequence into the pre-trained behavior prediction model and output the behavior prediction result and the prediction basis of the behavior prediction result; wherein, the behavior prediction result indicates whether the game account performs the target account behavior; The behavior prediction model is trained using a first training sample, a first positive sample, and a first negative sample. The first training sample includes a sample behavior sequence and a sample result label. The sample behavior sequence indicates the second account behavior performed by the game account within a second historical time period. The sample result label indicates whether the game account executed the target account behavior after completing the second account behavior. The first positive sample data is: a prediction basis that meets the preset rules, generated based on the sample behavior sequence and sample result label; the first negative sample data is: a prediction basis that does not meet the preset rules, generated based on the sample behavior sequence and sample result label.

[0095] In this method, training samples are pre-built using the behavior sequences of game accounts over historical time periods and the corresponding result labels. Positive sample data that meets preset rules and negative sample data that does not meet preset rules are then generated for these training samples. These training samples and positive and negative sample data are used together to train the behavior prediction model to obtain the trained behavior prediction model.

[0096] By directly extracting the behavioral sequences of game accounts and inputting them into a pre-trained behavior prediction model, the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, by clarifying the origin of the behavior prediction results through the prediction basis, the practicality and credibility of the behavior prediction results are improved.

[0097] The above behavior prediction model is trained in the following way: The first training sample is determined from the game log of the game account; the first training sample and the preset prompt words are input into the preset model, and the preset model is guided to generate the first positive sample data and the first negative sample data based on the preset prompt words. The model parameters of the preset model are the same as the model parameters of the behavior prediction model; the behavior prediction model is trained using the first training sample, the first positive sample data and the first negative sample data to obtain the trained behavior prediction model.

[0098] The aforementioned apparatus further includes: a first training module for: the training process further includes: inputting a first training sample and a first prompt word into a preset model, and outputting a first model result corresponding to the first training sample; wherein, the first prompt word is used to guide the preset model to generate a prediction basis that satisfies the preset rules based on the sample behavior sequence and the sample result label; inputting the first training sample and a second prompt word into the preset model, and outputting a second model result corresponding to the first training sample; wherein, the second prompt word is used to guide the preset model to generate a prediction basis that does not satisfy the preset rules based on the sample behavior sequence and the sample result label; The aforementioned apparatus further includes: a first determining module, configured to determine first positive sample data from the first model result and first negative sample data from the second model result.

[0099] The aforementioned preset rules include multiple rules; the aforementioned first determining module is used to determine a scoring table; wherein, the scoring table records the correspondence between each preset rule and the score content; the score content includes: a first score assigned when the prediction basis meets the preset rules, and a second score assigned when the prediction basis does not meet the preset rules; the first score is higher than the second score; the first model result is scored based on the scoring table, and the first model result is determined as the first positive sample data based on the scoring result.

[0100] The aforementioned first determining module is used to input the first model result and the third prompt word as input content into multiple scoring models respectively, and obtain the scoring results of the first model result output by each scoring model; wherein, the third prompt word is used to guide the scoring model to score the first model result based on the scoring table; determine the average value corresponding to multiple scoring results, and determine the first model result whose average value is not less than the score threshold as the first positive sample data.

[0101] The first training module described above is also used to: input the sample behavior sequence, the first positive sample data and the first negative sample data from the first training sample into the behavior prediction model for training, update the model parameters of the behavior prediction model based on the preference learning loss function, and obtain the trained behavior prediction model.

[0102] The aforementioned behavior prediction model is generated by training the large language model using the first training sample; the large language model has been pre-trained using training data corresponding to the game content.

[0103] The aforementioned device further includes: a second training module, which inputs the first training sample and the fourth prompt word into a preset model and outputs the third model result; wherein, the fourth prompt word is used to guide the preset model to generate prediction basis based on the sample behavior sequence and sample result label; the third model result is determined as the second positive sample data, the sample result label in the first training sample is determined as the second negative sample data, the sample behavior sequence, the second positive sample data and the second negative sample data are input into the behavior prediction model for training, and the model parameters of the behavior prediction model are updated based on the preference learning loss function.

[0104] The training data corresponding to the aforementioned game content was obtained in the following way: Game logs from the game account were obtained; data cleaning was performed on the game logs, deleting log data corresponding to specified behaviors to obtain cleaned log data; the specified behaviors included: repetitive behaviors, screen-swiping behaviors, and event tracking behaviors; the cleaned log data was translated into the target language; the target language log data was recombined according to a preset format to obtain recombined text; the recombined text was split into multiple text units, and these text units were used as the training data corresponding to the game content.

[0105] The aforementioned target behavior sequence includes: game logs generated by the game account within the first historical time period.

[0106] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the behavior prediction method in the game described above. This electronic device can be a server or a terminal device.

[0107] See Figure 4 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the behavior prediction method in the game described above.

[0108] Furthermore, Figure 4 The illustrated electronic device also includes a bus 102 and a communication interface 103. The processor 100, communication interface 103, and memory 101 are connected via the bus 102. The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk drive. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless). The interface can utilize the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 4The diagram uses only a single bidirectional arrow, but this does not imply a single bus or a single type of bus. Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0109] The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the behavior prediction method in the aforementioned game: acquiring a target behavior sequence of the game account; wherein, the target behavior sequence indicates: a first account behavior performed by the game account within a first historical time period; inputting the target behavior sequence into a pre-trained behavior prediction model, and outputting a behavior prediction result and the prediction basis for the behavior prediction result; wherein, the behavior prediction result indicates: whether the game account performed the target account behavior; the behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data; the first training sample includes: a sample behavior sequence and a sample result label; the sample behavior sequence indicates: a second account behavior performed by the game account within a second historical time period; the sample result label indicates: whether the game account performed the target account behavior after completing the second account behavior; the first positive sample data is: a prediction basis that satisfies preset rules generated based on the sample behavior sequence and the sample result label; the first negative sample data is: a prediction basis that does not satisfy preset rules generated based on the sample behavior sequence and the sample result label.

[0110] In this approach, training samples are pre-built using the game account's behavior sequences over historical time periods and corresponding result labels, and positive and negative sample data are generated. These training samples and positive and negative sample data are used to train the behavior prediction model, enabling the behavior prediction model to accurately learn the correlation logic between account behavior and behavior prediction results, thus obtaining a trained behavior prediction model.

[0111] By directly extracting the behavioral sequences of game accounts and inputting them into a pre-trained behavior prediction model, the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, by clarifying the origin of the behavior prediction results through the prediction basis, the practicality and credibility of the behavior prediction results are improved.

[0112] The above behavior prediction model is trained in the following way: The first training sample is determined from the game log of the game account; the first training sample and the preset prompt words are input into the preset model, and the preset model is guided to generate the first positive sample data and the first negative sample data based on the preset prompt words. The model parameters of the preset model are the same as the model parameters of the behavior prediction model; the behavior prediction model is trained using the first training sample, the first positive sample data and the first negative sample data to obtain the trained behavior prediction model.

[0113] The processor in the aforementioned electronic device, by executing machine-executable instructions, can implement the following operations of the behavior prediction method in the aforementioned game: The training process further includes: inputting a first training sample and a first prompt word into a preset model, and outputting a first model result corresponding to the first training sample; wherein, the first prompt word is used to guide the preset model to generate prediction criteria that satisfy preset rules based on the sample behavior sequence and sample result labels; inputting the first training sample and a second prompt word into the preset model, and outputting a second model result corresponding to the first training sample; wherein, the second prompt word is used to guide the preset model to generate prediction criteria that do not satisfy preset rules based on the sample behavior sequence and sample result labels; The processor in the aforementioned electronic device can perform the following operations of the behavior prediction method in the aforementioned game by executing machine-executable instructions: determining first positive sample data from the first model result and determining first negative sample data from the second model result.

[0114] The aforementioned preset rules include multiple rules; the processor in the aforementioned electronic device can perform the following operations of the behavior prediction method in the aforementioned game by executing machine-executable instructions; wherein, the scoring table records the correspondence between each preset rule and the score content; the score content includes: a first score assigned when the prediction basis meets the preset rules, and a second score assigned when the prediction basis does not meet the preset rules; the first score is higher than the second score; the first model result is scored based on the scoring table, and it is determined whether the first model result is the first positive sample data based on the scoring result.

[0115] The processor in the aforementioned electronic device, by executing machine-executable instructions, can perform the following operations of the behavior prediction method in the aforementioned game: inputting the first model result and the third prompt word as input content into multiple scoring models respectively, and obtaining the scoring results of the first model result output by each scoring model; wherein, the third prompt word is used to guide the scoring model to score the first model result based on the scoring table; determining the average value corresponding to multiple scoring results, and determining the first model result whose average value is not less than the score threshold as the first positive sample data.

[0116] The processor in the aforementioned electronic device can execute machine-executable instructions to perform the following operations of the behavior prediction method in the aforementioned game: inputting the sample behavior sequence, the first positive sample data, and the first negative sample data from the first training sample into the behavior prediction model for training; updating the model parameters of the behavior prediction model based on the preference learning loss function; and obtaining the trained behavior prediction model.

[0117] The aforementioned behavior prediction model is generated by training the large language model using the first training sample; the large language model has been pre-trained using training data corresponding to the game content.

[0118] The processor in the aforementioned electronic device, by executing machine-executable instructions, can perform the following operations of the behavior prediction method in the aforementioned game: inputting the first training sample and the fourth prompt word into a preset model, and outputting the third model result; wherein, the fourth prompt word is used to guide the preset model to generate prediction basis based on the sample behavior sequence and sample result label; determining the third model result as the second positive sample data, determining the sample result label in the first training sample as the second negative sample data, inputting the sample behavior sequence, the second positive sample data and the second negative sample data into the behavior prediction model for training, and updating the model parameters of the behavior prediction model based on the preference learning loss function.

[0119] The training data corresponding to the aforementioned game content was obtained in the following way: Game logs from the game account were obtained; data cleaning was performed on the game logs, deleting log data corresponding to specified behaviors to obtain cleaned log data; the specified behaviors included: repetitive behaviors, screen-swiping behaviors, and event tracking behaviors; the cleaned log data was translated into the target language; the target language log data was recombined according to a preset format to obtain recombined text; the recombined text was split into multiple text units, and these text units were used as the training data corresponding to the game content.

[0120] This embodiment also provides a storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the behavior prediction method in the above game.

[0121] The machine-executable instructions stored in the aforementioned storage medium can be executed to perform the following operations in the behavior prediction method in the aforementioned game: obtaining the target behavior sequence of the game account; wherein, the target behavior sequence indicates: the first account behavior performed by the game account within a first historical time period; inputting the target behavior sequence into a pre-trained behavior prediction model, and outputting the behavior prediction result and the prediction basis of the behavior prediction result; wherein, the behavior prediction result indicates: whether the game account performed the target account behavior; the behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data; the first training sample includes: a sample behavior sequence and a sample result label; the sample behavior sequence indicates: the second account behavior performed by the game account within a second historical time period; the sample result label indicates: whether the game account performed the target account behavior after completing the second account behavior; the first positive sample data is: a prediction basis that satisfies preset rules generated based on the sample behavior sequence and the sample result label; the first negative sample data is: a prediction basis that does not satisfy preset rules generated based on the sample behavior sequence and the sample result label.

[0122] In this approach, training samples are pre-built using the game account's behavior sequences over historical time periods and corresponding result labels, and positive and negative sample data are generated. These training samples and positive and negative sample data are used to train the behavior prediction model, enabling the behavior prediction model to accurately learn the correlation logic between account behavior and behavior prediction results, thus obtaining a trained behavior prediction model.

[0123] By directly extracting the behavioral sequences of game accounts and inputting them into a pre-trained behavior prediction model, the behavior prediction results and corresponding prediction basis can be output. This method saves manpower costs, avoids the interference of subjective experience on the prediction process, and at the same time, by clarifying the origin of the behavior prediction results through the prediction basis, the practicality and credibility of the behavior prediction results are improved.

[0124] The above behavior prediction model is trained in the following way: The first training sample is determined from the game log of the game account; the first training sample and the preset prompt words are input into the preset model, and the preset model is guided to generate the first positive sample data and the first negative sample data based on the preset prompt words. The model parameters of the preset model are the same as the model parameters of the behavior prediction model; the behavior prediction model is trained using the first training sample, the first positive sample data and the first negative sample data to obtain the trained behavior prediction model.

[0125] The machine-executable instructions stored in the aforementioned storage medium can be executed to achieve the following operations in the behavior prediction method of the aforementioned game: The training process further includes: inputting a first training sample and a first prompt word into a preset model, and outputting a first model result corresponding to the first training sample; wherein, the first prompt word is used to guide the preset model to generate a prediction basis that satisfies the preset rules based on the sample behavior sequence and sample result label; inputting a first training sample and a second prompt word into the preset model, and outputting a second model result corresponding to the first training sample; wherein, the second prompt word is used to guide the preset model to generate a prediction basis that does not satisfy the preset rules based on the sample behavior sequence and sample result label; The machine-executable instructions stored in the aforementioned storage medium can be used to perform the following operations in the behavior prediction method in the aforementioned game: determining the first positive sample data from the first model result and determining the first negative sample data from the second model result.

[0126] The aforementioned preset rules include multiple rules; the machine-executable instructions stored in the aforementioned storage medium can be executed to achieve the following operations in the behavior prediction method in the aforementioned game: wherein, the scoring table records the correspondence between each preset rule and the score content; the score content includes: a first score assigned when the prediction basis meets the preset rules, and a second score assigned when the prediction basis does not meet the preset rules; the first score is higher than the second score; the first model result is scored based on the scoring table, and the first model result is determined as the first positive sample data based on the scoring result.

[0127] The machine-executable instructions stored in the aforementioned storage medium can be executed to perform the following operations in the behavior prediction method in the aforementioned game: the first model result and the third prompt word are used as inputs and input into multiple scoring models respectively to obtain the scoring results of the first model result output by each scoring model; wherein, the third prompt word is used to guide the scoring model to score the first model result based on the scoring table; the average value corresponding to multiple scoring results is determined, and the first model result whose average value is not less than the score threshold is determined as the first positive sample data.

[0128] The machine-executable instructions stored in the aforementioned storage medium can be used to perform the following operations in the behavior prediction method in the aforementioned game: inputting the sample behavior sequence, the first positive sample data, and the first negative sample data from the first training sample into the behavior prediction model for training; updating the model parameters of the behavior prediction model based on the preference learning loss function; and obtaining the trained behavior prediction model.

[0129] The aforementioned behavior prediction model is generated by training the large language model using the first training sample; the large language model has been pre-trained using training data corresponding to the game content.

[0130] The machine-executable instructions stored in the aforementioned storage medium can be executed to achieve the following operations in the behavior prediction method in the aforementioned game: inputting the first training sample and the fourth prompt word into the preset model and outputting the third model result; wherein, the fourth prompt word is used to guide the preset model to generate prediction basis based on the sample behavior sequence and sample result label; determining the third model result as the second positive sample data, determining the sample result label in the first training sample as the second negative sample data, inputting the sample behavior sequence, the second positive sample data and the second negative sample data into the behavior prediction model for training, and updating the model parameters of the behavior prediction model based on the preference learning loss function.

[0131] The training data corresponding to the aforementioned game content was obtained in the following way: Game logs from the game account were obtained; data cleaning was performed on the game logs, deleting log data corresponding to specified behaviors to obtain cleaned log data; the specified behaviors included: repetitive behaviors, screen-swiping behaviors, and event tracking behaviors; the cleaned log data was translated into the target language; the target language log data was recombined according to a preset format to obtain recombined text; the recombined text was split into multiple text units, and these text units were used as the training data corresponding to the game content.

[0132] The aforementioned target behavior sequence includes: game logs generated by the game account within the first historical time period.

[0133] The computer program products of the behavior prediction method, apparatus, electronic device and storage medium in games provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0134] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0135] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0136] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0137] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0138] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for predicting behavior in games, characterized in that, The method includes: Obtain a target behavior sequence of a game account; wherein the target behavior sequence is used to indicate: a first account behavior performed by the game account within a first historical time period; The target behavior sequence is input into a pre-trained behavior prediction model, which outputs a behavior prediction result and the basis for the prediction; wherein the behavior prediction result indicates whether the game account performs the target account behavior. The behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data. The first training sample includes a sample behavior sequence and a sample result label. The sample behavior sequence indicates the second account behavior performed by the game account within a second historical time period. The sample result label indicates whether the game account executed the target account behavior after completing the second account behavior. The first positive sample data is a prediction basis that satisfies the preset rules, generated based on the sample behavior sequence and the sample result label; the first negative sample data is a prediction basis that does not satisfy the preset rules, generated based on the sample behavior sequence and the sample result label.

2. The method according to claim 1, characterized in that, The behavior prediction model is trained in the following manner: The first training sample is determined from the game logs of the game account; The first training sample and the preset prompt words are input into the preset model. Based on the preset prompt words, the preset model is guided to generate the first positive sample data and the first negative sample data. The preset model has more model parameters than the behavior prediction model. The behavior prediction model is trained using the first training sample, the first positive sample data, and the first negative sample data to obtain the trained behavior prediction model.

3. The method according to claim 2, characterized in that, The step of inputting the first training sample and a preset prompt word into a preset model, and guiding the preset model to generate first positive sample data and first negative sample data based on the preset prompt word, includes: The first training sample and the first prompt word are input into a preset model, and the first model result corresponding to the first training sample is output; wherein, the first prompt word is used to guide the preset model to generate a prediction basis that satisfies the preset rules based on the sample behavior sequence and the sample result label; The first training sample and the second prompt word are input into the preset model, and the second model result corresponding to the first training sample is output; wherein, the second prompt word is used to guide the preset model to generate a prediction basis that does not meet the preset rule based on the sample behavior sequence and the sample result label; The first positive sample data is determined from the first model result, and the first negative sample data is determined from the second model result.

4. The method according to claim 3, characterized in that, The preset rules include multiple rules; The step of determining the first positive sample data from the first model result includes: A scoring table is determined; wherein the scoring table records the correspondence between each preset rule and a score; the score includes: a first score assigned when the prediction basis meets the preset rule, and a second score assigned when the prediction basis does not meet the preset rule; the first score is higher than the second score; The first model result is scored based on the scoring table, and the first model result is determined as the first positive sample data based on the scoring result.

5. The method according to claim 4, characterized in that, The step of scoring the first model result based on the scoring table and determining whether the first model result is the first positive sample data based on the scoring result includes: The first model result and the third prompt word are used as inputs and respectively input into multiple scoring models to obtain the scoring results of the first model result output by each scoring model; wherein, the third prompt word is used to guide the scoring model to score the first model result based on the scoring table; Determine the average value corresponding to multiple scoring results, and determine the first model result whose average value is not less than the score threshold as the first positive sample data.

6. The method according to claim 2, characterized in that, The step of training the behavior prediction model using the first training sample, the first positive sample data, and the first negative sample data to obtain the trained behavior prediction model includes: The sample behavior sequence, the first positive sample data, and the first negative sample data in the first training sample are input into the behavior prediction model for training. Based on the preference learning loss function, the model parameters of the behavior prediction model are updated to obtain the trained behavior prediction model.

7. The method according to claim 1, characterized in that the behavior prediction model is achieved through... The first training sample is generated by training a large language model; wherein... The large language model has been pre-trained using training data corresponding to the game content of the game.

8. The method according to claim 6, characterized in that, Before the step of inputting the sample behavior sequence, the first positive sample data, and the first negative sample data from the first training sample into the behavior prediction model for training, the method further includes: The first training sample and the fourth prompt word are input into the preset model, and the third model result is output; wherein, the fourth prompt word is used to guide the preset model to generate prediction basis based on the sample behavior sequence and the sample result label; The third model result is determined as the second positive sample data, and the sample result label in the first training sample is determined as the second negative sample data. The sample behavior sequence, the second positive sample data, and the second negative sample data are input into the behavior prediction model for training. The model parameters of the behavior prediction model are updated based on the preference learning loss function.

9. The method according to claim 7, characterized in that, The training data corresponding to the game content was obtained through the following methods: The game logs of the game account are obtained, and data cleaning operations are performed on the game logs to delete log data corresponding to specified behaviors, thereby obtaining cleaned log data; wherein, the specified behaviors include: repetitive behaviors, screen-refreshing behaviors, and event tracking test behaviors; The cleaned log data is translated into the target language, and the log data in the target language is reconstructed according to a preset format to obtain the reconstructed text; The reconstructed text is split into multiple text units, and these text units are identified as training data corresponding to the game content.

10. The method according to claim 1, characterized in that, The target behavior sequence includes: game logs generated by the game account within a first historical time period.

11. A behavior prediction device for games, characterized in that, The device includes: The first acquisition module is used to acquire a target behavior sequence of a game account; wherein, the target behavior sequence is used to indicate: a first account behavior performed by the game account within a first historical time period; The first output module is used to input the target behavior sequence into a pre-trained behavior prediction model and output the behavior prediction result and the prediction basis of the behavior prediction result; wherein, the behavior prediction result indicates whether the game account performs the target account behavior; The behavior prediction model is trained using a first training sample, a first positive sample data, and a first negative sample data. The first training sample includes a sample behavior sequence and a sample result label. The sample behavior sequence indicates the second account behavior performed by the game account within a second historical time period. The sample result label indicates whether the game account executed the target account behavior after completing the second account behavior. The first positive sample data is a prediction basis that satisfies the preset rules, generated based on the sample behavior sequence and the sample result label; the first negative sample data is a prediction basis that does not satisfy the preset rules, generated based on the sample behavior sequence and the sample result label.

12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the behavior prediction method in a game according to any one of claims 1-10.

13. A storage medium, characterized in that, The storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the behavior prediction method in the game as described in any one of claims 1-10.