Generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment

By combining cross-domain codebook sharing and inter-domain semantic alignment methods with RQ-VAE and heterogeneous collaborative knowledge graphs, the problem of difficult alignment of item representations in cross-domain recommendation is solved, achieving efficient generative recommendation and improving the recommendation effect for cold-start users.

CN122309849APending Publication Date: 2026-06-30ANHUI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI UNIV
Filing Date
2026-04-07
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In cross-domain recommendation, existing RQ-VAE codebook construction and optimization rely solely on pure semantic features and reconstruction errors, making it difficult to align the discrete semantic representations of items in the source and target domains in a unified space. Furthermore, the quantized label sequence deviates from the actual requirements of the recommendation task.

Method used

We design a cross-domain shared codebook and inter-domain semantic alignment method. We construct a D-layer cross-domain shared codebook through a hierarchical joint clustering strategy and optimize it by combining reconstruction loss, quantization loss, cross-domain alignment loss and collaborative filtering constraint loss to generate a unique discrete semantic identifier sequence for each item. We use RQ-VAE to eliminate the cross-domain semantic gap and combine a two-layer heterogeneous collaborative interest knowledge graph and an adaptive gating network for feature fusion to achieve end-to-end generative recommendation.

Benefits of technology

It significantly improves Recall@10 and NDCG@10 for cold-start users, alleviates the data sparsity and cold-start problems, and realizes unified discrete representation of items and alignment of recommendation tasks in cross-domain recommendation scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309849A_ABST
    Figure CN122309849A_ABST
Patent Text Reader

Abstract

This invention relates to a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in the field of cross-domain recommendation system technology. The steps of the cross-domain shared codebook construction and optimization method include: Step 1, concatenating the semantic and collaborative features of items in the source and target domains to obtain a cross-domain joint representation of the items; Step 2, constructing a D-layer cross-domain shared codebook using a hierarchical joint clustering strategy, where D≥3; Step 3, optimizing and training the cross-domain shared codebook using a loss function, and outputting the optimized cross-domain shared codebook. The cross-domain shared codebook constructed by this invention provides a universal and unified semantic representation covering both the source and target domains, thereby solving the technical problem that the discrete semantic representations of items in the source and target domains are difficult to align in a unified space, and that the quantized identifier sequence deviates from the actual requirements of the recommendation task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a generative recommendation method in the field of cross-domain recommendation system technology, and particularly to a cross-domain recommendation scenario design method for cross-domain shared codebook and inter-domain semantic alignment, a cross-domain semantic gap elimination method based on RQ-VAE using the alignment method, and a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment using the cross-domain semantic gap elimination method. Background Technology

[0002] With the explosive growth of internet information, recommender systems have become a core technology for solving information overload and improving user experience. Cross-domain recommendation aims to provide personalized recommendations for a target domain with sparse data by leveraging rich user interaction data from the source domain. It is a core approach to solving the cold start problem for long-tail users and the data sparsity problem in recommender systems.

[0003] To achieve cross-domain knowledge transfer, existing technologies map users or items to a unified discrete semantic space. Among these, Residual Quantization Variational Autoencoders (RQ-VAEs) demonstrate superior performance in representation learning due to their ability to encode continuous features into hierarchical discrete identifier sequences. Cross-domain shared codebooks can leverage this discrete encoding mechanism to inherit the quantization representation capabilities of RQ-VAEs, establishing a link for the reuse and alignment of discrete semantic identifiers across different domains, and providing general semantic support for the efficient transfer of cross-domain knowledge. However, existing RQ-VAE applications focus solely on learning discrete representations of general semantic data. Their codebooks are typically learned independently or randomly initialized for each domain, failing to design cross-domain shared codebooks and inter-domain semantic alignment mechanisms for cross-domain recommendation scenarios. This results in source and target domain items not being mapped to a unified semantic space, making it difficult to effectively address the issue of semantic distribution differences between domains. Furthermore, existing RQ-VAE optimization objectives are solely guided by minimizing reconstruction errors, neglecting the collaborative signals inherent in user-item interactions during recommendation tasks. This leads to a disconnect between the learned discrete semantic labels and the goals of the recommendation task. Summary of the Invention

[0004] (1) Technical problems to be solved To address the technical problem that existing RQ-VAE codebook construction and optimization in cross-domain recommendation relies solely on pure semantic features and reconstruction errors, leading to difficulties in aligning the discrete semantic representations of items in the source and target domains in a unified space, and causing the quantized identifier sequence to deviate from the actual requirements of the recommendation task, this invention provides a method for designing a cross-domain shared codebook and inter-domain semantic alignment for cross-domain recommendation scenarios, a cross-domain semantic gap elimination method based on RQ-VAE using the alignment method, and a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment using the cross-domain semantic gap elimination method.

[0005] (2) Technical solution The first aspect of this invention provides a method for designing cross-domain shared codebooks and inter-domain semantic alignment in cross-domain recommendation scenarios, comprising: Step 1: Based on the known features of items in the source and target domains, a cross-domain joint representation of the items is obtained by concatenating them; the features include collaborative features and semantic features, i.e., inter-domain semantics. Step 2: Construct a D-layer cross-domain shared codebook using a hierarchical joint clustering strategy for the cross-domain joint representation, where D≥3. Each layer of the codebook includes K cluster centers, where 128<K<512. All cluster centers in each layer of the codebook are subjected to L2 normalization. The hierarchical joint clustering strategy is as follows: For the codebooks of layers 1-2, perform global clustering based on the cross-domain joint representation of all items, with the cluster centers capturing cross-domain general semantic features; For the codebooks of layers 3 and above, perform intra-domain clustering based on the cross-domain joint representation of items in the source domain and target domain, respectively, with the cluster centers capturing intra-domain personalized semantic features. Step 3: Optimize the cross-domain shared codebook using a loss function, and output the optimized cross-domain shared codebook to achieve alignment between the cross-domain shared codebook and inter-domain semantics.

[0006] As a further improvement to the above scheme, collaborative features are obtained by statistically analyzing collaborative information based on users' historical interaction data, and semantic features are obtained by encoding pre-trained language models based on item text information.

[0007] As a further improvement to the above scheme, the loss function includes reconstruction loss L. recon Quantification loss L vq Cross-domain alignment loss L align Collaborative filtering constraint loss L cf The objective function of the loss function is expressed as: ; In the formula, λ vq , λ align , λ cf The optimal value is determined by cross-validation, which serves as the balance coefficient.

