Semantic-guided conditional flow matching generative recommendation method
By constructing a semantically guided conditional flow matching generative recommendation method, the problems of mismatch between semantic and behavioral space distribution and information loss in existing recommendation systems are solved. This enables efficient personalized recommendations in sparse data scenarios and improves the recommendation accuracy and system stability for cold-start users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INNOVATION CENTER OF YANGTZE RIVER DELTA ZHEJIANG UNIVERSITY
- Filing Date
- 2026-01-20
- Publication Date
- 2026-06-02
AI Technical Summary
Existing recommendation systems suffer from problems such as mismatch between semantic and behavioral space distribution, information loss, lack of controllable semantic guidance mechanisms, and difficulty in probabilistic modeling of generative recommendations when integrating semantic embedding information from large language models. These problems lead to poor recommendation performance, especially in sparse data scenarios.
By constructing a semantically guided conditional flow matching generative recommendation method, a pre-trained large language model is used to generate semantic embedding vectors of users and items. Combined with behavior-guided Bernoulli prior distribution, a conditional flow matching network is constructed. A random mask interpolation method and a classifier-free guidance strategy are adopted to achieve weighted aggregation and controllable guidance of user semantics and item semantics, which are directly injected into the flow matching generation process.
It achieves efficient recommendation in sparse data scenarios, avoids information loss, improves recommendation accuracy for cold-start users, provides a controllable semantic guidance mechanism, enhances the personalization and stability of the recommendation system, and is applicable to various generative recommendation baselines.
Smart Images

