A method for modeling user behavior of an LLM and related devices

CN122548044APending Publication Date: 2026-08-11CHONGQING ANT CONSUMER FINANCE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

然而,现有技术中大多通过简单的序列建模或静态特征聚合来表示用户兴趣,难以刻画用户兴趣在时间维度上的动态演化过程;同时,随着大语言模型(Large Language Model,LLM)在行为理解与语义建模中的应用,直接利用LLM处理长行为序列时容易受到上下文窗口限制,且在生成兴趣表示时缺乏对兴趣连续性与预测有效性的综合评估机制,导致生成的兴趣表示稳定性和准确性不足

Benefits of technology

在本说明书一个或多个实施例中,通过对用户行为序列进行动态分块、以级联提示指导大语言模型逐块生成多样化候选兴趣、利用基于后续行为的多视角概率集合计算AUC 并据此构建连续性与有效性评分数据集训练评分模型、结合层次树搜索机制进行路径优化以及对推荐路径进行时间感知加权融合并与目标物品语义交互,形成对用户长期兴趣的高保真表示。该方法解决了长时序输入受大模型上下文窗口限制的问题,提高了兴趣演化路径的连贯性和预测有效性,并兼顾工程可部署性与可解释性。上述整体流程在离线批处理与在线增量推理场景均可实施,既可通过离线大批量生成候选并训练评分模型,也可在在线低延迟约束下采用缓存与分层推理策略以保证实时性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122548044A_ABST
    Figure CN122548044A_ABST
Patent Text Reader

Abstract

This specification discloses an LLM user behavior modeling method and related equipment. This method addresses the limitation of long-term inputs by large model context windows, improves the coherence of interest evolution paths and prediction effectiveness, and balances engineering deployability and interpretability. The overall process described above can be implemented in both offline batch processing and online incremental inference scenarios. It can generate candidates and train the scoring model offline in large batches, or employ caching and hierarchical inference strategies to ensure real-time performance under low-latency constraints online.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to an LLM user behavior modeling method and related equipment. Background Technology

[0002] With the continuous growth of user behavior data on internet platforms, recommendation systems typically need to model user interests based on historical behavior sequences to achieve product recommendations or behavior predictions. However, most existing technologies represent user interests through simple sequence modeling or static feature aggregation, which is insufficient to depict the dynamic evolution of user interests over time. Furthermore, with the application of Large Language Models (LLMs) in behavioral understanding and semantic modeling, directly using LLMs to process long behavior sequences is easily limited by context windows, and the generation of interest representations lacks a comprehensive evaluation mechanism for the continuity of interests and the effectiveness of predictions, resulting in insufficient stability and accuracy of the generated interest representations. Summary of the Invention

[0003] This specification provides an LLM user behavior modeling method and related equipment, the technical solution of which is as follows: Firstly, this specification provides an LLM user behavior modeling method, the method comprising: The user's behavior sequence data is dynamically divided into multiple behavior blocks according to time, resulting in a behavior block sequence; LLM is used to perform context concatenation modeling on each behavior block in the behavior block sequence, and multiple candidate interests generated by each behavior block are extracted incrementally. Based on the hierarchical tree search mechanism, the candidate interests generated by each behavior block in the behavior block sequence are optimized to obtain the recommended interest evolution path. The candidate interests in the recommended interest evolution path are fused using time-aware weighted fusion to generate a long-term interest representation for the user.

[0004] Secondly, this specification provides an LLM user behavior modeling apparatus, the apparatus comprising: The dynamic partitioning module is used to dynamically divide the user's behavior sequence data into multiple behavior blocks according to time, resulting in a behavior block sequence. The cascaded modeling module is used to perform context cascaded modeling on each behavior block in the behavior block sequence using LLM, and incrementally extract multiple candidate interests generated by each behavior block. The path optimization module is used to optimize the candidate interests generated by each behavior block in the behavior block sequence based on the hierarchical tree search mechanism to obtain the recommended interest evolution path. The weighted fusion module is used to perform time-aware weighted fusion of candidate interests in the recommended interest evolution path to generate a long-term interest representation for the user.

[0005] Thirdly, this specification provides a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the above-described method steps.

[0006] Fourthly, this specification provides an electronic device that may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the above-described method steps.

[0007] Fifthly, this specification provides a computer program product that stores at least one instruction, which is loaded by a processor and executes the above-described method steps.

[0008] The beneficial effects of the technical solutions provided in some embodiments of this specification include at least the following: In one or more embodiments of this specification, a high-fidelity representation of a user's long-term interests is formed by dynamically segmenting user behavior sequences, guiding a large language model to generate diverse candidate interests block by block with cascading prompts, calculating the AUC using a multi-perspective probability set based on subsequent behaviors and constructing a continuity and effectiveness scoring dataset to train a scoring model, optimizing paths using a hierarchical tree search mechanism, and performing time-aware weighted fusion of recommended paths and semantic interaction with target items. This method solves the problem of long-term inputs being limited by the context window of a large model, improves the coherence and predictive effectiveness of interest evolution paths, and balances engineering deployability and interpretability. The above overall process can be implemented in both offline batch processing and online incremental inference scenarios. It can generate candidates and train the scoring model offline in large batches, or use caching and hierarchical inference strategies to ensure real-time performance under online low-latency constraints. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in this specification or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a scenario diagram of an LLM user behavior modeling system provided in this manual.

[0011] Figure 2 This is a flowchart illustrating an LLM user behavior modeling method provided in this manual.

[0012] Figure 3 It is based on Figure 2 A flowchart illustrating a specific implementation of step S300 in the LLM user behavior modeling method shown in the corresponding embodiment.

[0013] Figure 4 It is based on Figure 2 A flowchart illustrating a specific implementation of step S400 in the LLM user behavior modeling method shown in the corresponding embodiment.

[0014] Figure 5 This is a schematic diagram of the structure of an LLM user behavior modeling device provided in this specification.

[0015] Figure 6 This is a schematic diagram of the structure of an electronic device provided in this specification.

[0016] Figure 7 This is a schematic diagram of the operating system and user space provided in this manual.

[0017] Figure 8 yes Figure 6 Architecture diagram of the Android operating system in China.

[0018] Figure 9 yes Figure 6 Architecture diagram of the iOS operating system. Detailed Implementation

[0019] The technical solutions in this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0020] In the description of this specification, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this specification, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this specification based on the specific circumstances. Furthermore, in the description of this specification, unless otherwise stated, "multiple" means 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: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.

[0021] The present specification will now be described in detail with reference to specific embodiments.

[0022] Please see Figure 1 This is a schematic diagram of a scenario for an LLM user behavior modeling system provided in this specification. Figure 1 As shown, the LLM user behavior modeling system may include at least a client cluster and a service platform 100.

[0023] The client cluster may include at least one client, such as Figure 1 As shown, it specifically includes client 1 corresponding to user 1, client 2 corresponding to user 2, ..., client n corresponding to user n, where n is an integer greater than 0.

[0024] Each client in a client cluster can be an electronic device with communication capabilities, including but not limited to: wearable devices, handheld devices, personal computers, tablets, in-vehicle devices, smartphones, computing devices, or other processing devices connected to a wireless modem. Electronic devices may have different names in different networks, such as: user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, cellular phone, cordless phone, personal digital assistant (PDA), and electronic devices in 5G networks or future evolved networks.

[0025] The service platform 100 can be a standalone server device, such as a rack-mount, blade, tower, or cabinet-type server device, or a workstation, mainframe, or other hardware device with strong computing power; or it can be a server cluster composed of multiple servers. The servers in the service cluster can be composed in a symmetrical manner, wherein each server is functionally and hierarchically equivalent in the transaction chain, and each server can provide services independently. The independent provision of services can be understood as not requiring the assistance of other servers.

[0026] In one or more embodiments of this specification, the service platform 100 can establish a communication connection with at least one client in the client cluster, and complete the data interaction in the LLM user behavior modeling process based on the communication connection, such as online transaction data interaction. For example, the service platform 100 can recommend content to the client based on the user's long-term interest representation obtained by the LLM user behavior modeling method of this specification; or, the service platform 100 can obtain user behavior sequence data from the client.

[0027] It should be noted that the service platform 100 establishes a communication connection with at least one client in the client cluster via a network for interactive communication. This network can be a wireless network or a wired network. Wireless networks include, but are not limited to, cellular networks, wireless LANs, infrared networks, or Bluetooth networks. Wired networks include, but are not limited to, Ethernet, universal serial bus (USB), or controller area networks. In one or more embodiments of the specification, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network (such as target compressed packets). Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0028] The LLM user behavior modeling system embodiments provided in this specification and the LLM user behavior modeling methods described in one or more embodiments belong to the same concept. The execution entity corresponding to the LLM user behavior modeling method involved in one or more embodiments of this specification can be the aforementioned service platform 100; the execution entity corresponding to the LLM user behavior modeling method involved in one or more embodiments of this specification can also be the electronic device corresponding to the client, specifically determined based on the actual application environment. The implementation process of the LLM user behavior modeling system embodiments can be detailed in the following method embodiments, and will not be repeated here.

[0029] based on Figure 1 The following is a detailed description of the LLM user behavior modeling method provided by one or more embodiments of this specification, as illustrated in the scenario diagram.

[0030] Please see Figure 2 This document provides a flowchart illustrating an LLM user behavior modeling method according to one or more embodiments. This method can be implemented using a computer program and can run on an LLM user behavior modeling device based on the von Neumann architecture. The computer program can be integrated into an application or run as a standalone utility application. The LLM user behavior modeling device can be a service platform.

[0031] Specifically, this LLM user behavior modeling method includes: S100 dynamically divides the user's behavior sequence data into multiple behavior blocks according to time to obtain a behavior block sequence.

[0032] S200, LLM is used to perform context cascading modeling on each behavior block in the behavior block sequence, and multiple candidate interests generated by each behavior block are extracted incrementally.

[0033] S300, Based on the hierarchical tree search mechanism, the candidate interests generated by each behavior block in the behavior block sequence are optimized to obtain the recommended interest evolution path.

[0034] S400, perform time-aware weighted fusion on the candidate interests in the recommended interest evolution path to generate a long-term interest representation for the user.

[0035] In the embodiments of this application, block-based cascade generation and hierarchical tree search optimization, combined with time-aware weighted fusion, improve the accuracy and predictive effectiveness of interest evolution characterization of long-term user behavior, and mitigate the impact of LLM context window limitations on modeling.

