Autoregression user behavior prediction system and method based on large model

By converting user behavior data into feature vectors and quantifying feature residuals, and combining with Transformer model for autoregressive sequence prediction, the problems of insufficient accuracy of user behavior prediction, low data processing efficiency and insufficient generalization capabilities in the prior art are solved, and more efficient and adaptive user behavior prediction is achieved.

CN119598416APending Publication Date: 2025-03-11QINGDAO HAIDA NOVA SOFTWARE CONSULTING CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411650658.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient accuracy, low data processing efficiency and insufficient model generalization capabilities in user behavior prediction, and it is difficult to effectively capture complex dependencies and adapt to different user groups and environments.

Method used

By converting user behavior data into feature vectors and quantizing feature residuals to generate code table embeddings, combining Transformer model for autoregressive sequence prediction, the accuracy and efficiency of prediction are improved, and the generalization ability and adaptability of the model are enhanced.

Benefits of technology

It significantly improves the accuracy and efficiency of user behavior prediction, enhances the generalization ability and adaptability of the model, can better understand and predict the complex patterns of user behavior, and meets the real-time prediction needs of the smart home field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598416A_ABST
    Figure CN119598416A_ABST
Patent Text Reader

Abstract

The invention relates to an autoregression user behavior prediction system based on a large model and a method thereof. The method comprises the following steps: firstly, data preprocessing: vectorizing high-dimensional data features representing user behaviors and user portraits; secondly, feature residual quantization is carried out, feature residual quantization is carried out on the feature vectors, and a code table embeddings is generated; secondly, user behaviors are expressed through tokens, and each token corresponds to a specific behavior or event; thirdly, the token in which the embed dingings are embedded is sent to a Transform model for training, and then the token in which the embed dingings are embedded is sent to the Transform model for training; the Transform model is used for learning the mode of the token sequence and adjusting parameters to minimize a prediction error so as to form a trained Transform model; then, on the basis of the trained Transform model, predicting the next token according to the input token sequence, namely predicting the next behavior of the user; the device is reasonable in design, compact in structure and convenient to use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a large model-based autoregressive user behavior prediction system and method thereof. Background Art

[0002] Nowadays, the influence of big model technology has gradually expanded to all areas of daily life and production, but the existing technology for predicting user behavior in the existing smart home smart scenes has some shortcomings: 1. Insufficient prediction accuracy and insufficient ability to capture complex dependencies: Traditional methods often rely on simple statistical models or shallow machine learning algorithms when processing user behavior data. These methods are unable to handle high-dimensional, nonlinear and complex dependency data, resulting in insufficient accuracy and reliability of prediction results; 2. Insufficient efficiency and performance in processing large-scale data: With the surge in the amount of user behavior data, existing technologies face performance bottlenecks when processing large-scale data, and are unable to quickly and effectively extract valuable information from massive data, resulting in slow model training and reasoning processes, making it difficult to meet the needs of real-time prediction; 3. Insufficient generalization and adaptability of the model: Existing prediction models often rely too much on the characteristics of specific data sets and lack good generalization capabilities, resulting in reduced prediction performance when facing new user groups or market environments.

[0003] Compared with the existing technology, the present invention focuses on processing large-scale multi-dimensional data (user behavior data), and more on the prediction ability of the model, indirectly realizing home control, converting the realized data into a feature vector, and then performing residual quantization on the feature vector, and capturing the potential structure of the data by mapping the data to a low-dimensional space. Finally, the Transformer model is used as the core prediction module, which is responsible for generating sequence predictions in an autoregressive manner. Summary of the invention

[0004] The technical problem to be solved by the present invention is generally to provide an autoregressive user behavior prediction system and method based on a large model. The purpose of the present invention is to solve the deficiencies of the prior art in terms of user behavior prediction accuracy, data processing efficiency and model generalization ability, and to provide a more accurate, efficient and adaptable smart home user behavior prediction solution.

[0005] To solve the above problems, the technical solution adopted by the present invention is:

[0006] 1. A large model-based autoregressive user behavior prediction method, characterized in that: the prediction method comprises the following steps;

[0007] First, data preprocessing is done to quantize the high-dimensional data features representing user behaviors and user portraits;

[0008] Then, the feature residual is quantized, and the feature vector is quantized to generate code table embeddings;

[0009] Secondly, user behavior is represented by tokens, and each token corresponds to a specific behavior or event;

[0010] Again, the tokens embedded with embeddings are fed into the Transformer model for training; the Transformer model learns the pattern of the token sequence and adjusts the parameters to minimize the prediction error, forming a trained Transformer model;

[0011] Then, based on the trained Transformer model, the next token is predicted according to the input token sequence, that is, the user’s next behavior is predicted.

[0012] 2. A large model-based autoregressive user behavior prediction method, characterized by: being used in smart home scenarios; the prediction method steps are as follows;

[0013] S1, collect data, including user behavior and user portrait information in smart home scenarios;