[0008] The second aspect of the present invention provides a cross-domain semantic gap elimination method based on RQ-VAE. Based on a cross-domain shared codebook, a unique discrete semantic identifier sequence for each item is generated through RQ-VAE to achieve a unified discrete representation of cross-domain items, thereby eliminating the cross-domain semantic gap. The cross-domain shared codebook is the optimized cross-domain shared codebook in the cross-domain recommendation scenario design and inter-domain semantic alignment method described above.

[0009] As a further improvement to the above scheme, the steps of the cross-domain semantic gap elimination method include: Step 1: Input the continuous vector x from the semantic features as described in claim 1 into the encoder of RQ-VAE, map it to the latent space vector z through a two-layer perceptron, and perform L2 normalization on the latent vector z; wherein, the input dimension of the encoder of RQ-VAE is consistent with the semantic feature dimension of the pre-trained language model, and the output dimension is consistent with the quantization dimension of the cross-domain shared codebook. Step 2: For the optimized cross-domain shared codebook as described in claim 1, an iterative residual approximation strategy is adopted to calculate the quantization residual of each layer in turn and match the optimal codebook vector, and a hierarchical weight allocation mechanism is designed for the recommendation scenario. Step 3: Concatenate the indexes of the cross-domain shared codebook in the order of quantization hierarchy to generate a unique discrete semantic identifier sequence for each item, thereby achieving a unified discrete representation of cross-domain items; establish a bidirectional mapping dictionary between the codebook index and the item ID, and use the discrete semantic identifier sequence directly as the input and output labels of the subsequent generative recommendation model, transforming the cross-domain recommendation task into an autoregressive sequence generation task, thereby achieving end-to-end integration of semantic representation and recommendation tasks.

[0010] As a further improvement to the above scheme, the L2 normalization formula for the latent vector z is as follows: ; In the formula, W enc1 W enc2 b is the encoder weight matrix; enc1 b enc2 This is the bias term; ReLU(·) means that positive numbers in the calculation result are retained and negative numbers are set to zero.

[0011] As a further improvement to the above scheme, the iterative residual approximation strategy includes the following specific steps: Layer 1: Find the codebook vector e1 that is closest to the latent vector z, calculate the residual r1, and assign a base weight of 1.0 to the underlying general semantic quantization: The formula for calculating the residual r1 is as follows: ; Level d (1 < d ≤ D): Based on the residual r of the previous level d-1 Find the nearest neighbor vector e in the codebook at level d. d Update the residuals to assign dynamic weight bits for semantic quantization in the higher-level domain; residual r d The calculation formula is as follows: ; Repeat the above process until the D-layer quantization is completed; add semantic consistency constraints, calculate the cosine similarity between the latent vector z before and after quantization and the reconstructed vector, and constrain the similarity to be no less than 0.9.

[0012] A third aspect of the present invention provides a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment, which uses the cross-domain semantic gap elimination method based on RQ-VAE as described above to provide a recommendation list to the user.

[0013] As a further improvement to the above scheme, the generative recommendation method includes the following steps: S1. Identify and enhance the user to be completed based on the differential sequence length threshold between the source domain and the target domain and the total number of interactions threshold. Extract high-confidence interest tags based on the large language model. Calculate semantic similarity through the pre-trained language model and select Top-20 items as candidate completion items. Filter out candidate items with co-occurrence probability below the threshold. The remaining candidate items complete the user interaction sequence. S2 defines users, items, interests, and entities as nodes, constructs four types of edges: user-item, user-interest, item-entity, and semantically similar item-item, and constructs semantic adjacency relationships based on the cosine similarity between items calculated by the pre-trained language model, forming a two-layer heterogeneous collaborative interest knowledge graph with collaborative relationships at the bottom layer and semantic relationships at the top layer. S3, using the cross-domain semantic gap elimination method to generate a unique discrete semantic identifier sequence for each item; S4. Construct a relation-aware graph neural network, use dynamic mask GMAE for self-supervised training, and design an adaptive gating network to dynamically fuse structured ID features and semantic features. S5 models cross-domain recommendation as an autoregressive sequence generation task. It uses a Transformer decoder to predict the probability distribution of items in the target domain based on the discrete semantic identifier sequence of items interacted with in the user's history. It decodes the item IDs through bundle search and codebook mapping. A LoRA lightweight fine-tuning strategy is adopted for the target domain. The pre-trained RQ-VAE and relation-aware graph neural network modules are frozen. Only the low-rank parameters of the Transformer attention layer, gating network, and projection layer are updated. The model is optimized by combining a hybrid loss function of sequence main loss, contrastive learning loss, and generative loss. The interacted items are sorted according to the generation probability and filtered to output a Top-N personalized recommendation list.

[0014] As a further improvement to the above scheme, the steps of S1 specifically include: S11, based on the user historical interaction data of the source domain and the target domain, set the differentiated sequence length thresholds of the source domain and the target domain to be 8 and 5 respectively; define users whose historical interaction sequence length is lower than one of the thresholds or whose total number of interactions is lower than 8 as users to be supplemented, and enhance the users to be supplemented; S12: Merge the item text information from the source and target domains into a unified semantic text for the items, extract the unified semantic text of the items to be completed from the user's historical interactions, and construct a batch inference Prompt adapted to the recommendation scenario. Its output constraint format is the user's core interest tags and corresponding confidence scores. Based on the large language model as input to the Prompt, output the user's interest tags and confidence scores in JSON format. Filter out interest tags with confidence scores higher than 0.7 as the user's explicit interest nodes. S13. For users whose effective interest tags are successfully inferred by the large language model, the interest tags and item text are encoded into semantic vectors based on the pre-trained language model, the cosine similarity is calculated as the semantic matching degree, and the Top-20 items are selected as candidate completion items; for users without effective interest tags, the cosine similarity between the user's historical interaction items and the candidate items is calculated, and the Top-20 items are selected as candidate completion items. S14, calculate the co-occurrence probability of candidate completion items and user's historical interaction items, and filter out candidate items with co-occurrence probabilities below the threshold; insert the candidate completion items that pass the verification into the end of the original interaction sequence of the user to be completed in descending order of semantic matching degree, and complete until the length of the user sequence reaches the minimum sequence length preset in the corresponding domain, and generate the completed user interaction sequence.