[0036] It should be noted that the above-mentioned behavior sequence refers to a set of discrete interaction events recorded in chronological order by a single user within a target time period. Each event must contain at least a timestamp and a target item identifier, and may also contain metadata such as behavior type, dwell time, and page context. This definition is used to limit the data input format for subsequent steps.

[0037] The aforementioned behavior block refers to a subsequence unit obtained by dividing a behavior sequence according to rules such as time or number of events. A behavior block can be a fixed time window or a variable-length subsequence. The block retains the original event records and statistical summary information, such as event counts, behavior type distribution, and activity density.

[0038] The aforementioned candidate interests refer to semantic preference descriptions or structured interest elements generated by LLM based on a certain behavior block and its context. Candidate interests can be represented as natural language phrases, labeled sets of interest elements, or embedding vectors.

[0039] The aforementioned context cascading modeling refers to using the interest information of the adjacent preceding row block as context input when generating candidate interests for a certain row block, in order to ensure the temporal coherence of interest representation.

[0040] The aforementioned hierarchical tree search mechanism refers to an algorithmic framework that maps time-sequential action blocks into layers of a tree structure and searches for recommended paths using candidate interests as nodes through inter-layer expansion and pruning strategies.

[0041] The aforementioned time-aware weighted fusion refers to a processing method that assigns weights to each node on the path based on the path optimization results and combines position encoding with causal and masked self-attention to perform weighted fusion of interest vectors, outputting the final long-term interest representation.

[0042] In S100, the action sequence is taken as input, and a series of ordered action blocks are output. Each behavior block contains a list of original events and block-level statistics. Specifically, the ordered behavior blocks mentioned above can be divided according to a fixed time window, an upper limit on the number of events, a time interval threshold, a hybrid strategy, or an adaptive data-driven approach.

[0043] Specifically, when dividing according to a fixed time window, the window is divided in units of a preset time window length Δt, and the window boundary can be a calendar boundary or a sliding window; this is suitable for business scenarios with obvious periodic behavior characteristics.

[0044] When dividing according to the upper limit of the number of events, events are accumulated with the maximum number of events Le in each block as the threshold until the upper limit is reached before cutting into blocks; this scheme can ensure that the number of events in a single block is controlled, which is convenient for matching with the context capacity of the target LLM.

[0045] When dividing according to a time interval threshold, the block is broken when the time difference between adjacent events exceeds the threshold Tgap, which is suitable for scenarios where user behavior has a long time interval.

[0046] In the case of a hybrid strategy, the above partitioning methods can be combined to take into account both dense and sparse distributions. For example, it can be divided by time intervals and then trimmed by the upper limit of the number of events.

[0047] In the case of adaptive data-driven partitioning, block boundaries are dynamically determined based on behavior density and information entropy metrics, for example, when the information gain within a block is below a threshold, the partitioning is triggered.

[0048] It is important to emphasize that each behavior block must store metadata such as start and end timestamps, event counts, behavior type distribution, and dominant category; the partitioner should support batch processing and streaming incremental construction, and record partitioning strategy parameters for traceability and reproducibility.

[0049] In S200, the block's behavior description and the interest context of the previous block are taken as input, and the output is a set of candidate interests for that block. Each candidate is accompanied by a text description, an embedding, and generation confidence information.

[0050] Candidate interests can be generated through text-level Prompt cascading.

[0051] Specifically, the corresponding text can be explicitly entered into the Prompt, and a general or fine-tuned LLM can be invoked for multiple samplings. For example, the entered text could be: "Historical Interests: X; Current Behavior Summary: Y; Please generate M current interest candidates, each not exceeding P characters, and return them in phrase form." This text-level Prompt cascading is more intuitive for users and easier to explain.

[0052] Candidate interests can be generated using structured output templates.

[0053] Specifically, the Prompt can be used to request the model to output a specific JSON structure for subsequent parsing and embedding mapping; this is suitable for engineering processes that require structured information.

[0054] Candidate interests can be generated through cascading with the assistance of embedding.

[0055] Specifically, historical interests can be incorporated into the model input as embeddings, and only the current action text can be used as the prompt, reducing the prompt length and improving semantic consistency.

[0056] Candidate interests can be generated in parallel using multiple models and strategies.

[0057] Specifically, different temperatures, top-k or nucleus sampling strategies can be used in parallel, or different models can be called in parallel. After merging the generated results, a clustering deduplication strategy is used to select N representative candidates to enhance diversity.

[0058] Candidate interests can be generated in two stages.

[0059] Specifically, the first stage uses a lightweight model to generate a large number of coarse-grained candidates, and the second stage uses a high-quality LLM to refine and score each candidate, retaining only high-quality candidates for subsequent searches, thereby reducing costs.

[0060] Candidate interests can be obtained by generating confidence scores.

[0061] Specifically, token-level logits, sampling temperature, and repeatability metrics during the generation process can be recorded to construct candidate confidence features.

[0062] It is important to emphasize that we define the maximum number of candidates N, the upper limit of candidate length, the decoding hyperparameters, and save the original generated metadata; implement candidate deduplication and diversity regularization to avoid highly redundant candidate sets; and in online scenarios, we can adopt a strategy that combines semi-offline pre-generation with online fine-tuning to reduce response latency and cost.

[0063] Specifically, in some embodiments, the specific implementation of step S200 can be found in the following embodiments. This embodiment is based on... Figure 2 According to the detailed description of step S200 in the LLM user behavior modeling method shown in the corresponding embodiment, step S200 in the LLM user behavior modeling method may include the following steps: Construct a cascading modeling prompt template that includes historical interests, current behavior, and current interest. The current interest is a candidate interest of the current behavior block, the current behavior is the behavior corresponding to the current behavior block, and the historical interest is a candidate interest of the previous behavior block adjacent to the current behavior block. The historical interest is used as context input and together with the current behavior, it is used as input to the current behavior block. The cascaded modeling prompt template guides the LLM to incrementally extract multiple candidate interests generated for each behavior block.

[0064] In this embodiment, by constructing a cascading modeling prompt template that includes historical interest and current behavior information, the LLM is guided to incrementally generate candidate interests in a continuous behavioral context, thereby enhancing the temporal continuity and semantic consistency of interest modeling and improving the ability of candidate interests to express users' true preferences.

[0065] It should be noted that the aforementioned cascaded modeling prompt template refers to a structured prompt text or structured input template used to guide LLM in generating candidate interests. This template contains at least three semantic parts: a description of historical interests, a description of current behavior, and instructions for generating current interests.

[0066] Here, historical interests refer to the candidate interests generated and retained by the previous action block adjacent to the current action block; current action refers to the set of user action events contained within the current action block; and current interest refers to the interest description or interest representation generated by LLM based on historical interests and current action. Cascaded modeling prompt templates input historical interests as contextual input along with the current action into the LLM, enabling the model to inherit the semantics of the previous stage when generating the current interest, thereby achieving the gradual evolution of interest information.

[0067] In practical implementation, there are several ways to construct cascading modeling prompt templates. The first approach is the natural language template approach, which concatenates historical interests and current behavior information in natural language and explicitly requires the LLM to generate several candidate interests. For example, the prompt template can include a historical interest description area, a current behavior summary area, and an interest generation instruction area. The historical interest description area is used to fill in the interest text generated by the previous behavior block, the current behavior summary area is used to fill in the behavior list or summary of the current behavior block, and the interest generation instruction area is used to require the model to output multiple interest candidates. The second approach is the structured template approach, which specifies that the model outputs structured data, such as outputting interest topics, interest categories, or interest intensities in key-value pairs, to facilitate subsequent system parsing and calculation. The third approach is the semi-structured template approach, which includes both natural language descriptions and structured fields, enabling the model to generate natural language interest expressions and provide parsable interest tags.

[0068] After obtaining the prompt template, historical interests and current behaviors are populated into the template and input into the LLM. To ensure the current behavior is accurately understood by the model, it can be represented in various ways. For example, in a first implementation, the current behavior directly lists the user's interaction records within the behavior block in chronological order, such as browsing, clicking, or purchasing behaviors. In a second implementation, a statistical summary of the behavior can be performed, such as extracting the most frequently occurring item categories, keywords, or tags from the behavior block and providing this summary to the model. In a third implementation, a behavior encoder can convert the behavior sequence into a vector representation, and this vector can be provided as additional input to the LLM, thereby enhancing the semantic expressiveness of the behavior.

[0069] After inputting historical interests and current behaviors into the model, candidate interest generation is performed using an LLM (Limited Ledger Model). To ensure the diversity and coverage of candidate interests, various generation strategies can be employed. For example, in the first embodiment, multiple random sampling is used to generate multiple interest candidates, i.e., by setting different random seeds or sampling temperature parameters, the model is repeatedly invoked to generate multiple interest descriptions; in the second embodiment, different cue variations can be set to guide the model to generate interests from different perspectives, such as generating candidate interests from the perspectives of user intent, interest category, or behavioral goal; in the third embodiment, a multi-model collaborative generation approach can be adopted, i.e., multiple LLMs with different structures or parameter scales are invoked simultaneously to generate interest candidates, and then the outputs of each model are merged into a candidate interest set.

[0070] After candidate interests are generated, they can be preprocessed to ensure the quality of the candidate set. Specifically, the semantic similarity between candidate interests can be calculated. If the semantic similarity between two candidate interests exceeds a preset threshold, one of them is considered a redundant candidate and is deleted. Alternatively, candidate interests can be filtered based on text length, semantic completeness, or confidence level to remove candidate results that do not meet the generation requirements. The filtered candidate interest set becomes the candidate interest set for the current action block and is used for node expansion and path optimization in the subsequent hierarchical tree search mechanism.

[0071] The above process is repeated chronologically for each action block in the action sequence. For the first action block, since there is no historical interest, it can be initialized with an empty interest or generated directly using only the current action as input. For subsequent action blocks, the interest of the previous action block is always used as the input for historical interests. In this way, interest information can be passed and updated block by block in the time dimension, thus forming a progressively evolving interest sequence.

[0072] It is important to emphasize that, to improve system efficiency, candidate interest sets for behavior blocks can be generated in batches during the offline phase, and incremental generation can be performed only on newly added behavior blocks during the online phase. Historical interest and behavior summaries can also be cached to reduce redundant computation. Furthermore, generation parameters, prompt template versions, and model version information during the candidate interest generation process can be recorded for traceability and optimization during system debugging and model iteration.

[0073] In S300, an interest tree is constructed using the candidate set at each layer as input, and the recommended interest evolution path P* is obtained through search.