[0014] S2, data feature vectorization: in the smart home scenario, the collected user behavior data and user portrait data are converted into numerical feature vectors;

[0015] S3, feature residual quantization;

[0016] S4, behavior token serialization;

[0017] When there is only one user, execute S4.1; when there are multiple users, execute S5;

[0018] S5, multi-dimensional feature embedding;

[0019] S6, behavior prediction model;

[0020] S7, predicting behavior sequences.

[0021] As a further improvement, in S1, the following steps are performed:

[0022] S1.1, analyze user behavior habits after data collection;

[0023] S1.2, analyzing user behavior data in smart homes and learning user habits and preferences;

[0024] In step S1, the data collection method includes voice collection, camera image and / or video collection;

[0025] When collecting user portrait information, users are allowed to directly input their personal preferences through the setting interface of the smart home system; personal preferences include temperature settings and lighting preferences;

[0026] Behavioral data, behavioral data within a set time period; behavioral data includes habitual behavior.

[0027] In S2, the following steps are executed;

[0028] S2.1, retrieve user behavior data and user portrait data:

[0029] S2.2, feature extraction and numerical representation;

[0030] S2.3, combine the featurized vectors, combine all the features to obtain a featurized vector and input it into the machine learning model for training or prediction.

[0031] In S2.1, basic user information includes age, gender, and occupation;

[0032] User preferences include preferred temperature, favorite music genre, and lighting preferences;

[0033] User behavior data within a set period includes average daily usage time of smart lights, average daily music listening time, average daily TV watching time, and average daily temperature adjustment times of smart thermostats;

[0034] In S2.3, the numerical features are normalized or standardized to ensure the consistency of proportions between different features.

[0035] In S3, the execution has the following steps;

[0036] S3.1, first, assume the scenario and data, collect user behavior data, and extract feature vectors:

[0037] x = [time point, action, device type, setting value];

[0038] S3.2, performing feature residual quantization step;

[0039] In S3.2, perform the following steps:

[0040] S3.2.1: Construct a code table; the code table contains basic vectors, each of which represents a corresponding user behavior pattern;

[0041] S3.2.2: Quantized feature vectors;

[0042] For each eigenvector in S3.1, find the basis vector closest to the eigenvector in the code table;

[0043] S3.2.3: Calculate the residual vector;

[0044] Calculate the difference between the feature vector and the code table vector, that is, the residual vector. If the feature vector and the code table vector completely match, the residual vector is a zero vector;

[0045] S3.2.4: Generate code table embeddings;

[0046] Code table embeddings are the code table vector itself or the combination of the code table vector and the residual vector;

[0047] S4.1, for a sentence or a user behavior sequence, an embedding vector corresponding to each token in the sequence: the embedding vectors are combined to form the final representation input to the model;

[0048] The serialized token looks like this:

[0049] Token1,token2,token3....tokenN.

[0050] In S5, the following steps are performed:

[0051] S5.1, design embedding matrix:

[0052] The number of rows in the embedding matrix is ​​equal to the size of the vocabulary;

[0053] The number of columns is the dimension of embedding;

[0054] In the embedding matrix, each row corresponds to the embedding vector of a token, that is, each row corresponds to a token;

[0055] S5.2, Token to index:

[0056] Map each token to a unique index, which is used to retrieve the corresponding embedding vector from the embedding matrix;

[0057] Therefore, the serialized token is as follows:

[0058] Token1(embedding1,embedding2,embeding3...),

[0059] token2(embedding1,embedding2,embeding3...),

[0060] token3(embedding1,embedding2,embeding3...), ....

[0062] tokenN(embedding1,embedding2,embeding3...).

[0063] In S6, the token generated based on steps S4 and S5 is used as the input of the model for different scenarios, and the Transformer model is used as the core prediction module; the Transformer model processes sequence data with a self-attention mechanism, captures long-distance dependencies in user behaviors, and performs autoregressive sequence prediction; the scenarios include single user or multi-user;

[0064] In S7, during the predictive reasoning stage, the user's real-time behavior data and portrait information are continuously collected and converted into featurized vector representations and code table embeddings; the processed data is input into the trained Transformer model, and the model outputs a prediction of the user's next behavior based on the learned patterns and relationships.

[0065] A large-model-based autoregressive user behavior prediction system includes a core prediction module using a Transformer model; used in the above method.

[0066] Through the collaborative work of the following three key components, the present invention aims to address the limitations of the prior art in user behavior prediction and provide a more accurate, efficient and adaptable prediction solution.

[0067] In order to improve the prediction accuracy and the ability to capture complex dependencies, the present invention effectively improves the prediction accuracy and the ability to capture complex dependencies through an innovative user behavior prediction method. In this solution, user behavior data is converted into a series of discrete behavior representations that can capture subtle changes and long-term dependencies in user behavior. Through this representation method, the model can predict the user's next behavior in the context of the entire behavior sequence, thereby better understanding and predicting the complex patterns of user behavior.