[0015] As a further improvement to the above scheme, the steps of S2 specifically include: S21, define all users in the source and target domains as user nodes, all items in the source and target domains as item nodes, interest tags with a confidence level higher than 0.7 inferred by the large language model as interest nodes for each user, and information extracted from the unified semantic text of items as entity nodes. The four nodes together serve as semantic attribute nodes for items. S22 establishes user-item edges representing interaction relationships, user-interest edges representing ownership relationships, item-entity edges representing inclusion relationships, and item-item edges representing semantic similarity relationships; S23 utilizes a pre-trained language model to generate continuous vectors from the semantic features of all items, calculates the cosine semantic similarity between items, and constructs semantic adjacency relationships between items based on the Top-5 similarity results, forming a complete two-layer heterogeneous collaborative interest knowledge graph; the bottom layer is the collaborative relationship layer of user-item-entity, and the upper layer is the semantic relationship layer of user-interest-item, realizing the deep fusion of semantic information and structured collaborative signals.

[0016] As a further improvement to the above scheme, the steps of S4 specifically include: S41, addressing the heterogeneity of the two-layer heterogeneous collaborative interest knowledge graph, designs a dedicated transformation matrix Wr for four types of edge relationships: "user-item," "user-interest," "item-entity," and "item-item." Employing a heterogeneous message passing mechanism, it aggregates multi-order neighbor features of target nodes according to edge relationship type. High-order collaborative signals are mined through cross-node type paths in the "user-item-entity-item" relationship. The node embedding update formula is as follows: ; In the formula, Let R be the embedding of node v at the (l+1)th level, R be the set of edge relations, and N be the embedding of node v at the (l+1)th level. r (v) is the set of neighbors of node v under relation r. The normalization coefficient is... Let r be the transformation matrix. Let σ be the transformation matrix of the node itself, and σ be the activation function. S42, for interest nodes inferred by the large language model, a dynamic masking rate strategy is used to mask their feature vectors, while randomly deleting the edges connecting the interest nodes to users / items; the dynamic masking rate ρ increases exponentially with the training rounds, as shown in the following formula: ; Where q is the training epoch, α=0.05 is the initial masking rate, ω=0.95 is the maximum masking rate, and Λ=160 is the attenuation coefficient; the nodes output by the relation-aware graph neural network are embedded and mapped back to the original feature space through a lightweight decoder, reconstructing the features of the masked interest nodes and the existence of associated edges, and calculating the reconstruction loss L. game This forces the model to learn global structural dependencies and strengthens the feature representation ability of sparse nodes during cold starts; S43, design an adaptive gating network that dynamically fuses structured ID features extracted by a relationship-aware graph neural network with semantic features extracted by a pre-trained language model to achieve adaptive adaptation in cold and warm start scenarios. The calculation formula is as follows: ; In the formula, E id E is the structured ID embedding learned by the relation-aware graph neural network. semantic For the semantic embedding of items mapped by the projection layer, || denotes the concatenation operation, σ is the sigmoid activation function, and w g and b g E is a learnable parameter. fused The final feature representation after fusion is obtained; the gating network can automatically adjust the weight α based on the length of the user interaction sequence. For warm-start users with rich interactions, α focuses on ID collaboration features; for cold-start users with sparse interactions, α approaches 0 and focuses on semantic features, achieving robust adaptation across all scenarios.

[0017] As a further improvement to the above scheme, the steps of S5 specifically include: S51 models the cross-domain recommendation task as an autoregressive sequence generation task, using a Seq2Seq custom model based on the Transformer decoder; the input is a discrete semantic identifier sequence of items that the user has interacted with in the past, and a causal attention mask is used to avoid future information leakage, ensuring that when predicting the t-th token, only the information of the previous t-1 time steps is used, and the model output is the probability distribution of discrete semantic identifiers of items in the target domain. S52, the decoder outputs the probability distribution of discrete semantic identifiers of items in the target domain. Combined with the cross-domain mapping relationship of the RQ-VAE codebook, the K paths with the highest cumulative probability are retained by the bundle search algorithm to decode the complete item semantic identifier sequence. Then, the token sequence is mapped back to the specific item ID through the bidirectional mapping dictionary between the codebook index and the item ID. S53 employs a customized LoRA fine-tuning strategy for the target domain. It freezes all parameters of the pre-trained RQ-VAE semantic representation module and the relation-aware graph neural network graph structure representation module, inserting low-rank matrices only into the attention layer, adaptive gating network, and projection layer of the Transformer decoder. It updates only the LoRA parameters and the parameters of the attention layer, adaptive gating network, and projection layer of the Transformer decoder, achieving target domain adaptation with extremely low parameter count and avoiding the destruction of pre-trained knowledge. A hybrid loss function is used to optimize the model, as shown in the following formula: ; In the formula, L seq For the main task loss of sequence recommendation, L cl For cross-domain / intra-domain contrastive learning loss based on InfoNCE, L gen Let λ be the generative loss of RQ-VAE. cl and λ gen This is the balance coefficient; S54, based on the fine-tuned model, takes the discrete semantic identifier sequence of the historical interactive items as input for each user, generates the discrete semantic identifier sequence of the target domain items, maps it to the corresponding item ID, sorts them from high to low generation probability, removes the items that the user has already interacted with, and forms the final Top-N personalized recommendation list.

[0018] (3) Beneficial effects 1. This invention first combines semantic features and collaborative features into a cross-domain joint representation, integrating the content and behavioral information of items. Then, it employs a hierarchical joint clustering strategy to construct a D-layer (D≥3) cross-domain shared codebook. The first two layers perform global clustering based on all items to capture cross-domain common semantic features, while the third and subsequent layers perform intra-domain clustering based on the source and target domains respectively to retain personalized semantic features. Simultaneously, L2 normalization is applied to the K cluster centers of each layer, and the K value is limited to between 128 and 512, thereby improving the stability and computational efficiency of quantization matching while ensuring semantic distinguishability. Finally, the codebook is jointly optimized using reconstruction loss, quantization loss, cross-domain alignment loss, and collaborative filtering constraint loss to ensure that the cross-domain shared codebook design for cross-domain recommendation scenarios is semantically aligned with inter-domain boundaries. Therefore, the cross-domain shared codebook constructed by this invention provides a universal and unified semantic representation covering both the source and target domains, thereby solving the technical problem that in existing RQ-VAE cross-domain recommendation, the construction and optimization of the codebook rely solely on pure semantic features and reconstruction errors, resulting in the difficulty of aligning the discrete semantic representations of items in the source and target domains in a unified space, and the quantized identifier sequence deviates from the actual needs of the recommendation task.