[0074] Specifically, the behavioral blocks of the time series are first mapped to a hierarchical tree structure, with the root node representing the initial interest and each level node representing candidate interests for that block. The initial interest can be empty or directly generated from the first block. The tree topology can be selected between offline static construction and online dynamic expansion. Static construction generates a complete tree for all candidates in the offline phase, suitable for offline training; dynamic expansion generates child nodes only for the currently retained parent nodes in the online phase to conserve resources.

[0075] For each parent node, a set of child nodes is generated using Best-of-N sampling or multi-strategy sampling. N can be dynamically set according to the importance of the block. For example, N can be increased for the most recent block or the block with dense behavior to enhance diversity.

[0076] To avoid exponential scaling, a scoring model can be introduced to provide intermediate scores for nodes, and a BeamSearch or top-M retention strategy can be used for pruning at each layer. Pruning strategies can include simple score ranking, parallel diversity preservation, or threshold-based filtering.

[0077] Greedy layer-by-layer selection, Beam Search, or Monte Carlo tree search can be used to explore better global paths when the scoring is uncertain; for scenarios with limited computing resources, approximate heuristic search can be selected.

[0078] The node comprehensive score can combine multiple signals, such as generation confidence, semantic similarity with the parent node, historical area under the curve performance, and temporal interval penalty; the scorer can be an interpretable LightGBM or a small neural network. The area under the curve can be the area under the curve (AUC) of the Receiver Operating Characteristic (ROC) curve, abbreviated as AUC.

[0079] After searching to the final level or meeting the early termination condition, output one or more paths with the highest scores, and record the combined score of each node on the path. .

[0080] It is important to emphasize that the intermediate tree structure is stored and the set of child nodes of common parent nodes is cached for reuse; the complete tree is used to generate training samples during the offline training phase, and dynamic expansion and caching are prioritized during the online inference phase to reduce latency; and a time decay penalty is introduced for long-term path selection to prevent excessive bias towards very early interests.

[0081] Specifically, in some embodiments, the specific implementation of step S300 can be found in [reference needed]. Figure 3 . Figure 3 It is based on Figure 2According to the detailed description of step S300 in the LLM user behavior modeling method shown in the corresponding embodiment, step S300 in the LLM user behavior modeling method may include the following steps: S310, Based on the hierarchical tree search mechanism, the behavior sequence is abstracted into an interest tree according to each behavior block, and each level of the interest tree corresponds to a behavior block.

[0082] S320, for each parent node in the interest tree, a Best-of-N sampling mechanism is used to generate multiple child nodes, and each child node corresponds to a candidate interest of the current behavior block.

[0083] S330 uses a pre-trained continuous scoring model and an effectiveness scoring model to comprehensively score each candidate interest, obtaining a node comprehensive score.

[0084] S340, in each layer, select the child node with the highest comprehensive score as the recommended interest node and add it to the path set, and continue to expand as the parent node of the next layer until the traversal is completed, and obtain the recommended interest evolution path.

[0085] In this embodiment, by mapping behavioral sequences to hierarchical interest trees and combining multi-candidate generation and scoring pruning, coherent and predictably valid interest evolution paths can be efficiently searched in the global path space, improving the accuracy and interpretability of interest representation while controlling computational overhead.

[0086] It should be noted that the interest tree is an ordered hierarchical data structure, with each level corresponding to a specific time sequence. The i-th level of the tree contains a set of candidate interest nodes corresponding to the i-th behavior block. The root node represents the initial interest state or a blank state. Parent and child nodes represent the connectivity between adjacent levels along the time direction in the interest tree; a node in the i-th level is the parent node of a node in the (i+1)-th level, and the latter is the child node of the former.

[0087] The Best-of-N sampling mechanism is a strategy that retains N generated results as a set of candidate child nodes when decoding the LLM or generator multiple times or using multiple strategies for generation. This mechanism is used to improve candidate diversity and coverage.

[0088] The node comprehensive score is a scalar evaluation value obtained by fusing multiple discriminative scores obtained from a pre-trained continuous scoring model and an effectiveness scoring model for a single candidate interest node. It is used to measure the priority of the node in path selection. The fusion function can be linear weighting, nonlinear combination, or Bayesian fusion based on posterior probability.

[0089] In S310, the action sequence When abstracting into an interest tree, each row is first divided into blocks. Generate candidate interest set and will This corresponds to the set of nodes at the i-th level of the tree. Interest trees can be constructed using two engineering methods: static trees and dynamic trees. Static trees are suitable for offline training and large-scale backtracking evaluation; the system generates these in batches for all historical blocks during the offline phase. This forms the entire tree; dynamic trees are suitable for low-latency online inference, only calling the generator to generate child nodes when needed for a few currently retained parent nodes, avoiding exponential growth in storage and computation. Regardless of whether it is static or dynamic, tree nodes should record the following metadata: candidate text, embedding, generation confidence, generation parameters, and similarity indicators with parent nodes and historical paths, as the basis for subsequent scoring and auditing.

[0090] In S320, the Best-of-N sampling mechanism can specifically include sampling mechanisms such as single-model multiple sampling, multi-model set sampling, multiple Prompt variant sampling, and two-stage screening sampling.

[0091] Under the single-model multiple sampling mechanism, the same LLM can be decoded N times with different random seeds or different temperature parameters to directly obtain N candidate nodes, which are then deduplicated and used as child nodes.

[0092] Under the multi-model ensemble sampling mechanism, multiple generative models with different structures or fine-tuning states can be called in parallel, and a number of samples from each model can be merged into N candidates to improve semantic diversity and reduce the risk of single-model bias.

[0093] Under the multi-Prompt variant sampling mechanism, several Prompt variants can be constructed for the same parent node. Each variant can have its own emphasis, such as emphasizing intent, category, or temporal context. Several candidates are sampled for each variant and then merged.

[0094] Under the two-stage screening and sampling mechanism, the first stage can sample a large number of candidates to obtain a large candidate pool, and the second stage can use a lightweight semantic filter to compress the candidate pool to N for formal scoring.

[0095] The generation strategy should incorporate deduplication and diversity control mechanisms, such as cosine similarity-based clustering for redundancy removal (similarity threshold θ), or the introduction of diversity scoring terms to avoid highly homogeneous candidates. The system should record generation metadata to support reproducibility and review.

[0096] In S330, for each candidate child node, a continuity score is calculated using a pre-trained continuity scoring model. ; Calculate the effectiveness score using a pre-trained effectiveness scoring model. Both models output scalar probabilities or confidence scores.

[0097] Specifically, in some embodiments, the specific implementation of step S330 can be found in the following embodiments. This embodiment is based on... Figure 3 According to the detailed description of step S330 in the LLM user behavior modeling method shown in the corresponding embodiment, step S330 in the LLM user behavior modeling method may include the following steps: The continuity score of the candidate interest is calculated using the continuity scoring model. The validity score of the candidate interest is calculated using the validity scoring model. The node comprehensive score, which includes weight coefficients, is obtained by weighted fusion of the continuity score and the validity score.

[0098] In this embodiment, by calculating the continuity score and validity score of candidate interests separately and generating a node comprehensive score based on weighted fusion, the temporal continuity and immediate predictive value of interests can be measured simultaneously. This allows for a balance between long-term coherence and short-term utility in path selection, thereby improving the robustness and predictive effect of the final interest evolution path.

[0099] It's important to clarify that the continuity scoring model is a supervised model used to evaluate whether candidate interests and historical interests remain consistent over time and whether they can represent a continuation of interest evolution. Its output is a scalar confidence score or probability (range [0,1]), often used to characterize whether the candidate is a reasonable subsequent interest. The effectiveness scoring model is a supervised model used to evaluate whether a candidate interest has a gain in predicting subsequent behavior relative to a baseline that only utilizes current behavior information. Its output is a scalar confidence score or probability, characterizing whether the candidate can improve the performance of the next step or short-term predictions. The node composite score is a single scalar synthesized from the outputs of the continuity scoring model and the effectiveness scoring model according to a specific fusion rule, used for ranking and filtering candidate nodes in tree search or path selection. Probability calibration refers to the post-processing of the model's probability output to better reflect the probability of real events; common methods include temperature scaling, isometric regression, and Platt scaling.

[0100] Specifically, the input features of the continuous scoring model can be composed of categories such as candidate interest embedding, cosine similarity sequence between the candidate and the top K historical interests, candidate generation confidence, inter-block time difference Δt, intra-block behavior statistics, the occurrence rate of item_id covered by the candidate in subsequent blocks, semantic matching degree between the candidate and the parent node text, and AUC performance from the candidate on historically similar user groups, and can be combined as needed.

[0101] To meet different latency and resource constraints, the continuity scoring model can be implemented based on a tree model for fast inference and to provide feature importance; it can also be implemented based on a shallow MLP containing 1–3 fully connected layers; or it can be implemented based on a small Transformer or sequence model to utilize historical AUC sequences and temporal features.

[0102] Features of the validity scoring model may include candidate embedding, AUC value of the candidate on the evaluation set or its surrogate quantity, coverage of the candidate and high-frequency items in the current block, candidate generation confidence, baseline model prediction difference features, and historical conversion rate of the candidate in similar contexts.

[0103] Similarly, validity scoring models can also be implemented based on tree models, MLPs, or small neural networks; for online services with extremely high real-time requirements, representation mapping combined with a lightweight linear model can be used.

[0104] In some embodiments, the node comprehensive score The calculation methods can include linear weighted fusion, post-calibrated weighted fusion, nonlinear fusion network, Bayesian or posterior fusion, multi-objective fusion with diversity penalty, etc.

[0105] The linear weighted fusion is achieved through the following formula:

[0106] Wherein, α and β are preset positive weight coefficients or positive weight coefficients obtained through offline optimization. This method is simple to implement and easy to interpret.

[0107] Post-calibration weighted fusion requires , First, perform probability calibration on each model individually, and then fuse them linearly to reduce the impact of differences in probability scale between models. Probability calibration can be performed using methods such as temperature scaling or isometric regression.

[0108] Nonlinear fusion networks are... Input a small fusion network, such as a two-layer MLP, and obtain the output. This is to facilitate the capture of interaction effects. Here, g is an additional feature vector, which can be the generation confidence score, similarity to the parent node, time interval, etc.

[0109] Bayesian or posterior fusion is to , Treating it as likelihood evidence, and combining priors such as historical path quality distribution, the posterior probability of the node is obtained through Bayesian update and used as... .