[0068] In order to improve the efficiency and performance of processing large-scale data, the data preprocessing and feature residual quantization module of the present invention can efficiently process and convert large-scale user behavior data and user portrait data, and generate feature vector representations and code table embeddings. This efficient data processing process, combined with the parallel computing capability of the model, significantly improves the speed of model training and reasoning, making real-time prediction possible. This method not only improves the efficiency of data processing, but also enhances the model's ability to process large-scale data sets.

[0069] In order to enhance the generalization ability and adaptability of the model, the solution of the present invention adopts advanced user behavior prediction technology, combined with the code table embeddings generated by the feature residual quantization module, which significantly improves the generalization ability of the model. This prediction method can adapt to different user behavior patterns and environmental changes, allowing the model to quickly adapt to new data and environments, maintaining the accuracy and relevance of the prediction. Through continuous optimization and adjustment of the training and reasoning modules, the model can flexibly respond to various user behavior variations, enhancing the adaptability of the model in different scenarios.

[0070] Technical name introduction:

[0071] The Transformer model is a deep learning architecture that is mainly used to process sequence data. It has made revolutionary progress in the field of natural language processing (NLP), but it is also used in other sequence tasks such as time series analysis and speech recognition.

[0072] In natural language processing, a token is the basic unit of text, which can be a word, a character, or a wordpiece.

[0073] Tokenization is the process of breaking down the original text into these basic units. For example, in English, the sentence "Hello, world!" may be broken down into a token sequence like ["Hello", "", "", "world", "!"].

[0074] Token serialization refers to the process of converting continuous natural language text into discrete token sequences. This process usually includes text cleaning (removing useless symbols and spaces), word segmentation (segmenting sentences into words or phrases), and mapping words to indexes in a predefined vocabulary. The serialized data can be processed by neural networks.

[0075] Feature residual quantization is the process of converting high-dimensional feature vectors into low-dimensional code table embeddings. This process involves the concept of residual quantization. The core idea is to decompose the feature vector into a series of residual vectors, and then map these residual vectors into a code table to generate a compact embeddings representation.

[0076] Description of the feature residual quantization process: The basic idea of ​​residual quantization is to represent a vector in a high-dimensional space as a linear combination of vectors in a code table plus a residual. This method can capture the local structure of the data, and since the number of code table vectors is much smaller than the dimension of the original feature space, it can effectively reduce the dimension of the feature.

[0077] The feature residual quantization formula is as follows. First, let the original feature vector be The code table (dictionary) is Where k is the size of the code table, d i is a vector in the code table. The goal of residual quantization is to find a coefficient vector c = [c1, c2, ..., c k ] T , such that: x≈Dc+r, where r is the residual vector representing the difference between x and its approximation in the code table space.

[0078] Analysis of feature residual quantization process:

[0079] (1) Code table learning: First, a code table D needs to be learned or predefined. This can be achieved through a clustering algorithm (such as K-means), which divides the feature space into k clusters and uses the center of each cluster as the code table vector.

[0080] (2) Feature vector quantization: For each feature vector x, calculate its residual with each vector in the code table, that is, xd i .

[0081] (3) Coefficient calculation: Find the coefficient vector c that minimizes the residual. This is usually achieved through the least squares method or other optimization techniques.

[0082] (4) Residual representation: Calculate the final residual vector r.

[0083] (5) Code table embeddings generation: The coefficient vector c is used as a low-dimensional representation of the feature vector x, i.e., the code table embeddings. The code table embeddings can be the codeword c j It can also be a combination of a codeword and a residual vector.

[0084] If only codewords are used as embeddings, then embedding = c j

[0085] If we combine the codeword and the residual vector, we can generate the final embeddings through some transformation f:

[0086] embedding=f(c j , r).

[0087] In this technical solution, the feature residual quantization module is responsible for converting high-dimensional feature vectors into low-dimensional code table embeddings to reduce model complexity and improve generalization ability and prediction accuracy.