[0019] 2. This invention supplements sparse users and cold-start users with rich semantic interests and structured features through a three-layer data augmentation mechanism and a two-layer heterogeneous collaborative interest knowledge graph. Compared with traditional cross-domain recommendation methods, the Recall@10 of cold-start users is increased by more than 45%, and the NDCG@10 is increased by more than 35%, thereby significantly alleviating the problems of data sparsity and cold start. Attached Figure Description

[0020] Figure 1 This is a flowchart of steps 1 and 2 of the generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in Embodiment 1 of the present invention; Figure 2 This is a flowchart of steps 3 to 5 of the generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the collaborative interest knowledge graph construction of the generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in Embodiment 1 of the present invention; Figure 4 This is a network structure diagram of the unified recommendation model of the generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in Embodiment 1 of the present invention; Figure 5 This is a flowchart of LoRA fine-tuning and generative inference for the generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in Embodiment 1 of the present invention. Detailed Implementation

[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] It should be noted that when a component is said to be "installed on" another component, it can be directly on the other component or it may be in a component that is centered on it. When a component is said to be "set on" another component, it can be directly set on the other component or it may also be in a component that is centered on it. When a component is said to be "fixed to" another component, it can be directly fixed to the other component or it may also be in a component that is centered on it.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "or / and" as used herein includes any and all combinations of one or more of the associated listed items.