[0110] Multi-objective fusion with diversity penalty incorporates a diversity or coverage penalty term D(node,path) into the fusion process to prevent the final path from becoming overly concentrated on semantically nearest neighbors. The specific formula is as follows: .

[0111] Wherein, α and β are preset or weight coefficients obtained through offline optimization, and γ is a penalty coefficient. In some embodiments, α∈[0.4,0.7], β∈[0.3,0.6], and γ is set to 0 or less than 0.2 according to diversity requirements. The diversity or coverage penalty function can be obtained based on set coverage or mutual information.

[0112] In S340, after generating and scoring child nodes on the parent node set of each layer, it is necessary to determine the parent node set to enter the next layer.

[0113] Specifically, in some embodiments, the single child node with the highest score of each parent node can be selected as the recommended interest node and added to the path set. This recommended node also serves as the parent node of the next layer to continue expansion. This method has low computational complexity and is easy to implement, but it may miss the global recommendation combination across parent nodes.

[0114] In some embodiments, a beam width M can be set, and the child node sets generated by all parent nodes can be sorted according to the cumulative path score, retaining the top-M global paths (the tail node of each path is used as the next-level parent node). This method strikes a balance between preserving diversity and near-global recommendation, and is suitable for medium-latency scenarios where computing resources allow.

[0115] In some embodiments, the node's overall score and semantic differences from the current set of retained paths can be considered simultaneously during the selection process, employing multi-objective optimization or heuristic selection of subsets to balance quality and coverage.

[0116] In some embodiments, MCTS can be used when the scoring has randomness or significant model uncertainty. It evaluates path rewards through simulation / sampling and gradually biases towards high-value branches, which is suitable for scenarios that require exploring an uncertain space.

[0117] In some embodiments, a minimum score threshold τ can be set for child nodes, and child nodes with scores below τ can be discarded directly; the threshold can be fixed or adaptively set based on the score distribution of this layer.

[0118] In practical applications, those skilled in the art can also determine conflict resolution rules and degradation strategies when resources are limited, such as deciding based on generation timestamp or parent node priority when scores are the same, reducing Beam Search to a top-1 greedy algorithm.

[0119] During the search process, the search can be terminated and a recommended interest evolution path output under any one or a combination of the following conditions: reaching the last level of the tree, i.e., traversing the corresponding last row block; the cumulative path score no longer significantly improving, i.e., reaching the convergence threshold ε; reaching the preset computation or time budget; and, in online near real-time scenarios, reaching the usable latency window. The output path should include the text representation, embedding, node comprehensive score, connection information with parent nodes, and generated metadata for each node on the path. Post-processing steps may include temperature adjustment of path scores, reordering of path diversity, or making binding corrections according to business rules. For businesses requiring interpretability, a chain of evidence for path selection can also be output for review or user presentation.

[0120] It should be noted that the training methods for the aforementioned continuous scoring model and effectiveness scoring model specifically include: The candidate interests generated by the t-th behavior block are matched with the behavior items of the (t+1)-th behavior block, and the information gain of the candidate interests on subsequent behavior prediction is evaluated to construct a continuous scoring dataset and an effectiveness scoring dataset.

[0121] The continuous scoring model is trained based on the continuous scoring dataset, and the continuous scoring model is a binary classification model.

[0122] The validity scoring model is trained based on the validity scoring dataset, and the validity scoring model is a binary classification model.

[0123] In this embodiment, by matching candidate interests with subsequent action items and constructing a continuity and effectiveness scoring dataset using information gain quantification, high-quality labels for supervised training can be obtained, thereby training a binary classification scoring model that can distinguish between interest continuity and immediate prediction utility, and improving the accuracy and robustness of path selection and long-term interest representation.

[0124] It should be noted that the aforementioned behavior items refer to single or aggregated interaction records in the (t+1)th behavior block, including item_id, category identifier, behavior type, timestamp, and optional contextual metadata.

[0125] The aforementioned matching or matching alignment refers to establishing a semantic or statistical correspondence between the candidate interest generated from the t-th behavior block and the behavior items within the (t+1)-th behavior block, in order to evaluate the predictive ability of the candidate interest for subsequent behaviors. Matching can be a one-to-one, one-to-many, or many-to-many mapping, depending on the specific implementation.

[0126] The aforementioned information gain refers to the increment in discriminative performance of a candidate interest relative to a certain reference baseline when used to predict the behavior of the (t+1)th block. It is often quantified by AUC, the reduction in log loss, or the increase in prediction probability.

[0127] The aforementioned continuous scoring dataset and validity scoring dataset refer to the labeled data sets used to train the continuous scoring model (continuous scoring model) and the validity scoring model (validity scoring model), respectively. Each sample in the dataset includes a candidate interest representation, the corresponding feature vector, a label, and meta-information during construction.

[0128] The specific process of constructing the continuous rating dataset and the validity rating dataset includes: Match and align the candidate interests generated by the t-th behavior block with the behavior items of the (t+1)-th behavior block; The LLM is guided by calling multiple preset evaluation prompt templates to predict the confidence level of the behavior item in meeting the candidate interest from different perspectives, and a probability set is obtained, which contains multiple confidence level probabilities. Based on the probability set, the average discrimination performance of the candidate interest on the evaluation set is calculated, and the current AUC value is quantified. The current AUC value is the AUC value of the candidate interest generated by the t-th behavior block. The current AUC value is compared with the previous K historical AUC values ​​to construct a continuous rating dataset, and the previous K historical AUC values ​​correspond to the previous K historical interests. The baseline AUC value is compared with the current AUC value to construct an effectiveness score dataset. The baseline AUC value is calculated based solely on the original interaction data of the current behavior block.

[0129] In this embodiment, by performing multi-angle matching between the candidate interests generated from the t-th behavior block and the behavior items of the (t+1)-th behavior block, introducing multiple evaluation prompts to obtain a probability set, and quantifying the discriminative performance of the candidates with AUC, a continuity and validity scoring dataset can be objectively constructed, improving the reliability and reproducibility of the subsequent scoring model labels, thereby enhancing the temporal coherence and prediction gain of path selection.

[0130] It should be noted that the above-mentioned matching alignment establishes a semantic or statistical correspondence between the candidate interests generated in block t and one or more behavior items in block t+1, so as to quantitatively evaluate the discriminative ability of the candidate interests in subsequent behaviors. Matching alignment can be one-to-one, one-to-many, or one-to-cluster many-to-many mapping. The above-mentioned evaluation prompt template is a set of preset natural language prompts or discriminator call templates, used to guide the LLM or discriminator module to output confidence probabilities of candidate-behavior pairs from a predetermined perspective; different templates correspond to different discriminative perspectives or task descriptions. The above-mentioned probability set is an ordered set of confidence probability values ​​obtained under multiple prompts or multiple discriminators for the same candidate evaluation set. The above-mentioned current AUC value is the area under the ROC curve calculated for the candidate on the evaluation set of block t+1 based on the probability set (or the fused probability) and the real label, used to measure the average discriminative ability of the candidate on that evaluation set. The above-mentioned first K historical AUC values ​​are the AUC sequence calculated for the first K retained historical interests corresponding to the candidate on their respective subsequent evaluation sets. The baseline AUC value mentioned above is the AUC calculated by the reference baseline model based solely on the original interaction data of the (t+1)th behavior block, and is used as a reference for validity comparison.

[0131] For different prompt templates, the corresponding probability output can be denoted as:

[0132]

[0133]

[0134] in, For target items from subsequent action blocks, represent the interest generated by the t-th action block; This represents the original interaction data of the t-th block; three probability sets. , , These reflect the confidence level of LLM predictions under different Prompt conditions.

[0135] The AUC values ​​under different Prompt conditions can be denoted as:

[0136] in, These figures reflect the average discriminative performance of candidate interests on the evaluation set under different Prompt conditions. Probability sets , , The probability in These are quantization parameters.

[0137] Specifically, the process of constructing a continuous rating dataset includes: Compare the previous K historical AUC values ​​with the current AUC value, and label the candidate interest as the first positive sample or the first negative sample; A continuous scoring dataset is constructed based on the first positive sample and the first negative sample.

[0138] In this embodiment, by explicitly comparing the first K historical AUCs with the current AUC and labeling the first positive and negative samples accordingly, a continuous scoring training set can be constructed stably and reproducibly. This allows the continuous scoring model to obtain reliable supervision signals, improve the ability to discriminate the continuity of interest, and reduce the impact of noise labels on model performance.

[0139] The specific classification rules for the first positive sample and the first negative sample are as follows: If the current AUC value is higher than the previous K historical AUC values, the candidate interest is labeled as the first positive sample; If the current AUC value is not higher than the previous K historical AUC values, the candidate interest is labeled as the first negative sample.

[0140] In this embodiment, candidate interests are binary-labeled using a clearly defined and quantitative AUC comparison rule to ensure that the quality of continuous training samples is reproducible and easy to audit, thereby improving the discrimination accuracy and stability of the continuous scoring model.

[0141] Specifically, the process of constructing the validity scoring dataset includes: By comparing the baseline AUC value with the current AUC value, the candidate interest is labeled as a second positive sample or a second negative sample. A validity score dataset is constructed based on the second positive sample and the second negative sample.

[0142] In this embodiment, the validity label is constructed with the baseline AUC as a reference, which can objectively quantify the gain of candidate interest on short-term prediction, ensure the robustness and reproducibility of the validity scoring dataset, and thus improve the discrimination ability of the validity scoring model and the downstream prediction effect.

[0143] The specific classification rules for the second positive sample and the second negative sample are as follows: If the current AUC value is greater than the baseline AUC value, the candidate interest is labeled as a second positive sample; If the current AUC value is not greater than the baseline AUC value, the candidate interest is labeled as a second negative sample.

[0144] In this embodiment, by using the baseline AUC as a unified reference, directly comparing the current AUC and performing binary labeling, a stable training sample for the effectiveness score can be constructed, so that whether the candidate interest has a real predictive gain can be objectively quantified, thereby improving the effectiveness score model's ability to discriminate the effectiveness of interests.

[0145] In some specific embodiments of this application, the training methods for the above-mentioned continuous scoring model and validity scoring model specifically include: obtaining a scoring training sample set, wherein the scoring training sample set contains multiple candidate interest samples, each candidate interest sample is labeled with a corresponding scoring label, wherein the scoring label includes a continuous label and a validity label; inputting the candidate interest samples one by one into the scoring model to obtain a scoring result; updating the parameters of the scoring model according to the output scoring result and the scoring label until a predetermined termination condition is reached, thereby ending the training and obtaining a trained scoring model.