Figure CN122132619A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a semantically guided conditional flow matching generative recommendation method. Background Technology
[0002] Recommendation systems are a key technology for solving the problem of information overload and have wide applications in e-commerce, social media, content platforms, and other fields. Based on different modeling methods, recommendation methods can be divided into two main categories: discriminative methods and generative methods.
[0003] Discriminative methods (such as matrix factorization and graph neural networks) establish metric relationships between users and items by learning unique embeddings of users and items. However, these methods heavily rely on sufficient interaction data and their performance is limited in data-sparse scenarios.
[0004] Generative methods aim to establish a complete probability distribution of user preferences, generating the probabilities of unknown interactions from known interaction data. Typical generative recommendation methods include: (1) Variational autoencoder (VAE) type methods: such as Mult-VAE constructs an approximate posterior distribution of users through variational inference, but due to the trade-off between representational power and processability, simple encoding and decoding structures are difficult to capture the complexity of user preferences and are prone to posterior collapse.
[0005] (2) Diffusion model methods: such as DiffRec and L-DiffRec, which gradually add Gaussian noise to the distribution space and remove it in the reverse process, but the training process is complicated, requires a lot of denoising steps, and has a large computational cost.
[0006] (3) Flow Matching methods: such as FlowCF, which uses a flow matching framework to learn a deterministic mapping from noise distribution to target distribution, resulting in more stable training and more efficient inference. However, existing flow matching methods only utilize behavioral data and fail to integrate semantic information.
[0007] With the rise of pre-trained large language models (such as GPT, LLaMA, etc.), leveraging LLM to enhance recommender systems has become a research hotspot. Existing methods are mainly divided into two categories: (1) Fine-tuning strategy: embedding the recommendation task into the fine-tuning process of LLM, but the training cost is high and it is limited by the application scenario.
[0008] (2) Auxiliary strategies: Using LLM as an aid to the recommendation model, the representation capability of the recommendation model is enhanced by generating user / item profile text and converting it into semantic vectors. Methods such as KAR and RLMRec attempt to align the semantic representation of LLM with the recommendation representation.
[0009] The existing technology has the following main problems: (1) Mismatch between semantic and behavioral space distribution: The text embeddings generated by LLM and the user interaction data are located in the language space and co-occurrence space, respectively, and there are significant differences between the two in probability density, distribution shape and support region. Direct alignment may lead to irreversible information distortion.
[0010] (2) Insufficient fusion of conditional information: Existing conditional generation methods often use additive fusion when fusing external semantic conditions, adding the conditional information to the hidden state. This approach allows the model to gradually ignore the conditional information during training, resulting in limited semantic guidance effects.
[0011] (3) Information loss of VAE-based methods: Generative recommendation methods based on VAE suffer information loss during the latent space encoding process, and the standard Gaussian prior assumptions deviate from the actual user preference distribution.
[0012] (4) Lack of controllable semantic guidance mechanism: Existing methods are difficult to flexibly adjust the degree of influence of semantic information on recommendation results and cannot meet the personalized needs of different scenarios.
[0013] (5) Difficulty in probabilistic modeling of generative recommendations: Applying LLM semantic embeddings to generative recommendations faces challenges because... The text embeddings output by LLM cannot be directly represented as probability distributions, making it difficult to reconcile with the probabilistic modeling process of generative models. Summary of the Invention
[0014] The purpose of this invention is to address the shortcomings of existing technologies by providing a semantically guided conditional flow matching generative recommendation method. This method effectively integrates the semantic embedding information of large language models in generative collaborative filtering recommendation systems, overcomes the problem that existing flow matching methods only utilize behavioral data and cannot integrate semantic information, avoids information loss in VAE-type methods, and provides a controllable semantic guidance mechanism.
[0015] The objective of this invention is achieved through the following technical solution: a semantically guided conditional flow matching generative recommendation method, comprising the following steps: (1) Use a pre-trained large language model to generate user profile text and item profile text based on the user and their interactive item set. Obtain user semantic embedding vector and item semantic embedding vector respectively through text embedding model. Pre-compute and store them as user semantic embedding matrix and item semantic embedding matrix. (2) Based on the interaction frequency of items in the training data, construct the Bernoulli prior distribution for behavior guidance; (3) Construct a conditional flow matching network, use user historical interaction to perform weighted aggregation of item semantic embedding vectors based on semantic similarity, and fuse the item semantic embedding vectors with user semantic embedding vectors to form a semantic condition vector, and use the semantic condition vector as a conditional injection flow matching generation process; (4) The conditional flow matching network is trained using a random mask interpolation method, with the training objective being to predict the user's real interaction vector; (5) The reasoning stage starts from the user's historical interactions and generates a recommendation score vector by gradually denoising.
[0016] Furthermore, the semantic condition vector is obtained by pre-computing the semantic embeddings of all users and storing them as a matrix W. user ∈R |U|×ds Pre-compute the semantic embeddings of all items and store them as a matrix. During inference, the corresponding user semantic embedding vector and item semantic embedding vector are obtained by directly looking up tables using the user index u and item index i, respectively. The item semantic embedding vector is then weighted and aggregated based on the user's historical interactions, and fused with the user semantic embedding vector to obtain the semantic condition vector c. u : .
[0017] Furthermore, the input to the conditional flow matching network in step (3) includes the interaction state vector x. t Time embedding e time(t) and semantic condition vector c u The three components are concatenated and input into a multilayer perceptron, and the network output is a predicted score vector for all items. The multilayer perceptron includes an interactive projection MLP and a fusion MLP, wherein the interactive projection MLP is used to map interactive state vectors into low-dimensional dense vectors; and the low-dimensional dense vectors are coupled with a temporal embedding e. time (t) Semantic condition vector concatenation is used as input to the fused MLP to output the predicted target state.
[0018] Furthermore, it also includes a conditional projection layer to reduce the semantic conditional vector c. u Dimensions.
[0019] 5. The method according to claim 1, wherein the random mask interpolation method in step (4) comprises: a) Sample the initial state x0 ~ Bernoulli(p0) from the behavior-guided prior distribution; b) Random sampling time step t ~ U[0, 1]; c) Generate a random mask m t ~Bernoulli(t); d) Constructing intermediate state x t =m t ⊙x1+(1 - m t ) ⊙ x0; e) Train the network with mean squared error loss to predict the target state x1.
[0020] Furthermore, it also includes employing a classifier-free guided training strategy to achieve controllable adjustment of semantic guidance strength: during training, a preset probability p is used. drop The semantic condition vector is randomly set to zero, and the difference between conditional and unconditional predictions is amplified during inference by guiding the scaling parameter ω. .
[0021] Furthermore, the stepwise denoising generation includes: a) Initialize the state using the user's historical interaction vector; b) Iteratively execute on multiple discrete time steps: predict the target state, calculate the velocity field, update the state with Euler steps, binarize and perform a logical OR operation with the history; c) Output the prediction result at the final time step as the recommendation score vector.
[0022] This invention also provides a semantically guided conditional flow matching generative recommendation system, comprising: The LLM embedding module is used to call a pre-trained large language model to encode user profile text, and obtain user semantic vectors through the text embedding model, pre-compute and store them as user semantic embedding matrices. The prior distribution construction module is used to construct a behavior-guided Bernoulli prior distribution based on the frequency of item interactions. The conditional flow matching module is used to construct the conditional flow matching network, injecting user semantic embedding vectors as conditions into the flow matching generation process; The training module is used to train the conditional flow matching network using a random mask interpolation method, with the training objective being to predict the user's actual interaction vector. The inference module is used to generate a recommendation score vector by gradually denoising the user's historical interactions.
[0023] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described semantically guided conditional flow matching generative recommendation method.
[0024] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described semantically guided conditional flow matching generative recommendation method.
[0025] Compared with the prior art, the beneficial effects of the embodiments of the present invention are: (1) No VAE information loss: The present invention directly performs conditional flow matching in the data space, avoiding information loss and posterior collapse problems caused by VAE latent space encoding, and retaining complete interaction information.
[0026] (2) Joint Modeling of User Semantics and Item Semantics: The user semantic embeddings generated by the pre-trained LLM and the weighted aggregated vector of item semantics based on user historical interactions are used to jointly construct semantic conditions. Weighted aggregation based on semantic similarity highlights item semantic information highly relevant to the user profile. Compared to using only user semantics or simple average aggregation, this approach can more precisely characterize the user's center of interest. This semantic condition vector and the user-item interaction matrix... different: The column represents the items (the dimension is the number of items). ), the element is the child interaction record (0 or 1); and The dimension is The elements are continuous value semantic features.
[0027] (3) Direct injection of semantic conditions: The above-mentioned fused semantic condition vector is directly used as the condition injection flow matching generation process, realizing the effective transfer of language space semantic knowledge to collaborative filtering recommendation without the need for complex alignment mechanisms.
[0028] (4) Controllable semantic guidance: Through the classifier-free guidance (CFG) mechanism, the influence of LLM semantic information on the recommendation results can be flexibly adjusted (the guidance scale W can be adjusted in the range of 1.0-3.0), so as to achieve fine control of the semantic guidance intensity and meet the needs of different scenarios.
[0029] (5) Joint modeling of behavior and semantics: By simultaneously utilizing behavior-guided priors based on item frequency and LLM semantic embedding, effective fusion of behavioral and semantic information is achieved. Behavioral priors provide global popularity bias, while semantic conditions provide personalized preference guidance.
[0030] (6) Stable and efficient training: The flow matching method is more stable in training than the diffusion model, with a simple loss function (single MSE loss), fast convergence speed (usually converges in 50-100 rounds), and fewer inference steps (only 2-10 steps are needed).
[0031] (7) Performance Improvement in Sparse Scenarios: Through LLM semantic enhancement, especially by using weighted aggregation of user semantics and item semantics for joint modeling, this invention can extract implicit preferences from limited interaction data for users with extremely sparse interactions, significantly improving the recommendation accuracy for cold-start users. Meanwhile, since the item semantic embedding vector directly originates from the item's own attribute information (title, tags, description) and does not depend on interaction data, this invention can also achieve effective recommendation for new items with sparse interactions (cold-start items) through semantic similarity matching, alleviating the cold-start problem.
[0032] (8) Plug-and-play modular design: The conditional flow matching module of the present invention can be integrated into various generative recommendation baselines as a plug-in, and has good versatility and scalability. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart of a conditional flow matching training process provided in an embodiment of the present invention.
[0035] Figure 2 This is a flowchart of a conditional flow matching inference provided in an embodiment of the present invention.
[0036] Figure 3 This is a schematic diagram of obtaining a vector field based on interaction and semantics, provided as an embodiment of the present invention. Detailed Implementation
[0037] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.
[0038] This invention provides a semantically guided conditional flow matching generative recommendation method, see [link to related document]. Figures 1-3 This includes the following steps: (1) Encode the user profile text using a pre-trained large language model, obtain the user semantic embedding vector through the text embedding model, pre-compute and store it as a user semantic embedding matrix; Specifically, step (1) includes the following sub-steps: (1.1) User / Item Profile Generation: Given any user u and its set of interactive items M(u), use the preset prompt template P to call the large language model to generate a structured profile: (1) Among them, s u To create user profiles, s i Create an item profile, where u is the user index and i is the item index. The user prompt P(u) contains a description and comment summary of the user-interacted item; the item prompt P(i) contains a title, tag, and description.
[0039] (1.2) Semantic Vector Embedding: The text embedding model is used to convert the portrait text into fixed-dimensional semantic vectors. (2) Where d s For the semantic embedding dimension, w u w is the user semantic embedding vector. i It is the semantic embedding vector of the item (such as the 1536-dimensional OpenAI text-embedding-ada-002).
[0040] (1.3) Semantic Condition Vector Construction: The user semantic vector defined by equation (2) is stored as a user semantic embedding matrix W. user ∈R |U|×ds The semantic embedding vector of an item is stored as an item semantic embedding matrix. During training or inference, the user index is used. Item index i can be directly looked up in the table to obtain the corresponding user semantic embedding vector. Item semantic embedding vector Furthermore, based on user history interactions, the semantic embedding vectors of items are semantically weighted and aggregated to construct a semantic condition vector that integrates user semantics and item semantics.
[0041] Specifically, using user semantic embedding vectors With item semantic embedding vector Calculate semantic similarity and in user interaction vectors Weighted aggregation is performed under the mask constraint. The normalized semantic weights can be expressed as: (3) in, It is the numerical stability constant. The weights are non-zero only for items that the user has actually interacted with. Based on the above weights, the semantics of the items are weighted and aggregated to obtain the aggregated item semantic vector: (4) Finally, the user semantic embedding vector and the polymer product semantic vector are fused to construct a semantic conditional vector. The embodiments in this paper use vector concatenation: (5) The user semantic vector that will represent global preferences Polymer semantic vectors that describe the semantic weighted "interest centers" of objects The semantic condition vector is formed by directly concatenating features along their dimensions. This method preserves both the abstract semantic information of the user profile and the fine-grained semantic structure information of historically interacted items without losing any branch information, thus providing users with more comprehensive and stable semantic guidance during the stream matching generation process. It should be noted that alternative solutions such as dimension-wise weighted fusion (e.g., fixed weighting) can be used in other implementations. This semantic condition vector is related to the user-item interaction matrix. different: The column represents the items (the dimension is the number of items). ), where the element is a binary interactive record (0 or 1); and The dimension is The elements are continuous value semantic features.
[0042] (2) Based on the interaction frequency of items in the training data, construct the Bernoulli prior distribution for behavior guidance; Specifically, step (2) includes: Unlike standard flow matching which uses uniform noise as the initial distribution, this invention constructs a behavior-guided prior distribution based on the interaction frequency of items in the training data: (6) Where |U| represents the total number of users, x ui Let I[·] be the interaction record of user u with item i, and let I[·] be the indicator function.
[0043] The advantage of this prior distribution is that: The starting point x0 of the flow matching reflects the global item popularity distribution, rather than random noise; Shorten the transmission distance from noise to the target distribution and accelerate training convergence; We utilize the popularity bias in collaborative filtering as an inductive bias.
[0044] During sampling, Bernoulli sampling is performed independently for each item: (7) in The initial interaction state vector, obtained by sampling from the prior distribution, represents the starting point of the flow matching process; for The i-th element represents the interaction value of item i in its initial state (1 indicates interaction, 0 indicates no interaction).
[0045] (3) Construct a conditional flow matching network and inject user semantic embedding vectors as conditions into the flow matching generation process; The conditional flow matching network includes a temporal embedding layer and a multilayer perceptron; the multilayer perceptron includes an interactive projection MLP and a fusion MLP, wherein the interactive projection MLP is used to map the interactive state vector into a low-dimensional dense vector; and the low-dimensional dense vector is then coupled with the temporal embedding layer. time (t) Semantic condition vector concatenation is used as input to the fused MLP to output the predicted target state.
[0046] In another embodiment, the conditional flow matching network further includes a conditional projection layer for reducing the semantic condition vector c. u Dimensions.
[0047] (4) The conditional flow matching network is trained using a random mask interpolation method, with the training objective being to predict the user's actual interaction vector; Specifically, step (4) includes the following sub-steps: (4.1) Flow Matching Principle: Flow matching defines a continuous transmission path from a simple distribution p0 to a target distribution p1 by learning the time-dependent velocity field vt(x). Given a probabilistic path p... t Flow matching trains the velocity field by minimizing the following objective: (8) in To generate The target velocity field.
[0048] (4.2) Conditional Flow Matching Objective: This invention employs a Conditional Flow Matching framework, constructing a conditional probability path pt(x|x1) based on the user's actual interaction x1. For binary interaction data in collaborative filtering, random mask interpolation is used to construct intermediate states (i.e., interaction state vectors). ): (9) in, The mask is random, and t∈[0,1] is the time step. This is element-wise multiplication.
[0049] The training objective of conditional flow matching is simplified to directly predicting the target state x1: (10) in The empirical distribution of real user interaction vectors in the training data, i.e., randomly sampled users from the training set. Its real interaction vector The above formula indicates that at time t, the distribution follows a uniform distribution U(0,1), starting from... ,end Predict the target state under the joint distribution. The expected value (i.e. mean squared error) of the squared Euclidean distance between the actual user interaction x1 and the actual user interaction x1.
[0050] (4.3) Semantic Conditional Injection Network Architecture: A conditional flow matching network is constructed, using the user's semantic embedding vector as the conditional injection flow matching generation process. The interaction state vector, temporal embedding, and semantic condition vector are concatenated and then input into the fusion MLP for prediction. Optionally, to reduce computational complexity, the high-dimensional sparse interaction state vector can be mapped to a low-dimensional dense feature representation through an interaction projection MLP before concatenation.
[0051] In one embodiment, it also includes interactive data projection: due to the interactive state vector x t ∈R |I| High dimension (number of items) The input dimensions of the MLP can range from thousands to tens of thousands and are sparse (most elements are 0). Direct concatenation would result in an excessively large input dimension. Therefore, we first map the interaction state vector into a low-dimensional dense vector using an interaction projection MLP: (11) Where d proj For the projection dimension (usually set to 300-512), MLP proj It contains 1-2 fully connected layers and activation functions. The functions of this projection layer include: Dimensionality reduction: reducing the size of a high-dimensional sparse vector ( Compression of 1D into a low-dimensional dense vector (d) proj (Dimensionality), significantly reducing the input dimensionality of subsequent MLPs; Feature extraction: Extracting abstract feature representations from sparse interactive data and removing redundant information; Spatial coordination: Transforming sparse 0 / 1 values into dense continuous values, which is more consistent with the numerical range of semantic vectors.
[0052] Feature concatenation and fusion: The interaction state vector, temporal embedding, and semantic conditional vector are concatenated and input into the fusion MLP. Optionally, to reduce computational complexity, the interaction state vector can first be processed by an interaction projection MLP. Dimensional reduction Then they are concatenated. In this embodiment, the original interaction state vector is used directly: (12) in: :time The interactive state vector (optional ground line is reduced to dimensionality by interactive projection MLP) ); : Time step embedding (after linear mapping); : user semantic embedding vector semantic vectors of polymer products The semantic conditional vector obtained by fusion (optionally after conditional projection); ||: Vector concatenation operation.
[0053] The advantages of using interactive projection are: Reduce computational complexity: When interactive projection MLP is enabled, the main MLP input dimension is reduced from... +d time +2d s Reduced to d proj +d time +2d s This significantly reduces the number of parameters and computational overhead. Phased learning: Interactive projection MLP is dedicated to learning feature extraction from interactive data, while fusion MLP is dedicated to learning the fusion of multimodal information, with clear responsibilities; Spatial coordination: The projected interactive features and semantic vectors are both dense continuous values, with more coordinated numerical ranges and distributions, which is conducive to fusion; Conditional flow matching networks predict the target state based on projected interaction features, temporal embeddings, and semantic conditional vectors, thereby calculating the velocity field. The specific process is as follows: Figure 3 As shown.
[0054] Temporal embedding design: Time step t∈[0,1] uses sine and cosine position encoding: (13) Where frequency It covers multi-scale periodic information. This is a frequency index used to generate sine and cosine codes for different frequencies; The dimension of the temporal embedding (usually set to 10-20) determines the length and frequency resolution of the encoded vector.
[0055] Network Structure: The conditional flow matching network is implemented using a fusion MLP, optionally including an interactive projection MLP for dimensionality reduction optimization. Interactive Projection MLP (Optional): Optionally, to reduce computational complexity, the Interactive Projection MLP maps high-dimensional sparse interaction vectors to low-dimensional dense features. (14) in Composed of multiple fully connected layers, activation functions ( It consists of a Dropout layer and an input dimension of . The output dimension is .
[0056] Fusion MLP: As the core prediction module of the conditional flow matching network, the fusion MLP accepts the concatenated multimodal feature vectors and directly predicts the target state. (15) in To fuse the multilayer perceptron, the input is the concatenated feature vector. (Input dimension is) If interactive projection is used, then it is The output dimension is , representing the predicted score for all items. This MLP consists of multiple fully connected layers and activation functions ( It consists of a Dropout layer and a Dropout layer, and its core function is to learn from intermediate states. To the target state The mapping is a key step in the conditional flow matching generation process.
[0057] One embodiment also includes a conditional projection layer: when the LLM semantic embedding dimension is too large (e.g., d... s >4096), you can optionally add a conditional projection layer for dimensionality reduction: (16) Among them W proj ∈R dproj×ds Here is the weight matrix of the conditional projection layer. The bias of the conditional projection layer is used to transfer high-dimensional semantic embedding vectors from Dimension mapping to dimension; Let be the dimension of the projected semantic condition vector, satisfying d proj <d s Use after projection Replace c u Then, the parts are assembled.
[0058] In another embodiment, referring to Table 1, a classifier-free guidance training strategy is also included: To enhance the control over the semantic conditions of LLM and achieve adjustable semantic guidance strength, a classifier-free guidance (CFG) training strategy is adopted: Conditions are randomly discarded during training: during training, conditions are discarded with probability p. drop The conditional vector is randomly set to zero, allowing the model to learn both conditional and unconditional generation simultaneously. (17) In the specific implementation, a discard mask is independently sampled for each batch of samples: (18) Inference phase guidance and scalar control: conditional predictions are calculated separately during inference. and unconditional prediction The influence of conditions is amplified by guiding the scale ω: (19) Where 1 represents the time step. (End point / target state of the flow matching process) For conditional prediction, it means using semantic condition vectors. The target state predicted by the time model, i.e. ; For unconditional prediction, it means using the zero vector ( When ) is used as a condition, the target state predicted by the model is, i.e. ; The predicted target state after CFG guidance is obtained by fusing conditional and unconditional predictions using the above formula.
[0059] Semantic interpretation of guiding scale: ω=1: Standard condition generation, equivalent to direct use ; ω>1: Amplifying the influence of semantic conditions, the recommendation results are more consistent with the semantics of the user profile; ω<1: The influence of semantic conditions is weakened, and the recommendation results rely more on behavioral patterns; ω=0: Completely ignore semantic conditions, degenerate into unconditional flow matching.
[0060] Table 1 (5) Referring to Table 2, the reasoning stage starts from the user's historical interactions and generates a recommendation score vector by gradually denoising.
[0061] Specifically, step (5) includes the following sub-steps: (5.1) Initialization: Use the user's historical interaction vector as the initial state: (20) in For users The historical interaction vector represents the user's historical interaction vector. Known interaction records in the training data.
[0062] (5.2) Iterative denoising: For discrete time step sequences t∈{t start, t start+∆t ,...,t endFor a specific user u, noise reduction is performed stepwise to generate the data. For each time step... Repeat the following steps: (a) Predict the target state (apply bootstrapping if CFG is enabled): (twenty one) (b) Calculate the velocity field: (twenty two) in, For users The interaction state vector at the current time t, Let ϵ be the velocity field at time t, representing the rate of state change, and ϵ be the numerical stability term (e.g., 10). -6 The conditional flow matching network predicts the target state based on the interaction state vector, temporal embedding, and semantic conditional vector, thereby calculating the velocity field. The specific process is as follows: Figure 3 As shown.
[0063] (c) Euler step update state: (twenty three) in For time step, This is the probability state vector updated by the Euler step.
[0064] (d) Binarization sampling: (twenty four) in This is the binarized state vector. The indicator function converts the probabilistic state into a two-word interactive state.
[0065] (e) Logical OR operation with historical data (retaining known positive feedback): (25) in This represents a logical OR operation element-wise, ensuring that the user's behavior is preserved in each iteration. All known positive feedback interactions.
[0066] (f) Update the state vector for the next iteration: (26) The updated state vector is used as the input for the next iteration.
[0067] Table 2 (5.3) Output: Prediction of the final time step As the recommendation score vector, the Top-K items in the training set that have been interacted with are masked and used as the recommendation list: (27) in For users The interaction vectors in the training set represent the... Items that have been interacted with in the training data (1 indicates interaction, 0 indicates no interaction) are used to mask interacted items in the training set to avoid duplicate recommendations. In the formula... This is used to set the scores of interacted items in the training set to extremely negative values, ensuring that these items are excluded during Top-K selection and avoiding duplicate recommendations.
[0068] This invention also provides a semantically guided conditional flow matching generative recommendation system, comprising: LLM embedded module: Given any user u and its set of interactive items M(u), call a pre-trained large language model (such as GPT-3.5-turbo, LLaMA-2, etc.) to generate user profiles and item profiles; Use text embedding models (such as text-embedding-ada-002, BGE-large, etc.) to convert text into semantic vectors; Supports offline pre-computation and caching, avoiding the overhead of LLM calls during online inference; Store the pre-computed user semantic embedding matrix Wuser∈R |U|×ds With item semantic embedding matrix ; The semantic condition vector is obtained by directly looking up the table through the user index, and the semantic embedding vector of the item is weighted and aggregated based on semantic similarity in combination with the user's historical interaction to obtain the semantic embedding vector of the polymer item.
[0069] The semantic embedding vector of the user is fused with the semantic vector of the polymer product to construct a semantic condition vector, which serves as the input condition of the conditional flow matching module.
[0070] In one embodiment, a conditional projection layer is further included for reducing the user semantic embedding vector c. u Dimensions.
[0071] Prior distribution construction module: Statistically analyze the interaction frequency of each item in the training set; Construct a behavior-guided Bernoulli prior distribution; Supports online updates to adapt to changes in data distribution.
[0072] Conditional flow matching module: Temporal embedding layer: Sine and cosine position encoding; Conditional projection layer (optional): used for dimensionality reduction of large-scale LLM embeddings; Multilayer perceptron: Input dimension +dtime+dcond, output dimension ; Activation function: Tanh, Dropout rate: 0.1.
[0073] Training module: Implement random mask interpolation training; CFG conditional random drop (default drop rate 0.1); Adam optimizer, learning rate 1e-3; Early stopping strategy: Stop if Recall@20 on the validation set does not increase for 20 consecutive rounds.
[0074] Reasoning module: Stepwise denoising generation (default 10 steps, configurable); CFG-guided inference (default guiding scale 1.5); Training set item mask; Top-K recommendation list generation.
[0075] For example, see Table 3 for key parameter settings: Table 3: Key Hyperparameter Configuration Example 1: Taking a movie recommendation scenario as an example; Scenario: Recommending movies that users might be interested in. Dataset: Number of users: 11,000 Number of movies: 9,332 Number of interactions: 200,860 Sparsity: 99.80% Step 1: LLM Profile Generation For user u (who has watched "Interstellar", "Inception", and "The Matrix"), build hints: Based on the user's viewing history: - Interstellar: A sci-fi epic about space exploration... - Inception: A mind-bending thriller about dreams... - The Matrix: A cyberpunk action film about reality... Please summarize this user's movie preferences in 100 words. LLM output image: This user prefers thought-provoking sci-fi films with complexnarratives, philosophical themes about reality and consciousness, visually stunning cinematography, and strong directorial vision from filmmakers like Christopher Nolan and the Wachowskis. Step 2: Semantic Embedding Calling text-embedding-ada-002 gets w u ∈ R 1536 .
[0076] Step 3: Training • Load the pre-computed user semantic embedding matrix W user ∈ R 11000×1536 ; • Calculate the movie frequency prior p0∈R 9332 ; • Train the conditional flow matching model with an input dimension of 9332 + 10 + 1536 = 10878; • Number of training rounds: approximately 80 rounds to converge.
[0077] Step 4: Reasoning Starting with the user's historical interactions, perform 8 steps of noise reduction; Apply CFG bootloader (ω= 2.0); The mask has been used to watch the movie; Output a Top-20 recommended list.
[0078] Example of recommendation results: 1. *2001: A Space Odyssey* (classic science fiction with philosophical themes); 2. Blade Runner 2049 (Cyberpunk, visually stunning); 3. Arrival (hard science fiction, deep narrative); 4. Prometheus (space exploration, existentialism); 5. ...
[0079] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A semantically guided conditional flow matching generative recommendation method, characterized in that, Includes the following steps: (1) Use a pre-trained large language model to generate user profile text and item profile text based on the user and their interactive item set. Obtain user semantic embedding vector and item semantic embedding vector respectively through text embedding model. Pre-compute and store them as user semantic embedding matrix and item semantic embedding matrix. (2) Based on the interaction frequency of items in the training data, construct the Bernoulli prior distribution for behavior guidance; (3) Construct a conditional flow matching network, use user historical interaction to perform weighted aggregation of item semantic embedding vectors based on semantic similarity, and fuse the item semantic embedding vectors with user semantic embedding vectors to form a semantic condition vector, and use the semantic condition vector as a conditional injection flow matching generation process; (4) The conditional flow matching network is trained using a random mask interpolation method, with the training objective being to predict the user's real interaction vector; (5) The reasoning stage starts from the user's historical interactions and generates a recommendation score vector by gradually denoising.
2. The method according to claim 1, characterized in that, The semantic condition vector is obtained by pre-computing the semantic embeddings of all users and storing them as a matrix W. user ∈R |U|×ds Pre-compute the semantic embeddings of all items and store them as a matrix. During inference, the corresponding user semantic embedding vector and item semantic embedding vector are obtained by directly looking up tables using the user index u and item index i, respectively. The item semantic embedding vector is then weighted and aggregated based on the user's historical interactions, and fused with the user semantic embedding vector to obtain the semantic condition vector c. u : 。 3. The method according to claim 2, characterized in that, The input to the conditional flow matching network in step (3) includes the interaction state vector x. t Time embedding e time(t) and semantic condition vector c u The three components are concatenated and input into a multilayer perceptron, and the network output is a predicted score vector for all items. The multilayer perceptron includes an interactive projection MLP and a fusion MLP, wherein the interactive projection MLP is used to map interactive state vectors into low-dimensional dense vectors; and the low-dimensional dense vectors are coupled with a temporal embedding e. time (t) Semantic condition vector concatenation is used as input to the fused MLP to output the predicted target state.
4. The method according to claim 3, characterized in that, It also includes a conditional projection layer to reduce the semantic conditional vector c. u Dimensions.
5. The method according to claim 1, characterized in that, The random mask interpolation method described in step (4) includes: a) Sample the initial state x0 ~ Bernoulli(p0) from the behavior-guided prior distribution; b) Random sampling time step t ~ U[0, 1]; c) Generate a random mask m t ~Bernoulli(t); d) Constructing intermediate state x t =m t ⊙x1+(1 - m t ) ⊙ x0; e) Train the network with mean squared error loss to predict the target state x1.
6. The method according to claim 1, characterized in that, It also includes using a classifier-free guided training strategy: during training, training is performed with a preset probability p drop The semantic condition vector is randomly set to zero, and the difference between conditional and unconditional predictions is amplified during inference by guiding the scaling parameter ω. 。 7. The method according to claim 1, characterized in that, The stepwise denoising generation includes: a) Initialize the state using the user's historical interaction vector; b) Iteratively execute on multiple discrete time steps: predict the target state, calculate the velocity field, update the state with Euler steps, binarize and perform a logical OR operation with the history; c) Output the prediction result at the final time step as the recommendation score vector.
8. A semantically guided conditional flow matching generative recommendation system, characterized in that, include: The LLM embedding module is used to call a pre-trained large language model to encode user profile text, and obtain user semantic vectors through the text embedding model, pre-compute and store them as user semantic embedding matrices. The prior distribution construction module is used to construct a behavior-guided Bernoulli prior distribution based on the frequency of item interactions. The conditional flow matching module is used to construct the conditional flow matching network, injecting user semantic embedding vectors as conditions into the flow matching generation process; The training module is used to train the conditional flow matching network using a random mask interpolation method, with the training objective being to predict the user's actual interaction vector. The inference module is used to generate a recommendation score vector by gradually denoising the user's historical interactions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the semantically guided conditional flow matching generative recommendation method according to any one of claims 1-7.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements a semantically guided conditional flow matching generative recommendation method as described in any one of claims 1-7.