[0088] The present invention has the following technical effects: a. Refined user behavior representation. The present invention realizes a refined representation of user behavior by converting user behavior data and user portrait data into a feature vector representation, and further generating code table embeddings by feature residual quantization. This method can capture subtle changes and long-term dependencies in user behavior, and provide rich contextual information for behavior prediction. This advantage solves the problem that user behavior representation in the prior art is rough and cannot effectively capture complex behavior patterns, and improves the accuracy and reliability of prediction. Multimodal fusion smart home scene understanding and interaction solutions to promote the development and popularization of smart home technology. b. Efficient data processing and real-time prediction capabilities. The data preprocessing and feature residual quantization modules of the present invention can efficiently process large-scale user behavior data and quickly generate feature vector representations and code table embeddings. This efficient data processing process makes real-time prediction possible and significantly improves the speed of model training and reasoning. This advantage solves the problem that large-scale data processing is inefficient and difficult to achieve real-time prediction in the prior art, and improves the response speed of the system and user experience. c. Powerful model adaptability and generalization ability. The present invention significantly improves the generalization ability of the model by combining the code table embeddings generated by the feature residual quantization module with advanced user behavior prediction technology. This prediction method can adapt to different user behavior patterns and environmental changes, so that the model can quickly adapt to new data and environments. This advantage solves the problem of insufficient generalization ability and adaptability of the model in the prior art, so that the model can maintain the accuracy and relevance of predictions in different scenarios, and enhances the practicality and reliability of the model. d. Innovative user behavior serialization processing. The present invention realizes the serialization processing of user behavior by serializing user behavior data into a series of discrete tokens and generating code table embeddings for each token. This serialization method not only improves the efficiency of data processing, but also enhances the model's understanding and prediction ability of user behavior sequences. This advantage solves the problem of insufficient flexibility in user behavior data processing and difficulty in capturing the internal connection of behavior sequences in the prior art, and provides a more accurate and flexible user behavior prediction method for smart home systems.

[0089] The present invention not only improves the accuracy and efficiency of prediction, but also enhances the adaptability and generalization ability of the system, meeting the demand for intelligent and personalized services in the smart home field. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 It is a characteristic residual quantization flow chart of the present invention.

[0091] Figure 2 This is a user behavior prediction diagram for a smart home scenario before the improvement of the present invention.

[0092] Figure 3 It is a schematic diagram of a single-user processing flow of the present invention.

[0093] Figure 4 It is a schematic diagram of the multi-user processing flow of the present invention.

[0094] Figure 5 It is a data preprocessing and characterization vector representation diagram of the present invention. DETAILED DESCRIPTION

[0095] Embodiment 1, as Figure 1-5 ,The technical solution before improvement, the existing user behavior prediction ,solutions for smart home scenarios are as follows Figure 2 As shown. Assume that there is the following user behavior dataset, which records the user's activities at different time periods of the day:

[0096] Table 1

[0097] User ID Time period Activity 1 morning running 1 morning Work 1 night read 2 morning Yoga 2 morning Work 3 morning running 3 afternoon swim

[0098] First, the feature dictionary needs to be built. In this example, activities can be used as atoms of the feature dictionary. Assume that the following set of activities are used as dictionary atoms:

[0099] D = {running, working, reading, yoga, swimming};

[0100] Next, sparse coding converts each user's behavior into sparse coding. Assume that each user's behavior can be represented as a linear combination of these activities, using "1" to indicate that the user has performed the activity and "0" to indicate that the user has not. The following is an example of sparse coding for user 1:

[0101] User 1 runs in the morning, works in the morning, and reads in the evening.

[0102] Therefore, the sparse coding vector of user 1 is: a1 = [1, 1, 1, 0, 0];

[0103] This means that the activity of user 1 can be represented as:

[0104] User 1's behavior ≈ 1× running + 1× work + 1× reading User 1's behavior ≈ 1× running + 1× work + 1× reading;

[0105] For other users, the same method can be used to obtain their sparse coding vectors. For example, the behavior of user 2 creates a sparse coding vector a2 = [0, 1, 0, 1, 0];

[0106] Then, train a behavior prediction model; with these sparse codes, you can train a behavior prediction model. For example, if you want to predict what kind of activity a user will perform in the next time period, you can use these sparse coding vectors as feature inputs and the user's actual activities in the next time period as label outputs to train a classification model.

[0107] For example, for user 1, if the model predicts that the activity that user 1 is likely to perform in the next time period is running, working, reading, yoga, or swimming, the output may be as follows:

[0108] P = [0.1, 0.3, 0.2, 0.1, 0.3]

[0109] This probability distribution means that the model predicts that user 2 has a 10% probability of running, a 30% probability of working, a 20% probability of reading, a 10% probability of yoga, and a 30% probability of swimming.

[0110] Embodiment 2, as an improvement, the behavior of a certain user can be represented by token serialization; then, the prediction model is used to predict the next token; the steps are as follows;

[0111] SA1, defines the content of the "token" of the user behavior; for example, in a smart home environment, a token can be:

[0112] A simple action, such as "turn on the light", "turn off the light".

[0113] A state change, such as "temperature set to 22°C".

[0114] A timestamp that indicates the exact time when an action occurred.

[0115] A device identifier that represents the specific device with which the user interacted.

[0116] SA2 collects data on the interaction between users and smart home systems; the data includes the following:

[0117] Sensor data, such as motion sensors, temperature sensors, cameras, etc.

[0118] Commands entered directly by the user, such as commands issued through smart speakers or mobile phone apps.

[0119] Records of device status changes, such as temperature adjustment records for smart thermostats.

[0120] SA3, converts the collected data into recognizable behaviors.

[0121] For example: using image recognition technology to identify the behavior of "watching TV" from camera data; using voice recognition technology to identify the command of "playing music" from microphone data.