[0146] In the embodiments of this application, during training, a scoring sample set containing multiple candidate interest samples can be obtained first. Each candidate interest sample contains candidate interest content, corresponding behavioral block information, and the AUC evaluation result of the candidate interest, and is labeled with a corresponding continuity label or validity label. Then, the scoring sample set is divided into a training set, a validation set, and a test set according to a predetermined ratio. Then, the parameters of the scoring model are adjusted and determined according to the candidate interest samples included in the training set, validation set, and test set to obtain the trained scoring model.

[0147] Specifically, the construction process of the above training sample set includes: matching and aligning the candidate interests generated by the t-th behavior block with the behavior items of the (t+1)-th behavior block to construct the evaluation relationship between the candidate interests and the real behaviors; calling multiple preset evaluation prompt templates to guide the LLM to predict the confidence level of the behavior item matching the candidate interest from different perspectives, obtaining multiple confidence probabilities, and forming a probability set; calculating the average discriminative performance of the candidate interest on the evaluation set based on the probability set, thereby obtaining the corresponding current AUC value; comparing the current AUC value with the top K historical AUC values ​​corresponding to historical interests, if the current AUC value is higher than the top K historical AUC values, then... The candidate interest is labeled as the first positive sample, otherwise it is labeled as the first negative sample, thus constructing a continuous scoring dataset. At the same time, the current AUC value is compared with the baseline AUC value. If the current AUC value is greater than the baseline AUC value, the candidate interest is labeled as the second positive sample. If the current AUC value is not greater than the baseline AUC value, the candidate interest is labeled as the second negative sample, thus constructing a validity scoring dataset. The above continuous scoring dataset and validity scoring dataset are combined to form a scoring training sample set, where each sample contains candidate interest features, historical interest information, current AUC value, historical AUC value, baseline AUC value, and corresponding scoring label.

[0148] In some embodiments, during model training, the scoring training sample set can be divided into a training set, a validation set, and a test set. The scoring model is then trained based on the training set, validated based on the validation set, and tested based on the test set to obtain a trained scoring model. Before training based on the training set, the training samples can be preprocessed. This preprocessing includes vectorizing candidate interest texts, normalizing AUC values, and encoding behavioral block features to form a unified format of model input features. After obtaining the preprocessed training set, the scoring model can be trained and its parameters updated based on the training set.

[0149] Specifically, candidate interest samples from the training set are input into the scoring model to obtain the scoring results output by the model. The scoring results are compared with the scoring labels, the loss function is calculated, and then the stochastic gradient descent method is used to minimize the loss function. The parameters in the scoring model are updated through backpropagation until the loss function meets predetermined conditions, such as the loss function convergence or the loss function is less than a preset threshold. During training, the model can be periodically validated using a validation set. When the loss function on the validation set continues to decrease and meets the predetermined conditions, the current model parameters are retained. If the validation set loss does not meet the predetermined conditions, the learning rate and other hyperparameters are automatically adjusted and the next round of training continues. After the model training is completed, the trained scoring model can be tested using a test set. By comparing the model loss values ​​of multiple training rounds, the model parameters with the smallest loss value are selected as the final model parameters, thus obtaining the trained continuous scoring model and effective scoring model.

[0150] By using the training methods described above, the scoring model can learn the continuous and effective contributions of candidate interests to user behavior prediction, thereby accurately scoring candidate interests in the subsequent interest path search process, and thus improving the reliability of recommended interest evolution path selection and the overall effect of user interest modeling.

[0151] In S400, the selected interest path and the score of each node are taken as input, and the output is a long-term interest vector or a set of vectors for downstream prediction.

[0152] Specifically, the overall score of each node in the path can be converted into a weight through softmax or normalization operations; an alternative is to use the normalized score multiplied by the time decay factor to obtain the final weight to reflect time sensitivity.

[0153] For each interest embedding, add a positional encoding to preserve temporal positional information. The positional encoding can be sine or cosine encoding, learnable embeddings, or directly use the time difference value as an additional scalar.

[0154] The weighted interest sequence is input into a self-attention network with a causal mask to ensure that any position can only access interest information that is temporally earlier or equal to it, thereby maintaining the directionality of evolution during fusion; an alternative implementation is self-attention based on local windows, which only interacts within a fixed window size to reduce computational cost.

[0155] Finally, by fusing through weighted averaging or attention pooling, a single pooled vector can be output as a long-term interest representation, or a serialized multi-scale representation can be output for subsequent cross-attention or multi-head interaction.

[0156] For subsequent recommendation or matching stages, the original text of each node in the path can be retained to generate interpretable evidence, or the embedding of each node can be cached for reuse across requests.

[0157] It is important to emphasize that, in online scenarios, to reduce latency, local recomputation can be used, where the fusion of the k nearest nodes is recalculated only when a new block arrives, and the previous fusion results are cached; during offline training and evaluation, the intermediate attention weights in the fusion process are recorded for model interpretation and review.

[0158] Specifically, in some embodiments, the specific implementation of step S400 can be found in [reference needed]. Figure 4 . Figure 4 It is based on Figure 2 According to the detailed description of step S400 in the LLM user behavior modeling method shown in the corresponding embodiment, step S400 in the LLM user behavior modeling method may include the following steps: S410 employs a masked self-attention mechanism to fuse candidate interests from different action blocks, ensuring that each position can only access its interest state that precedes it in time sequence.

[0159] S420, using the target item knowledge extraction prompt template, the semantic description of the target item is extracted through the LLM and encoded into a vector.

[0160] S430, through a cross-attention layer, the semantic description vector of the target item is interacted with the candidate interests after time fusion to generate the final user interest representation.

[0161] In this embodiment, the causal fusion of interests over time is achieved through time mask self-attention, and cross-attention interaction is performed in combination with the semantic vector of the target item. This can enhance the semantic matching with the target item while maintaining the consistency of the interest evolution time sequence, thereby generating a more accurate and stable long-term user interest representation.

[0162] It should be noted that the aforementioned candidate interests refer to the interest descriptions generated by LLM based on the context of behavior blocks during the behavior sequence modeling stage, which can be represented as text or semantic vectors. The recommended interest evolution path refers to the interest sequence that best matches the continuity and effectiveness of user interests, selected from all candidate interest paths through a hierarchical tree search mechanism. The temporal fusion interest representation refers to the user's stage-specific interest vector obtained by weighted integration of candidate interests from each behavior block through a time-series-constrained attention mechanism. The target item semantic vector refers to the semantic representation vector obtained by encoding the semantic description extracted from the target item's textual information using LLM. The final user interest representation refers to the user interest vector obtained by fusing temporal evolution interests and target item semantic information, used for subsequent recommendation or prediction tasks.

[0163] In S410, a masked self-attention mechanism is used to model the interest sequence.

[0164] Specifically, in some embodiments, the specific implementation of step S410 can be found in the following embodiments. This embodiment is based on... Figure 4 According to the detailed description of step S410 in the LLM user behavior modeling method shown in the corresponding embodiment, step S410 in the LLM user behavior modeling method may include the following steps: The weighting coefficients are determined based on the path optimization results, and each candidate interest is weighted and incorporated into the position encoding.

[0165] Each candidate interest is input into a masked self-attention mechanism for feature fusion, wherein the masking mechanism restricts each position to accessing only the interest states that precede it in time sequence.

[0166] In this embodiment, by introducing weights obtained from path optimization and combining them with position encoding during the candidate interest fusion process, and then using a mask self-attention mechanism for feature fusion, the importance of high-quality interest nodes can be highlighted while maintaining the temporal causality of interest evolution, thereby improving the accuracy and stability of users' long-term interest representation.

[0167] Specifically, it can be done through Let the sequence of interest vectors be... .

[0168] For a vector sequence, we can first calculate the query vector, key vector, and value vector. , , The attention weights are then calculated, but to ensure consistency in the temporal order, a temporal mask matrix M is introduced to obtain masked attention weights. Finally, the time-fusion interest vector is obtained. .

[0169] The specific formula is as follows:

[0170]

[0171]

[0172]

[0173]

[0174]

[0175]

[0176] in, , , These are the query vector, key vector, and value vector, respectively. , , For a trainable parameter matrix, For attention weights, For the corresponding time mask matrix, This represents the interest representation obtained by fusing at the i-th action block position.

[0177] After multiple behavior blocks are fused, the interest vector Hn of the last time step can be used as the base vector for the user's long-term interest representation.

[0178] In S420, during recommendation or behavior prediction tasks, the semantic matching relationship between user interests and target items needs to be considered. In one embodiment, a preset target item knowledge extraction prompt template guides the LLM to extract item semantic information. The LLM generates a semantic description of the target item based on the prompt template, and then uses a text encoding model to encode the semantic description into a vector, obtaining the target item semantic vector. In a practical system, the target item semantic vector can be pre-calculated and stored offline to reduce online computational overhead.

[0179] In S430, a cross-attention mechanism is used to fuse user interest representations with target items to further enhance the correlation between user interest representations and target items.

[0180] Specifically, the semantic vector of the target item can be used as the query vector. Using time-fused interest sequences as keys Sum Then calculate the cross-attention weights. Ultimately, user interest representations are obtained. .

[0181] The specific formula is as follows:

[0182]

[0183]

[0184]

[0185]

[0186] Where U is the final generated user interest vector. For cross-attention weights, Interest value, For interest keys, This is the query vector.

[0187] The final generated user interest vector contains both information on the evolution of the user's historical interests and semantic features of the target item.

[0188] To enable those skilled in the art to better understand the technical solution of this application, an example of user interest modeling and product click-through rate prediction in an e-commerce recommendation system is used for illustration. In this prediction task, the system generates a long-term user interest representation by performing hierarchical modeling and interest evolution analysis of user historical behavior, which is then used for subsequent recommendation ranking or behavior prediction.

[0189] First, the system acquires user behavior sequence data on the platform, including records of actions such as browsing products, clicking on products, adding items to the shopping cart, and purchasing products, and sorts these data according to the chronological order of the actions. Since user behavior sequences typically span a long period, directly inputting them into the LLM model can be limited by the context window. Therefore, the system first divides the user behavior sequence into multiple behavior blocks according to a preset time window. Each behavior block contains a set of actions that occurred within the same time interval, thus forming a behavior block sequence. This approach reduces the sequence length of a single input model while maintaining the chronological order, thereby alleviating the problem of the LLM's limited context window.

