Hierarchical calibration optimization method and system for user memory
Patent Information
- Application Number
- CN202611520483.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]现有层次记忆的利用体系虽可实现分层记忆的检索与复用,但整体技术方案存在固有缺陷,核心体现为层次记忆的利用模式单一、调控能力缺失
1、本申请提出的用户记忆的层次化校准优化方法,首先,基于层次记忆构造记忆完整视图和记忆粗视图;然后,获取记忆完整视图所对应的完整视图对数概率和记忆粗视图所对应的粗视图对数概率,并将完整视图对数概率减去按自适应系数加权的粗视图对数概率,获取校准分数;最后将校准分数最高的候选词作为校准优化结果。该方法在保留完整层次记忆的前提下,分级、自适应地调节各层(尤其粗粒度)记忆对生成的影响强度,从而抑制过强先验,放大关键证据,对用户记忆进行层次化校准优化,提升了回答的具体性与正确性。
Smart Images

Figure CN123012135A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of long-term memory technology for intelligent agents, and specifically to a hierarchical calibration and optimization method and system for user memory. Background Technology
[0002] Hierarchical memory is a layered structured memory architecture adapted to large-scale model and long-text tasks. It can retain multi-level semantic information and is widely used in AI scenarios such as intelligent question answering, knowledge base retrieval, and literature and industry data analysis.
[0003] While existing hierarchical memory utilization systems can achieve the retrieval and reuse of hierarchical memories, the overall technical solutions have inherent defects, primarily manifested in the single utilization mode and lack of control capabilities. All current mainstream technical solutions treat recalled multi-level hierarchical memories as passive context, achieving only a single function of "memory filtering." That is, they can only control which level and content of memory information enters the context, failing to differentiate and adaptively control the influence intensity of memories of different granularities injected into the context. Coarse-grained and fine-grained memory information are indiscriminately "consumed" and used by the model.
[0004] This technical model directly leads to two core problems: First, the global prior interference of coarse-grained memory is uncontrollable. Although high-level global summaries can provide basic global background information, they can create excessively strong and unconstrained prior guidance, causing the model to generate content that is too general and superficial, failing to focus on fine-grained key evidence. This easily results in problems such as empty content, missing details, and semantic deviation, severely diluting the core guiding role of precise fine-grained evidence in the generated results. Second, there is a lack of a hierarchical dynamic control mechanism. Existing technologies cannot suppress coarse-grained redundant priors and amplify high-value fine-grained key evidence as needed based on query task type, reasoning difficulty, and semantic requirements. They also cannot achieve dynamic adaptation of multi-level memory weights, resulting in the hierarchical structure advantage of hierarchical memory not being fully utilized. This significantly reduces the accuracy, professionalism, and relevance of the content generated by large models, making it difficult to meet the usage requirements of high-precision knowledge question answering, refined reasoning, and professional document parsing.
[0005] Therefore, there is an urgent need to propose a hierarchical calibration and optimization method for user memory in order to solve the problems existing in the current technology when utilizing hierarchical memory. Summary of the Invention
[0006] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a hierarchical calibration optimization method and system for user memory, which solves at least one or more of the aforementioned technical problems.
[0007] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: Firstly, this application proposes a hierarchical calibration optimization method for user memory, the method comprising: Based on hierarchical memory, construct a complete memory view and a coarse memory view; In the current decoding step, obtain the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view; The calibration score is obtained by subtracting the coarse view log probability weighted by the adaptive coefficient from the full view log probability. The candidate word with the highest calibration score in the current decoding step is taken as the calibration optimization result.
[0008] In one embodiment, constructing a complete memory view and a coarse memory view based on hierarchical memory includes: Based on hierarchical memory, a complete memory view and a coarse memory view are constructed using the same pre-trained large language model and cue word splicing technology.
[0009] In one embodiment, obtaining the adaptive coefficient includes calculating it using the following formula: in, This indicates the calibration strength that adapts to each decoding step; Indicates the base strength A bounded monotonic mapping for parameters; This indicates that the complete view is more definitive than the coarse view; Entropy represents the probability distribution; This represents the probability distribution of the next word when the memory coarse view is used as a condition; This represents the probability distribution of the next word when the complete view of memory is assumed. V represents the candidate word "token" in the vocabulary; V represents the vocabulary. Represents the natural exponential function; Represents the logarithmic probability of the complete view; This represents the logarithmic probability of the coarse view.
[0010] Preferably, the bounded monotonic mapping includes a hyperbolic tangent modulation form, which can be expressed by the formula: in, These are the preset base strength parameters; The preset modulation amplitude parameter; These are the preset smoothing parameters.
[0011] In one embodiment, the method for constructing the hierarchical memory includes: The original memory is divided into multiple layers based on multiple granularities; The newly introduced user interactions are extracted into candidate memories for the corresponding layers according to the multi-layer architecture. The candidate memories are floated up when they meet the evidence gating, and an evidence ledger is maintained for the candidate memories that float up to the higher layers. The credibility of each memory is calculated based on the aforementioned evidence ledger, and conflicts are resolved. By comparing the stated credibility with a preset credibility maintenance threshold, a bidirectional hierarchical shift is performed on the memory to obtain the final hierarchical memory.
[0012] In one embodiment, the multilayer includes: The context layer stores the original user interactions; The semantic layer stores cross-context facts and patterns derived from the context layer; The preference layer stores stable preferences and user profiles that are further distilled from the semantic layer.
[0013] In one embodiment, the step of extracting newly introduced user interactions as candidate memories for corresponding layers according to a multi-layered architecture includes: Candidate cross-context facts, patterns, and preferences are extracted from original user interactions based on large language models or text clustering.
[0014] In one embodiment, the floating of candidate memories when they satisfy evidence gating includes: The condition for the upward floating of candidate cross-context facts and rules is: when the number of sources that corroborate the candidate cross-context facts and rules in mutually independent sources reaches the first threshold, the candidate cross-context facts and rules float to the semantic layer; The conditions for the upward floating of candidate preferences are as follows: when the number of sources that confirm the candidate preference among mutually independent sources reaches the second threshold, and the candidate preference tends to be consistent in direction and the intensity exceeds the third threshold, the candidate preference floats up to the preference layer. The second threshold is greater than or equal to the first threshold.
[0015] In one embodiment, the confidence level is calculated according to the following formula: in, This indicates the credibility of cross-scenario facts, patterns, or stable preferences after the upward movement; Indicates the temporality weight of evidence e; Let e be the time e is from the current time; T is the preset time scale. The preset decay factor is denoted by c; c represents any candidate memory. , Let represent the supporting evidence set and the opposing evidence set for candidate memory c, respectively.
[0016] Secondly, this application also proposes a hierarchical calibration optimization system for user memory, the system comprising: The memory view building module is configured to construct a complete memory view and a coarse memory view based on hierarchical memory. The view probability acquisition module is configured to acquire the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view in the current decoding step; The calibration score acquisition module is configured to subtract the coarse view log probability weighted by adaptive coefficients from the full view log probability to obtain the calibration score; The calibration optimization result generation module is configured to take the candidate word with the highest calibration score in the current decoding step as the calibration optimization result.
[0017] (III) Beneficial Effects This invention provides a hierarchical calibration optimization method and system for user memory. Compared with existing technologies, it has the following advantages: 1. The hierarchical calibration and optimization method for user memory proposed in this application first constructs a complete memory view and a coarse memory view based on hierarchical memory. Then, it obtains the log probability of the complete view corresponding to the complete memory view and the log probability of the coarse view corresponding to the coarse memory view, and subtracts the log probability of the coarse view weighted by an adaptive coefficient from the log probability of the complete view to obtain a calibration score. Finally, the candidate word with the highest calibration score is taken as the calibration and optimization result. This method, while preserving the complete hierarchical memory, hierarchically and adaptively adjusts the influence strength of each layer (especially the coarse-grained) of memory on the generation, thereby suppressing excessive priors, amplifying key evidence, and performing hierarchical calibration and optimization of user memory, thus improving the specificity and correctness of the answer.
[0018] 2. The hierarchical calibration and optimization method for user memory proposed in this application is compatible with all hierarchical memory systems on the market. It can be used directly without modifying the original memory retrieval and construction logic. It has strong adaptability, better robustness, and low implementation cost.
[0019] 3. The hierarchical calibration optimization method for user memory proposed in this application sets adaptive changes in calibration intensity, which can automatically match different candidate words (between words) and different types of questions (between questions), avoiding the disadvantage of fixed intensity and outputting more accurate answers.
[0020] 4. The hierarchical memory construction method of this application ensures that high-level knowledge only accepts content supported by sufficient independent evidence, its reliability can be quantified and ranked, and it can be revised or even downgraded and reverted with new evidence. This suppresses noise intrusion, avoids profile drift during long-term and multi-conversation use, and maintains the long-term reliability, traceability, and auditability of the memory. The hierarchical memory constructed by this method has a cleaner memory bank and does not deviate from the established path in long-term chats; casual remarks and outdated information cannot be mixed into long-term user profiles, greatly reducing profile decay; there are complete evidence records, each preference can be traced, and the reliability can be intuitively judged; contradictory information can be automatically downgraded and corrected; after long-term and multi-round conversations, the accuracy of user habit recognition is much higher than that of old solutions. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of the hierarchical calibration optimization method for user memory in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the hierarchical memory construction in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.
[0025] By storing a user's historical memories on a system or platform in multiple tiers based on coarse-to-medium detail, confidence level, and timeliness, rather than piling up all the original chat texts together, the user's memory develops a hierarchical structure, known as hierarchical memory. However, when retrieving and using these memories, it's necessary to select them based on the actual needs, such as the type of question asked by the user and the semantic requirements, rather than simply providing answers based on past impressions. For example: In the use of long-term companion-type intelligent assistants and multi-conversation dialogue systems, the intelligent agent accumulates user memory over several months and hundreds of conversations. When answering questions such as "What was the name of the restaurant that was recommended last time?", it needs to be based on the exact name in the specific conversation, rather than giving a broad guess based on the user profile. In intelligent customer service and after-sales service systems, user (customer) memory includes long-term tags (such as "enterprise customer, prefers online communication") and original records of historical work orders. When responding to specific disputes, orders, and repair progress, it is necessary to accurately cite the processing result of a particular work order to avoid generating templated responses based on customer tags. Enterprise knowledge base Q&A and industry literature analysis: The knowledge base is organized in layers of "overall review - chapter summary - original text paragraph". When answering questions about specific clauses, parameters, and data, it is necessary to suppress the "overview-style" tendency brought about by the review layer and make the answer fall on the specific expression of the original text. In health management and medical follow-up assistance scenarios, users' memories include long-term health records (such as "high blood pressure") and specific values from a single examination. When answering questions such as "the blood pressure value at the last follow-up examination", the exact value must be output, rather than a general description of the record impression. In personalized recommendation and content generation scenarios, the system simultaneously holds a user's long-term preference profile and the immediate needs explicitly expressed in the current conversation. When the two are inconsistent (e.g., a long-term preference for business style but a current explicit request for casual style), the long-term prior needs should be suppressed and the current evidence should be prioritized as needed. In smart office and meeting assistant scenarios, office memory includes a summary of the entire project's progress and the original minutes of each meeting. When answering questions such as "who was responsible for this matter at the last meeting," it is necessary to focus on the specific resolutions of the specific meeting, rather than a general statement at the project summary level.
[0026] It should be noted that the hierarchical calibration and optimization technology for user memory proposed in this application is applicable to various application scenarios, including but not limited to the aforementioned scenarios such as long-term companionship intelligent assistants, multi-conversation intelligent customer service, enterprise knowledge bases and industry literature Q&A, health management and medical follow-up assistance, personalized recommendations and content generation, and intelligent office and meeting assistants. To facilitate the explanation of the technical solution of this application, the following embodiments will use personalized recommendations and content generation as an example to illustrate the implementation process of the technical solution of this application in detail. However, this example of a specific application scenario is not intended to limit the scope of protection of this application.
[0027] Example 1: Firstly, this invention proposes a hierarchical calibration optimization method for user memory, see [link to relevant documentation]. Figure 1 The method includes: S1. Construct a complete memory view and a coarse memory view based on hierarchical memory; S2. In the current decoding step, obtain the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view; S3. Subtract the coarse view log probability weighted by the adaptive coefficient from the complete view log probability to obtain the calibration score; S4. Take the candidate word with the highest calibration score in the current decoding step as the calibration optimization result.
[0028] The hierarchical calibration and optimization method for user memory proposed in this embodiment automatically suppresses the interference of general old impressions while preserving complete hierarchical memory. It prioritizes the specific details of the current dialogue, resulting in more specific and accurate output content that avoids generalities and provides answers that are more relevant to the current question and are not vague.
[0029] The following is in conjunction with the appendix Figure 1 The implementation process of an embodiment of the present invention will be explained in detail through the explanation of the specific steps S1-S4.
[0030] S1. Construct a complete memory view and a coarse memory view based on hierarchical memory.
[0031] This step, assuming the user-level memory already exists, performs operations on each decoding step during the decoding phase to construct a complete memory view and a coarse memory view. There are many existing mature technologies for generating hierarchical memories, including but not limited to: RAPTOR (Recursive Abstract Active Processing for Tree-Organized Retrieval), MemoryOS (Hierarchical Memory Operating System), GraphRAG (Graph-Based Retrieval-Augmented Generation), etc. However, the specific method for generating user-level memories is not the focus of this embodiment, and its specific generation steps will not be elaborated here.
[0032] Based on the aforementioned mature technologies, user-level memory structures can generally be categorized into coarse-, medium-, and fine-grained types: 1) Low-level context: This refers to contextual memory, the most detailed and complete original event, stored round by round in the form of timestamped dialogue transcripts, preserving complete dialogue details and tone. For example, a contextual memory might be: [2026-06-14, 21:37, Conversation #58]. Agent: "How was your stay on this business trip?"; User: "I stayed at Hotel L in District N in City M this time, and I really liked it." This record includes the exact time of the conversation, the corresponding conversation number, and the original words spoken by both parties.
[0033] 2) Mid-level semantics: This refers to semantic memory, which is the cross-contextual facts and patterns summarized and extracted from multiple contextual memories, no longer retaining the original text and details of any single dialogue. For example, related to the aforementioned low-level context, semantic memory could be: "Users frequently travel to City M for business trips"; or: "Users are quite concerned about their accommodation experience during business trips and usually actively provide feedback after checking in." Compared to the low-level context, semantic memory has omitted the original words, exact time, and details of a single event, retaining only regular conclusions at the level of "frequently" and "usually." Compared to high-level profiles, semantic memory is still bound to specific themes or scenarios (such as business trips and accommodation), with a narrower scope of conclusions, and has not yet been condensed into long-term user conclusions across scenarios.
[0034] 3) High-level profiles (high-level preferences, high-level summaries, user profiles): These refer to preference memory, highly condensed long-term conclusions, such as user preference profiles, stable summaries, and coarse-grained summaries, without any specific time, location, or details of individual events. For example, "Users frequently travel for business and prefer to stay in chain business hotels."
[0035] In one embodiment, a complete view of memory is constructed using the same pre-trained large language model, based on hierarchical memory. (Including basic context, mid-level semantics, and high-level profile) and a rough memory map (Portraits of high-ranking officials only).
[0036] The pre-trained large language model refers to a large language model that has been trained and can be directly used for text generation, such as the GPT series, Llama series (e.g., Llama3.1-8B-Instruct), and Qwen series (e.g., Qwen3-8B). It should be noted that the method in this application is executed during the inference (decoding) phase, and the parameters of the pre-trained large language model remain fixed throughout the execution process. No additional training or fine-tuning is required for this method; this is commonly referred to in the industry as model "frozen" usage. In other words, the method in this application is training-independent and can be directly applied to any existing pre-trained large language model.
[0037] A pre-trained large language model is used to construct a complete memory view and a coarse memory view. A mature prompt concatenation technique in the field of large language models is employed: the user query and the memory content selected from hierarchical memory are concatenated according to a preset prompt template to form a memory condition input; this memory condition input is then fed into the pre-trained large language model for forward computation, and the model outputs the probability distribution of the next word conditioned on this input. Based on this, two memory condition views are constructed: Memory full view The input is the memory conditions obtained by combining the three layers of memory content (lower-level context, middle-level semantics, and higher-level profile) to be recalled with the user's query. Memory coarse view : A memory condition input obtained by splicing only the recalled high-level portrait layer memory content with the user query.
[0038] The two views are constructed using the same model and the same query, and only the included memory levels are different.
[0039] S2. At the current decoding step, obtain the full-view log probability corresponding to the memory full view and the coarse-view log probability corresponding to the memory coarse view.
[0040] At the current decoding step t, the next-word full-view log probability is obtained based on the two memory condition views respectively and the coarse-view log probability , where denotes the candidate token in the vocabulary.
[0041] In one embodiment, an autoregressive large language model is used to calculate the next-word probability, and one forward calculation is performed for each of the two views (the two forward passes are independent of each other and can be executed in parallel), so as to obtain the respective next-word probability distributions of the two views. Specifically: At the current decoding step t, the memory condition view and the generated prefix (i.e., the word sequence output up to the current step) are input into the pre-trained large language model together. The model outputs the score of each candidate word in the vocabulary through one forward calculation, and then obtains the log probability of each candidate word in the vocabulary through log-softmax.
[0042] Accordingly, the above calculation is performed with the memory full view and the memory coarse view as conditions to obtain the full-view log probability and the coarse-view log probability, which are expressed by the formula as: where denotes the scoring function of the pre-trained large language model with fixed parameters; y<t denotes the prefix word sequence generated up to the current decoding step t, and the two views share the same prefix; and respectively denote the log probability of the candidate word v in the vocabulary when the memory full view and the memory coarse view are taken as conditions; v denotes the candidate token in the vocabulary.
[0043] S3. Subtract the coarse-view log probability weighted by the adaptive coefficient from the full-view log probability to obtain the calibration score.
[0044] Sometimes, when calibrating and generating candidate words from the user's memory in the current decoding step, there are multiple candidate words (e.g., candidate words). and Furthermore, since all these candidate words appear in the full view, without calibration, simply comparing the scores of the full views of multiple candidate words might result in broad or even incorrect answers. Therefore, calibration is necessary.
[0045] In one embodiment, at the current decoding step, for different candidate words, the calibration score is obtained by subtracting the coarse view log probability weighted by adaptive coefficients from the complete view log probability of that candidate word. This process can be expressed by the formula: in, This represents the calibration score, which is the score of the candidate word after calibration based on the probability difference following two model inferences. This represents the candidate word "token" in the vocabulary list. This represents the calibration strength that adapts to each decoding step, i.e., the adaptive weighting coefficient for the logarithmic probability of the coarse view.
[0046] For example, in one level of memory, the high-level profile is "the user frequently travels for business and prefers to stay in chain business hotels." A detailed record of the original text includes the sentence, "This time I stayed at Hotel L on the outskirts of District N in City M, and I really liked it." The user then asks, "Where did I stay last time in City M?" This examines the crucial decoding step of generating the "location name."
[0047] For candidate words The "Business Hotel" received a score of 8.0 for the complete view. Since the high-rise portrait is also included in the input for the complete view, this preconceived notion also applies to the complete view, resulting in a relatively high score. However, its score based solely on impression (high-rise portrait) is very high, deducting items... After calibration, .
[0048] For candidate words "L Hotel," with a full view score of 7.6; it's hardly a word that comes to mind, so a score based solely on impression is very low, resulting in a deduction of only a few points. After calibration .
[0049] Analysis of the above results shows that, before calibration, when comparing the scores of the complete view, "business hotel" scores higher (8.0 vs. 7.6). Without calibration, the model would give a broad or even incorrect answer such as "it should be the type of business hotel you usually stay in." However, after calibration, comparing the calibration scores... and Therefore, "L Hotel" is significantly larger than "Business Hotel" with a score of 6.0 compared to 2.4, which provides a more specific answer based on concrete facts.
[0050] Therefore, a high coarse logarithmic probability for a word indicates that it sounds pleasant and will result in a higher deduction of points; the base score for a word... The large number indicates that its support goes beyond what impressions can explain, has solid evidence, and is closer to real memory. Therefore, calibration is needed when there are multiple candidate words.
[0051] Furthermore, within the same response, different candidate words require different levels of subtraction of the coarse view log probability, and the level of subtraction required also varies across different question types. Therefore, it is necessary to set an adaptive calibration strength for each decoding step to avoid a fixed subtraction strength that could lead to inconsistencies.
[0052] In one embodiment, calibration intensity The step-by-step decoding adapts to the entropy difference between the complete view and the coarse view, which can be expressed by the formula: in, For the base strength It is a bounded monotonic mapping of parameters, that is, the more definite the complete view is relative to the coarse view (i.e., The larger the value, the stronger the calibration; conversely, the smaller the value, the weaker the calibration, and the calibration strength is limited to a preset range to avoid over-calibration. This represents the probability distribution of the next word in the vocabulary at the current decoding step, conditioned on the complete view of memory. It is obtained by exponentially restoring the logarithmic probability of the complete view. , This represents the probability distribution of the next word when the coarse view of memory is used as a condition. .
[0053] Entropy represents the probability distribution: Here, V represents the vocabulary (lexicon set), used to measure the uncertainty of the distribution: the more concentrated the distribution is on a few candidate words (the more certain the model is about the next word), the lower the entropy; the flatter the distribution (the more hesitant the model), the higher the entropy. Correspondingly, the entropy difference... Measure the difference in uncertainty between the coarse view and the complete view: The larger the value, the more certain the complete view is relative to the coarse view, supported by fine-grained evidence, and the stronger the calibration should be applied.
[0054] In one embodiment, Hyperbolic tangent (tanh) modulation is used: in, is a preset base intensity parameter, i.e., the neutral calibration intensity when the entropy difference is zero (the two views have comparable certainty); is a preset modulation amplitude parameter, 0<λ<1, which determines the amplitude of the calibration intensity fluctuating up and down around the base intensity, and ensures is bounded, ; is a preset smoothing parameter, , determines the sensitivity to changes in the entropy difference; tanh(·) is the hyperbolic tangent function, with a value range of (-1, 1), which ensures varies with monotonically increasing. For example, when λ=0.5 and =2, monotonically varies with the entropy difference between 0.5· and 1.5· : when the complete view is significantly more certain, the calibration is enhanced to a maximum of 1.5 times the base intensity; when the complete view is not more certain, the calibration is weakened to a minimum of 0.5 times the base intensity; when the entropy difference is zero, the base intensity is maintained.
[0055] It can be understood that is not limited to the above form, any mapping that satisfies boundedness and is non-decreasing monotonically with the entropy difference, for example, a sigmoid function mapping (σ(·) is the sigmoid function), a truncated linear mapping, etc., can all be used as the specific implementation form, and other embodiments of the present application do not limit the specific function form of .
[0056] It should be noted that the adaptive change of the calibration intensity can output more accurate answers for different candidate words (between characters) and different types of questions (between questions).
[0057] In the same answer, different characters require different intensities. When outputting core answer words (such as hotel names, dates, numbers), it is necessary to strongly exclude preconceived notions; when writing connecting words such as "of", "because", "furthermore" or preparatory sentences, the two views are almost the same, and no intervention is required.
[0058] The intensity required to answer different types of questions also varies. Detail-oriented questions: the answer cannot be accurately given only by the portrait (the coarse view is hesitant with high entropy), while the complete view has a clear answer (certain with low entropy), is large — this is exactly the moment when the impression is most likely to backfire, is automatically increased. Generalized questions: such as "What is my overall travel preference?", at this time the high-level portrait itself is the correct source of the answer, and the complete view is not more certain than the coarse view, , Automatically reduce the size to avoid accidentally damaging useful global background information.
[0059] therefore, The adaptive adjustment can be summarized as follows: before each word is written, the model automatically checks whether "the specific evidence here is significantly more certain than the general impression". If it is certain, more points are deducted for the influence of the impression; if it is not certain, fewer points are deducted.
[0060] In terms of effectiveness, the calibration intensity is automatically matched between "words" and "questions", avoiding the problem of inconsistent application of a fixed intensity.
[0061] It should be noted that because of the adaptive calculation method for calibration intensity, specific parameter tuning is not required in engineering. Furthermore, if a fixed calibration coefficient is used, suitable values need to be manually selected from a series of candidate values through multiple trials for each pre-trained large language model and each type of application data: coefficients that are too small will result in insufficient calibration, while coefficients that are too large will excessively suppress coarse-grained memory, significantly reducing the generation quality; moreover, the selected values cannot be universally applied across models or data, requiring re-selection after changing the model or data, leading to high implementation costs. In this embodiment, the calibration intensity... The entropy difference between the two views is automatically calculated in each decoding step according to the above mapping, without any manual selection process. Experiments show that the generation quality achieved by the adaptively calculated calibration strength is comparable to that obtained by manually selecting the optimal fixed coefficients one by one.
[0062] S4. Take the candidate word with the highest calibration score in the current decoding step as the calibration optimization result.
[0063] Based on the calibration score for each candidate word in step S3, the candidate word with the highest calibration score is selected as the hierarchical calibration optimization result of the user's memory. That is, the candidate word is the result of the system or platform's personalized recommendation to the user when the user asks a question to the system or platform (e.g., an intelligent agent).
[0064] This completes the entire process of the hierarchical calibration optimization method for user memory in this embodiment and its preferred embodiment.
[0065] It should be noted that the hierarchical calibration optimization method for user memory proposed in the above embodiments and their preferred embodiments reflects the generation tendency induced only by high-level coarse-grained memory (i.e., coarse-grained prior) under the condition of coarse view alone; from the distribution of the complete view, according to By subtracting this reference item, the effect of excessively strong coarse-grained priors and relatively amplified fine-grained evidence can be targeted to weaken the complete hierarchy, making the candidate words generated by calibration more realistic and accurate.
[0066] To illustrate the superiority of the hierarchical calibration optimization method for user memory proposed in this embodiment, specific experimental data will be used to explain it below.
[0067] 1) A comparative experiment using calibrated / uncalibrated user hierarchical memory.
[0068] The user hierarchical memory calibrated and optimized by the method of Example 1 and its preferred embodiment, and the user memory without calibration and optimization were simultaneously applied to different models (5 open source LLMs), and the comparison results are shown in Table 1 below.
[0069] Table 1. Comparison of calibrated / uncalibrated user memory in different models. As shown in Table 1, under the two long-term memory QA benchmarks, compared with the uncalibrated optimized full hierarchical baseline (Full), the user hierarchical memory (HiR) precisely optimized in this application improved the performance of all five open-source LLM models on LoCoMo, with an average improvement of about 4.1 F1 (F1 score); on LongMemEval-s, the five open-source LLMs improved by an average of 1.4.
[0070] In Table 1, LoCoMoFull represents the LoCoMo dataset + full context input (memoryless retrieval, complete context); LoCoMoHiR represents the LoCoMo dataset + high recall memory retrieval architecture; LMEFull represents the LongMemEval dataset + full context baseline; and LMEHiR represents the LongMemEval dataset + high recall memory retrieval architecture.
[0071] Furthermore, replacing BM25 (a traditional keyword retrieval algorithm without neural networks) or BGE-M3 (an open-source neural network embedding model for semantic vector retrieval) or rearranging the retrieval backend, HiR improved by 3.8–5.8 points compared to the baseline under the same conditions in every case; even switching to the native hierarchy of the dataset still resulted in a 1.1-point improvement. Adaptive It approaches the optimal value without needing to search for parameters.
[0072] This demonstrates that the calibrated and optimized user-level memory exhibits better robustness when used on the user side.
[0073] Example 2: Existing solutions for building memory systems based on similarity ladders and constructing hierarchical memories by merging and refining underlying content without barriers have three main drawbacks: First, unconditional abstraction and summarization will equally weight noise such as slips of the tongue, irony, jokes, one-off statements, and outdated information into high-level profiles or user profiles (e.g., profiles distilled from all scenarios using Bi-Mem), thus polluting high-level knowledge; second, there is a lack of credibility evaluation criteria, making it impossible to distinguish between stable knowledge and occasional expressions, and impossible to assess and rank the reliability of knowledge; third, it does not support conflict handling, version management, and hierarchical downgrading, and cannot revert to correct previous high-level conclusions when new evidence overturns them, leading to gradual drift and distortion of user profiles and knowledge summaries over long-term use.
[0074] To address this issue, this embodiment proposes an evidence-gated derived memory (EDM) construction method to construct the hierarchical memory used in step S1 of embodiment 1 above.
[0075] For details, see Figure 2 Evidence-gated fractal derived memory construction methods include: S11. Divide the original memory into multiple layers based on multiple granularities; S12. The newly introduced user interactions are extracted into candidate memories of the corresponding layers according to the multi-layer architecture. The candidate memories are floated up when the evidence gating is satisfied, and an evidence ledger is maintained for the candidate memories that float up to the higher layers. S13. Calculate the credibility of each memory based on the evidence ledger and resolve conflicts; S14. Compare the credibility with the preset credibility maintenance threshold, perform bidirectional hierarchical movement on the memory, and obtain the final hierarchical memory.
[0076] The following is in conjunction with the appendix Figure 2 The implementation process of this embodiment and its preferred embodiment will be explained in detail, along with the explanation of the specific steps in S11-S14.
[0077] S11. Based on multiple granularities, the original memory is divided into multiple layers.
[0078] This step divides the original user memories in the system or platform (such as an intelligent agent) into three layers: contextual layer (L0), semantic layer (L1), and preference layer (L2). It should be noted that this three-layer division is not an artificial categorization of existing memory content, but rather is automatically determined by computable admission criteria in the construction process of this method: the layer a memory belongs to depends on its derivation depth and evidentiary status, as detailed below: Context Layer (L0): Stores raw user interactions. For example, multiple rounds of raw user interactions are recorded as "Go hiking on Saturday", "Go hiking while on a business trip", and "Let's go hiking again this weekend", representing three independent sessions; The admission criterion for Layer L0 is as follows: all new user interactions are directly written into this layer in the original, timestamped dialogue format, without any processing or filtering. For example: [2026-03-07, 20:11, Conversation #12] User: "Went hiking on Saturday, had a lot of fun." Semantic layer (L1): Stores cross-context facts and patterns derived from the context layer, i.e., declarative conclusions at the "frequent" or "usual" level summarized from multiple contextual memories, without retaining any original text or details of a single conversation. For example: "Users often go hiking on weekends" (summarized from hiking and trekking records in multiple independent conversations); The admission criteria for L1 layer are: candidate patterns must be automatically extracted from the scenario layer by the candidate extraction algorithm, and only when the number of mutually independent sources of corroboration reaches a certain threshold can they be written into this layer.
[0079] Preference Layer (L2): Stores stable preferences and user profiles further distilled from the semantic layer, represented by structured tuples (preference item, preference content, tendency direction, tendency strength, evidence count, timeliness), without any details of individual events. For example, the L2 preference layer obtained from the L1 semantic layer distillation is: "(activity type, outdoor hiking, positive, high, 3, last 30 days)"; where the first three fields of this tuple describe the preference itself, and the last three fields are a summary of its evidence ledger, in the following order: Preference Item (Activity Type): The category dimension to which this preference belongs, i.e., what aspect the preference is about; Preference Content (Outdoor Hiking): The specific objects of user preferences under this dimension; Tendency direction (positive "+"): The user's attitude towards the object. A positive value indicates liking or actively choosing it, while a negative value indicates dislike or avoidance. Tendency Strength (High): The credibility of this preference, mapped from credibility C to high, medium, and low in intervals; Number of evidence (3): The number of mutually independent sources of corroboration N supporting this preference; Timeliness (last 30 days): The time range since the last time the preference was supported by evidence, used to indicate its freshness.
[0080] The admission criteria for L2 layer are: candidate preferences must be generated by semantic layer aggregation distillation, and their support strength in the semantic layer must reach the third threshold τ, and the tendency direction of each supporting evidence must be consistent, before they can be written into L2 layer.
[0081] It should be noted that the admission criteria for each of the three layers are all automatically executable algorithmic conditions—whether the original text is written directly, whether the number of supporting sources meets the standard, and whether the support strength and tendency direction meet the standard. The layer classification is objectively determined by the construction process and does not require manual judgment.
[0082] S12. The newly introduced user interactions are extracted into candidate memories for the corresponding layers according to the multi-layer architecture. The candidate memories are floated up when they meet the evidence gating, and an evidence ledger is maintained for the candidate memories that float up to the higher layers.
[0083] For the newly introduced user interactions, according to the above multi-layer architecture, user interactions are extracted into high-level candidate memories corresponding to each layer, including: candidate cross-contextual facts and patterns, and candidate preferences. This application does not limit the specific implementation method of candidate extraction.
[0084] In one embodiment, candidate cross-context facts and patterns, and candidate preferences are continuously extracted from user interactions using either LLM or clustering, or a combination of both. Specifically: Extraction based on a pre-trained large language model: Whenever a new user interaction is written into the context layer, or at a preset period (such as at the end of each session), the newly added context memory and the existing context memory related to its content, together with the preset prompt template, are input into the pre-trained large language model. The model then summarizes and outputs candidate cross-context facts and rules (represented by declarative sentences, such as "users often go hiking outdoors on weekends") and candidate preferences (preference items, preferred content, and inclination direction).
[0085] Extraction based on text clustering: Calculate semantic vectors for each context memory, cluster contexts with similar semantics into a cluster, and then summarize multiple contexts within the same cluster into candidate cross-context facts and patterns and candidate preferences (the summarization can be done by a language model or a preset template).
[0086] Regardless of the method used, each candidate must be labeled with the contextual memory source identifier (such as session number and timestamp) on which it is based, as the basis for subsequent statistics on the number of independent corroborating sources and maintenance of the evidence ledger.
[0087] Candidate cross-scenario facts and patterns, as well as candidate preferences, are not directly written into the upper layer; they must pass evidence gating verification before being moved to the next layer. Specifically: The criteria for the upward floating of candidate cross-context facts and rules are as follows: count the number of sources that corroborate the candidate cross-context facts and rules in mutually independent sources (not the same repeated conversation, time period, or topic context). If the number of sources reaches the first threshold k1, then it floats to the semantic layer, and the candidate cross-context facts and rules become the updated cross-context facts and rules.
[0088] The conditions for the upward floating of candidate preferences are as follows: count the number of sources that confirm the candidate preference in mutually independent sources (not the same repeated conversation, time period, or topic context). If the number of sources reaches the second threshold k2, and the preferences (L1→L2) polarity is consistent (i.e. the direction of tendency is consistent) and the intensity exceeds the third threshold τ, then the candidate preference floats up to the preference layer, and the candidate preference becomes the updated stable preference / profile.
[0089] In this context, consistency of polarity (or consistency of tendency direction) means that all evidence supporting the candidate preference reflects the same user attitude direction; that is, all of them are either positive (like, active choice) or all are negative (dislike, avoidance), and there are no contradictory expressions. If the tendency direction is inconsistent, it indicates that the preference is not yet stable and will not be considered for consideration, but will remain in the candidate state to accumulate evidence.
[0090] In a preferred embodiment, each upper-level node maintains an evidence ledger: supporting evidence sets and opposing evidence sets, and a source identifier and timestamp for each evidence record.
[0091] The following example illustrates the process of determining the upward shift of candidate cross-contextual facts and patterns and candidate preferences: For any candidate memory c (i.e., candidate cross-context facts and patterns or candidate preferences), let its evidence set be E(c)={e_1,…,e_n}. Each piece of evidence e records its source identifier s(e) and timestamp t(e). The evidence of candidate preferences also records the direction of preference d(e), where d(e) can be positive or negative.
[0092] Number of independent sources for evidence e: N(c) is the number of distinct independent sources in the evidence set. When two pieces of evidence have different source identifiers (such as different session numbers) and the time interval reaches a preset interval (such as 12 hours), they are considered to be independent sources; multiple repeated statements within the same session are counted as the same source.
[0093] Memory support strength (time-proximal weighted): .
[0094] in, The time e is the distance from the current time; T is the preset time scale (e.g., T=30 days); The preset attenuation factor is 0 < <1. That is, the newer the evidence, the closer its contribution is to 1, and the older the evidence, the smaller its contribution is.
[0095] The conditions for upward floating are as follows: The conditions for candidate cross-context facts and rules r to float to the semantic layer are: N(r)≥k1; The conditions for candidate preferences p to float to the preference layer are: N(p)≥k2, the direction of each piece of evidence is consistent, and S(p)≥τ are satisfied simultaneously.
[0096] When the conditions for upward movement are met, an evidence ledger (supporting evidence sets and recording the source identifiers and timestamps of each piece of evidence) is simultaneously established for that memory, for use in subsequent credibility calculations and conflict resolution. The time-proximity decay mechanism here uses the same mechanism as the credibility calculation in S13 later, and S13 further incorporates opposing evidence on this basis.
[0097] For example, in one embodiment, k1=3, k2=3, τ=2.0, λ=0.9, and T=30 days. The candidate preference "(activity type, outdoor hiking, positive)" has three pieces of evidence: "going hiking on Saturday," "hiking while on a business trip," and "hiking again this weekend," each from a different session, i.e., N=3≥k2=3 (mutually independent sources reach the second threshold k2); the times of the three different sessions are 5 days ago, 20 days ago, and 40 days ago, and the direction of the preference is positive; the support strength S≈0.9^(5 / 30)+0.9^(20 / 30)+0.9^(40 / 30)≈0.98+0.93+0.87=2.78≥τ=2.0. All three conditions are met, and the candidate preference is moved to the preference layer. Here, 0.9^(5 / 30) represents the sixth root of 0.9, and the other terms are analogous.
[0098] Thresholds k1, k2, and τ are preset parameters, determined by the following principles: k1 and k2 determine the minimum number of independent corroborations required for upward movement; larger values result in more conservative upward movement and more stable high-level memory, but slower updates. Typically, k1 can be set to 2-5 (e.g., k1=3), and k2≥k1 (the preference layer is the highest layer, with stricter admission criteria). τ determines the equivalent amount of fresh evidence required for upward movement, which can be set in conjunction with attenuation parameters; for example, τ can be 0.6-0.8 times k2. These thresholds can also be calibrated and selected on labeled validation data, using the accuracy and stability of high-level memory as indicators. This application does not limit the specific values of each threshold.
[0099] S13. Calculate the credibility of each memory based on the evidence ledger and resolve conflicts.
[0100] Each high-level memory comes with its own evidence ledger: supporting evidence set or opposing evidence set, recording the source identifier and timestamp of each piece of evidence, and calculating the credibility of each high-level memory. The newer the high-level memory and the more times it has been verified, the higher the credibility score.
[0101] Each higher-level memory (cross-contextual facts and patterns or stable preferences) that rises to the surface is continuously maintained by its evidence ledger. The evidence ledger includes supporting sets of evidence. With opposing evidence set New evidence in the same direction as this memory is included. New evidence that contradicts this memory (such as expressions that show the opposite trend or statements that deny the pattern) is included. .
[0102] In one embodiment, the reliability of the higher-level memory after surfacing is calculated using the following formula: in, This indicates the credibility of higher-level memories (cross-contextual facts and patterns or stable preferences) after they have surfaced. The time-relevance weight of evidence e is as follows: the newer the evidence, the closer the weight is to 1; the older the evidence, the smaller the weight is.
[0103] As can be seen from this formula, credibility is the difference between the time-proximity weighted corroboration of the supporting and opposing sides: each item represents the time probabilities of the evidence, and the corroboration is reflected by accumulating them one by one from independent sources. Therefore, the support strength in step S12, the credibility of this step, and conflict resolution all use the same time-proximity attenuation mechanism, which is the application of the same quantity at different stages.
[0104] In a preferred embodiment, to reflect the diversity of sources and prevent the accumulation of repeated statements from the same source, only the one with the highest proximity weight among multiple pieces of evidence from the same source is counted.
[0105] When new evidence conflicts with existing high-level memories, conflict resolution is carried out. The conflict resolution process involves adding the new evidence to the set of opposing evidence for that memory. The credibility C is then recalculated using the formula above. Since each piece of evidence is weighted by its proximity and accumulated based on independent sources, this recalculation achieves a weighted resolution based on "proximity × corroboration": the side with more recent and multi-source corroboration naturally receives greater weight. After resolution, the retention and hierarchy of the memory are determined according to the threshold rule in step S14.
[0106] S14. Compare the credibility with the preset credibility maintenance threshold, perform bidirectional hierarchical movement on the memory, and obtain the final hierarchical memory.
[0107] If the credibility of a memory remains above a threshold, it is maintained or continues to rise. However, when a large amount of new, contradictory evidence emerges, and the accumulation of opposing evidence causes the credibility to fall below the maintenance threshold, the higher-level memory conclusion should automatically be downgraded and reverted to a lower level (e.g., L2 stable preference is downgraded to L1 provisional rule), and version records should be retained for backtracking. Each piece of knowledge that rises carries a pointer to its supporting evidence, supporting the above calculations, downgrading, and auditing.
[0108] In one embodiment, a credibility maintenance threshold is set. With the flip condition ( If the value is less than the floating threshold τ, a hysteresis interval is formed, preventing the memory from repeatedly rising and falling around the threshold. 1) Maintain: At that time, the memory remains in the current layer, and its tendency strength field is updated with C (e.g., mapped to high, medium, and low according to the interval where C is located); 2) Sinking: When memory is downgraded from the current layer: stable preferences are downgraded from the preference layer to provisional rules at the semantic layer, and rules are moved back to the candidate state from the semantic layer; version records are retained during downgrade, including the downgrade time and the snapshot of the evidence ledger at that time, for backtracking; 3) Flip: If the opposing evidence itself meets the floating conditions of step S12 (number of independent sources, consistent bias direction, and support strength all meet the criteria), then a new stable preference is generated in the opposite bias direction and written into the preference layer, and the original memory is stored as a historical version and marked as replaced.
[0109] In addition, each high-level memory stores a traceability pointer that points to the original contextual text (conversation number and round) corresponding to each piece of evidence in its evidence ledger, so that any high-level conclusion can be traced back to the specific original dialogue, supporting the above calculations, downgrades, and audits.
[0110] For example, according to the S12 example (λ=0.9, T=30 days, τ=2.0, and θ1=1.0): After the preference "(activity type, outdoor hiking, positive, high, 3, ...)" has risen for about three months, the three supporting pieces of evidence are 95, 110, and 130 days ago, respectively, and the weighted average of the supporting side is approximately 0.72+0.68+0.63=2.03; during this period, the user stated in two different conversations that "my knees have been bothering me lately, and I don't want to go hiking" (3 days and 10 days ago, respectively), and these two pieces of opposing evidence are included. The opposing side's score is approximately 0.99 + 0.97 = 1.96; the credibility C ≈ 2.03 - 1.96 = 0.07 < θ1. This preference is downgraded to a provisional semantic layer rule, and version records are retained. Subsequently, if opposing evidence continues to accumulate and meets the upward floating condition, it is written to the preference layer in a flipped format: "(Activity Type, Outdoor Hiking, Negative, ...)". Thus, the user profile is updated as the evidence evolves, no longer becoming rigid and distorted.
[0111] The following example illustrates the evidence-gated fractal derived memory construction method of this embodiment: L0 scenario: Multiple rounds of recording "Going hiking on Saturday", "Going hiking on a business trip", "Let's go hiking again this weekend", 3 independent conversations; L1 semantic pattern: The statement "Users often hike outdoors on weekends" was confirmed by 3 sources and thus rose to the top. The evidence ledger is: 3 in support and 0 against. L2 preference: distilled from L1 preference: activity, outdoor hiking, +, high, 3, last 30 days).
[0112] Months later, the user repeatedly stated that "my knees have been bothering me lately and I don't want to go hiking." The evidence against this accumulated over time, causing the intensity of the preference to reverse / decline and settle to L1 (provisional) and remain in the version—the profile was no longer rigid and distorted.
[0113] It should be noted that this embodiment constructs long-term memory as a credibility ladder, still setting three knowledge types: context, semantics, and preference. However, the criteria for determining who can float up, how to represent, and how to move are the strength of evidence, rather than similarity as in the prior art.
[0114] To illustrate the superiority of the user-level memory construction method proposed in this embodiment, specific experimental data will be used for explanation below.
[0115] 1) A comparative experiment on constructing user-level memory using different methods.
[0116] The user hierarchical memory (EDM) constructed by the method of Embodiment 2 and its preferred embodiments of this application, and the user hierarchical memory (EDM+HiR) constructed by the method of Embodiment 2 and its preferred embodiments of this application and calibrated and optimized by the method of Embodiment 1 and its preferred embodiments of this application, are compared with the user hierarchical memory constructed by the existing hierarchical memory construction method. The comparison results are shown in Table 2 below.
[0117] Table 2 Comparison of long-term memory QA (Qwen 3.5-9B, standard decoding) constructed using different methods As shown in Table 2, for long-term memory QA (answering questions based on long-term memory), using Qwen 3.5-9B and standard decoding, comparing EDM with three baselines—Flat (no hierarchy), Summary-Hier (route one), and Cascade (route two, Bi-Mem unconditional distillation)—hierarchical memory showed a significant improvement, with EDM+HiR showing an even more significant improvement. Here, LoCoMoF1 represents the F1 score measured on the LoCoMo dataset; LongMemEvalAcc represents the accuracy measured on the LongMemEval dataset.
[0118] 2) Comparative experiment on the anti-interference of different methods for constructing user-level memory.
[0119] When constructing user-level memories using the method of Embodiment 2 and its preferred embodiments of this application, as well as when constructing user-level memories using existing hierarchical memory construction methods, interfering factors (such as resistance / irony / outdated statements, etc.) are injected. Then, the degree of resistance to profile decay of user-level memories constructed by different methods is compared (by comparing the preference profile accuracy %). The comparison results are shown in Table 3 below.
[0120] Table 3. Anti-Portrait Deterioration (after injecting 20% resistance / irony / outdated statements) As shown in Table 3, the method for constructing user hierarchical memory (EDM) in this embodiment has superior anti-image decay ability compared with the prior art. The decline rate has been reduced from 17.7% to only 4.8%, which proves the stability of long conversations in the user hierarchical memory construction method of this embodiment. It will not interfere with the overall memory due to noise from a single user behavior. The evidence gating adopted in Embodiment 2 and its preferred implementation makes high-level knowledge more resistant to noise and drift, which is significantly better than unconditional distillation under long-term or multi-conversation settings.
[0121] Example 3: Secondly, the present invention also provides a hierarchical calibration optimization system for user memory, the system comprising: The memory view building module is configured to construct a complete memory view and a coarse memory view based on hierarchical memory. The view probability acquisition module is configured to acquire the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view in the current decoding step; The calibration score acquisition module is configured to subtract the coarse view log probability weighted by adaptive coefficients from the full view log probability to obtain the calibration score; The calibration optimization result generation module is configured to take the candidate word with the highest calibration score in the current decoding step as the calibration optimization result.
[0122] It is understood that the hierarchical calibration and optimization system for user memory provided in this embodiment of the invention corresponds to the hierarchical calibration and optimization method for user memory described above. The explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding content in the hierarchical calibration and optimization method for user memory, and will not be repeated here.
[0123] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0124] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A hierarchical calibration optimization method for user memory, characterized by, The method includes: Based on hierarchical memory, construct a complete memory view and a coarse memory view; In the current decoding step, obtain the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view; The calibration score is obtained by subtracting the coarse view log probability weighted by the adaptive coefficient from the full view log probability. The candidate word with the highest calibration score in the current decoding step is taken as the calibration optimization result.
2. The method as described in claim 1, characterized in that, The construction of a complete memory view and a coarse memory view based on hierarchical memory includes: Based on hierarchical memory, we construct a complete memory view and a coarse memory view using the same pre-trained large language model and cue word splicing technology.
3. The method as described in claim 1, characterized in that, The adaptive coefficients are obtained by calculation using the following formula: in, This indicates the calibration strength that adapts to each decoding step; Indicates the base strength A bounded monotonic mapping for parameters; This indicates that the complete view is more definitive than the coarse view; Entropy represents the probability distribution; This represents the probability distribution of the next word when the memory coarse view is used as a condition; This represents the probability distribution of the next word when the complete view of memory is assumed. V represents the candidate word "token" in the vocabulary; V represents the vocabulary. Represents the natural exponential function; Represents the logarithmic probability of the complete view; This represents the logarithmic probability of the coarse view.
4. The method as described in claim 3, characterized in that, The bounded monotonic mapping includes a hyperbolic tangent modulation form, which can be expressed by the formula: in, These are the preset base strength parameters; The preset modulation amplitude parameter; These are the preset smoothing parameters.
5. The method according to any one of claims 1-4, characterized in that, The method for constructing the hierarchical memory includes: The original memory is divided into multiple layers based on multiple granularities; The newly introduced user interactions are extracted into candidate memories for the corresponding layers according to the multi-layer architecture. The candidate memories are floated up when they meet the evidence gating, and an evidence ledger is maintained for the candidate memories that float up to the higher layers. The credibility of each memory is calculated based on the aforementioned evidence ledger, and conflicts are resolved. By comparing the stated credibility with a preset credibility maintenance threshold, a bidirectional hierarchical shift is performed on the memory to obtain the final hierarchical memory.
6. The method as described in claim 5, characterized in that, The multi-layer includes: The context layer stores the original user interactions; The semantic layer stores cross-context facts and patterns derived from the context layer; The preference layer stores stable preferences and user profiles that are further distilled from the semantic layer.
7. The method as described in claim 6, characterized in that, The step of extracting newly introduced user interactions into candidate memories for corresponding layers according to a multi-layered architecture includes: Candidate cross-context facts, patterns, and preferences are extracted from original user interactions based on large language models or text clustering.
8. The method as described in claim 6, characterized in that, The candidate memory floats up when it meets the evidence gating, including: The condition for the upward floating of candidate cross-context facts and rules is: when the number of sources that corroborate the candidate cross-context facts and rules in mutually independent sources reaches the first threshold, the candidate cross-context facts and rules float to the semantic layer; The conditions for the upward floating of candidate preferences are as follows: when the number of sources that confirm the candidate preference among mutually independent sources reaches the second threshold, and the candidate preference tends to be consistent in direction and the intensity exceeds the third threshold, the candidate preference floats up to the preference layer. The second threshold is greater than or equal to the first threshold.
9. The method as described in claim 5, characterized in that, The credibility is calculated according to the following formula: in, This indicates the credibility of cross-scenario facts, patterns, or stable preferences after the upward movement; Indicates the temporality weight of evidence e; Let e be the time e is from the current time; T is the preset time scale. The preset decay factor is denoted by c; c represents any candidate memory. , Let represent the supporting evidence set and the opposing evidence set for candidate memory c, respectively.
10. A hierarchical calibration optimization system for user memory, characterized in that, The system includes: The memory view building module is configured to construct a complete memory view and a coarse memory view based on hierarchical memory. The view probability acquisition module is configured to acquire the log probability of the complete view corresponding to the memorized complete view and the log probability of the coarse view corresponding to the memorized coarse view in the current decoding step; The calibration score acquisition module is configured to subtract the coarse view log probability weighted by adaptive coefficients from the full view log probability to obtain the calibration score; The calibration optimization result generation module is configured to take the candidate word with the highest calibration score in the current decoding step as the calibration optimization result.