[0024] Example 1 This invention provides a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment. By designing a specific cross-domain shared codebook and adding constraints to the loss function, it obtains a hierarchical discrete semantic identifier sequence that can uniformly map items in the source and target domains. Based on this, it provides generative cross-domain recommendation. The specific method includes the following five steps. Please refer to... Figure 1 and Figure 2 understand( Figure 1 and Figure 2 (Flowchart of a generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment in the implementation of co-construction cost).

[0025] S1: Sparse Data Augmentation and Interest Inference for Cross-Domain Scenarios This step addresses the pain point of sparse cross-domain recommendation data by implementing a three-layer data augmentation mechanism. Unlike the conventional application of semantic completion using general-purpose large language models, this step is designed entirely around the collaborative patterns and cross-domain characteristics of recommendation scenarios. The specific steps are as follows: S11: Multi-domain Data Acquisition and Preprocessing The system acquires historical user interaction data and item text information from the source and target domains, cleans the data to remove duplicate interactions, abnormal item interactions, and invalid text information, and unifies the data format of user IDs and item IDs. At the same time, it merges the item titles, categories, brands, and attribute descriptions to generate unified semantic text for items, providing a foundation for subsequent semantic encoding and interest inference.

[0026] S12: Short Sequence Sparse User Identification and Filtering To address the differences in data distribution between domains in cross-domain scenarios, differentiated sequence length thresholds are set: the minimum sequence length for the source domain is 8, and the minimum sequence length for the target domain is 5. The historical interaction sequence length of each user is counted, and users whose sequence length is lower than the corresponding domain threshold are defined as sparse users to be completed. At the same time, users with a total number of interactions lower than 8 are marked as cold start users and given priority enhancement processing.

[0027] S13: Batch Inference of User Interests Based on Large Language Models For users whose data needs to be completed, we extract the unified semantic text of their historical interactive items and construct a batch inference prompt adapted to the recommendation scenario. The prompt explicitly constrains the output format to include the user's core interest tags and corresponding confidence scores, and prohibits the output of irrelevant content. The batch prompt is then input into a locally deployed open-source large language model and processed in parallel using batch inference mode, outputting user interest tags and confidence scores in JSON format. Interest tags with a confidence score higher than 0.7 are selected as explicit interest nodes for the user and used for subsequent graph construction and sequence completion.

[0028] S14: Semantic Retrieval and Collaborative Verification of Candidate Items For users whose valid interest tags are inferred, semantic vectors of interest tags and text in the item pool are generated based on the pre-trained language model. Cosine similarity is calculated as semantic matching degree, and the top-20 items with the highest matching degree are selected as candidate completion items. For extreme cold-start users whose effective interests cannot be inferred by the large language model, the semantic vectors of all items are generated using the pre-trained language model, the cosine similarity between the user's historical interaction items and the candidate items is calculated, and the top-20 items with the highest similarity are selected as candidate completion items. Calculate the co-occurrence probability of candidate items and items from the user's historical interactions, and remove candidate items with co-occurrence probabilities below a threshold to ensure that the completed items conform to the user's collaborative behavior patterns.

[0029] S15: Semantic Enhancement and Completion of User Interaction Sequences The candidate completion items that pass the verification are inserted into the end of the original interaction sequence of the user to be completed, in descending order of semantic matching degree. The completion continues until the length of the user sequence reaches the minimum sequence length preset in the corresponding domain, generating the completed user interaction sequence. This completes the user feature enhancement and provides a high-quality data foundation for subsequent graph construction and model training.

[0030] S2: Construction of a Two-Layer Heterogeneous Collaborative Interest Knowledge Graph Please see Figure 3This step breaks through the limitations of traditional user-item bipartite graphs, constructing a two-layer heterogeneous graph that integrates semantic and collaborative layers. This is the core carrier for achieving deep fusion of semantic information and collaborative signals in this invention. The specific steps are as follows: S21: Node Type Definition and Extraction Based on the completed user interaction data, entities extracted from item text, and user interests inferred from the large language model, four types of core nodes are defined to form a complete node system: 1. User node (User): All users in the source and target domains; 2. Item node: All items in the source and target domains; 3. Interest Nodes: High-confidence interest tags inferred by the large language model, representing personalized interest nodes for each user; 4. Entity: Entities such as category, brand, attribute, and core keywords extracted from the unified semantic text of the item are semantic attribute nodes of the item.

[0031] S22: Edge Relationship Construction For the four types of nodes, four types of edge relationships with clear business meanings are established to form a semantic and collaborative association system: 1. User-Item Edge: Interaction relationship, constructed based on the completed user interaction sequence, representing the user's historical interaction behavior with the item; 2. User-Interest Edge: This is a relationship built based on the correspondence between users and interest tags inferred from a large language model, representing the user's explicit interest preferences. 3. Item-Entity Edge: Containment relationship, constructed based on the correspondence between item text and extracted entities, representing the semantic attributes of the item; 4. Item-Item Edges: Semantic similarity relationships, constructed based on the Top-K results of item semantic similarity calculated by a pre-trained language model, representing the semantic association between items.

[0032] S23: Semantic adjacency relationship supplementation and final graph generation The semantic vectors of all items are generated using a pre-trained language model. The cosine semantic similarity between items is calculated. Based on the Top-5 similarity results, semantic adjacency relationships between items are constructed and added to the two-layer heterogeneous collaborative interest knowledge graph to form a complete two-layer heterogeneous collaborative interest knowledge graph. The bottom layer is the collaborative relationship layer of user-item-entity, and the upper layer is the semantic relationship layer of user-interest-item, realizing the deep fusion of semantic information and structured collaborative signals.

[0033] S3: Generation of Unified Discrete Semantic Identifiers for Items Based on Customized RQ-VAE This step is the core of this invention for bridging the cross-domain semantic gap and enabling generative recommendations. It involves a complete customization of the general RQ-VAE, specifically designed for cross-domain recommendation scenarios. The specific implementation details are as follows: S31: Cross-domain shared codebook construction A residual quantization variational autoencoder adapted for cross-domain recommendation is used to construct a D-layer (D≥3) cross-domain shared codebook. Each layer of the codebook contains K cluster centers (K=128~512). The specific construction strategy is as follows: 1. High-dimensional semantic vectors of all items in the source and target domains are extracted based on a pre-trained language model. At the same time, collaborative features such as user interaction frequency and domain distribution of each item are statistically analyzed. The semantic features and collaborative features are concatenated to generate a cross-domain joint representation of the items. 2. A hierarchical joint clustering strategy is adopted. For the bottom codebook (layers 1-2), global clustering is performed based on the joint representation of all items, and the cluster centers capture cross-domain common semantic features (such as item categories and core categories). For the top codebook (layer 3 and above), intra-domain clustering is performed based on the joint representation of items in the source domain and the target domain, respectively, and the cluster centers capture intra-domain personalized semantic features (such as subdivision attributes and style preferences). 3. Perform L2 normalization on the cluster centers of each codebook layer to ensure the stability of the quantization process, and finally form a multi-layer codebook that can be shared across domains, so as to achieve pre-alignment of the semantic spaces of the source domain and the target domain.

[0034] S32: Semantic Vector Projection The high-dimensional semantic vector x of the item extracted by the pre-trained language model is input into the encoder of RQ-VAE, mapped to a latent space vector z through a two-layer perceptron, and then L2 normalized to the latent vector, as shown in the following formula: ; Among them, W enc1 W enc2 b is the encoder weight matrix; enc1 b enc2 is the bias term; ReLU(·) means to keep positive numbers in the calculation result and set negative numbers to zero; the input dimension of the encoder is consistent with the semantic vector dimension of the pre-trained language model, and the output dimension matches the quantization dimension of the codebook, ensuring that the semantic vector is adapted to the quantization space of the cross-domain shared codebook.

[0035] S33: Iterative Residual Quantization and Weight Optimization An iterative residual approximation strategy is adopted, which calculates the quantization residual of each layer sequentially and matches the optimal codebook vector. Simultaneously, a hierarchical weight allocation mechanism is designed for recommendation scenarios, the specific process of which is as follows: Layer 1: Find the codebook vector e1 that is closest to the latent vector z, calculate the residual r1, and assign a base weight of 1.0 to the underlying general semantic quantization: The formula for calculating the residual r1 is as follows: ; Level d (1 < d ≤ D): Based on the residual r of the previous level d-1 Find the nearest neighbor vector e in the codebook at level d. d The residuals are updated to assign dynamic weights to semantic quantization within higher-level domains. Bit weights decrease linearly with increasing hierarchy, ensuring that general semantics dominate the quantization representation. The residual r... d The calculation formula is as follows: ; Repeat the above process until the D-layer quantization is completed. At the same time, add semantic consistency constraints to ensure that the cosine similarity of the latent vectors before and after quantization is not less than 0.9, so as to avoid the loss of core semantic information.

[0036] S34: Generation and End-to-End Mapping of Discrete Semantic Identifier Sequences The indexes of the D-level codebook are concatenated in quantization hierarchy order to generate a unique discrete semantic token sequence for each item, achieving a unified discrete representation of cross-domain items. At the same time, a bidirectional mapping dictionary between the codebook index and the item ID is established, and the discrete semantic token sequence is directly used as the input and output labels of the subsequent generative recommendation model, transforming the cross-domain recommendation task into an autoregressive sequence generation task, and realizing end-to-end integration of semantic representation and recommendation tasks.

[0037] S35: Customized Loss Function Optimization Based on the reconstruction loss and quantization loss of the general RQ-VAE, cross-domain alignment loss and collaborative filtering constraint loss are added to construct a multi-task loss function, as shown in the following formula: ; In the formula, L recon To measure the reconstruction loss, we need to assess the degree of semantic vector restoration before and after quantization; L vq To quantify the loss and ensure the stability of the quantification process; L align To achieve cross-domain alignment loss, the quantized representation distance of semantic items between the source and target domains is constrained, thereby reducing the semantic differences between domains; L cf To constrain the loss of collaborative filtering, the similarity of the quantized representations of items with collaborative co-occurrence relationships is constrained to ensure that the quantized representations match the collaborative patterns of the recommendation scenario; λ vq , λ align , λ cf The optimal value is determined by cross-validation, which serves as the balance coefficient.

[0038] S4: Unified Model Pre-training Please see Figure 4 This step, based on the constructed two-layer heterogeneous collaborative interest knowledge graph and unified semantic representation of items, completes the joint learning of structured features and semantic features, providing a high-quality feature foundation for subsequent generative recommendations. The specific steps are as follows: S41: Construction of a Relation-Aware Graph Neural Network To address the heterogeneity of the two-layer heterogeneous collaborative interest knowledge graph, a dedicated transformation matrix Wr is designed for four types of edge relationships: "user-item", "user-interest", "item-entity", and "item-item". A heterogeneous message passing mechanism is employed to aggregate multi-order neighbor features of target nodes according to edge relationship type. High-order collaborative signals are mined through cross-node type paths in the "user-item-entity-item" relationship. The node embedding update formula is as follows: ; In the formula, Let R be the embedding of node v at the (l+1)th level, R be the set of edge relations, and N be the embedding of node v at the (l+1)th level. r (v) is the set of neighbors of node v under relation r. The normalization coefficient is... Let r be the transformation matrix. Let σ be the transformation matrix of the node itself, and σ be the activation function.

[0039] S42: Self-supervised training of dynamic masked GMAE For interest nodes inferred by the large language model, a dynamic masking rate strategy is used to mask their feature vectors, while randomly deleting the edges connecting the interest nodes to users / items; the dynamic masking rate ρ increases exponentially with the training epochs, as shown in the following formula: ; Where q is the training epoch, α=0.05 is the initial masking rate, ω=0.95 is the maximum masking rate, and Λ=160 is the attenuation coefficient; the nodes output by the relation-aware graph neural network are embedded and mapped back to the original feature space through a lightweight decoder, reconstructing the features of the masked interest nodes and the existence of associated edges, and calculating the reconstruction loss L. game This forces the model to learn global structural dependencies and strengthens the feature representation ability of sparse nodes during cold starts.

[0040] S43: Feature Fusion in Adaptive Gated Networks An adaptive gating network is designed to dynamically fuse structured ID features extracted by a relationship-aware graph neural network with semantic features extracted by a pre-trained language model, achieving adaptive adaptation for cold and warm start scenarios. The calculation formula is as follows: ; In the formula, E id E is the structured ID embedding learned by the relation-aware graph neural network.semantic For the semantic embedding of items mapped by the projection layer, || denotes the concatenation operation, σ is the sigmoid activation function, and w g and b g E is a learnable parameter. fused The final feature representation after fusion is obtained; the gating network can automatically adjust the weight α based on the length of the user interaction sequence. For warm-start users with rich interactions, α focuses on ID collaboration features; for cold-start users with sparse interactions, α approaches 0 and focuses on semantic features, achieving robust adaptation across all scenarios.

[0041] S5: Fine-tuning of generative recommendation and cross-domain adaptation Please see Figure 5 This step transforms cross-domain recommendation into an autoregressive sequence generation task. Target domain adaptation is achieved through customized LoRA fine-tuning, completing the final cross-domain recommendation. The specific steps are as follows: S51: Construction of Generative Sequence Models The cross-domain recommendation task is modeled as an autoregressive sequence generation task, using a custom Seq2Seq model based on the Transformer decoder. The input is a discrete semantic identifier sequence (prefix sequence) of items that the user has interacted with in the past. Causal attention masks are used to avoid future information leakage, ensuring that when predicting the t-th token, only the information from the previous t-1 time steps is used. The model output is the probability distribution of discrete semantic identifiers of items in the target domain.

[0042] S52: Target Domain Item Semantic Identification Prediction The decoder outputs the probability distribution of discrete semantic identifiers of items in the target domain. Combined with the cross-domain mapping relationship of the RQ-VAE codebook, the K paths with the highest cumulative probability are retained through the beam search algorithm to decode the complete item semantic identifier sequence. Then, through the bidirectional mapping dictionary between the codebook index and the item ID, the token sequence is mapped back to the specific item ID.

[0043] S53: Lightweight fine-tuning for cross-domain adaptation of LoRA For the target domain, a customized LoRA fine-tuning strategy is adopted to freeze all parameters of the pre-trained RQ-VAE semantic representation module and relation-aware graph neural network graph structure representation module. Low-rank matrices are inserted only in the attention layer, adaptive gating network and projection layer of the Transformer decoder. Only the LoRA parameters and the parameters of the above modules are updated to achieve target domain adaptation with a very low number of parameters and avoid destroying the pre-trained knowledge. The model is optimized using a hybrid loss function, as shown in the following formula: ; In the formula, L seq For the main task loss of sequence recommendation, L clFor cross-domain / intra-domain contrastive learning loss based on InfoNCE, L gen Let λ be the generative loss of RQ-VAE. cl and λ gen The balancing coefficient is used; the difference in feature distribution between domains is reduced by contrastive learning loss to avoid negative transfer, and the consistency between sequence generation and semantic representation is ensured by generative loss.

[0044] S54: Recommendation List Generation Based on the fine-tuned model, for each user, a discrete semantic identifier sequence of their historically interacted items is input, generating a discrete semantic identifier sequence of target domain items, which is mapped to the corresponding item IDs. The items are sorted from high to low according to their generation probability, and items that the user has already interacted with are removed to form the final Top-N personalized recommendation list.

[0045] In summary, this invention first addresses the sparse interaction scenario of cross-domain recommendation by customizing a three-layer data augmentation strategy involving large language model interest inference, semantic matching, and collaborative verification to complete the sparse user interaction sequence and solve the problem of missing user-side information. Secondly, it constructs a two-layer heterogeneous collaborative interest knowledge graph containing four core nodes: users, items, interests, and entities. This incorporates user interests inferred from the large language model and attribute entities extracted from item texts into the graph structure, achieving deep fusion of semantic information and structured collaborative signals. Subsequently, a customized and improved residual quantization variational autoencoder is used to construct a cross-domain shared codebook, transforming source and target domain items into a unified discrete semantic identifier sequence, thus resolving the semantic gap between domains. Then, a relation-aware graph neural network and a dynamic masking GMAE mechanism are used to learn the global structured features of the graph. An adaptive gating network dynamically balances structured ID features and semantic features, taking into account feature representation in both warm-start and cold-start scenarios. Finally, the cross-domain recommendation task is transformed into an autoregressive sequence generation task. Lightweight LoRA fine-tuning adapted to the cross-domain scenario achieves target domain adaptation, resulting in efficient and high-precision cross-domain recommendation.

[0046] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0047] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A method for cross-domain shared codebook and inter-domain semantic alignment in a cross-domain recommendation scenario, characterized in that, include: Step 1: Based on the known features of items in the source and target domains, concatenate them to obtain a cross-domain joint representation of the items; The features include collaborative features and semantic features, namely inter-domain semantics; Step 2: Construct a D-layer cross-domain shared codebook using a hierarchical joint clustering strategy for the cross-domain joint representation, where D≥3. Each layer of the codebook includes K cluster centers, where 128<K<512. All cluster centers in each layer of the codebook are subjected to L2 normalization. The hierarchical joint clustering strategy is as follows: For the codebooks of layers 1-2, perform global clustering based on the cross-domain joint representation of all items, with the cluster centers capturing cross-domain general semantic features; For the codebooks of layers 3 and above, perform intra-domain clustering based on the cross-domain joint representation of items in the source domain and target domain, respectively, with the cluster centers capturing intra-domain personalized semantic features. Step 3: Optimize the cross-domain shared codebook using a loss function, and output the optimized cross-domain shared codebook to achieve alignment between the cross-domain shared codebook and inter-domain semantics.