[0190] Subsequently, interest extraction is performed on each behavior block. The system constructs a cascading modeling cue template containing historical interests, current behavior, and current interest, and uses LLM to process the behavior blocks one by one. When processing the t-th behavior block, the candidate interests generated by the (t-1)-th behavior block are used as historical interests and input into the LLM along with the behavior information of the current behavior block. The cue template guides the model to generate multiple candidate interests, thereby realizing the gradual updating of interest information in the time dimension.

[0191] After obtaining the candidate interests for each behavior block, the system constructs an interest tree structure for path search. Specifically, a set of candidate interests corresponding to each behavior block is used as a layer node in the interest tree, with the root node corresponding to the interest node of the earliest behavior block. For each parent node, the system uses a Best-of-N sampling strategy to generate multiple child nodes, each child node corresponding to a candidate interest, thus forming multiple possible interest evolution paths.

[0192] To select the most reasonable interest evolution path from multiple paths, the system introduces a continuous scoring model and a validity scoring model to evaluate candidate interests. The continuous scoring model is used to assess the rationality of interest evolution over time, while the validity scoring model is used to assess the contribution of interests to future behavior prediction. To train these scoring models, the system first constructs a scoring dataset. Specifically, the candidate interests generated from the t-th behavior block are matched with the actual behaviors from the (t+1)-th behavior block, and various evaluation prompt templates are used to guide LLM prediction of the probability that a behavior item matches a candidate interest, thus obtaining a probability set. Based on the probability set, the discriminative performance of the candidate interests on the evaluation data is calculated to obtain the current AUC value.

[0193] Subsequently, the current AUC value is compared with the top K historical AUC values ​​corresponding to the historical interests. If the current AUC value is higher than the historical AUC value, the candidate interest is marked as a continuous positive sample; otherwise, it is marked as a continuous negative sample, thus constructing a continuous scoring dataset. Simultaneously, the current AUC value is compared with the baseline AUC value. If the current AUC value is greater than the baseline AUC value, the candidate interest is marked as a validity positive sample; otherwise, it is marked as a validity negative sample, thus constructing a validity scoring dataset. Based on these datasets, both the continuous scoring model and the validity scoring model are trained.

[0194] During the interest tree search process, the system uses a continuous scoring model and a validity scoring model to score candidate interests, and obtains a comprehensive score for each node through weighted fusion. At each layer, the interest node with the highest comprehensive score is selected and added to the path set, serving as the parent node for the next layer, continuing to expand until the traversal is complete, thus obtaining the recommended interest evolution path.

[0195] After obtaining the recommended interest path, the system performs time-aware fusion on the candidate interests within the path. First, the weight of each interest node is determined based on the node's comprehensive score, and the interest vector is weighted while incorporating positional encoding to represent the order of interests in the time series. Subsequently, the interest vector sequence is input into a masked self-attention network for feature fusion. The masking mechanism restricts the current interest node to accessing only previously occurring interest states in the time sequence, thereby preserving the causal relationship of interest evolution.

[0196] After obtaining the temporally fused interest representation, the system further incorporates semantic information about the target item. Specifically, using a pre-defined target item knowledge extraction prompt template, the LLM is guided to extract semantic features from the product title, category, and description information, and encodes the semantic description into a target item vector. Subsequently, a cross-attention mechanism is used to allow the target item semantic vector to interact with the user interest representation, thereby generating the final user interest representation. This interest representation includes both user historical behavior evolution information and target item semantic features, and can be used for subsequent recommendation ranking or click-through rate prediction tasks.

[0197] In the above embodiments, behavior block partitioning alleviates the LLM context window limitation, and cascaded interest generation and hierarchical tree search are combined to realize dynamic evolution modeling of user interests. At the same time, a continuous scoring model and an effectiveness scoring model based on the AUC index are introduced to objectively evaluate candidate interests, thereby obtaining the evolution path of recommended interests. Furthermore, time-aware mask attention and target item semantic cross-fusion are used to generate long-term user interest representations, enabling the system to simultaneously capture the interest evolution law and the semantic matching relationship of goods, thereby significantly improving the accuracy of user interest modeling and recommendation prediction performance.

[0198] The following will combine Figure 5 This manual provides a detailed introduction to the LLM user behavior modeling apparatus provided. It should be noted that... Figure 5 The LLM user behavior modeling apparatus shown is used to perform the functions described in this specification. Figures 1-4 The methods of the embodiments shown are illustrated only in connection with this specification for ease of explanation. For specific technical details not disclosed, please refer to this specification. Figures 1-4 The example shown.

[0199] Please see Figure 5 This diagram illustrates the structure of the LLM user behavior modeling device described in this specification. The LLM user behavior modeling device 500 can be implemented as all or part of a user terminal through software, hardware, or a combination of both. According to some embodiments, the LLM user behavior modeling device 500 includes a dynamic partitioning module 510, a cascaded modeling module 520, a path optimization module 530, and a weighted fusion module 540.

[0200] The dynamic partitioning module 510 is used to dynamically partition the user's behavior sequence data into multiple behavior blocks according to time, thereby obtaining a behavior block sequence; the cascade modeling module 520 is used to perform context cascade modeling on each behavior block in the behavior block sequence using LLM, and incrementally extract multiple candidate interests generated by each behavior block; the path optimization module 530 is used to optimize the path of the candidate interests generated by each behavior block in the behavior block sequence based on a hierarchical tree search mechanism, thereby obtaining a recommended interest evolution path; and the weighted fusion module 540 is used to perform time-aware weighted fusion on the candidate interests in the recommended interest evolution path, thereby generating a long-term interest representation for the user.

[0201] Optionally, the cascaded modeling module 520 specifically includes: a cascaded modeling submodule, used to construct a cascaded modeling prompt template containing historical interests, current behavior, and current interest, wherein the current interest is a candidate interest of the current behavior block, the current behavior is the behavior corresponding to the current behavior block, and the historical interest is a candidate interest of the previous behavior block adjacent to the current behavior block, wherein the historical interest serves as context input and together with the current behavior serves as input to the current behavior block; and an incremental extraction submodule, used to guide the LLM through the cascaded modeling prompt template to incrementally extract multiple candidate interests generated for each behavior block.

[0202] Optionally, the path optimization module 530 specifically includes: a behavior block abstraction submodule, used to abstract the behavior sequence into an interest tree based on a hierarchical tree search mechanism, where each layer of the interest tree corresponds to a behavior block; a child node generation submodule, used to generate multiple child nodes for each parent node in the interest tree using a Best-of-N sampling mechanism, where each child node corresponds to a candidate interest of the current behavior block; a comprehensive scoring submodule, used to comprehensively score each candidate interest using a pre-trained continuous scoring model and an effectiveness scoring model to obtain a node comprehensive score; and a node traversal submodule, used to select the child node with the highest node comprehensive score in each layer as a recommended interest node and add it to the path set, and continue to expand as the parent node of the next layer until the traversal is completed, thus obtaining the recommended interest evolution path.

[0203] Optionally, the comprehensive scoring submodule specifically includes: a continuity scoring unit, used to calculate the continuity score of the candidate interest using the continuity scoring model; an effectiveness scoring unit, used to calculate the effectiveness score of the candidate interest using the effectiveness scoring model; and a node comprehensive scoring unit, used to obtain a node comprehensive score including weight coefficients based on the continuity score and the effectiveness score through a weighted fusion method.

[0204] Optionally, the apparatus further includes: an information gain module, configured to match the candidate interest generated by the t-th behavior block with the behavior item of the (t+1)-th behavior block, evaluate the information gain of the candidate interest on subsequent behavior prediction, and construct a continuous rating dataset and a validity rating dataset; a first training module, configured to train the continuous rating model based on the continuous rating dataset, wherein the continuous rating model is a binary classification model; and a second training module, configured to train the validity rating model based on the validity rating dataset, wherein the validity rating model is a binary classification model.

[0205] Optionally, the information gain module specifically includes: a matching and alignment submodule, used to match and align the candidate interest generated by the t-th behavior block with the behavior item of the (t+1)-th behavior block; a probability set submodule, used to call multiple preset evaluation prompt templates to guide the LLM, predict the confidence level of the behavior item matching the candidate interest from different perspectives, and obtain a probability set, the probability set containing multiple confidence probabilities; a performance quantization submodule, used to calculate the average discriminative performance of the candidate interest on the evaluation set according to the probability set, and quantify to obtain the current AUC value, the current AUC value being the AUC value of the candidate interest generated by the t-th behavior block; a first construction submodule, used to compare the previous K historical AUC values ​​with the current AUC value to construct a continuous scoring dataset, the previous K historical AUC values ​​corresponding to the previous K historical interests; and a second construction submodule, used to compare the baseline AUC value with the current AUC value to construct a validity scoring dataset, the baseline AUC value being calculated only based on the original interaction data of the current behavior block.

[0206] Optionally, the first construction submodule specifically includes: a first annotation unit, used to compare the first K historical AUC values ​​with the current AUC value, and annotate the candidate interest as a first positive sample or a first negative sample; and a first construction unit, used to construct a continuous scoring dataset based on the first positive sample and the first negative sample.

[0207] Optionally, the first annotation unit specifically includes: a first positive sample annotation subunit, used to annotate the candidate interest as a first positive sample when the current AUC value is higher than the previous K historical AUC values; and a first negative sample annotation subunit, used to annotate the candidate interest as a first negative sample when the current AUC value is not higher than the previous K historical AUC values.

[0208] Optionally, the second construction submodule specifically includes: a second annotation unit, used to compare the baseline AUC value with the current AUC value and annotate the candidate interest as a second positive sample or a second negative sample; and a second construction unit, used to construct an effectiveness scoring dataset based on the second positive sample and the second negative sample.

[0209] Optionally, the second annotation unit specifically includes: a second positive sample annotation subunit, used to annotate the candidate interest as a second positive sample when the current AUC value is greater than the baseline AUC value; and a second negative sample annotation subunit, used to annotate the candidate interest as a second negative sample when the current AUC value is not greater than the baseline AUC value.

[0210] Optionally, the weighted fusion module 540 includes: a masked attention submodule, used to fuse candidate interests of different behavior blocks using a masked self-attention mechanism, so that each position can only access its interest state before its time sequence; a vector encoding submodule, used to extract prompt templates using target item knowledge, extract semantic descriptions of target items through the LLM and encode them into vectors; and a cross-attention submodule, used to interact the semantic description vector of the target item with the temporally fused candidate interests through a cross-attention layer to generate the final user interest representation.

