Generative recommendation system-oriented position-aware speculation decoding acceleration method
By introducing item location encoding and speculative step location encoding into the generative recommendation system, the draft model's ability to perceive item structure and speculative depth is enhanced. This solves the problems of insufficient structure perception and poor depth adaptability in existing speculative decoding techniques, thereby improving recommendation quality and inference speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH OF CHINA
- Filing Date
- 2026-01-21
- Publication Date
- 2026-04-14
AI Technical Summary
Existing speculative decoding techniques suffer from insufficient perception of the internal structure of items and poor depth adaptability in generative recommendation systems. This leads to deviations between the generated candidate sequences and the target distribution, resulting in low verification pass rates and impacting inference efficiency.
By introducing item location encoding and speculative step location encoding, and fusing them with the original semantic embedding vector through a gating mechanism, the draft model's ability to perceive item structure and speculative depth is enhanced, thereby improving the generation quality and validation pass rate of candidate sequences.
Without increasing computational overhead, it achieves a dual improvement in recommendation quality and inference speed, is applicable to various generative recommendation tasks, and has good generalization ability.
Smart Images

Figure CN121860064A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of generative recommendation system technology, specifically a method for accelerating location-aware speculative decoding in generative recommendation systems. Background Technology
[0002] With the widespread application of Large Language Models (LLMs) in tasks such as natural language processing, dialogue systems, and search recommendation, their powerful semantic understanding and generation capabilities have gradually been introduced into the field of recommendation systems, giving rise to the emerging field of generative recommender systems. Unlike traditional "scoring" recommendation methods based on collaborative filtering, deep neural networks, or graph models, generative recommender systems transform the recommendation task into a sequence generation task. They utilize large models to autoregressively generate lists of items that users may be interested in, possessing advantages such as end-to-end modeling, rich semantic representation, and strong interpretability.
[0003] In generative recommendation systems, each item is typically encoded as several semantic ID tokens (e.g., four tokens encoded using RQ-VAE), and these tokens are arranged in a specific order to form a recommendation list. The user's historical interaction records are organized as input prefixes, upon which the model generates future item sequences. However, because large models strictly adhere to an autoregressive mechanism during inference—requiring a complete forward propagation computation for each token generated—significant inference latency occurs when generating long recommendation lists, severely limiting their application in real-time recommendation scenarios.
[0004] To alleviate the above problems, researchers have proposed the Speculative Decoding (SD) technique in recent years. Its core idea is to introduce a lightweight draft model to generate multiple candidate tokens in parallel in each round. The target large model then verifies these candidates all at once and adopts the longest prefix that is consistent with the target distribution, thereby achieving "multi-step jump" generation, significantly reducing the number of times the large model is called, and achieving lossless acceleration.
[0005] like Figure 1 As shown, although speculative decoding has achieved good results in general text generation tasks, existing methods still have the following two key unresolved issues in recommendation system applications: 1. The internal structure information of items is not considered. In generative recommendation systems, each item typically consists of a fixed number of semantic ID tokens (e.g., 4), arranged in a fixed order (e.g., ...). <c> <d>These tokens do not exist independently, but together constitute a complete item representation. Tokens in different positions have different semantic roles and distribution characteristics. For example, the first token may represent the item category, the second the brand, and the third the subtype, etc. However, existing speculative decoding methods treat all tokens as equal individuals during the draft generation process, failing to distinguish their "slot" positions within the item. This results in the draft model being unable to accurately model the structural dependencies within the item, leading to a deviation between the generated candidate sequences and the distribution of the target model. This reduces the validation pass rate and limits the speedup effect.
[0006] 2. Undefined uncertainty in speculative depth. The essence of speculative decoding is to generate multiple future tokens "in advance" in each round. The generation order of these tokens depends on the historical information preceding them. As the number of speculative steps increases, the contextual information relied upon by the draft model gradually changes from "real history" to "self-generated drafts," which may contain errors or inaccuracies, leading to error accumulation and making later tokens increasingly difficult for the target model to accept. However, existing draft models do not model the current number of speculative steps during training and inference. Their generation strategy remains consistent across all depths, failing to adapt to changes in uncertainty at different depths. This results in decreased quality and increased verification failure rate during deeper generation, impacting overall acceleration performance.
[0007] In summary, although speculative decoding provides an effective way to accelerate reasoning in large models, its application in generative recommendation systems still faces two major bottlenecks: lack of structural perception and poor depth adaptability. There is an urgent need for a draft generation method that can simultaneously model the internal structure of items and the changes in speculative depth, so as to further improve the reasoning efficiency and generation quality of recommendation systems. Summary of the Invention
[0008] The problem addressed by this invention is how to solve the issues of insufficient structure awareness and poor depth adaptability in existing speculative decoding techniques for generative recommendation systems.
[0009] To address the aforementioned problems, this invention provides a method, apparatus, recommendation system, electronic device, and storage medium for accelerating location-aware speculative decoding in generative recommendation systems.
[0010] In a first aspect, the present invention provides a method for accelerating location-aware speculative decoding in generative recommendation systems, comprising the following steps: During the generation of the draft model, an item location code is introduced for each semantic ID token. The item location code is used to identify the slot position of the token within its respective item. A speculative step position code is introduced for the current speculative generation step of the draft model, and the speculative step position code is used to identify the uncertainty level of the current generation depth; The item location code and the speculative step location code are fused with the original semantic embedding vector of the token and used as enhanced input features of the draft model to improve the generation quality of candidate token sequences and the verification pass rate of the target model.
[0011] Optionally, the item location encoding is obtained through a learnable item location embedding layer, the dimension of which is [missing information]. ,in The number of semantic ID tokens included for each item. The number of delimiters, is the dimension of the embedding vector.
[0012] Optionally, the speculative step position encoding is obtained through a learnable speculative step position embedding layer, the dimension of which is B×d, where B is the preset maximum speculative generation depth and d is the dimension of the embedding vector.
[0013] Optionally, the fusion step employs a gating mechanism, including: The contribution strength of the item location code to the fused features is adjusted by using a learnable item gating coefficient. The contribution strength of the speculative step position encoding to the fused features is dynamically adjusted by using a step gating coefficient calculated based on context.
[0014] Optionally, the fusion process specifically includes: ; ; in, For the first The original semantic embedding vector of each token. Encode the location of the item. Encoding the position of the speculative step. This is the item gate control coefficient. For step gating coefficient, It is a trainable fully connected layer.
[0015] Optionally, the draft model is trained using a multi-step unfolding training strategy, during which the parameters of the target large model are fixed, and the training objective is to minimize the difference in probability distribution between the draft model and the target large model on the recommendation list generation task.
[0016] Optionally, during the inference phase, the candidate token sequence generated by the draft model is verified in parallel by the target large model in one go, and the longest prefix that is consistent with the target distribution is adopted to advance the generation process.
[0017] Secondly, the present invention provides a location-aware speculative decoding acceleration device for generative recommendation systems, comprising: The item location encoding module is used to generate an item location encoding for each semantic ID token; The speculative step position encoding module is used to generate a speculative step position encoding for the current speculative generation step of the draft model; The feature fusion module is used to fuse the item location code and the speculative step location code with the original semantic embedding vector of the token, and input the fused features into the draft model.
[0018] Thirdly, the present invention also provides a generative recommendation system, comprising: The target large model is used to autoregressively generate recommended item sequences based on users' historical interaction records; A draft model is used to generate candidate token sequences in parallel during speculative decoding. A location-aware speculative decoding acceleration module is used in the above-mentioned location-aware speculative decoding acceleration method for generative recommendation systems, or includes the above-mentioned location-aware speculative decoding acceleration device for generative recommendation systems. The candidate token sequence generated by the draft model is verified in parallel by the target large model in one go, and the longest prefix that is consistent with the target distribution is adopted to advance the generation process, thereby achieving lossless and accelerated generation of the recommendation list.
[0019] Fourthly, the present invention provides an electronic device including a processor, a communication interface, a memory, and a bus, wherein the processor, the communication interface, and the memory communicate with each other through the bus, and the processor can call logical instructions in the memory to execute the steps of the method provided in the first aspect.
[0020] Fifthly, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the location-aware speculative decoding acceleration method for generative recommendation systems as described in the first aspect.
[0021] The beneficial effects of the location-aware speculative decoding acceleration method for generative recommendation systems of the present invention are as follows: This invention introduces item location encoding, enabling the draft model to identify the slot position of each token within an item, enhancing its understanding and modeling ability of the item structure, thereby generating candidate sequences that better match the target distribution. By introducing speculative step location encoding, the draft model can perceive its current speculative step number, adaptively adjusting the generation strategy, reducing the uncertainty of deeper generation, and improving the validation pass rate. Through lightweight structural design and gating mechanisms, it ensures that the introduced location signals do not interfere with the original semantic expression, achieving a dual improvement in recommendation quality and inference speed with almost no increase in computational overhead. It can be seamlessly integrated with existing speculative decoding methods, is applicable to various generative recommendation tasks, and possesses good generalization ability and practical value. Attached Figure Description
[0022] < / d> < / c> Figure 1 A diagram illustrating traditional reasoning acceleration models and the challenges they face in recommender systems; Figure 2 This is a flowchart of a location-aware speculative decoding acceleration method for generative recommendation systems in an embodiment of the present invention; Figure 3 This is a structural diagram of the PAD-Rec module in an embodiment of the present invention; Figure 4 This is a diagram showing ablation experimental data related to the embedded module in an embodiment of the present invention; Figure 5 This is a diagram showing ablation experimental data related to the gating mechanism in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the effect of the draft step size on PAD-Rec during inference in an embodiment of the present invention; Figure 7 This is a structural block diagram of a location-aware speculative decoding acceleration device for a generative recommendation system according to an embodiment of the present invention. Figure 8 This is a structural block diagram of the electronic device in an embodiment of the present invention. Detailed Implementation
[0023] To better understand the purpose, technical solution, and advantages of this application, the application is described and explained below in conjunction with the accompanying drawings and embodiments.
[0024] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. The words "a," "an," "an," "the," "these," and similar terms used in this application do not indicate quantitative limitation and may be singular or plural. The terms "comprising," "including," "having," and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms "connected," "linked," "coupled," and similar terms used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term "multiple" used in this application refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A exists alone, A and B exist simultaneously, and B exists alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.
[0025] This invention aims to address the problems of insufficient structure awareness and poor depth adaptability in existing speculative decoding techniques for generative recommendation systems. It proposes a position-aware speculative decoding acceleration method for generative recommendation systems. By introducing item position encoding and speculative step position encoding, the draft model's ability to perceive item structure and speculative depth is enhanced, thereby improving the validation pass rate and inference speed, and achieving high-quality, low-latency personalized recommendation services.
[0026] This invention addresses the shortcomings and deficiencies of the existing technologies by proposing a location-aware speculative decoding acceleration method for generative recommendation systems. Its core objectives include: Enhance the draft model's ability to perceive item structure: By introducing Item Position Embedding (IPE), the draft model can identify the "slot" position of each token inside the item, enhancing its understanding and modeling ability of item structure, thereby generating candidate sequences that better match the target distribution.
[0027] Enhance the draft model's adaptability to speculation depth: By introducing Speculative Step Position Embedding (SPE), the draft model can perceive the current speculation step number, adaptively adjust the generation strategy, reduce the uncertainty of deep step generation, and improve the validation pass rate.
[0028] Achieving a balance between lossless acceleration and high-quality recommendations: Through lightweight structural design and gating mechanisms, it ensures that the introduced location signals do not interfere with the original semantic expression, thereby achieving a dual improvement in recommendation quality and inference speed with almost no increase in computational overhead.
[0029] This invention provides a general and scalable acceleration framework: It can be seamlessly integrated with existing speculative decoding methods (such as EAGLE, HASS, etc.), is applicable to a variety of generative recommendation tasks, and has good generalization ability and practical value.
[0030] To achieve the above objectives, this invention proposes a location-aware speculative decoding acceleration method (PAD-Rec) for generative recommendation systems. The core idea is to introduce two types of location signals into the draft model: item location code (IPE) and speculative step location code (SPE), and to achieve effective fusion with the original features through a gating mechanism, thereby improving the generation quality and validation pass rate of the draft model in recommendation scenarios. The specific implementation steps are as follows.
[0031] like Figure 2 and Figure 3 As shown in the embodiment of the present invention, a method for accelerating location-aware speculative decoding in generative recommendation systems includes the following steps: S1. During the generation of the draft model, an item location code is introduced for each semantic ID token. The item location code is used to identify the slot position of the token within its respective item. The item location code is obtained through a learnable item location embedding layer, the dimension of which is [missing information]. ,in The number of semantic ID tokens included for each item. The number of delimiters, is the dimension of the embedding vector.
[0032] This invention introduces a "slot" location identifier within an item for each token. For example, assuming each item consists of K semantic ID tokens (typically K=4), the location of each token within the item can be represented as slot 1 to slot K. By constructing an item location embedding table, each slot is mapped to a fixed-dimensional vector as an additional input feature for that token.
[0033] Specifically, if the t-th token belongs to the k-th slot, then its item location code... for: ; in, It is a learnable embedding layer, in which, The number of semantic ID tokens included for each item. The number of delimiters, Dimension is the embedding vector. This encoding is fused with the token's original embedding vector and fed into the draft model, enabling it to recognize the current token's structural role within the item and enhancing its ability to model dependencies within the item.
[0034] S2. Introduce a speculative step position code for the current speculative generation step of the draft model. The speculative step position code is used to identify the uncertainty level of the current generation depth. The speculative step position encoding is obtained through a learnable speculative step position embedding layer, the dimension of which is B×d, where B is the preset maximum speculative generation depth and d is the dimension of the embedding vector.
[0035] Specifically, this invention also introduces a "step" position encoding for the current speculative step number of the draft model. Assuming that each round of speculation involves a maximum of B steps, each step corresponds to a unique step position embedding vector. This encoding is used to characterize the uncertainty level of the current generation process; the larger the step number, the more of the historical information the model relies on contains its own generated drafts, and the higher the uncertainty.
[0036] For example, let the current one be the first... The position code of its speculative step. for: ; in It is a learnable embedding layer, in which d represents the maximum draft depth (i.e., the preset maximum speculative generation depth), and d is the dimension of the embedding vector. This encoding will be fused with token features, enabling the draft model to adaptively adjust its generation strategy based on the current speculative depth, thereby improving the accuracy of deeper generation.
[0037] S3. The item location code and the speculative step location code are fused with the original semantic embedding vector of the token as enhanced input features of the draft model to improve the generation quality of candidate token sequences and the verification pass rate of the target model.
[0038] The fusion step employs a gating mechanism, including: The contribution strength of the item location code to the fused features is adjusted by using a learnable item gating coefficient. The contribution strength of the speculative step position encoding to the fused features is dynamically adjusted by using a step gating coefficient calculated based on context.
[0039] Specifically, to avoid the introduced location information interfering with the original token semantics, this invention designs two lightweight gating mechanisms: Item Gate: Sets a learnable scalar weight coefficient for item location coding. Control the degree of its influence on token characteristics; Step Gate: Sets a context-based MLP gating function for speculative step position encoding. It dynamically adjusts its contribution intensity in different speculative steps.
[0040] The fusion process is specifically as follows: ; ; in, For the first The original semantic embedding vector of each token (the vector retrieved from the embedding layer of the original large language model for the t-th token). Encode the location of the item. Encoding the position of the speculative step. This is the item gate control coefficient. For step gating coefficient, It is a trainable fully connected layer. Through a gating mechanism, the model can flexibly adjust the intensity of the position signal, enhancing structure awareness and depth adaptation while maintaining faithful expression of the original semantics.
[0041] The draft model is trained using a multi-step unfolding training strategy. During the training process, the parameters of the target large model are fixed. The training objective is to minimize the difference in probability distribution between the draft model and the target large model on the recommendation list generation task.
[0042] Specifically, this invention employs a multi-step unfolding training strategy (similar to HASS), training only the draft model and its IPE / SPE embedding table and gating parameters, while keeping the target large model frozen. The training objective is to minimize the distribution difference between the draft model and the target model on the response segment (recommendation list).
[0043] During the inference phase, the candidate token sequence generated by the draft model is verified in parallel by the target large model in one go, and the longest prefix that is consistent with the target distribution is adopted to advance the generation process.
[0044] Specifically, the draft model generates a candidate token sequence based on the current context, integrates the item location code and the speculative step location code information, and constructs a candidate tree; the target model performs a one-time verification of the candidate tree, adopts the longest consistent prefix, and advances the generation process.
[0045] The PAD-Rec method proposed in this invention demonstrates significant technical advantages in accelerating speculative decoding in generative recommender systems. By introducing Item Location Encoding (IPE) and Speculative Step Location Encoding (SPE), and combining them with a gating mechanism, PAD-Rec achieves a substantial improvement in inference speed while maintaining recommendation quality. The following section provides a detailed explanation based on experimental data from five aspects: acceleration performance, recommendation quality, module contribution, generalization ability, and deployment overhead.
[0046] On two real-world datasets (Beauty and Instruments), PAD-Rec is compared with mainstream speculative decoding methods (EAGLE-2, HASS, FSPAD, and GRIFFIN) under the same hardware and inference configurations. The speedup results are shown in Tables 1 and 2. Table 1. Comparison of speedup ratio and reception length (Beauty)
[0047] Table 2 Comparison of speedup ratio and receiving length (Beauty)
[0048] As can be seen, when the temperature coefficient is 0, PAD-Rec achieves a speedup of 3.07× on Beauty and 3.15× on Instruments, both outperforming the comparison methods such as EAGLE-2, HASS, FSPAD, and GRIFFIN. Combining the original records in Tables 1 and 2, PAD-Rec adopts an average of 7.35 tokens (Beauty) and 7.43 tokens (Instruments) per validation round, which is 0.52 and 0.46 more tokens than the second-place GRIFFIN, respectively. This indicates that the candidate sequences generated by this invention are more consistent with the distribution of the target model, thus "skipping more steps at once." Even when the temperature coefficient is 0.5, PAD-Rec still achieves the best speedup performance.
[0049] Recommended quality is virtually unaffected. Tables 1 and 2 also list the Recall@10 results for each method. When the temperature coefficient is 0, PAD-Rec is completely consistent with the target LLM on both datasets (Beauty 0.0486; Instruments 0.0337), verifying the core advantage of "lossless acceleration". When the temperature coefficient is 0.5, PAD-Rec also shows good acceleration performance.
[0050] The module's contribution is clear, and IPE and SPE complement each other. To evaluate the effectiveness of the item location coding module and the speculative step location coding module, this study compares the PAD-Rec model with its variants (baseline models: no PAD-Rec; PAD-Rec (without IPE); PAD-Rec (without SPE); complete PAD-Rec) under the same SD settings, focusing on two key metrics: actual running speedup and acceptable length. Figure 4 The following key conclusions were drawn from this study: 1. Overall speedup performance: The complete PAD-Rec achieved the strongest or near-strongest speedup ratio under different datasets and temperature conditions. At the same time, the acceptable length (τ) ranked among the top two, indicating that more tokens can be verified in each target call without significantly increasing complexity.
[0051] 2. Removing both IPE and SPE reduces the speedup ratio, indicating that clear slot hints and step-aware adjustments help the draft model generate more verifiable candidate content.
[0052] 3. Complementarity: IPE (In-Project Layout) and SPE (Survey Depth Adaptation) are complementary; the performance of the complete model is consistently better than that of an ablation model that only removes one of them. Lightweight slot and step signals, adjusted through simple gating, can improve the alignment between the draft and target models, achieving stable acceleration with minimal overhead.
[0053] To evaluate the necessity of the two gating methods for adjusting the position signal, this invention compares four model variants: no gating (both gating methods are disabled simultaneously), no IPE item gating (item gating is disabled only), no SPE speculative step gating (speculative step gating is disabled only), and the complete PAD-Rec model. Figure 5 The results show that the gating mechanism has a significant effect on improving model performance. IPE item gating is the "core stabilizer" of slot hints, which mainly maintains content acceptance rate and semantic rationality. SPE speculative step gating provides "lightweight depth adaptive adjustment" to supplement performance gains. The combination of the two can maximize content acceptance rate and end-to-end acceleration effect, and the additional overhead is negligible.
[0054] like Figure 6 As shown, further research is needed on the speculative step length (speculative depth during the reasoning phase). When considering the impact of fixed training speculation depth, it was found that... To fully cover the SPE step position, change (Values are 1, 2, 4, 6, 8, 10, 12) and its effect on speedup and acceptable length 𝜏 is analyzed on two datasets.
[0055] The results show that the acceptable length 𝜏 will vary with Increases and rises monotonically, initially ( (when) shows linear growth and the acceleration ratio increases significantly with R, but when After exceeding 6, the growth of R slows down and gradually converges, at which point the acceleration ratio begins to decline; the acceleration ratio generally exhibits a single-peak trend, with... Increase first, rise to a moderate depth (usually...) The acceptance rate peaks at [a certain level], then declines due to increased costs caused by excessively deep drafts and diminishing marginal returns on acceptance. Meanwhile, the acceptance rate for medium-length drafts... Because it can roughly cover the fixed tokens and separators of a single item in the structured output, it becomes the optimal balance point for end-to-end latency; and this rule holds true at both temperature = 0 and temperature = 0.5, with the peak speedup being slightly higher only at temperature = 0. This allows for a more stable and longer acceptable prefix. Meanwhile, although training... The optimal depth for the inference phase is smaller (e.g., Therefore, the default deployment depth is medium speculation depth. To balance acceptable length with verification / branching overhead.
[0056] This invention also provides a location-aware speculative decoding acceleration device for generative recommendation systems. This device is used to implement the above-described method embodiments, and details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below can refer to combinations of software and / or hardware that implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation or a combination of software and hardware is also possible and contemplated.
[0057] like Figure 7 As shown, Figure 7 This is a structural block diagram of the location-aware speculative decoding acceleration device for generative recommendation systems in this invention. The device includes: The item location encoding module 101 is used to generate an item location encoding for each semantic ID token; The speculative step position encoding module 102 is used to generate a speculative step position encoding for the current speculative generation step of the draft model; The feature fusion module 103 is used to fuse the item location code and the speculative step location code with the original semantic embedding vector of the token, and input the fused features into the draft model.
[0058] This invention also provides a generative recommendation system, comprising: The target large model is used to autoregressively generate recommended item sequences based on users' historical interaction records; A draft model is used to generate candidate token sequences in parallel during speculative decoding. A location-aware speculative decoding acceleration module is used in the above-mentioned location-aware speculative decoding acceleration method for generative recommendation systems, or includes the above-mentioned location-aware speculative decoding acceleration device for generative recommendation systems. The candidate token sequence generated by the draft model is verified in parallel by the target large model in one go, and the longest prefix that is consistent with the target distribution is adopted to advance the generation process, thereby achieving lossless and accelerated generation of the recommendation list.
[0059] like Figure 8 As shown in the figure, an electronic device provided by an embodiment of the present invention includes: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute the following method: During the generation of the draft model, an item location code is introduced for each semantic ID token. The item location code is used to identify the slot position of the token within its respective item. A speculative step position code is introduced for the current speculative generation step of the draft model, and the speculative step position code is used to identify the uncertainty level of the current generation depth; The item location code and the speculative step location code are fused with the original semantic embedding vector of the token and used as enhanced input features of the draft model to improve the generation quality of candidate token sequences and the verification pass rate of the target model.
[0060] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0061] This invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the methods provided in the above embodiments.
[0062] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for accelerating location-aware speculative decoding in generative recommendation systems, characterized in that, Includes the following steps: During the generation of the draft model, an item location code is introduced for each semantic ID token. The item location code is used to identify the slot position of the token within its respective item. A speculative step position code is introduced for the current speculative generation step of the draft model. The speculative step position code is used to identify the uncertainty level of the current generation depth. The item location code and the speculative step location code are fused with the original semantic embedding vector of the token and used as enhanced input features of the draft model to improve the generation quality of candidate token sequences and the verification pass rate of the target model.
2. The method according to claim 1, characterized in that, The item location code is obtained through a learnable item location embedding layer, the dimension of which is [missing information]. ,in The number of semantic ID tokens included for each item. The number of delimiters, is the dimension of the embedded vector.
3. The method according to claim 1, characterized in that, The speculative step position encoding is obtained through a learnable speculative step position embedding layer, the dimension of which is B×d, where B is the preset maximum speculative generation depth and d is the dimension of the embedding vector.
4. The method according to claim 1, characterized in that, The fusion step employs a gating mechanism, including: The contribution strength of the item location code to the fused features is adjusted by using a learnable item gating coefficient. The contribution strength of the speculative step position encoding to the fused features is dynamically adjusted by using a step gating coefficient calculated based on context.
5. The method according to claim 4, characterized in that, The fusion process is specifically as follows: ; ; in, For the first The original semantic embedding vector of each token. Encode the location of the item. Encoding the position of the speculative step. This is the item gate control coefficient. For step gating coefficient, It is a trainable fully connected layer.
6. The method according to claim 1, characterized in that, The draft model is trained using a multi-step unfolding training strategy. During the training process, the parameters of the target large model are fixed. The training objective is to minimize the difference in probability distribution between the draft model and the target large model on the recommendation list generation task.
7. The method according to claim 1, characterized in that, During the inference phase, the candidate token sequence generated by the draft model is verified in parallel by the target large model in one go, and the longest prefix that is consistent with the target distribution is adopted to advance the generation process.
8. A location-aware speculative decoding acceleration device for generative recommendation systems, characterized in that, include: The item location encoding module is used to generate an item location encoding for each semantic ID token; The speculative step position encoding module is used to generate a speculative step position encoding for the current speculative generation step of the draft model; The feature fusion module is used to fuse the item location code and the speculative step location code with the original semantic embedding vector of the token, and input the fused features into the draft model.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to, when executing the computer program, implement the location-aware speculative decoding acceleration method for generative recommendation systems as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the location-aware speculative decoding acceleration method for generative recommendation systems as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Data resource generation method and device, storage medium and electronic equipment
CN119884356A
Artificial intelligence device for skippy simultaneous self-speculative decoding and method thereof
US20250363353A1