2. The method for cross-domain shared codebook and inter-domain semantic alignment in cross-domain recommendation scenarios according to claim 1, characterized in that, Collaborative features are obtained by statistically analyzing collaborative information based on users' historical interaction data, while semantic features are obtained by encoding item text information through a pre-trained language model. And / or, the loss function includes reconstruction loss L recon Quantification loss L vq Cross-domain alignment loss L align Collaborative filtering constraint loss L cf The objective function of the loss function is expressed as: ; In the formula, λ vq , λ align , λ cf The optimal value is determined by cross-validation, which serves as the balance coefficient.

3. A method for eliminating cross-domain semantic gaps based on RQ-VAE, characterized in that, Based on the cross-domain shared codebook, a unique discrete semantic identifier sequence for each item is generated through RQ-VAE to achieve a unified discrete representation of cross-domain items, thereby eliminating the cross-domain semantic gap. The cross-domain shared codebook is characterized by being an optimized cross-domain shared codebook in the cross-domain recommendation scenario design and inter-domain semantic alignment method as described in claim 1 or 2.

4. The cross-domain semantic gap elimination method according to claim 3, characterized in that, The steps of cross-domain semantic gap elimination methods include: Step 1: Input the continuous vector x from the semantic features as described in claim 1 into the encoder of RQ-VAE, map it to the latent space vector z through a two-layer perceptron, and perform L2 normalization on the latent vector z; wherein, the input dimension of the encoder of RQ-VAE is consistent with the semantic feature dimension of the pre-trained language model, and the output dimension is consistent with the quantization dimension of the cross-domain shared codebook. Step 2: For the optimized cross-domain shared codebook as described in claim 1, an iterative residual approximation strategy is adopted to calculate the quantization residual of each layer in turn and match the optimal codebook vector, and a hierarchical weight allocation mechanism is designed for the recommendation scenario. Step 3: Concatenate the indexes of the cross-domain shared codebook in the order of quantization hierarchy to generate a unique discrete semantic identifier sequence for each item, thereby achieving a unified discrete representation of cross-domain items; establish a bidirectional mapping dictionary between the codebook index and the item ID, and use the discrete semantic identifier sequence directly as the input and output labels of the subsequent generative recommendation model, transforming the cross-domain recommendation task into an autoregressive sequence generation task, thereby achieving end-to-end integration of semantic representation and recommendation tasks.