[0211] It should be noted that the LLM user behavior modeling device provided in the above embodiments is only illustrated by the division of the above functional modules when executing the LLM user behavior modeling method. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the LLM user behavior modeling device and the LLM user behavior modeling method embodiments provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments, which will not be repeated here.

[0212] The serial numbers in this specification are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0213] In this specification, block-based cascading generation and hierarchical tree search optimization, combined with time-aware weighted fusion, are used to improve the accuracy and predictive effectiveness of interest evolution characterization of long-term user behavior, and to mitigate the impact of LLM context window limitations on modeling.

[0214] This specification also provides a computer storage medium capable of storing multiple instructions adapted to be loaded and executed by a processor as described above. Figures 1-4 The LLM user behavior modeling method described in the illustrated embodiment can be found in the following documentation for its specific execution process. Figures 1-4 The specific details of the illustrated embodiments will not be elaborated here.

[0215] This specification also provides a computer program product that stores at least one instruction, said at least one instruction being loaded and executed by the processor as described above. Figures 1-4The LLM user behavior modeling method described in the illustrated embodiment can be found in the following documentation for its specific execution process. Figures 1-4 The specific details of the illustrated embodiments will not be elaborated here.

[0216] Please refer to Figure 6 This diagram illustrates a structural block diagram of an electronic device provided in an exemplary embodiment of this specification. The electronic device in this specification may include one or more components such as a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected via the bus 150.

[0217] Processor 110 may include one or more processing cores. Processor 110 connects to various parts of the electronic device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 120, and by calling data stored in memory 120. Optionally, processor 110 may be implemented using at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). Processor 110 may integrate one or more of a central processing unit (CPU), graphics processing unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 110 and may be implemented separately using a communication chip.

[0218] The memory 120 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 120 may include a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described below, etc. The operating system may be the Android system, including systems deeply developed based on the Android system, the iOS system developed by Apple Inc., including systems deeply developed based on the iOS system, or other systems. The data storage area may also store data created by the electronic device during use, such as phonebook data, audio and video data, chat log data, etc.

[0219] See Figure 7 As shown, the memory 120 can be divided into operating system space and user space. The operating system runs in the operating system space, while native and third-party applications run in the user space. To ensure that different third-party applications can achieve good running performance, the operating system allocates corresponding system resources for each application. However, different application scenarios within the same third-party application have different requirements for system resources. For example, in local resource loading scenarios, third-party applications have high requirements for disk read speed; in animation rendering scenarios, third-party applications have high requirements for GPU performance. Since the operating system and third-party applications are independent of each other, the operating system often cannot promptly perceive the current application scenario of a third-party application, resulting in the operating system's inability to adapt system resources accordingly to the specific application scenario of the third-party application.

[0220] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to establish data communication between the third-party applications and the operating system. This would allow the operating system to obtain the current scenario information of the third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0221] Taking the Android operating system as an example, the programs and data stored in memory 120 are as follows: Figure 8As shown, the memory 120 can store the Linux kernel layer 320, the system runtime library layer 340, the application framework layer 360, and the application layer 380. The Linux kernel layer 320, system runtime library layer 340, and application framework layer 360 belong to the operating system space, while the application layer 380 belongs to the user space. The Linux kernel layer 320 provides low-level drivers for various hardware components of the electronic device, such as display drivers, audio drivers, camera drivers, Bluetooth drivers, Wi-Fi drivers, and power management. The system runtime library layer 340 provides support for key features of the Android system through several C / C++ libraries. For example, the SQLite library provides database support, the OpenGL / ES library provides 3D graphics support, and the Webkit library provides browser kernel support. The system runtime library layer 340 also provides the Android runtime library, which mainly provides core libraries that allow developers to write Android applications using the Java language. The Application Framework Layer 360 provides various APIs that may be used when building applications. Developers can also use these APIs to build their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. At least one application runs in the Application Layer 380. These applications can be native applications that come with the operating system, such as contacts, SMS, clock, and camera apps; or third-party applications developed by third-party developers, such as games, instant messaging, and photo editing apps.

[0222] Taking the operating system as an example (iOS), the programs and data stored in memory 120 are as follows: Figure 9As shown, the iOS system includes: Core OS layer 420, Core Services layer 440, Media layer 460, and Cocoa Touch layer 480. Core OS layer 420 includes the operating system kernel, drivers, and low-level program frameworks. These low-level program frameworks provide hardware-level functionality for use by the program frameworks located in Core Services layer 440. Core Services layer 440 provides system services and / or program frameworks required by applications, such as Foundation framework, account framework, advertising framework, data storage framework, network connectivity framework, geolocation framework, motion framework, etc. Media layer 460 provides applications with audiovisual interfaces, such as interfaces related to graphics and images, audio technology, video technology, and wireless playback (AirPlay) interfaces. Cocoa Touch layer 480 provides various commonly used interface-related frameworks for application development and is responsible for user touch interaction on electronic devices. Examples include local notification services, remote push services, advertising frameworks, game tool frameworks, message user interface (UI) frameworks, UIKit user interface frameworks, map frameworks, and so on.

[0223] exist Figure 9 The framework shown includes, but is not limited to, the base framework in the core service layer 440 and the UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, offering the most basic system services to all applications, and is independent of the UI. The UIKit framework, on the other hand, provides a basic UI class library for creating touch-based user interfaces. iOS applications can use the UIKit framework to provide their UI, thus providing the application's infrastructure for building user interfaces, drawing, handling user interaction events, responding to gestures, and so on.

[0224] The methods and principles for implementing data communication between third-party applications and the operating system in the iOS system can be found in the Android system, and will not be repeated here.

[0225] The input device 130 is used to receive input instructions or data, and includes, but is not limited to, a keyboard, mouse, camera, microphone, or touch device. The output device 140 is used to output instructions or data, and includes, but is not limited to, a display device and a speaker. In one example, the input device 130 and the output device 140 can be combined into a touch screen, which is used to receive touch operations from the user using a finger, stylus, or any suitable object on or near it, and to display the user interface of various applications. The touch screen is usually located on the front panel of the electronic device. The touch screen can be designed as a full-screen, curved screen, or irregularly shaped screen. The touch screen can also be designed as a combination of a full-screen and a curved screen, or a combination of an irregularly shaped screen and a curved screen; this specification does not limit this.

[0226] In addition, those skilled in the art will understand that the structure of the electronic device shown in the above figures does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the electronic device may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, etc., which will not be described in detail here.

[0227] In this specification, the entity executing each step can be the electronic device described above. Optionally, the entity executing each step can be the operating system of the electronic device. The operating system can be Android, iOS, or other operating systems; this specification does not limit this.

[0228] The electronic device described in this manual may also be equipped with a display device. This display device can be any device capable of displaying information, such as a cathode ray tube display (CR), a light-emitting diode display (LED), an e-ink screen, a liquid crystal display (LCD), or a plasma display panel (PDP). Users can use the display device on electronic device 101 to view displayed text, images, videos, and other information. The electronic device may be a smartphone, tablet, gaming device, AR (Augmented Reality) device, automobile, data storage device, audio playback device, video playback device, laptop, desktop computing device, or wearable device such as an electronic watch, electronic glasses, electronic helmet, electronic bracelet, electronic necklace, or electronic clothing.

[0229] exist Figure 6 In the illustrated electronic device, which can be a terminal, the processor 110 can be used to call the network optimization application stored in the memory 120 and specifically perform the following operations: User behavior sequence data is dynamically divided into multiple behavior blocks according to time to obtain a behavior block sequence. LLM is used to perform context cascading modeling on each behavior block in the behavior block sequence, and multiple candidate interests generated by each behavior block are extracted incrementally. The candidate interests generated by each behavior block in the behavior block sequence are optimized based on a hierarchical tree search mechanism to obtain a recommended interest evolution path. The candidate interests in the recommended interest evolution path are fused with time-aware weighted fusion to generate a long-term interest representation of the user.

[0230] In one embodiment, when the processor 110 performs context-cascaded modeling of each behavior block in the behavior block sequence using the LLM and incrementally extracts multiple candidate interests generated by each behavior block, it specifically performs the following operations: constructing a cascaded modeling cue template containing historical interests, current behavior, and current interest, wherein the current interest is a candidate interest of the current behavior block, the current behavior is the behavior corresponding to the current behavior block, and the historical interest is a candidate interest of the previous behavior block adjacent to the current behavior block, and the historical interest serves as context input and together with the current behavior serves as input to the current behavior block; and guiding the LLM through the cascaded modeling cue template to incrementally extract multiple candidate interests generated by each behavior block.

[0231] In one embodiment, when the processor 110 performs path optimization on the candidate interests generated for each behavior block in the behavior block sequence based on the hierarchical tree search mechanism to obtain the recommended interest evolution path, it specifically performs the following operations: Based on the hierarchical tree search mechanism, the behavior sequence is abstracted into an interest tree according to each behavior block, and each layer of the interest tree corresponds to a behavior block; for the parent node of each layer in the interest tree, multiple child nodes are generated using the Best-of-N sampling mechanism, and each child node corresponds to a candidate interest of the current behavior block; each candidate interest is comprehensively scored using a pre-trained continuity scoring model and effectiveness scoring model to obtain a node comprehensive score; in each layer, the child node with the highest node comprehensive score is selected as the recommended interest node and added to the path set, and continues to expand as the parent node of the next layer until the traversal is completed, thus obtaining the recommended interest evolution path.

[0232] In one embodiment, when the processor 110 performs the comprehensive scoring of each candidate interest using a pre-trained continuity scoring model and an effectiveness scoring model to obtain a node comprehensive score, it specifically performs the following operations: calculates the continuity score of the candidate interest using the continuity scoring model; calculates the effectiveness score of the candidate interest using the effectiveness scoring model; and obtains a node comprehensive score including weight coefficients based on the continuity score and the effectiveness score through a weighted fusion method.

[0233] In one embodiment, the processor 110 further performs the following operations: matching the candidate interests generated by the t-th behavior block with the behavior items of the (t+1)-th behavior block, evaluating the information gain of the candidate interests for subsequent behavior prediction, and constructing a continuous scoring dataset and a validity scoring dataset; training the continuous scoring model based on the continuous scoring dataset, wherein the continuous scoring model is a binary classification model; and training the validity scoring model based on the validity scoring dataset, wherein the validity scoring model is a binary classification model.