[0122] SA4, converts the behaviors identified in SA3 into tokens.

[0123] The content includes:

[0124] First, map the behavior to a predefined token list;

[0125] Then, assign a unique identifier or tag to each behavior;

[0126] SA5, arranges the generated tokens in chronological or logical order to form a sequence.

[0127] For example: ["get up", "turn on the light", "adjust the temperature to 22℃", "prepare breakfast"]

[0128] Each token represents a specific behavior or event, and the sequence represents the flow of user behavior. Among them, the continuous state changes or action sequences are divided into discrete events;

[0129] SA6, extracts features from the token sequence for subsequent prediction model training.

[0130] SA7, first, uses the token sequence and its features to train the prediction model, and then uses the model to predict future user behavior sequences.

[0131] As a further improvement, the present invention is based on a smart home scenario, which usually has multiple users. Therefore, first, it is necessary to extract the behavior and characteristics of each user for representation by a feature vector; then, it is embedded into a token and input into a large model for training. The trained model then outputs a token-based behavior prediction.

[0132] Among them, each token represents the behavior of a user, each token can support N features for embedding, and each embedding supports N dimensions. These embeddings contain user behavior information, user portrait and other information.

[0133] Embodiment 3, compared with the existing solution, in the improvement of embodiment 2, the improved processing flow of this solution is as follows: first, data preprocessing: quantizing the high-dimensional data features representing user behavior and user portrait; then, feature residual quantization: quantizing the feature residual of the feature vector to generate code table embeddings; second, token representation of user behavior: each token corresponds to a specific behavior or event;

[0134] Again, the tokens with embeddings are fed into the Transformer model for training. The model learns the patterns of these token sequences and adjusts its parameters to minimize the prediction error;

[0135] Then, the trained model can predict the next token based on the input token sequence, that is, predict the user's next behavior.

[0136] Example 4: Existing technologies may rely on simple feature engineering and traditional machine learning algorithms, which often fail to fully capture the complexity and diversity of data when processing user behavior data. This results in the inability of the prediction model to accurately understand and predict the complex patterns of user behavior.

[0137] Moreover, the prediction models in the existing technology may be overly dependent on the characteristics of a specific data set and lack good generalization capabilities, resulting in a decrease in the prediction performance of the model when facing new user groups or market environments.

[0138] Based on the above reasons, this plan proposes:

[0139] (1) Convert user behavior data into a series of discrete behavior representations, effectively capture subtle changes and long-term dependencies in user behavior, improve prediction accuracy, and predict the user's next behavior in the context of the entire behavior sequence, so as to better understand and predict the complex patterns of user behavior.

[0140] (2) Through data preprocessing and feature residual quantization modules, large-scale user behavior data and user portrait data can be efficiently processed and converted to generate feature vector representations and code table embeddings. Combined with the model's parallel computing capabilities, the speed of model training and reasoning can be significantly improved, real-time prediction can be achieved, and the efficiency of data processing and the model's ability to handle large-scale data sets can be improved.

[0141] In summary,

[0142] Example 5, based on Example 4, the process is described as follows:

[0143] S1, user behavior collection and user portrait information collection in smart home scenarios;

[0144] The data collection methods used in smart home scenarios include voice collection, camera image / video collection, etc. The collected data is used to analyze user behavior habits.

[0145] Analyze user behavior data in smart homes and learn user habits and preferences.

[0146] Regarding the collection of user portrait information, the setting interface of the smart home system can be used to allow users to directly input personal preferences, such as temperature settings, lighting preferences, etc.

[0147] S2, data feature vectorization;

[0148] The user behavior data and user portrait data collected in the smart home scene are converted into numerical feature vectors. This process is demonstrated through a specific example:

[0149] S2.1, assume that there are the following user behavior data and user portrait data:

[0150]

Basic user information

[0151] Age: 35

[0152] Gender: Male

[0153] Occupation: Software Engineer

[0154] User Preferences:

[0155] Preferred temperature: 22℃

[0156] Favorite music type: Jazz

[0157] Lighting preference: Soft light

[0158]

User behavior data (past week)

[0159] Average time spent using smart lights per day: 2 hours

[0160] Average time spent listening to music per day: 1 hour

[0161] Average TV viewing time per day: 0.5 hours

[0162] Average number of times a smart thermostat is used to adjust the temperature per day: 3 times

[0163] S2.2, Feature extraction and numerical representation

[0164] Age: Directly expressed as a numerical value: 35

[0165] Gender: Use binary encoding: male is 1, female is 0 → [1]

[0166] Occupation: Assume there are 5 occupational categories: software engineer, doctor, teacher, lawyer, freelancer. Use one-hot encoding → [1,0,0,0,0]

[0167] Preferred temperature: Directly expressed as a numerical value: 22

[0168] Favorite music type:

[0169] Suppose there are 4 types of music: jazz, rock, pop, classical. Use one-hot encoding → [1,0,0,0]

[0170] Lighting preference:

[0171] Assume there are 3 lighting preferences: soft, bright, natural light. Use one-hot encoding → [1,0,0]

[0172] Smart light usage time: directly expressed in numerical value: 2 hours

[0173] Listening time: Directly expressed in numerical value: 1 hour

[0174] TV viewing time: Directly expressed as a numerical value: 0.5 hours

[0175] Smart thermostat usage times: Directly expressed as a value: 3 times

[0176] S2.3, combined characterization vector;

[0177] Combining all the features, we get a featurized vector representation as follows:

[0178] User behavior vector = [35,1,[1,0,0,0,0],22,[1,0,0,0],[1,0,0],2,1,0.5,3]

[0179] This vector can be further input into the machine learning model for training or prediction. In practical applications, it may be necessary to normalize or standardize the numerical features to ensure the consistency of the proportions between different features and improve the performance of the model.

[0180] S3, feature residual quantization;

[0181] First, assume the scenario and data

[0182] Assume that the following user behavior data is collected through sensors and user interaction interfaces in the smart home system:

[0183] ●User A frequently adjusts the smart thermostat at 8pm to set the temperature to 22℃.

[0184] ●User A often turns on the lights in the living room at 9pm and sets them to soft mode.

[0185] ●User A often plays jazz music through the smart speaker at 10 pm.

[0186] From these data, the following feature vectors were extracted:

[0187] Eigenvector

[0188] x = [time point, action, device type, setting value] = [20:00, adjust temperature, thermostat, 22°C]

[0189] Then, the feature residual quantization step is performed;

[0190] S3.1: Construct code table

[0191] The code table contains a set of basic vectors, each of which represents a common user behavior pattern. For example, the code table may contain the following vectors:

[0192] C = {c1 = [20:00, adjust temperature, thermostat, 22°C],

[0193] c2=[21:00, turn on the lights, lights, soft],

[0194] c3 = [22:00, play music, speakers, jazz]}

[0195] S3.2: Quantized feature vectors

[0196] For each eigenvector, find the vector in the code table that is closest to it. In this example, the eigenvector

[0197] x is closest to c1 in the code table.

[0198] S3.3: Calculate the residual vector

[0199] Calculate the difference (residual) between the feature vector and the code table vector: r = xc

[0200] If x exactly matches c1, then the residual vector r is the zero vector.

[0201] S3.4: Generate code table embeddings

[0202] The code table embeddings can be the code table vector itself or a combination of the code table vector and the residual vector. In this example, since x matches c1 exactly, the code table embeddings is the index of c1 or directly c1.

[0203] In this way, each user behavior feature vector can be converted into a low-dimensional code table embeddings, which can be used for subsequent machine learning model training, such as behavior prediction models. This method can not only reduce the dimension of the data, but also capture the potential patterns of user behavior and improve the performance and efficiency of the model.

[0204] In summary, feature residual quantization generates compact embeddings representations by mapping high-dimensional feature vectors into predefined code tables, which can be used for various analysis and prediction tasks in smart home scenarios.

[0205] S4, behavior token serialization;

[0206] S4.1, [one user];

[0207] For a sentence or a sequence of user actions, such as "[20:00, adjust temperature, thermostat, 22°C]", retrieve the embedding vector for each token in the sequence:

[0208] "20:00" corresponds to an embedding vector.

[0209] ●“Adjust temperature” corresponds to an embedding vector.

[0210] ●“Thermostat” corresponds to an embedding vector.

[0211] ●“22℃” corresponds to an embedding vector.

[0212] Therefore, for each token in the sequence, there is a corresponding embedding vector. These vectors can be concatenated, added, or combined in other ways to form the final representation that is input to the model.

[0213] The serialized token is as follows:

[0214] Token1,token2,token3....token N

[0215] S4.2, [Multiple Users];

[0216] When there are multiple users, refer to step (5) for explanation.

[0217] S5, multi-dimensional feature embedding;

[0218] In a multi-user scenario, each user corresponds to a token, so the following adjustments need to be made:

[0219] S5.1, design an embedding matrix:

[0220] The number of rows is equal to the size of the vocabulary (i.e., how many c1, c2, ..., cn are contained in C),

[0221] The number of columns is the dimension of the embedding.

[0222] Each row corresponds to the embedding vector of a token, that is, each row corresponds to a token.

[0223] S5.2, Token to index:

[0224] Map each token to a unique index, which is used to retrieve the corresponding embedding vector from the embedding matrix.

[0225] Therefore, the serialized token is as follows:

[0226] Token1(embedding1,embedding2,embeding3...),

[0227] token2(embedding1,embedding2,embeding3...),

[0228] token3(embedding1,embedding2,embeding3...) ....

[0230] tokenN(embedding1,embedding2,embeding3...)

[0231] S6, behavior prediction model;