5. The cross-domain semantic gap elimination method according to claim 4, characterized in that, The L2 normalization formula for the latent vector z is as follows: ; In the formula, W enc1 W enc2 b is the encoder weight matrix; enc1 b enc2 This is the bias term; ReLU(·) means that positive numbers in the calculation result are retained and negative numbers are set to zero.

6. The cross-domain semantic gap elimination method according to claim 4, characterized in that, The specific steps of the iterative residual approximation strategy include: Layer 1: Find the codebook vector e1 that is closest to the latent vector z, calculate the residual r1, and assign a base weight of 1.0 to the underlying general semantic quantization: The formula for calculating the residual r1 is as follows: ; Level d (1 < d ≤ D): Based on the residual r of the previous level d-1 Find the nearest neighbor vector e in the codebook at level d. d Update the residuals to assign dynamic weight bits for semantic quantization in the higher-level domain; residual r d The calculation formula is as follows: ; Repeat the above process until the D-layer quantization is completed; add semantic consistency constraints, calculate the cosine similarity between the latent vector z before and after quantization and the reconstructed vector, and constrain the similarity to be no less than 0.

9.

7. A generative recommendation method based on cross-domain shared codebook construction and residual quantization alignment, characterized in that, It employs the cross-domain semantic gap elimination method based on RQ-VAE as described in any one of claims 3 to 6 to provide users with a recommendation list.

8. The generative recommendation method according to claim 7, characterized in that, The steps of generative recommendation methods include: S1. Identify and enhance the user to be completed based on the differential sequence length threshold between the source domain and the target domain and the total number of interactions threshold. Extract high-confidence interest tags based on the large language model. Calculate semantic similarity through the pre-trained language model and select Top-20 items as candidate completion items. Filter out candidate items with co-occurrence probability below the threshold. The remaining candidate items complete the user interaction sequence. S2 defines users, items, interests, and entities as nodes, constructs four types of edges: user-item, user-interest, item-entity, and semantically similar item-item, and constructs semantic adjacency relationships based on the cosine similarity between items calculated by the pre-trained language model, forming a two-layer heterogeneous collaborative interest knowledge graph with collaborative relationships at the bottom layer and semantic relationships at the top layer. S3, using the cross-domain semantic gap elimination method to generate a unique discrete semantic identifier sequence for each item; S4. Construct a relation-aware graph neural network, use dynamic mask GMAE for self-supervised training, and design an adaptive gating network to dynamically fuse structured ID features and semantic features. S5 models cross-domain recommendation as an autoregressive sequence generation task. It uses a Transformer decoder to predict the probability distribution of items in the target domain based on the discrete semantic identifier sequence of items interacted with in the user's history. It decodes the item IDs through bundle search and codebook mapping. A LoRA lightweight fine-tuning strategy is adopted for the target domain. The pre-trained RQ-VAE and relation-aware graph neural network modules are frozen. Only the low-rank parameters of the Transformer attention layer, gating network, and projection layer are updated. The model is optimized by combining a hybrid loss function of sequence main loss, contrastive learning loss, and generative loss. The interacted items are sorted according to the generation probability and filtered to output a Top-N personalized recommendation list.