[0234] In one embodiment, when the processor 110 performs the steps of matching the candidate interest generated from the t-th behavior block with the behavior item of the (t+1)-th behavior block, evaluating the information gain of the candidate interest for subsequent behavior prediction, and constructing a continuous scoring dataset and a validity scoring dataset, the processor 110 specifically performs the following operations: matching and aligning the candidate interest generated from the t-th behavior block with the behavior item of the (t+1)-th behavior block; calling multiple preset evaluation prompt templates to guide the LLM, predicting the confidence level of the behavior item matching the candidate interest from different perspectives, and obtaining a probability set, the probability set containing multiple confidence probabilities; calculating the average discriminative performance of the candidate interest on the evaluation set based on the probability set, quantifying it to obtain the current AUC value, the current AUC value being the AUC value of the candidate interest generated from the t-th behavior block; comparing the previous K historical AUC values ​​with the current AUC value to construct a continuous scoring dataset, the previous K historical AUC values ​​corresponding to the previous K historical interests; comparing the baseline AUC value with the current AUC value to construct a validity scoring dataset, the baseline AUC value being calculated only based on the original interaction data of the current behavior block.

[0235] In one embodiment, when the processor 110 performs the operation of comparing the first K historical AUC values ​​with the current AUC value to construct a continuous rating dataset, it specifically performs the following operations: comparing the first K historical AUC values ​​with the current AUC value, labeling the candidate interest as a first positive sample or a first negative sample; and constructing a continuous rating dataset based on the first positive sample and the first negative sample.

[0236] In one embodiment, when the processor 110 performs the comparison of the previous K historical AUC values ​​with the current AUC value and labels the candidate interest as a first positive sample or a first negative sample, it specifically performs the following operations: if the current AUC value is higher than the previous K historical AUC values, the candidate interest is labeled as a first positive sample; if the current AUC value is not higher than the previous K historical AUC values, the candidate interest is labeled as a first negative sample.

[0237] In one embodiment, when the processor 110 performs the operation of comparing the baseline AUC value with the current AUC value to construct a validity score dataset, it specifically performs the following operations: comparing the baseline AUC value with the current AUC value, labeling the candidate interest as a second positive sample or a second negative sample; and constructing a validity score dataset based on the second positive sample and the second negative sample.

[0238] In one embodiment, when the processor 110 performs the operation of comparing the baseline AUC value with the current AUC value and labeling the candidate interest as a second positive sample or a second negative sample, it specifically performs the following operations: if the current AUC value is greater than the baseline AUC value, the candidate interest is labeled as a second positive sample; if the current AUC value is not greater than the baseline AUC value, the candidate interest is labeled as a second negative sample.

[0239] In one embodiment, when the processor 110 performs time-aware weighted fusion of candidate interests in the recommended interest evolution path to generate a long-term interest representation for the user, it specifically performs the following operations: A masked self-attention mechanism is used to fuse candidate interests from different action blocks, so that each position can only access its interest state that precedes it in time sequence; Using the target item knowledge extraction prompt template, the semantic description of the target item is extracted and encoded into a vector through the LLM; By using a cross-attention layer, the semantic description vector of the target item is interacted with the temporally fused candidate interests to generate the final user interest representation.

[0240] In this specification, block-based cascading generation and hierarchical tree search optimization, combined with time-aware weighted fusion, are used to improve the accuracy and predictive effectiveness of interest evolution characterization of long-term user behavior, and to mitigate the impact of LLM context window limitations on modeling.

[0241] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0242] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the object characteristics, interactive behavior characteristics, and user information involved in this specification were all obtained under full authorization.

[0243] The above-disclosed embodiments are merely preferred embodiments of this specification and should not be construed as limiting the scope of this specification. Therefore, any equivalent variations made in accordance with the claims of this specification shall still fall within the scope of this specification.

Claims

1. A method of LLM user behavior modeling, characterized by, The method includes: The user's behavior sequence data is dynamically divided into multiple behavior blocks according to time, resulting in a behavior block sequence; LLM is used to perform context concatenation modeling on each behavior block in the behavior block sequence, and multiple candidate interests generated by each behavior block are extracted incrementally. Based on the hierarchical tree search mechanism, the candidate interests generated by each behavior block in the behavior block sequence are optimized to obtain the recommended interest evolution path. The candidate interests in the recommended interest evolution path are fused using time-aware weighted fusion to generate a long-term interest representation for the user.

2. The method according to claim 1, characterized in that, The step of using the LLM to perform context concatenation modeling on each behavior block in the behavior block sequence and incrementally extracting multiple candidate interests generated for each behavior block specifically includes: Construct a cascading modeling prompt template that includes historical interests, current behavior, and current interest. The current interest is a candidate interest of the current behavior block, the current behavior is the behavior corresponding to the current behavior block, and the historical interest is a candidate interest of the previous behavior block adjacent to the current behavior block. The historical interest is used as context input and together with the current behavior, it is used as input to the current behavior block. The cascaded modeling prompt template guides the LLM to incrementally extract multiple candidate interests generated for each behavior block.

3. The method according to claim 1, characterized in that, The path optimization of candidate interests generated from each behavior block in the behavior block sequence based on the hierarchical tree search mechanism to obtain the recommended interest evolution path specifically includes: Based on the hierarchical tree search mechanism, the behavior sequence is abstracted into an interest tree according to each behavior block, and each level of the interest tree corresponds to a behavior block; For each parent node in the interest tree, a Best-of-N sampling mechanism is used to generate multiple child nodes, and each child node corresponds to a candidate interest of the current behavior block; The pre-trained continuous scoring model and effectiveness scoring model are used to comprehensively score each candidate interest to obtain the node comprehensive score; In each layer, the child node with the highest comprehensive score is selected as the recommended interest node and added to the path set. This child node then serves as the parent node for the next layer, and the process continues until the traversal is complete, thus obtaining the recommended interest evolution path.

4. The method according to claim 3, characterized in that, The process of using a pre-trained continuous scoring model and an effectiveness scoring model to comprehensively score each candidate interest, thereby obtaining a node comprehensive score, specifically includes: The continuity score of the candidate interest is calculated using the continuity scoring model. The validity score of the candidate interest is calculated using the validity scoring model. The node comprehensive score, which includes weight coefficients, is obtained by weighted fusion of the continuity score and the validity score.

5. The method according to claim 3, characterized in that, The method further includes: The candidate interests generated by the t-th behavior block are matched with the behavior items of the (t+1)-th behavior block, and the information gain of the candidate interests on the prediction of subsequent behaviors is evaluated to construct a continuous scoring dataset and an effectiveness scoring dataset. The continuous scoring model is trained based on the continuous scoring dataset, and the continuous scoring model is a binary classification model. The validity scoring model is trained based on the validity scoring dataset, and the validity scoring model is a binary classification model.

6. The method according to claim 5, characterized in that, The process of matching the candidate interests generated from the t-th behavior block with the behavior items of the (t+1)-th behavior block, evaluating the information gain of the candidate interests for subsequent behavior prediction, and constructing a continuous scoring dataset and a validity scoring dataset specifically includes: Match and align the candidate interests generated by the t-th behavior block with the behavior items of the (t+1)-th behavior block; The LLM is guided by calling multiple preset evaluation prompt templates to predict the confidence level of the behavior item in meeting the candidate interest from different perspectives, and a probability set is obtained, which contains multiple confidence level probabilities. Based on the probability set, the average discrimination performance of the candidate interest on the evaluation set is calculated, and the current AUC value is quantified. The current AUC value is the AUC value of the candidate interest generated by the t-th behavior block. The current AUC value is compared with the previous K historical AUC values ​​to construct a continuous rating dataset, and the previous K historical AUC values ​​correspond to the previous K historical interests. The baseline AUC value is compared with the current AUC value to construct an effectiveness score dataset. The baseline AUC value is calculated based solely on the original interaction data of the current behavior block.

7. The method according to claim 6, characterized in that, The step of comparing the previous K historical AUC values ​​with the current AUC value to construct a continuous scoring dataset specifically includes: Compare the previous K historical AUC values ​​with the current AUC value, and label the candidate interest as the first positive sample or the first negative sample; A continuous scoring dataset is constructed based on the first positive sample and the first negative sample.

8. The method according to claim 7, characterized in that, The step of comparing the previous K historical AUC values ​​with the current AUC value and labeling the candidate interest as the first positive sample or the first negative sample specifically includes: If the current AUC value is higher than the previous K historical AUC values, the candidate interest is labeled as the first positive sample; If the current AUC value is not higher than the previous K historical AUC values, the candidate interest is labeled as the first negative sample.

9. The method according to claim 6, characterized in that, The step of comparing the baseline AUC value with the current AUC value to construct a validity score dataset specifically includes: By comparing the baseline AUC value with the current AUC value, the candidate interest is labeled as a second positive sample or a second negative sample. A validity score dataset is constructed based on the second positive sample and the second negative sample.

10. The method according to claim 9, characterized in that, The step of comparing the baseline AUC value with the current AUC value and labeling the candidate interest as a second positive sample or a second negative sample specifically includes: If the current AUC value is greater than the baseline AUC value, the candidate interest is labeled as a second positive sample; If the current AUC value is not greater than the baseline AUC value, the candidate interest is labeled as a second negative sample.

11. The method according to claim 1, characterized in that, The step of performing time-aware weighted fusion of candidate interests in the recommended interest evolution path to generate a user's long-term interest representation includes: A masked self-attention mechanism is used to fuse candidate interests from different action blocks, so that each position can only access its interest state that precedes it in time sequence; Using the target item knowledge extraction prompt template, the semantic description of the target item is extracted and encoded into a vector through the LLM; By using a cross-attention layer, the semantic description vector of the target item is interacted with the temporally fused candidate interests to generate the final user interest representation.

12. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the method steps as claimed in any one of claims 1 to 11.

13. A computer program product, characterized in that, The computer program product stores at least one instruction, which is loaded by a processor and executed as a method step as claimed in any one of claims 1 to 11.

14. An electronic device, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 11.

15. An LLM user behavior modeling device, characterized in that, The device includes: The dynamic partitioning module is used to dynamically divide the user's behavior sequence data into multiple behavior blocks according to time, resulting in a behavior block sequence. The cascaded modeling module is used to perform context cascaded modeling on each behavior block in the behavior block sequence using LLM, and incrementally extract multiple candidate interests generated by each behavior block. The path optimization module is used to optimize the candidate interests generated by each behavior block in the behavior block sequence based on the hierarchical tree search mechanism to obtain the recommended interest evolution path. The weighted fusion module is used to perform time-aware weighted fusion of candidate interests in the recommended interest evolution path to generate a long-term interest representation for the user.