[0232] The tokens generated based on the previous steps S4 and S5 are used as the input of the model for different scenarios (single or multiple people). In this solution, the Transformer model is used as the core prediction module. The model can effectively process sequence data with its self-attention mechanism, capture long-distance dependencies in user behaviors, and perform autoregressive sequence prediction.

[0233] S7, predicted behavior sequence;

[0234] During the inference phase, the system continuously collects users' real-time behavior data and portrait information, and converts them into featurized vector representations and code table embeddings.

[0235] The processed data is input into the trained Transformer model, and the model outputs a prediction of the user's next behavior based on the learned patterns and relationships.

[0236] like Figure 2-5 Based on the above steps S1-S7, a solution for smart home scene understanding and intelligent interaction based on multimodal fusion can be implemented.

[0237] The present invention solves technical problems including but not limited to the following through technical innovations such as data preprocessing and characterization vector representation, feature residual quantization and code table embeddings generation: a. How to convert user behavior data and user portrait data into characterization vector representation. This process involves in-depth analysis and feature extraction of the original data to facilitate subsequent model training and prediction; b. The present invention converts the characterization vector into code table embeddings through a feature residual quantization module. This step is one of the core innovations of the present invention, which can compress high-dimensional data into low-dimensional representation while retaining key information, thereby improving the efficiency and performance of the model; c. The generalization ability and adaptability of the system. The system of the present invention has good generalization ability and adaptability, and can adapt to different user behavior patterns and environmental changes. This is achieved through continuous optimization and adjustment of the training and reasoning modules.

[0238] The present invention is fully described for a clearer disclosure, and the prior art is not listed one by one.

[0239] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein with equivalents; it is obvious for those skilled in the art to combine multiple technical solutions of the present invention. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention. The technical contents not described in detail in the present invention are all known technologies.

Claims

1. A large model-based autoregressive user behavior prediction method, characterized by: The prediction method includes the following steps; First, data preprocessing is done to quantize the high-dimensional data features representing user behaviors and user portraits; Then, the feature residual is quantized, and the feature vector is quantized to generate code table embeddings; Secondly, user behavior is represented by tokens, and each token corresponds to a specific behavior or event; Again, the tokens embedded with embeddings are fed into the Transformer model for training; the Transformer model learns the pattern of the token sequence and adjusts the parameters to minimize the prediction error, forming a trained Transformer model; Then, based on the trained Transformer model, the next token is predicted according to the input token sequence, that is, the user’s next behavior is predicted.

2. A large model-based autoregressive user behavior prediction method, characterized by: Used in smart home scenarios; the prediction method steps are as follows; S1, collect data, including user behavior and user portrait information in smart home scenarios; S2, data feature vectorization: in the smart home scenario, the collected user behavior data and user portrait data are converted into numerical feature vectors; S3, feature residual quantization; S4, behavior token serialization; When there is only one user, execute S4.1; when there are multiple users, execute S5; S5, multi-dimensional feature embedding; S6, behavior prediction model; S7, predicting behavior sequences.

3. The autoregressive user behavior prediction method based on a large model according to claim 2, characterized in that: In S1, the following steps are performed; S1.1, analyze user behavior habits after data collection; S1.2, analyzing user behavior data in smart homes and learning user habits and preferences; In step S1, the data collection method includes voice collection, camera image and / or video collection; When collecting user portrait information, users are allowed to directly input their personal preferences through the setting interface of the smart home system; personal preferences include temperature settings and lighting preferences; Behavioral data, behavioral data within a set time period; behavioral data includes habitual behavior.

4. The large model-based autoregressive user behavior prediction method according to claim 2, characterized in that: In S2, the following steps are executed; S2.1, retrieve user behavior data and user portrait data: S2.2, feature extraction and numerical representation; S2.3, combine the featurized vectors, combine all the features to obtain a featurized vector and input it into the machine learning model for training or prediction; In S2.1, basic user information includes age, gender, and occupation; User preferences include preferred temperature, favorite music genre, and lighting preferences; User behavior data within the set period includes the average time per day for using smart lights, the average time per day for listening to music, the average time per day for watching TV, and the average number of times per day for adjusting the temperature using the smart thermostat; In S2.3, the numerical features are normalized or standardized to ensure the consistency of proportions between different features.