9. The generative recommendation method according to claim 8, characterized in that, The specific steps in S1 include: S11, based on the user historical interaction data of the source domain and the target domain, set the differentiated sequence length thresholds of the source domain and the target domain to be 8 and 5 respectively; define users whose historical interaction sequence length is lower than one of the thresholds or whose total number of interactions is lower than 8 as users to be supplemented, and enhance the users to be supplemented; S12: Merge the item text information from the source and target domains into a unified semantic text for the items, extract the unified semantic text of the items to be completed from the user's historical interactions, and construct a batch inference Prompt adapted to the recommendation scenario. Its output constraint format is the user's core interest tags and corresponding confidence scores. Based on the large language model as input to the Prompt, output the user's interest tags and confidence scores in JSON format. Filter out interest tags with confidence scores higher than 0.7 as the user's explicit interest nodes. S13. For users whose effective interest tags are successfully inferred by the large language model, the interest tags and item text are encoded into semantic vectors based on the pre-trained language model, the cosine similarity is calculated as the semantic matching degree, and the Top-20 items are selected as candidate completion items; for users without effective interest tags, the cosine similarity between the user's historical interaction items and the candidate items is calculated, and the Top-20 items are selected as candidate completion items. S14, calculate the co-occurrence probability of candidate completion items and user's historical interaction items, and filter out candidate items with co-occurrence probabilities below the threshold; insert the candidate completion items that pass the verification into the end of the original interaction sequence of the user to be completed in descending order of semantic matching degree, and complete the sequence until the length of the user sequence reaches the minimum sequence length preset in the corresponding domain, and generate the completed user interaction sequence. And / or, the steps of S2 specifically include: S21, define all users in the source and target domains as user nodes, all items in the source and target domains as item nodes, interest tags with a confidence level higher than 0.7 inferred by the large language model as interest nodes for each user, and information extracted from the unified semantic text of items as entity nodes. The four nodes together serve as semantic attribute nodes for items. S22 establishes user-item edges representing interaction relationships, user-interest edges representing ownership relationships, item-entity edges representing inclusion relationships, and item-item edges representing semantic similarity relationships; S23 utilizes a pre-trained language model to generate continuous vectors from the semantic features of all items, calculates the cosine semantic similarity between items, and constructs semantic adjacency relationships between items based on the Top-5 similarity results, forming a complete two-layer heterogeneous collaborative interest knowledge graph; the bottom layer is the collaborative relationship layer of user-item-entity, and the upper layer is the semantic relationship layer of user-interest-item, realizing the deep fusion of semantic information and structured collaborative signals.

10. The generative recommendation method according to claim 8, characterized in that, The steps in S4 specifically include: S41, addressing the heterogeneity of the two-layer heterogeneous collaborative interest knowledge graph, designs a dedicated transformation matrix Wr for four types of edge relationships: "user-item", "user-interest", "item-entity", and "item-item". Employing a heterogeneous message passing mechanism, it aggregates multi-order neighbor features of target nodes according to edge relationship type. High-order collaborative signals are mined through cross-node type paths in the "user-item-entity-item" relationship. The node embedding update formula is as follows: ; In the formula, Let R be the embedding of node v at the (l+1)th level, R be the set of edge relations, and N be the embedding of node v at the (l+1)th level. r (v) is the set of neighbors of node v under relation r. The normalization coefficient is... Let r be the transformation matrix. Let σ be the transformation matrix of the node itself, and σ be the activation function. S42, for interest nodes inferred by the large language model, a dynamic masking rate strategy is used to mask their feature vectors, while randomly deleting the edges connecting the interest nodes to users / items; the dynamic masking rate ρ increases exponentially with the training rounds, as shown in the following formula: ; Where q is the training epoch, α=0.05 is the initial masking rate, ω=0.95 is the maximum masking rate, and Λ=160 is the attenuation coefficient; the nodes output by the relation-aware graph neural network are embedded and mapped back to the original feature space through a lightweight decoder, reconstructing the features of the masked interest nodes and the existence of associated edges, and calculating the reconstruction loss L. game This forces the model to learn global structural dependencies and strengthens the feature representation ability of sparse nodes during cold starts; S43, design an adaptive gating network that dynamically fuses structured ID features extracted by a relationship-aware graph neural network with semantic features extracted by a pre-trained language model to achieve adaptive adaptation in cold and warm start scenarios. The calculation formula is as follows: ; In the formula, E id E is the structured ID embedding learned by the relation-aware graph neural network. semantic For the semantic embedding of items mapped by the projection layer, || denotes the concatenation operation, σ is the sigmoid activation function, and w g and b g E is a learnable parameter. fused The final feature representation after fusion is obtained; the gated network can automatically adjust the weight α based on the length of the user interaction sequence. For warm-start users with rich interactions, α focuses on ID collaborative features; for cold-start users with sparse interactions, α approaches 0 and focuses on semantic features, achieving robust adaptation across all scenarios. And / or, the steps in S5 specifically include: S51 models the cross-domain recommendation task as an autoregressive sequence generation task, using a Seq2Seq custom model based on the Transformer decoder; the input is a discrete semantic identifier sequence of items that the user has interacted with in the past, and a causal attention mask is used to avoid future information leakage, ensuring that when predicting the t-th token, only the information of the previous t-1 time steps is used, and the model output is the probability distribution of discrete semantic identifiers of items in the target domain. S52, the decoder outputs the probability distribution of discrete semantic identifiers of items in the target domain. Combined with the cross-domain mapping relationship of the RQ-VAE codebook, the K paths with the highest cumulative probability are retained by the bundle search algorithm to decode the complete item semantic identifier sequence. Then, the token sequence is mapped back to the specific item ID through the bidirectional mapping dictionary between the codebook index and the item ID. S53 employs a customized LoRA fine-tuning strategy for the target domain. It freezes all parameters of the pre-trained RQ-VAE semantic representation module and the relation-aware graph neural network graph structure representation module, inserting low-rank matrices only into the attention layer, adaptive gating network, and projection layer of the Transformer decoder. It updates only the LoRA parameters and the parameters of the attention layer, adaptive gating network, and projection layer of the Transformer decoder, achieving target domain adaptation with extremely low parameter count and avoiding the destruction of pre-trained knowledge. A hybrid loss function is used to optimize the model, as shown in the following formula: ; In the formula, L seq For the main task loss of sequence recommendation, L cl For cross-domain / intra-domain contrastive learning loss based on InfoNCE, L gen Let λ be the generative loss of RQ-VAE. cl and λ gen This is the balance coefficient; S54, based on the fine-tuned model, takes the discrete semantic identifier sequence of the historical interactive items as input for each user, generates the discrete semantic identifier sequence of the target domain items, maps it to the corresponding item ID, sorts them from high to low generation probability, removes the items that the user has already interacted with, and forms the final Top-N personalized recommendation list.