Retrieval enhancement generation parameter automatic adjustment method based on content feature modeling
By dynamically adjusting the retrieval and generation parameters based on content feature modeling, the problem that existing technical documentation systems are unable to adjust the depth of knowledge according to the user's professional level is solved, personalized content output is achieved, and user experience and efficiency are improved.
Patent Information
- Application Number
- CN202511335752.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing technical documentation systems are unable to dynamically adjust the depth of knowledge and expression form according to the user's professional level, resulting in cognitive overload for beginners or wasted time for expert users. They lack the ability to implicitly perceive the user's professional level and are unable to provide personalized technical knowledge services.
Through a method based on content feature modeling, we receive user query text for component analysis, identify professional terms and entities, combine user historical behavior, build user level scores, dynamically adjust retrieval and generation parameters, and output customized content that meets the user's cognitive level.
It achieves accurate perception of users' professional levels, dynamically optimizes document retrieval strategies and content generation, solves the problems of fragmented user experience and inefficient information transmission in traditional systems, and improves knowledge transmission efficiency and user satisfaction.
Smart Images

Figure CN120821818A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of retrieval enhancement generation, and in particular to a method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling. Background Art
[0002] Existing technical documentation systems generally adopt a fixed content presentation method, which cannot dynamically adjust the knowledge depth and expression form according to the user's professional level. As a result, the same document needs to serve both beginners and experts at the same time, and the content is too simple for some users and too complex for others. When using existing document systems, beginners are prone to cognitive overload when faced with massive professional terms, and the learning curve is steep, making it difficult to get started. Expert users need to manually filter key technical details from a large amount of basic information, wasting precious time and energy. Existing systems lack the ability to implicitly perceive the user's professional level and cannot automatically adjust retrieval and generation parameters according to user behavior. The information presentation method is rigid and difficult to adapt to dynamic changes in the user's knowledge level, which reduces the efficiency of knowledge transfer.
[0003] To sum up, the problem in existing technologies that they cannot provide personalized technical knowledge services for users with different professional levels needs to be solved urgently. Summary of the Invention
[0004] Based on this, it is necessary to provide a method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling to solve at least one of the above technical problems.
[0005] To achieve the above-mentioned purpose, a method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling includes the following steps: Step S1: Receive the user's original query text, perform component analysis, identify professional terms, general terms and question entities, and quantify them to form a query fingerprint; Step S2: Obtain the user's historical behavior sequence, combine it with the query fingerprint, and use a time-decay weighted algorithm to construct a user level score that reflects the user's current professional level; Step S3: Convert the user level score into a specific search parameter configuration to form a search strategy blueprint; Step S4: Guide the document library search according to the search strategy blueprint to screen out the candidate knowledge set that best matches the user's professional level; Step S5: intelligently fill in the role, style, and structure placeholders in the preset instruction template based on the user's level score to construct a contextualized generation instruction; Step S6: Use contextual generation instructions to guide the model to process the candidate knowledge set and output customized content that meets the user's cognitive level.
[0006] The present invention uses professional dictionaries and natural language processing technology to accurately identify professional terms and entities in queries, overcoming the limitations of traditional keyword matching; term density and rarity indicators quantify the degree of query expertise, providing a numerical basis for user intent; structured query fingerprints integrate semantic and statistical features to improve the accuracy of user professional level perception; rare term identification mechanism effectively discovers the advanced domain knowledge mastered by users, avoiding the problem of underestimated expertise.
[0007] The time-decay weighted algorithm enables the evaluation results to prioritize reflecting the user's latest status, overcoming the lag in user portrait updates; multi-dimensional behavioral feature fusion analysis provides a comprehensive horizontal evaluation perspective; the two-stage fusion strategy balances the stability of historical behavior with the immediacy of current queries; and the S-shaped normalized mapping ensures the statistical stability of the scoring, resolving the pain point that the technical documentation system cannot perceive differences in user cognition.
[0008] The segmented knowledge base activation mechanism prevents low-level users from being troubled by overly professional content, and ensures that high-level users are not disturbed by basic content; the three-interval weight distribution strategy ensures that the search results are accurately matched with the user's cognitive ability; the nonlinear inverse slice size mapping and step-by-step recall quantity adjustment effectively reduce information noise and balance the breadth and depth of knowledge requirements; the retrieval strategy blueprint realizes fully parameterized adaptive retrieval, solving the problem of fragmented user experience caused by traditional "standardization".
[0009] Semantic boundary segmentation technology ensures the integrity of knowledge fragments; vector similarity calculation combined with weight adjustment realizes differentiated document importance assessment; deduplication mechanism and context expansion technology improve information density and coherence; precise control of knowledge granularity enables low-level users to obtain more contextual support and high-level users to obtain refined core content.
[0010] The multi-dimensional parameter mapping mechanism enables the generation model behavior to be precisely aligned with the user level; dynamic control parameter adjustment enables a continuous transition from diverse and detailed to precise and concise; contextualized instructions integrate user cognitive models and retrieval knowledge to address the defects of "standardization" of content generated by traditional systems.
[0011] The five-stage processing flow ensures the logic and pertinence of the output content; the post-processing mechanism driven by the horizontal threshold solves the need for fine-tuning of key adaptation points; the high correlation between content complexity and user level verifies the system's precise adaptation capability; structured processing improves output readability and knowledge coherence, completely solving the problem of uneven cognitive load caused by traditional systems, and significantly improving the efficiency of technical knowledge transfer and user satisfaction.
[0012] Therefore, this paper establishes a user expertise modeling system based on content features, combined with time-decay weighted historical behavior analysis, to achieve accurate perception of user expertise. Based on this, the method automatically adjusts retrieval parameter configuration and generates instruction templates, dynamically optimizing document retrieval strategies and content generation logic. Ultimately, it outputs personalized technical content that matches the user's cognitive level, effectively addressing core issues such as the "standardization" of technical documents, fragmented user experience, and inefficient information transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 A flowchart of the steps of an automatic parameter adjustment method for retrieval enhancement based on content feature modeling is provided; Figure 2 The flowchart of the adaptive retrieval enhancement generation based on the user's professional level in the present invention is shown.
[0014] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0015] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. It is obvious that the embodiments described are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of the present invention.
[0016] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor and / or microcontroller approaches.
[0017] It should be understood that although the terms "first," "second," and the like may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used solely to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the scope of the exemplary embodiments. The term "and / or" as used herein includes any and all combinations of one or more of the listed associated items.
[0018] To achieve this, please refer to Figures 1 to 2The present invention provides a method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling, comprising the following steps: Step S1: Receive the user's original query text, perform component analysis, identify professional terms, general terms and question entities, and quantify them to form a query fingerprint; In the embodiment of the present invention, user queries are processed through multi-level text analysis. The system first receives the original query text and limits the length to 5,000 characters, performs standardization cleaning; then loads a professional dictionary covering 20 fields, with more than 10,000 terms in each field, and performs component analysis using a word segmentation engine and a syntactic analyzer; then identifies and annotates professional terms, general terms, and technical entities, records their location index, field label, and importance; and then calculates the term density. And limited to the interval [0.05,0.6]; calculate the term rarity ,in The frequency of terms in the corpus is finally generated, which contains a JSON-formatted structured query fingerprint of the term list, density, rarity mean, entity, and original query, and generates a unique hash identifier.
[0019] Step S2: Obtain the user's historical behavior sequence, combine it with the query fingerprint, and use a time-decay weighted algorithm to construct a user level score that reflects the user's current professional level; In this embodiment of the present invention, a user level assessment based on historical behavior is implemented. The system extracts up to 100 historical behavior records in the last 30 days from the session cache, including query fingerprints, document clicks, and page scrolling data; an exponential decay function is applied. Assign a time weight to each behavior, reducing the weight of behavior 24 hours ago to 0.79 and 7 days ago to 0.18; extract the professionalism features of the behavior, including querying professionalism , content preference indicators (five-level document classification weighting) and reading behavior patterns (regional stay ratio and jump pattern analysis); a two-stage weighted fusion strategy is adopted, first calculating the weighted average of historical features, and then fusing it with the current query features at a ratio of 0.6:0.4; finally, an S-type normalization function is applied to map the results to the interval [0.05, 0.95] to obtain the user level score.
[0020] Step S3: Convert the user level score into a specific search parameter configuration to form a search strategy blueprint; In the embodiments of the present invention, an exact mapping from horizontal scores to retrieval parameters is established. The system receives the user's horizontal score S ∈ [0.05, 0.95] as input; maps S to the knowledge base selection parameter, activates different levels of knowledge base combinations through five equal intervals; realizes the weight allocation mapping, sets two thresholds T1 = 0.35 and T2 = 0.65, when S < T1, uses the concept - heavy weight [0.40, 0.35, 0.15, 0.07, 0.03], when S > T2, uses the technology - heavy weight [0.03, 0.07, 0.15, 0.35, 0.40], when T1 ≤ S ≤ T2, uses the balanced weight, and uses interpolation for smooth transition at the interval boundaries; converts S into the slice size parameter through the non - linear inverse function CS = CS_max - S×(CS_max - CS_min); uses the step function to determine the recall number parameter; finally, integrates each parameter to generate a retrieval strategy blueprint in JSON format, which includes five parts: knowledge base selection, weight allocation, slice size, recall number, and metadata.
[0021] Step S4: Guide the document library retrieval according to the retrieval strategy blueprint, and screen out the candidate knowledge set that best matches the user's professional level; In the embodiments of the present invention, a parameterized knowledge retrieval process is executed. The system analyzes the knowledge base selection parameter in the blueprint, and screens out the valid documents in the activated knowledge base from the document metadata table; performs semantic boundary segmentation on the documents according to the slice size parameter to maintain the structural integrity; uses a 768 - dimensional BERT variant model to convert the query and knowledge fragments into vector representations, and performs L2 normalization; calculates the original similarity , then applies the weight adjustment formula and further corrects it by combining the document freshness and quality factors; performs a descending sort and implements a deduplication mechanism with a 30% overlap rate, extracts the first RC knowledge fragments from K_sorted, and forms a candidate knowledge set after context expansion, which includes the original text, similarity score, document metadata, and location information.
[0022] Step S5: According to the user's horizontal score, intelligently fill in the role, style, and structure placeholders in the preset instruction template to construct a contextualized generation instruction; In an embodiment of the present invention, dynamic personalization of instruction templates is achieved. The system presets a JSON structure instruction template containing four types of placeholders: ${ROLE}, ${STYLE}, ${STRUCTURE}, and ${EXPERTISE}; constructs a mapping function set that maps the user level score S to the content of each placeholder; applies a role identification adjustment function to map S to the three-dimensional parameter space RP of professionalism, tutoring tendency, and technical depth, and matches predefined roles using a nearest neighbor algorithm; uses a language style adjustment function to convert S into the parameters LP of explanation detail, term frequency, and expression complexity, and generates a style description through a decision tree; uses a content structure adjustment function to calculate the proportions SP of the three parts of concept explanation, example display, and technical details, and converts them into percentage expressions; performs a precise placeholder replacement operation to generate the filled instructions; finally, integrates the instructions with the candidate knowledge set into a contextualized generated instruction, and dynamically adjusts the model control parameters using the formulas T=0.9-0.6×S, P=0.95-0.4×S, and L=4000-2500×S.
[0023] Step S6: Use contextual generation instructions to guide the model to process the candidate knowledge set and output customized content that meets the user's cognitive level.
[0024] In this embodiment of the present invention, customized content generation and optimization are completed. The system transmits contextualized instructions to a 175B parameter-scale generation model through a high-throughput API, allocating differentiated computing resources based on user proficiency scores. The model performs a five-stage process: instruction parsing, knowledge understanding, content planning, draft generation, and self-correction. It adjusts the tone and professionalism based on role identification, controls term density based on language style, and divides the length ratio based on content structure. The content organization module performs format standardization, block division, key point highlighting, and link enhancement to ensure that the correlation coefficient between content complexity C and user proficiency S is ≥0.85. The post-processing module performs differentiated optimization based on S. When S < 0.35, it extracts technical terms TE and inserts concise explanations. When S > 0.75, it deletes redundant basic explanations and enhances technical details. At the same time, it controls the output length to not exceed MaxLen = h(S), achieving the final customized output.
[0025] Preferably, step S1 includes the following steps: Step S11: receiving the original query text input by the user; Step S12: Analyze the query text using pre-set domain dictionaries and natural language processing tools; Step S13: Identify and label the professional terms, general terms and question entities in the query; Step S14: Calculate the term density in the query text, where the term density is the ratio of the number of professional terms to the total number of query words; Step S15: Calculating term rarity, where the term rarity is determined based on the frequency of occurrence of each professional term in a preset corpus; Step S16: Generate a structured query fingerprint containing term list, density, rarity mean, entity and original query.
[0026] In the embodiment of the present invention, the original query text receiving module captures user queries through an API interface, limits the length to 5,000 characters, and performs standardization preprocessing, including space deletion, punctuation standardization, and special character removal.
[0027] The component analysis unit loads a professional dictionary covering 20 technical fields with more than 10,000 terms in each field, performs word segmentation processing on the query text to generate a word sequence, and performs part-of-speech tagging and dependency analysis through a syntactic analyzer to build a grammatical tree structure.
[0028] The terminology recognition unit matches the word segmentation results with the dictionary, marks the professional terms and records the location index, field label and importance; the entity recognition unit extracts problem entities such as technology names, method names, tool names, assigns type labels and confidence values, and finally generates a set of annotation results.
[0029] The term density calculation unit counts the number of professional terms N_term and the total number of words N_total, calculates the density TD=N_term / N_total, and limits it to the range of [0.05,0.6] to ensure rationality.
[0030] The term rarity calculation unit queries the frequency of each term in the 1 billion word technical corpus , calculate rarity , the rarity of the term that does not appear is 1, and finally the weighted average is calculated as the overall rarity index.
[0031] The query fingerprint generation unit constructs structured data in JSON format, including a term list, density value, rarity mean, question entity array, and metadata, and generates a unique hash identifier for subsequent retrieval and behavioral association analysis.
[0032] Preferably, step S2 includes the following steps: Step S21: extracting a user history behavior sequence from the user's session cache, where the user history behavior sequence includes fingerprints of historical queries, document click preferences, and page scrolling behaviors; Step S22: assigning a time decay weight to each action in the user's historical action sequence, where the time decay weight decreases as the time interval between the action occurrence time and the current time increases; Step S23: extracting the expertise features corresponding to each behavior item in the user's historical behavior sequence, including the term density of historical queries, the technical depth of clicked content, and the jump pattern of page reading; Step S24: performing weighted fusion on the professionalism feature of the current query fingerprint and the professionalism features of each historical behavior item to obtain a weighted fusion result, where the weighting coefficient in the weighted fusion result is the corresponding time decay weight; Step S25: Map the weighted fusion result to the interval [0, 1] through a normalization function to obtain the final user level score.
[0033] In this embodiment of the present invention, the user session database is first connected, and session cache data from the past 30 days is retrieved based on the user's unique identifier. The cache uses a hierarchical key-value structure to store three core behaviors: a historical query fingerprint set HQ = {q_1, q_2, ..., q_n}, which contains structured query fingerprints and timestamps; a document click record set DC = {d_1, d_2, ..., d_m}, which contains document ID, type label, technical difficulty coefficient, and dwell time; and a page scrolling behavior sequence PS = {p_1, p_2, ..., p_k}, which contains scrolling rate, pause position, and reading depth ratio. Up to 100 recent behavior records are extracted to form the initial historical behavior sequence H_init.
[0034] Then apply the exponential decay function to each record to calculate the weight. Calculate the time interval (hours), time decay weights are calculated by The calculation reduces the weight of activity 24 hours ago to 0.79, and that of activity 7 days ago to 0.18. The weight floor is set at 0.05 to minimize the impact of very early activity.
[0035] We then extract expertise features for each record: term density TD_i and rarity TR_i are extracted from historical queries; document type DT_i (1-5) is obtained from document click records and a technical depth score DS_i is calculated; and jump pattern features JS_i are calculated from page scroll records to assess behaviors such as the frequency of direct jumps to advanced sections. This is aggregated to form a feature vector F_i = [TD_i, TR_i, DS_i, JS_i], with missing values filled in to address missing features.
[0036] Perform two-stage weighted fusion: first calculate the weighted average of each type of feature TD_fused, TR_fused, DS_fused and JS_fused, with the weight being the time decay value; then fuse the current query feature with the historical fusion feature in a ratio of 0.6:0.4 to generate the final vector F_final.
[0037] Finally, a piecewise sigmoid function is applied to map the fused features to the range [0, 1]. A sigmoid normalization function with pre-calibrated parameters is applied to each feature component, and a weighted average score is calculated, with weights of 0.3 for term density, 0.3 for term rarity, 0.2 for document depth, and 0.2 for jump features. A calibration function is applied to constrain the final score to the range [0.05, 0.95], enabling precise quantification of user expertise.
[0038] It is particularly important that the time decay weight in step S22 is calculated using an exponential decay function, so that behaviors that occurred earlier have a significantly smaller impact on the current user level score than behaviors that occurred more recently, where the decay rate is controlled by a preset decay coefficient.
[0039] In the embodiment of the present invention, the time decay weight calculation adopts the exponential decay function implementation, where The attenuation coefficient is fixed at 0.01. Indicates the number of hours between the time the behavior occurs and the current time. The base of the natural logarithm is λ. During system implementation, the precise time difference is first calculated using millisecond timestamps, converted to hours, and then substituted into the decay formula. This function weights behavior from one hour ago to 0.99, 12 hours ago to 0.89, 24 hours ago to 0.79, 3 days ago to 0.49, 7 days ago to 0.18, and 14 days ago to 0.03. The system sets a lower threshold for weight calculation of 0.05. When the calculated weight falls below this value, it is forcibly set to 0.05 to prevent long-term behavior from being completely ignored. An upper limit of 1.0 is also set to ensure weight normalization. This exponential decay mechanism accurately quantifies the impact of time on the importance of user behavior. Through precise calibration of the parameter λ = 0.01, the system maintains high sensitivity to recent behavior while retaining the influence of long-term behavior patterns, achieving temporal dynamics in user professional level assessment.
[0040] Preferably, the professionalism features in step S23 include: Query specialization calculated based on term density and term rarity in the query fingerprint; Content preference indicators are determined based on the document type clicked by the user, where API documentation, source code analysis, and technical documentation correspond to high professionalism, while introductory tutorials, concept explanations, and basic documentation correspond to low professionalism; The reading behavior pattern is determined based on the distribution of users' stay time in the document and their jump behavior. The behavior of directly jumping to the advanced chapter or API part corresponds to high expertise, while the behavior of reading in sequence or frequently viewing the basic parts corresponds to low expertise.
[0041] In an embodiment of the present invention, professional feature extraction includes three core dimensions. The first dimension is the calculation of query professionalism. The system extracts term density TD and term rarity TR from the query fingerprint, and uses the weighted sum formula QP=0.4×TD+0.6×TR to calculate the query professionalism. In this formula, the term rarity weight is greater than the term density weight because the use of rare terms can better reflect the user's actual professional level. The system sets a professionalism threshold. When QP<0.3, it is judged as a primary query. When QP>0.7, it is judged as an advanced query. The query between the two is an intermediate query. The second dimension is the content preference index. The system classifies technical documents into five levels: L1 (introductory tutorial, weight 0.2), L2 (concept explanation, weight 0.4), L3 (basic practice, weight 0.6), L4 (technical document, weight 0.8), L5 (API document and source code analysis, weight 1.0). User click behavior is cumulatively weighted according to document classification to form a content preference vector ,in Indicates the user's The preference of the content is in the range of [0,1]. The system calculates the comprehensive score of content preference , the value range is [1,5]. The higher the score, the more professional the user prefers. The third dimension is the analysis of reading behavior patterns. The system records the user's page dwell heat map HM and jump sequence JS in the document. The heat map HM divides the document into three parts: basic area B, intermediate area M and advanced area A, and records the proportion of the user's dwell time in each area. The jump sequence JS captures the user's reading path in the document, including the number of times DJ jumps directly from the directory to the advanced chapter, the access frequency AF of the API part, the number of repeated views RB of the basic part, etc. The system uses the formula Calculate reading expertise, where is the total number of jumps, The value range is [0,1]. After standardization, the professional characteristics of the three dimensions together constitute the professional characteristic vector of user behavior. , providing a multi-dimensional professional level assessment basis for subsequent weighted fusion.
[0042] Preferably, step S3 includes the following steps: Step S31: receiving user level rating as input; Step S32: Mapping the user level score to a knowledge base selection parameter, which is used to determine the search scope; Step S33: Mapping the user level rating to a weight distribution parameter, which is used to adjust the retrieval priority of different types of content; Step S34: Mapping the user level score to a slice size parameter, where the slice size parameter decreases as the user level score increases; Step S35: Mapping the user level score to a recall quantity parameter, which is used to control the number of knowledge fragments returned; Step S36: Integrate the weight distribution parameters, the slice size parameters and the recall quantity parameters to generate the retrieval strategy blueprint.
[0043] In the embodiment of the present invention, the user level score S∈[0.05,0.95] is first received as a retrieval parameter configuration benchmark, and validity verification is performed and boundary truncation processing is performed to ensure that S is strictly within a preset interval.
[0044] Then, we map user proficiency ratings to knowledge base configurations. We pre-set a five-level document knowledge base: L1 (entry level), L2 (basic concepts), L3 (application practice), L4 (technical details), and L5 (professional and advanced). The interval [0.05, 0.95] is divided into five equal parts, corresponding to different activation combinations: S∈[0.05, 0.23) activates {L1, L2}; S∈[0.23, 0.41) activates {L1, L2, L3}; S∈[0.41, 0.59) activates {L2, L3, L4}; S∈[0.59, 0.77) activates {L3, L4, L5}; and S∈[0.77, 0.95] activates {L4, L5}. This strategy ensures that the search scope matches the user proficiency level.
[0045] Next, we convert the user-level ratings into a document-type weight vector W = [w_1, w_2, w_3, w_4, w_5]. We use linear interpolation to pre-set low-level baseline weights W_low = [0.45, 0.30, 0.15, 0.07, 0.03] and high-level baseline weights W_high = [0.03, 0.07, 0.15, 0.30, 0.45]. For any level rating S, we calculate the weight vector W using linear interpolation, ensuring that the weight of high-level content gradually increases as the user's level improves.
[0046] Convert user-level ratings to document slice size parameters using a nonlinear inverse mapping function. ,in =2000, =200, so that beginners can obtain larger knowledge fragments and advanced users can obtain smaller, precisely located fragments. The calculation results are rounded to the nearest multiple of 50 to ensure the normalization of the slice boundaries.
[0047] Calculate the number of matched knowledge fragments returned. Set the base number RN_base to 10 and dynamically adjust it using a step function: when S < 0.3, RN = RN_base + 5; when S∈[0.3,0.7), RN = RN_base; when S≥0.7, RN = RN_base + 3, balancing the knowledge breadth and depth needs of users at different levels.
[0048] Finally, the generated parameters are integrated into a retrieval strategy blueprint in JSON format, which includes five core parts: the activeKnowledgeBases array, the weightDistribution object, the chunkSize integer, the recallCount integer, and the metaData object, to guide the subsequent document retrieval process.
[0049] Preferably, in step S33: When the user's proficiency score is lower than the first preset threshold, increase the weight of conceptual documents and decrease the weight of technical detail documents; When the user's proficiency score is higher than the second preset threshold, increase the weight of technical detail documents and decrease the weight of conceptual documents; When the user's proficiency score is between the first preset threshold and the second preset threshold, adopt a balanced weight distribution.
[0050] In the embodiment of the present invention, the weight distribution unit implements a weight adjustment mechanism based on threshold segmentation. The system sets the first preset threshold = 0.35, and the second preset threshold = 0.65, and divides the user's proficiency score into three intervals. The documents are divided into five categories: conceptual documents ( , ), application practice documents ( ), and technical detail documents ( , ). When < T1, the system executes a concept-heavy weight distribution, and the specific weight values are = [0.40, 0.35, 0.15, 0.07, 0.03], where the five elements in correspond to the retrieval weights of the five categories of documents from to respectively. This configuration makes the sum of the weights of and categories of documents reach 0.75, ensuring that conceptual content dominates the retrieval results and helping low-level users establish a basic knowledge framework. When > T2, the system executes a technology-heavy weight distribution, and the weight values are = [0.03, 0.07, 0.15, 0.35, 0.40]. This configuration reverses the weight ratio of conceptual documents to technical documents, making the sum of the weights of and categories of documents reach 0.75, providing in-depth technical details for high-level users. When T1 ≤ ≤ T2, the system executes a balanced weight distribution, and the weight values are =[0.20,0.20,0.20,0.20,0.20], all types of documents get equal retrieval opportunities, which meets the needs of medium-level users. In order to achieve smooth transition, the system uses interpolation smoothing algorithm at the interval boundary: when near hour, ; When S approaches T2, This weight distribution mechanism avoids the drawbacks of "standardization" in traditional document retrieval, dynamically adjusting content preferences for different user levels to achieve personalized optimization of retrieval results. In actual implementation, the weight array is normalized to ensure that the sum of the weights of the five categories of documents is 1, ensuring the numerical stability of the retrieval system.
[0051] Preferably, step S4 includes the following steps: Step S41: Determine the document set to be retrieved based on the knowledge base selection parameters in the retrieval strategy blueprint; Step S42: Segment the document collection into knowledge segments according to the slice size parameter in the retrieval strategy blueprint; Step S43: using a vector embedding model to convert the user query and knowledge fragment into a vector representation; Step S44: Calculate the similarity between the query vector and each knowledge segment vector, and adjust the similarity score according to the weight allocation parameter in the retrieval strategy blueprint to obtain an adjusted similarity score; Step S45: Sort the knowledge fragments according to the adjusted similarity scores, and select the fragments with the highest relevance according to the recall quantity parameter in the retrieval strategy blueprint to form the candidate knowledge set.
[0052] In the embodiment of the present invention, technical documents are first organized through a hierarchical knowledge base architecture: (Entry-level knowledge base, 1 million documents), (Basic concept library, 1.5 million documents), (Application practice library, 2 million documents), (Technical Details Library, 1.8 million documents) and (Professional advanced library, 1.2 million documents). Based on the list of active knowledge bases in the search strategy blueprint, parallel queries are performed to filter documents that meet the conditions, using bitmap indexes to speed up the process. Metadata filtering is performed to exclude expired (>5 years) and low-quality (<3.5 5) Documents, forming a document set D to be retrieved.
[0053] The document is semantically segmented based on the slice size parameter CS in the retrieval strategy blueprint. Segmentation is prioritized at semantic boundaries to ensure integrity; statement-level segmentation is performed only when the semantic block exceeds CS. Structural integrity is maintained for special content such as code blocks and tables. Each knowledge fragment contains the original text, metadata references, location index, and automatically extracted summary, forming a knowledge fragment set K.
[0054] The pre-trained 768-dimensional BERT variant dual-tower encoding model (fine-tuned on 15 million technical documents) is used to convert text into vector representations. Query encoding combines the original query and the identified entities into an enhanced query text to generate a query vector q; fragment encoding processes each knowledge fragment in parallel, extracting text, title, and type information to generate a set of fragment vectors. . Perform on all vectors Normalize to ensure Euclidean length is 1.
[0055] Calculating query vectors With each fragment vector The dot product similarity , and then according to the document type to which the fragment belongs and its weight Adjust similarity: This formula retains 50% of the original similarity and adjusts 50% based on the document type. Further application of document freshness and quality Factor correction: .
[0056] The adjusted similarity scores are sorted in descending order to generate a K_sorted sequence. A deduplication mechanism is implemented with a content overlap ratio greater than 30%. The top RC segments (RC is the recall parameter in the retrieval strategy blueprint) are extracted from the K_sorted sequence to form the candidate knowledge set. Contextual expansion is performed on each selected segment to supplement necessary information for completeness. Finally, the candidate knowledge set is serialized into JSON format, containing the original text, similarity scores, metadata, and location information.
[0057] Preferably, step S5 includes the following steps: Step S51: Preset an instruction template with placeholders, where the placeholders include role identification, language style, content structure, and professional assumptions; Step S52: constructing a mapping function from user level rating to placeholder filling content; Step S53: determining the specific filling content of each placeholder according to the mapping function and the user level score; Step S54: Substitute the determined filling content into the instruction template to complete the placeholder replacement and obtain the filled instruction; Step S55: combining the filled instruction with the candidate knowledge set to generate the contextualized generation instruction.
[0058] In this embodiment of the present invention, a unified JSON structure is first defined to generate an instruction framework, which contains four key placeholders: ${ROLE} (respondent role), ${STYLE} (language expression style), ${STRUCTURE} (content organization structure), and ${EXPERTISE} (expertise assumption). The instruction template consists of three parts: task description, style guidance, and content specifications. Five standardized template variants are maintained for different difficulty levels, and each has been tested 1,000 times to verify its stability.
[0059] A quantitative conversion mechanism was established to transform user-level ratings into placeholder content, defining four mapping functions: the role mapping function R(S) maps ratings to five roles; the style mapping function L(S) maps to a parameter vector of [explanation detail, term frequency, and expression complexity]; the structure mapping function T(S) maps to a parameter vector of [concept explanation weight, example weight, and technical detail weight]; and the expertise mapping function E(S) maps to five hypothetical levels of expertise. Each function was implemented using piecewise linear optimization using historical data from 10,000 users, with weight adjustment parameters α=0.8, β=0.7, γ=0.9, and δ=0.6 to control sensitivity.
[0060] The specific placeholder content is calculated based on the user's level score S: the role identifier is "junior lecturer" when S<0.3, and changes to "basic tutorial lecturer", "application expert", "technical consultant" and "senior engineer" (S≥0.85) as S increases; the language style evolves from "concise and intuitive, few terms, simple sentences" to "professional and precise, many terms, complex sentences"; the content structure changes from "mainly concepts (60%), examples (30%), and a few details (10%)" to "mainly technical details (70%), necessary concepts (20%), and key examples (10%)"; the professionalism is assumed to increase step by step from "beginner" to "expert".
[0061] Perform placeholder replacement, selecting the best-matching template variant and sequentially replacing four placeholder types using regular expressions, using a single-pass scan algorithm (O(n) complexity). Verification is performed after replacement to ensure all placeholders have been replaced and that the syntax is correct. Common replacement patterns are cached, allowing generated templates to be reused within the same scoring interval.
[0062] The populated instructions are combined with the candidate knowledge set to form the final input: the instructions are placed first as control instructions, the query description (original query, key entities, term explanations) is added, knowledge context tags are inserted, knowledge snippets are added in descending order of relevance, and output formatting guidelines are attached. The final instructions contain four parts: instructions, query, knowledge, and output guidelines. The total length is kept within 65,536 characters. Compression is performed to remove redundant formatting and optimize transmission efficiency.
[0063] Of particular importance is that the contextual generation instructions also contain control parameters for the generation model, including: The temperature parameter decreases as the user's level score increases; The top_p parameter decreases as the user level score increases; The maximum output length parameter decreases as the user's level score increases.
[0064] In this embodiment of the present invention, the contextualized instruction generation module integrates a generation model control parameter adjustment mechanism based on user proficiency scores. The system dynamically calculates three key control parameters based on a precise mapping function: The temperature parameter is calculated using the formula T = 0.9-0.6 × S (where S is the user proficiency score), enabling beginners to obtain diverse explanations (T ≈ 0.8) and experts to obtain precisely focused content (T ≈ 0.3). The top_p parameter is calculated using the formula P = 0.95-0.4 × S. For low-level users, a higher threshold (P ≈ 0.9) is set to preserve diverse expression paths, while for high-level users, the threshold is reduced to around 0.6 to ensure professional and accurate output. The maximum output length parameter follows the calculation rule L = 4000-2500 × S, providing beginners with detailed explanations (approximately 3500 characters) and experts with concise answers (approximately 1500 characters). These three sets of parameter adjustments are embedded in contextual instructions as a JSON-formatted generation_config object. Working in conjunction with content guidance, they enable output control from diverse and detailed (for beginners) to precise and concise (for experts). This ensures that the generated content accurately matches the user's cognitive level in terms of information volume and expression, significantly improving the efficiency of knowledge transfer.
[0065] Preferably, step S53 includes: Construct a role identification adjustment function to map the user's level score to a role identification parameter set. The role identification parameter set contains numerical values expressing the degree of professionalism, tutoring tendency, and technical depth, and generates the corresponding role identification based on the role identification parameter set. Construct a language style adjustment function to map user proficiency scores to a language style parameter set. The language style parameter set includes values for explanation detail, term frequency, and expression complexity, and generates a corresponding language style based on the language style parameter set. Construct a content structure adjustment function to map user level ratings to a content structure parameter set. The content structure parameter set includes numerical values for the concept explanation ratio, example display ratio, and technical detail ratio, and generates the corresponding content structure based on the content structure parameter set. Fill the generated role identifier, language style, and content structure into the corresponding placeholders in the instruction template.
[0066] In this embodiment of the present invention, the role identification adjustment function first maps the user's proficiency score S to a three-dimensional parameter space RP = [rp_1, rp_2, rp_3], which respectively represent the degree of professionalism, the degree of tutoring tendency, and the degree of technical depth, with a value range of [0, 1]. A piecewise linear mapping is used: when S < 0.3, RP = [0.2, 0.9, 0.1]; when 0.3 ≤ S < 0.5, RP = [0.4, 0.7, 0.3]; when 0.5 ≤ S < 0.7, RP = [0.6, 0.5, 0.5]; when 0.7 ≤ S < 0.85, RP = [0.8, 0.3, 0.7]; when S ≥ 0.85, RP = [0.9, 0.1, 0.9]. Based on the parameter set RP, a mapping table containing 25 predefined roles is queried, and the best matching role is selected using the nearest neighbor algorithm. For example, RP=[0.2,0.9,0.1] is mapped to "Technical Entry Instructor", and RP=[0.9,0.1,0.9] is mapped to "Senior Technical Architect".
[0067] The language style adjustment function maps S to the parameter set LP = [lp_1, lp_2, lp_3], representing explanation detail, term frequency, and expression complexity. The mapping formulas are: lp_1 = 1 - 0.7 × S, lp_2 = 0.2 + 0.7 × S, and lp_3 = 0.1 + 0.8 × S. This ensures that as user skill improves, explanations become more concise while terminology and complexity increase. A decision tree converts LP into a specific style description. For example, LP = [0.9, 0.3, 0.2] is converted to "use plain language, explain each concept in detail, and avoid complex terminology."
[0068] The content structure adjustment function maps S to the parameter set SP = [sp_1, sp_2, sp_3], which represents the proportion of concept explanation, example presentation, and technical details, satisfying sp_1 + sp_2 + sp_3 = 1. Linear interpolation is used: sp_1 = 0.7 - 0.5 × S, sp_2 = 0.25, and sp_3 = 0.05 + 0.5 × S. This ensures that as user skill improves, concept explanation decreases and technical details increase. SP is converted to a percentage. For example, SP = [0.6, 0.25, 0.15] is converted to "Content structure: concept explanation (60%), example presentation (25%), technical details (15%)."
[0069] Finally, the generated role identifier, language style, and content structure description are replaced with regular expressions in the ${ROLE}, ${STYLE}, and ${STRUCTURE} placeholders in the instruction template. This automatically converts the user proficiency rating into specific instruction text, ensuring that the generated model adapts to the cognitive needs of users at different levels. The replacement results are then validated to prevent formatting errors from causing instruction failure.
[0070] Preferably, step S6 includes the following steps: Step S61: inputting the contextualized generation instruction into the generation model; Step S62: The generation model processes the candidate knowledge set according to the role identifier, language style, content structure, and expertise hypothesis in the contextual generation instruction to obtain processed content; Step S63: Organize the processed content and generate a customized response; Step S64: The customized response is post-processed according to the user level score. When the user level score is low, term explanations are automatically added; when the user level score is high, basic explanations are omitted and technical depth is increased.
[0071] In this embodiment of the present invention, contextual generation instructions are first transmitted to a pre-deployed large-scale language model with a 175B parameter scale through a high-throughput API interface. This model has been fine-tuned for 30 billion tokens for technical document comprehension and knowledge integration tasks. Using an asynchronous processing mechanism, the instructions are serialized into JSON format, adding a request ID, timestamp, and priority tag. Differentiated computing resource allocation is implemented based on the user's proficiency score: 4 tensor processing units are allocated for S < 0.3, and 8 tensor processing units are allocated for S > 0.7. A 30-second timeout threshold is set, which triggers a backup call process.
[0072] The generation process follows a five-stage process: the instruction parsing stage extracts and internalizes control signals such as role identification and language style; the knowledge comprehension stage processes candidate knowledge fragments, performs entity linking and relationship extraction, and constructs a temporary knowledge graph; the content planning stage determines the output framework based on structural parameters, dividing the length of concept explanations, examples, and technical details; the draft generation stage adjusts the tone and professionalism based on role identification, and controls term density and sentence complexity based on language style; the self-correction stage checks adaptability against professional assumptions and adjusts the depth of explanations. The entire process uses the temperature parameter T = f(S) and the top_p parameter P = g(S) to control output diversity. f and g are decreasing functions, making the output more accurate as the user's level improves.
[0073] After receiving the raw output, we perform structural processing: converting the plain text into HTML format, adding structural tags such as headings and paragraphs; dividing the functional blocks according to the preset content structure ratio; identifying core terms and conclusions, and applying bold or highlighting to enhance prominence; adding internal reference links to relevant technical concepts; and performing consistency checks to ensure consistent terminology and structural integrity. We also calculate the complexity index C (term density, sentence complexity, and concept abstraction) and ensure that the correlation coefficient with the user's level score S is ≥0.85.
[0074] Finally, differentiated post-processing is performed based on user proficiency scores: When S < 0.35, technical terms are extracted, the set requiring explanation (TE) is screened, basic definitions are retrieved, and concise explanations are inserted at their first occurrence. When S > 0.75, redundant basic explanations are identified and removed, and technical details are enhanced, adding deeper information such as implementation principles and performance parameters, replacing vague statements with precise descriptions. Content length is tracked in real time to ensure it does not exceed the limit of MaxLen = h(S), where h is a decreasing function that decreases as user proficiency increases.
[0075] See also Figure 2 This figure illustrates the workflow of the adaptive retrieval enhancement generation process based on user expertise in this invention. The entire process begins with the user's original query, which first passes through the query analysis module (S1) and is converted into a structured "query fingerprint." This fingerprint, along with the user's historical behavior data, is then integrated into the core step of user proficiency modeling (S2) to calculate a key metric—the "user proficiency score." This score is the watershed of the process, driving two parallel paths: the upper retrieval path, through S3 and S4, uses the score to generate a retrieval blueprint and adaptively search the document library to obtain a "candidate knowledge set." The lower generation path, in S5, uses the score to construct "contextualized generation instructions." Finally, the products of these two paths are integrated in the personalized content generation stage (S6), combining "what to say" (the knowledge set) with "how to say it" (the instructions) to generate and output a "customized response" tailored to the user.
[0076] The present invention is therefore intended to be illustrative and non-restrictive in all respects, with the scope of the invention being defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the application documents are intended to be embraced therein.
[0077] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is to be construed in the widest possible manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling, characterized in that: Applied to a technical documentation system, the method comprises the following steps: Step S1: Receive the user's original query text, perform component analysis, identify professional terms, general terms and question entities, and quantify them to form a query fingerprint; Step S2: Obtain the user's historical behavior sequence, combine it with the query fingerprint, and use a time-decay weighted algorithm to construct a user level score that reflects the user's current professional level; Step S3: Convert the user level score into a specific search parameter configuration to form a search strategy blueprint; Step S4: Guide the document library search according to the search strategy blueprint to screen out the candidate knowledge set that best matches the user's professional level; Step S5: intelligently fill in the role, style, and structure placeholders in the preset instruction template based on the user's level score to construct a contextualized generation instruction; Step S6: Use contextual generation instructions to guide the model to process the candidate knowledge set and output customized content that meets the user's cognitive level.
2. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: receiving the original query text input by the user; Step S12: Analyze the query text using pre-set domain dictionaries and natural language processing tools; Step S13: Identify and label the professional terms, general terms and question entities in the query; Step S14: Calculate the term density in the query text, where the term density is the ratio of the number of professional terms to the total number of query words; Step S15: Calculating term rarity, where the term rarity is determined based on the frequency of occurrence of each professional term in a preset corpus; Step S16: Generate a structured query fingerprint containing term list, density, rarity mean, entity and original query.
3. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: extracting a user history behavior sequence from the user's session cache, where the user history behavior sequence includes fingerprints of historical queries, document click preferences, and page scrolling behaviors; Step S22: assigning a time decay weight to each action in the user's historical action sequence, where the time decay weight decreases as the time interval between the action occurrence time and the current time increases; Step S23: extracting the expertise features corresponding to each behavior item in the user's historical behavior sequence, including the term density of historical queries, the technical depth of clicked content, and the jump pattern of page reading; Step S24: performing weighted fusion on the professionalism feature of the current query fingerprint and the professionalism features of each historical behavior item to obtain a weighted fusion result, where the weighting coefficient in the weighted fusion result is the corresponding time decay weight; Step S25: Map the weighted fusion result to the interval [0, 1] through a normalization function to obtain the final user level score.
4. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 3 is characterized in that: The professional features in step S23 include: Query specialization calculated based on term density and term rarity in the query fingerprint; Content preference indicators are determined based on the document type clicked by the user, where API documentation, source code analysis, and technical documentation correspond to high professionalism, while introductory tutorials, concept explanations, and basic documentation correspond to low professionalism; The reading behavior pattern is determined based on the distribution of users' stay time in the document and their jump behavior. The behavior of directly jumping to the advanced chapter or API part corresponds to high expertise, while the behavior of reading in sequence or frequently viewing the basic parts corresponds to low expertise.
5. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: receiving user level rating as input; Step S32: Mapping the user level score to a knowledge base selection parameter, which is used to determine the search scope; Step S33: Mapping the user level rating to a weight distribution parameter, which is used to adjust the retrieval priority of different types of content; Step S34: Mapping the user level score to a slice size parameter, where the slice size parameter decreases as the user level score increases; Step S35: Mapping the user level score to a recall quantity parameter, which is used to control the number of knowledge fragments returned; Step S36: Integrate the weight distribution parameters, the slice size parameters and the recall quantity parameters to generate the retrieval strategy blueprint.
6. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 5, characterized in that: In the step S33: When the user level score is lower than a first preset threshold, the weight of the conceptual document is increased and the weight of the technical detail document is reduced; When the user level score is higher than a second preset threshold, the weight of the technical details document is increased and the weight of the conceptual document is reduced; When the user level score is between the first preset threshold and the second preset threshold, balanced weight distribution is adopted.
7. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: Determine the document set to be retrieved based on the knowledge base selection parameters in the retrieval strategy blueprint; Step S42: Segment the document collection into knowledge segments according to the slice size parameter in the retrieval strategy blueprint; Step S43: using a vector embedding model to convert the user query and knowledge fragment into a vector representation; Step S44: Calculate the similarity between the query vector and each knowledge segment vector, and adjust the similarity score according to the weight allocation parameter in the retrieval strategy blueprint to obtain an adjusted similarity score; Step S45: Sort the knowledge fragments according to the adjusted similarity scores, and select the fragments with the highest relevance according to the recall quantity parameter in the retrieval strategy blueprint to form the candidate knowledge set.
8. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1 is characterized in that: Step S5 includes the following steps: Step S51: Preset an instruction template with placeholders, where the placeholders include role identification, language style, content structure, and professional assumptions; Step S52: constructing a mapping function from user level rating to placeholder filling content; Step S53: determining the specific filling content of each placeholder according to the mapping function and the user level score; Step S54: Substitute the determined filling content into the instruction template to complete the placeholder replacement and obtain the filled instruction; Step S55: combining the filled instruction with the candidate knowledge set to generate the contextualized generation instruction.
9. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 8, characterized in that: In step S53: Construct a role identification adjustment function to map the user's level score to a role identification parameter set. The role identification parameter set contains numerical values expressing the degree of professionalism, tutoring tendency, and technical depth, and generates the corresponding role identification based on the role identification parameter set. Construct a language style adjustment function to map user proficiency scores to a language style parameter set. The language style parameter set includes values for explanation detail, term frequency, and expression complexity, and generates a corresponding language style based on the language style parameter set. Construct a content structure adjustment function to map user level ratings to a content structure parameter set. The content structure parameter set includes numerical values for the concept explanation ratio, example display ratio, and technical detail ratio, and generates the corresponding content structure based on the content structure parameter set. Fill the generated role identifier, language style, and content structure into the corresponding placeholders in the instruction template.
10. The method for automatically adjusting retrieval enhancement generation parameters based on content feature modeling according to claim 1, characterized in that: Step S6 includes the following steps: Step S61: inputting the contextualized generation instruction into the generation model; Step S62: The generation model processes the candidate knowledge set according to the role identifier, language style, content structure, and expertise hypothesis in the contextual generation instruction to obtain processed content; Step S63: Organize the processed content and generate a customized response; Step S64: The customized response is post-processed according to the user level score. When the user level score is low, term explanations are automatically added; when the user level score is high, basic explanations are omitted and technical depth is increased.
Citation Information
Patent Citations
Method and system for intention entity recognition based on user query log
CN106372956A
Text generation enhancement method and device applied to retrieval enhancement generation
CN118377844A
User preference analysis method based on memory enhanced multi-modal large model
CN119884981A
Dynamic knowledge retrieval enhancement method based on large language model
CN120407570A
Enhanced generation method based on question matching retrieval
CN120611021A
Cited By
General text intelligent retrieval method and system based on rule analysis
CN121210649A
A general intelligent text retrieval method and system based on rule parsing
CN121210649B
RAG and expert system collaborative industrial instrument intelligent type selection method and device
CN121233637A
Enhanced retrieval generation optimization method fusing knowledge graph
CN121350280A
Intelligent document question answering and knowledge base retrieval method and system based on large model
CN121478941A