5. The large model-based autoregressive user behavior prediction method according to claim 4, characterized in that: In S2, it is assumed that user behavior data and user profile data; In S2.1, basic information of the user, age: 35 years old; Gender: Male; Occupation: Software Engineer; User preferences, preferred temperature: 22℃; preferred music type: jazz; Lighting preference: Soft lighting; User behavior data within the set time period in the past: average time of using smart lights per day: 2 hours; average time of listening to music per day: 1 hour; average time of watching TV per day: 0.5 hours; average number of times of using smart thermostat to adjust the temperature per day: 3 times; In S2.2, Age: directly expressed as a numerical value: 35; Gender: using binary encoding: male is 1, female is 0→[1]; Occupation: Assume we have 5 occupation categories: software engineer, doctor, teacher, lawyer, freelancer; use one-hot encoding → [1,0,0,0,0]; Preferred temperature: directly expressed as a numerical value: 22; Preferred music type: Assume we have 4 music types: jazz, rock, pop, classical; use one-hot encoding → [1,0,0,0]; Lighting preference: Assume we have 3 lighting preferences: soft, bright, natural light; use one-hot encoding → [1,0,0]; Smart light usage time: directly expressed as a numerical value: 2 hours; Listening to music time: directly expressed as a numerical value: 1 hour; Watching TV time: directly expressed as a numerical value: 0.5 hours; Number of times the smart thermostat is used: directly expressed as a numerical value: 3 times; In S2.3, all features are combined to obtain a characterization vector represented as follows: User behavior vector = [35,1,[1,0,0,0,0],22,[1,0,0,0],[1,0,0],2,1,0.5,3].

6. The large model-based autoregressive user behavior prediction method according to claim 4, characterized in that: In S3, the execution has the following steps; S3.1, first, assume the scenario and data, collect user behavior data, and extract feature vectors: x = [time point, action, device type, setting value]; S3.2, performing feature residual quantization step; In S3.2, perform the following steps; S3.2.1: Construct a code table; the code table contains basic vectors, each of which represents a corresponding user behavior pattern; S3.2.2: Quantized feature vectors; For each eigenvector in S3.1, find the basis vector closest to the eigenvector in the code table; S3.2.3: Calculate the residual vector; Calculate the difference between the feature vector and the code table vector, that is, the residual vector. If the feature vector and the code table vector completely match, the residual vector is a zero vector; S3.2.4: Generate code table embeddings; Code table embeddings are the code table vector itself or the combination of the code table vector and the residual vector; S4.1, for a sentence or a user behavior sequence, an embedding vector corresponding to each token in the sequence: the embedding vectors are combined to form the final representation input to the model; The serialized token looks like this: Token1,token2,token3....token N.

7. The large model-based autoregressive user behavior prediction method according to claim 6, characterized in that: In S3.1, it is assumed that the following user behavior data is collected through sensors and user interaction interfaces in the smart home system: User A often adjusts the smart thermostat at 8pm to set the temperature to 22℃; User A often turns on the lights in the living room at 9pm and sets them to soft mode; User A often plays jazz music through the smart speaker at 10 pm; The following eigenvectors were extracted: x = [time point, action, device type, setting value] = [20:00, adjust temperature, thermostat, 22°C]; In S3.2.1, the code table contains the following basis vectors: C = {c1 = [20:00, adjust temperature, thermostat, 22°C], c2=[21:00, turn on the lights, lights, soft], c3 = [22:00, play music, speakers, jazz]}; In S3.2.2, x is closest to c1 in the code table; In S3.2.3, the residual between the feature vector and the code table basis vector is calculated: r = xc; If x and c1 match exactly, the residual vector r is a zero vector; In S3.2.4, since x matches c1 exactly, the code table embeddings is the index of c1 or directly c1.

8. The large model-based autoregressive user behavior prediction method according to claim 7, characterized in that: In S5, the following steps are performed: S5.1, design embedding matrix: The number of rows in the embedding matrix is ​​equal to the size of the vocabulary; The number of columns is the dimension of embedding; In the embedding matrix, each row corresponds to the embedding vector of a token, that is, each row corresponds to a token; S5.2, Token to index: Map each token to a unique index, which is used to retrieve the corresponding embedding vector from the embedding matrix; Therefore, the serialized token is as follows: Token1(embedding1,embedding2,embeding3...), token2(embedding1,embedding2,embeding3...), token3(embedding1,embedding2,embeding3...), .... token N(embedding1,embedding2,embedding3...).

9. The large model-based autoregressive user behavior prediction method according to claim 8, characterized in that: In S6, the tokens generated based on steps S4 and S5 are used as the input of the model for different scenarios, and the Transformer model is used as the core prediction module; the Transformer model processes sequence data with a self-attention mechanism, captures long-distance dependencies in user behaviors, and performs autoregressive sequence prediction; Scenarios include single-user or multi-user; In S7, during the predictive reasoning stage, the user's real-time behavior data and portrait information are continuously collected and converted into featurized vector representations and code table embeddings; the processed data is input into the trained Transformer model, and the model outputs a prediction of the user's next behavior based on the learned patterns and relationships.

10. An autoregressive user behavior prediction system based on a large model, characterized by: The system includes a core prediction module using a Transformer model; and is used to execute the method described in claim 1.

Citation Information

Patent Citations

  • User behavior prediction method and system and computer equipment

    CN113570204A

  • User behavior prediction method, system and device

    CN114463117A

  • Determining future user actions using time-based featurization of clickstream data

    US11799734B1