A search relevance score optimization method and system based on a large language model
Patent Information
- Application Number
- CN202610677876.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-11
- Estimated Expiration
- 2046-05-18
AI Technical Summary
[0004]上述技术虽然在一定程度上提升了搜索结果的排序性能,但在实际应用中仍存在一些不足:对于长文本、复杂表达、隐含意图以及多轮上下文条件下的语义关联把握不够充分,容易出现表层匹配较强而真实相关性不足的情况;面对不同搜索场景、不同业务目标及动态变化的用户需求时,评分标准的适应性和泛化能力有限;此外,现有方法在处理多源异构数据、非结构化内容以及细粒度相关性判断时,也容易出现评分不稳定、解释性不足和优化周期较长的问题,从而影响搜索结果的整体质量
本发明通过在同一检索会话内引入跨请求连续性计算机制,将关键词重合率、相邻点击结果的语义距离补偿量、归一化停留比值以及重复点击标记联合用于构建连续性系数,使相关性判断不再局限于单次检索请求与单次点击反馈,而是能够反映用户在连续改写过程中的真实检索意图演变。基于该连续性系数筛选增强正样本和困难负样本,能够使排序评分头的更新更贴近真实搜索场景中的意图收敛过程,从而提高相关性评分优化对复杂检索链路的适配能力。
Smart Images

Figure CN122220478B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of large model retrieval result optimization, specifically involving a search relevance scoring optimization method and system based on a large language model. Background Technology
[0002] With the continuous expansion of internet information and the increasing sophistication of user search needs, search systems are placing ever higher demands on the quality of search result ranking. Search relevance scoring, as a core element influencing search result ranking, directly impacts users' perception of the accuracy, completeness, and timeliness of search results. Traditional search systems typically construct relevance evaluation mechanisms based on information such as query terms, document content, click feedback, and semantic features to filter and rank candidate results. In recent years, large language models have demonstrated strong capabilities in semantic understanding, contextual reasoning, cross-text association analysis, and complex intent recognition, gradually highlighting their application value in search scenarios and providing new technological directions for optimizing search relevance scoring.
[0003] Currently, existing search relevance scoring techniques can be broadly categorized as follows: One category is the traditional ranking method based on keyword matching, inverted indexes, and manually designed features, which calculates the degree of matching between queries and documents through methods such as term frequency, inverse document frequency, field weights, and positional relationships; another category is the ranking method based on machine learning or deep learning, which constructs query features, document features, and interaction features, and uses a ranking model to output a relevance score; and yet another category introduces pre-trained language models or semantic representation models to vectorize queries and candidate content, and then combines similarity calculations or re-ranking strategies to complete the relevance assessment.
[0004] While the aforementioned technologies have improved search result ranking performance to some extent, they still have some shortcomings in practical applications: they are not sufficiently capable of grasping semantic relationships under long texts, complex expressions, implicit intents, and multi-turn contextual conditions, and are prone to situations where surface matching is strong but true relevance is insufficient; the adaptability and generalization ability of the scoring criteria are limited when facing different search scenarios, different business objectives, and dynamically changing user needs; in addition, existing methods are also prone to problems such as unstable scoring, insufficient interpretability, and long optimization cycles when dealing with multi-source heterogeneous data, unstructured content, and fine-grained relevance judgment, thus affecting the overall quality of search results.
[0005] Therefore, it is necessary to propose a new search relevance scoring optimization scheme to better adapt to the actual needs of accurate evaluation and stable ranking of search results in complex semantic retrieval scenarios, thereby providing a more valuable technical foundation for the relevance optimization of search systems. Summary of the Invention
[0006] To address the aforementioned problems, the present invention aims to propose a method for optimizing search relevance scoring based on a large language model, applicable to a search server, comprising the following steps: S1. Log collection and session segmentation: Collect user identifier, retrieval request text, candidate result display sequence, click location, click timestamp, page dwell time, page scroll depth, bounce marker and retrieval rewrite time interval, and segment the session according to the continuous retrieval behavior of the same user within a preset idle time threshold, and write each session data into the session cache area. S2. Candidate Result Vectorization and Interaction Feature Construction: Read the candidate result text from the document index library, use the large language model semantic encoder to generate the retrieval request semantic vector and the candidate result semantic vector respectively, and normalize the click position, dwell time, scroll depth, bounce mark and retrieval rewriting time interval to form the query-result interaction feature vector. S3. Initial score calculation: Input the retrieval request semantic vector, candidate result semantic vector and query-result interaction feature vector into the ranking score head in the relevance scoring model to obtain the initial relevance score of each candidate result; S4. Cross-request continuity calculation: For two adjacent search requests within the same search session, calculate the keyword overlap rate, semantic distance compensation of adjacent click results, normalized dwell ratio, and duplicate click marker, and generate a continuity coefficient accordingly. S5. Sample selection and incremental update: Based on the continuity coefficient, the number of consecutive retrieval rewrites and the dwell time threshold, enhance positive samples and difficult negative samples are selected. The samples are divided into popular word samples and long-tail word samples according to the historical retrieval frequency. Gradient accumulation is performed in two gradient accumulation channels respectively. While keeping the parameters of the semantic encoder of the large language model unchanged, the ranking score head parameters are incrementally updated. S6. Result Reordering Output: After the preset incremental update cycle ends, the relevance score of the candidate result list corresponding to the newly arrived retrieval request is recalculated using the updated relevance scoring model and the output is reordered.
[0007] As a preferred technical solution, in step S1, sessions are segmented according to user identifier, retrieval time order and idle time threshold. When the time interval between two adjacent retrieval requests is greater than the idle time threshold, it is determined as a new retrieval session. The request sequence, click sequence and page interaction sequence corresponding to each retrieval session are written into the session index table, click trajectory table and interaction feature table in the session cache, respectively.
[0008] As a preferred technical solution, the query-result interaction feature vector generated in step S2 includes at least: first-click position coefficient, normalized dwell time coefficient, normalized scroll depth coefficient, bounce marker, and retrieval rewriting time interval coefficient.
[0009] As a preferred technical solution, the retrieval request semantic vector and the candidate result semantic vector are fixed-dimensional vectors, and are generated by the same large language model semantic encoder and written into the vector cache for reuse in scoring calculation and continuous calculation.
[0010] As a preferred technical solution, the continuity coefficient in step S4 is obtained by weighted summation of keyword overlap rate, semantic distance compensation between two adjacent click results, normalized dwell ratio of two adjacent click results, and duplicate click markers.
[0011] As a preferred technical solution, the semantic distance compensation amount is obtained by normalizing the distance value between the semantic vectors of the candidate results corresponding to two adjacent click results; the duplicate click marker is generated according to the following rules: when the first click result of two adjacent retrieval requests has the same document identifier, or has the same result clustering label obtained by clustering the semantic vectors of the candidate results, it is recorded as a duplicate click; otherwise, it is recorded as a non-duplicate click.
[0012] As a preferred technical solution, in step S5, when a sample meets the following conditions: the continuity coefficient is not lower than the first threshold, the dwell time of the first click result is not lower than the second threshold, and no new retrieval rewriting occurs within the preset observation time, the sample is determined as an enhanced positive sample. When a sample meets the following conditions: its continuity coefficient is lower than the first threshold, the number of consecutive retrievals and rewrites is not lower than the preset number, and the dwell time of each click is lower than the third threshold, the sample is identified as a difficult negative sample and written into the positive sample buffer and the negative sample buffer respectively.
[0013] As a preferred technical solution, in step S5, the search requests are divided into popular word samples and long-tail word samples according to the historical search frequency threshold. Popular word gradient accumulation channels and long-tail word gradient accumulation channels are established respectively. The gradient vectors in the two channels are normalized by norm and then weighted fusion is performed to update the ranking score header parameters. Among them, the lower limit of the fusion weight of long-tail word samples is greater than the lower limit of the fusion weight of popular word samples.
[0014] As a preferred technical solution, step S5 also includes multi-user consensus enhancement processing: within a preset statistical period, request clustering is performed on semantically similar retrieval requests, result clustering is performed on candidate results according to semantic vectors, and the click concentration and average dwell time of different users for the same result cluster are statistically analyzed. When the click concentration is higher than the fourth threshold and the average dwell time is higher than the fifth threshold, the corresponding sample is determined as a consensus enhancement sample, and its sample weight is increased when updating the ranking score header parameters.
[0015] As a preferred technical solution, step S5 also includes abnormal sample filtering: samples with fewer than a preset lower limit of page interaction are removed, and samples whose click paths deviate from the center path of the same retrieval session sample set by more than a preset threshold are downweighted.
[0016] As a preferred technical solution, the central path is calculated by taking the mean of the click position sequence, dwell time sequence, and scroll depth sequence within the same retrieval session, and the path deviation distance is calculated by taking the sequence distance between the path of the sample to be tested and the central path.
[0017] This invention also provides a search relevance scoring optimization system based on a large language model for implementing the method, comprising: a search server, a document index library, a session cache, a vector cache, and a processor; the search server further comprises a log collection unit, a session segmentation unit, a candidate result vectorization unit, an initial scoring unit, a cross-request continuity calculation unit, a sample screening and incremental update unit, and a result rearrangement unit.
[0018] As a preferred technical solution, the session segmentation unit is connected to the session cache, the candidate result vectorization unit is connected to the document index and the vector cache, and the sample screening and incremental update unit is connected to the initial scoring unit and the cross-request continuity calculation unit.
[0019] As a preferred technical solution, the candidate result vectorization unit includes a large language model semantic encoder, and the initial scoring unit includes a ranking scoring head; the sample screening and incremental update unit includes an enhanced positive sample screening subunit, a difficult negative sample screening subunit, a popular word gradient accumulation subunit, a long-tail word gradient accumulation subunit, a multi-user consensus enhancement subunit, and an abnormal sample filtering subunit; the incremental update process keeps the parameters of the large language model semantic encoder unchanged, and only updates the ranking scoring head parameters.
[0020] Beneficial effects This invention introduces a cross-request continuity calculation mechanism within the same retrieval session. It combines keyword overlap rate, semantic distance compensation between adjacent click results, normalized dwell ratio, and repeated click markers to construct a continuity coefficient. This allows relevance assessment to move beyond a single retrieval request and click feedback, reflecting the evolution of the user's true search intent during continuous rewriting. Based on this continuity coefficient, enhanced positive samples and difficult negative samples are filtered, enabling the ranking score head update to more closely resemble the intent convergence process in real search scenarios. This improves the adaptability of relevance scoring optimization to complex retrieval paths.
[0021] This invention addresses the differences in historical search frequency by dividing samples into popular word samples and long-tail word samples, and setting gradient accumulation channels for each. After norm normalization of the gradient vectors in both channels, a weighted fusion is performed, with a higher lower bound for the fusion weights of long-tail word samples. This prevents the ranking score header parameter updates from being overly dominated by high-frequency search samples. This dual-channel incremental update method maintains stable optimization for high-frequency queries while enhancing the learning depth for low-frequency, segmented, and semantically sparse search requests, demonstrating a targeted improvement for long-tail search scenarios.
[0022] This invention further introduces multi-user consensus enhancement and abnormal sample filtering in the incremental update stage. On the one hand, it extracts effective training samples with group consistency by statistically analyzing the cross-user click concentration and average dwell time after clustering semantically similar requests and results. On the other hand, it reduces the interference of occasional clicks, abnormal browsing paths, and noise feedback on parameter updates by removing or downweighting low-interaction samples and path deviation samples. Furthermore, while keeping the parameters of the large language model's semantic encoder unchanged, only the ranking and scoring head is incrementally updated, so that sample enhancement, noise suppression, and lightweight updates form a synergistic relationship. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation
[0024] To enhance understanding of the present invention, the present invention will be further described in detail below with reference to embodiments. These embodiments are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.
[0025] Example 1 This embodiment provides a method for optimizing search relevance scoring based on a large language model, applied to a search server. The search server is communicatively connected to a document index, a session cache, a vector cache, and a processor for performing ranking calculations and parameter updates.
[0026] The search server can be deployed in site search, knowledge base search, question-and-answer retrieval, or general information retrieval scenarios. Its purpose is to incrementally optimize the relevance score of candidate results by combining the behavioral feedback of users in the continuous retrieval process, so that the output ranking is more in line with the user's true intention.
[0027] In this embodiment, the large language model is primarily used as a semantic encoder to map the retrieval request text and candidate result text into semantic vectors that can be compared and scored. The ranking and scoring head serves as a lightweight scoring structure, used to fuse semantic and interaction information and output a relevance score. The entire method can be executed cyclically according to a preset period, thus forming a continuous optimization process of "log collection, sample construction, parameter update, and result rearrangement." Figure 1 As shown, the specific steps include: S1. Log Collection and Session Segmentation: After a user initiates a search request through the terminal, the search server collects the behavior logs related to the request in real time.
[0028] The collected data includes user identifier, search request text, candidate result display sequence, click location, click timestamp, page dwell time, page scroll depth, bounce marker, and search rewriting time interval. The search rewriting time interval represents the time difference between the current request and the previous request from the same user, reflecting whether the user continuously adjusts their search expression within a short period. To ensure a consistent data boundary for subsequent continuity assessments, this embodiment segments the session based on the same user's continuous search behavior within a preset idle time threshold.
[0029] For example, the idle time threshold can be set to 15 to 30 minutes. When the time interval between two adjacent requests exceeds this threshold, the subsequent request is considered a new retrieval session. After session segmentation is completed, the request sequence, click sequence, and page interaction sequence corresponding to each session are written into the session index table, click trajectory table, and interaction feature table in the session cache, respectively, so that subsequent steps can read them directly.
[0030] This process organizes previously discrete single search logs into retrieval session data with sequential relationships, providing a foundation for subsequent analysis of changes in user intent.
[0031] S2. Candidate Result Vectorization and Interaction Feature Construction: For each retrieval request in each retrieval session, the search server first retrieves the corresponding candidate result list from the document index based on the original recall strategy. Then, it reads the title, abstract, text fragments, tag information, or other text fields that can characterize the document topic of the candidate results, and inputs the retrieval request text and candidate result text into the same large language model semantic encoder to obtain fixed-dimensional retrieval request semantic vectors and candidate result semantic vectors.
[0032] To avoid repeated coding during subsequent scoring and continuous calculations, this embodiment writes the generated semantic vector into a vector cache and establishes a mapping relationship according to the request identifier and document identifier.
[0033] Meanwhile, the click location, dwell time, scroll depth, bounce marker, and retrieval rewriting time interval are normalized to form a query-result interaction feature vector. Specifically, the click location can be converted into a first-click position coefficient or a position decay coefficient, the dwell time can be converted into a normalized dwell time coefficient, the scroll depth can be converted into a normalized scroll depth coefficient, the bounce marker can be processed into a binary value, and the retrieval rewriting time interval can be processed into a time interval coefficient reflecting the urgency of modification.
[0034] Through the above processing, the system simultaneously obtains vector information reflecting semantic matching relationships and interactive features reflecting user behavior quality, providing multi-dimensional input for subsequent scoring.
[0035] S3. Initial score calculation: After completing the construction of semantic vectors and interaction features, the retrieval request semantic vector, candidate result semantic vector, and query-result interaction feature vector are jointly input into the ranking score head in the relevance scoring model to obtain the initial relevance score of the candidate results.
[0036] The ranking score head can be a lightweight ranking module deployed in the search server, with fewer parameters than the semantic encoder of a large language model, which facilitates high-frequency incremental updates.
[0037] In this embodiment, the ranking score head does not regenerate the semantic representation, but rather fuses existing semantic vectors and interaction features to output a ranking score for candidate results for the current request. The processor forms an initial ranking list of results for the current request based on the initial relevance score and stores this ranking result in association with the user's subsequent actual click behavior.
[0038] It should be noted that this initial scoring stage is not the final optimization goal of this invention, but rather provides a basic scoring reference for subsequent sample selection and incremental updates. By combining static semantic matching results with dynamic interactive feedback, the system can more accurately distinguish between results that truly match the user's intent and results that only appear relevant on the surface but were not actually clicked.
[0039] S4. Cross-request continuity calculation: For two adjacent search requests within the same search session, this embodiment further calculates a continuity coefficient to characterize the evolution trend of search intent.
[0040] In practice, the process first involves calculating the keyword overlap between two adjacent search requests to obtain the keyword overlap rate. Then, the semantic vectors of the candidate results corresponding to the first or main click result in each request are read, and the semantic distance between them is calculated and mapped to a semantic distance compensation value. Next, a normalized dwell ratio is calculated based on the dwell time of the two adjacent click results. Simultaneously, it is determined whether the first click results of the two adjacent requests have the same document identifier or the same result cluster label obtained from the clustering of candidate result semantic vectors. If either condition is met, it is recorded as a duplicate click; otherwise, it is recorded as a non-duplicate click. The processor then comprehensively processes the keyword overlap rate, semantic distance compensation value, normalized dwell ratio, and duplicate click markers to generate a continuity coefficient.
[0041] This continuity coefficient describes whether a user, when continuously rewriting a search request, continues to converge around the same topic, or whether they are repeatedly trying different approaches due to topic shifts or unsatisfactory results. Compared to constructing samples based solely on a single click, this embodiment incorporates the dynamic changes in user intent into the training process through cross-request continuity analysis, resulting in higher consistency between the behavioral context and the determination of positive and negative samples.
[0042] S5. Sample Screening and Incremental Update: After obtaining the continuity coefficients, the search server begins to perform sample screening and update the ranking score header parameters.
[0043] First, enhanced positive samples and difficult negative samples are selected based on the continuity coefficient, the number of consecutive retrieval rewrites, and the dwell time threshold.
[0044] For example, when a sample meets the following conditions: the continuity coefficient is not lower than the first threshold, the dwell time of the first click result is not lower than the second threshold, and no new retrieval rewriting occurs within the preset observation time, it can be identified as an enhanced positive sample; when a sample meets the following conditions: the continuity coefficient is lower than the first threshold, the number of consecutive retrieval rewritings is not lower than the preset number, and the dwell time of each click is lower than the third threshold, it can be identified as a difficult negative sample and written into the positive sample buffer and the negative sample buffer respectively.
[0045] Subsequently, the samples were divided into popular word samples and long-tail word samples according to the historical retrieval frequency. Gradient accumulation channels for popular words and long-tail word samples were established respectively. The gradient vectors in the two channels were accumulated and normalized according to norm. Then, the ranking score header parameters were updated according to the preset fusion rules. The lower limit of the fusion weight of long-tail word samples was higher than that of popular word samples to enhance the system's adaptability to low-frequency query scenarios.
[0046] In this embodiment, step S5 may further include multi-user consensus enhancement processing and abnormal sample filtering processing.
[0047] For multi-user consensus enhancement processing, request clustering can be performed on semantically similar search requests within a preset statistical period, and result clustering can be performed on candidate results according to semantic vectors. The click concentration and average dwell time for different users targeting the same result cluster are then statistically analyzed. When the click concentration exceeds a fourth threshold and the average dwell time exceeds a fifth threshold, the corresponding sample is identified as a consensus enhancement sample, and its sample weight is increased during parameter updates. For abnormal sample filtering, samples with fewer than a preset lower limit of page interactions are directly removed, and samples whose click paths deviate from the center path by more than a preset threshold are downweighted. The center path is calculated by averaging the click position sequence, dwell time sequence, and scroll depth sequence within the same search session sample set. These processes reduce the interference of accidental clicks, accidental clicks, extremely short browsing times, or abnormal access paths on the ranking and scoring head update process.
[0048] It should be noted that during the entire incremental update process, the parameters of the semantic encoder of the large language model remain unchanged, and only the ranking score header parameters are updated, thereby reducing the update cost and avoiding the deployment instability caused by frequent modification of the main parameters of the large language model.
[0049] S6. Result Reordering Output: After the preset incremental update cycle ends, for example, an update end node can be triggered by hour, day or cumulative sample size. The search server uses the updated relevance scoring model to process newly arrived search requests.
[0050] In practice, the system first retrieves the list of candidate results corresponding to the new request from the document index library, then calls the existing vectors in the vector cache or re-encodes and generates new semantic vectors, and combines them with the interaction feature vectors corresponding to the current request to input the updated sorting and scoring header, and recalculates the relevance score of each candidate result.
[0051] Subsequently, the candidate result list is rearranged based on the recalculated scores, and the ranking results are returned to the user terminal. For subsequent new click behaviors and retrieval rewriting behaviors, the search server continues to record, analyze, and incrementally learn according to steps S1 to S5, thereby forming a continuous closed-loop optimization.
[0052] Through this execution method, this embodiment can not only sort the results at the level of a single request, but also dynamically optimize the ranking score head for real search scenarios by combining changes in intent during continuous retrieval, long-tail query characteristics, and multi-user consensus information.
[0053] In summary, this embodiment constructs a relevance scoring optimization process that can run continuously on the search server side through processing steps such as session-level log organization, semantic vector caching, cross-request continuity calculation, positive and negative sample enhancement filtering, dual-channel gradient accumulation update, and lightweight rearrangement output.
[0054] Example 2 This embodiment provides a search relevance scoring optimization system based on a large language model, including a search server, a document index, a session cache, a vector cache, and a processor. The processor is used to perform data processing and calculation operations for each unit.
[0055] The document index library stores searchable text content and its index information; the session cache is used to store user behavior data organized by search session; the vector cache is used to store semantic vectors so that they can be directly reused in multiple calculations.
[0056] The search server is internally configured with a log collection unit, a session segmentation unit, a candidate result vectorization unit, an initial scoring unit, a cross-request continuous calculation unit, a sample screening and incremental update unit, and a result rearrangement unit. These units are connected sequentially according to the data processing order to form a complete processing flow.
[0057] The log collection unit is used to record user behavior information during the search process. When a user initiates a search request and browses the results, the log collection unit will simultaneously collect information such as user identifier, search request text, candidate result display order, click location, click time, page dwell time, page scroll depth, whether the user exits the search, and search rewrite time interval.
[0058] The above data can simultaneously reflect the user's input and actual browsing behavior, providing basic data for subsequent analysis.
[0059] The session segmentation unit is connected to the log collection unit and is used to organize continuous retrieval behaviors into several retrieval sessions. Specifically, the session segmentation unit classifies logs according to user identifiers and arranges them in chronological order. When the time interval between two adjacent retrieval requests exceeds a preset idle time threshold, it is divided into a new retrieval session.
[0060] After segmentation, the request sequence, click sequence, and page interaction sequence in each search session are written to the session cache. This method transforms fragmented search behaviors into continuous data with sequential relationships, facilitating the analysis of changes in user intent across multiple searches.
[0061] The candidate result vectorization unit is connected to the document index library and vector cache area, and is used to convert text data into semantic vectors.
[0062] This unit includes a large language model semantic encoder. Upon receiving a retrieval request, it first retrieves the corresponding candidate result text from the document index, and then encodes both the retrieval request text and the candidate result text to obtain fixed-dimensional semantic vectors for the retrieval request and candidate results. The generated vectors are stored in a vector cache for direct use in subsequent steps, avoiding redundant calculations.
[0063] Meanwhile, this unit will also normalize the click location, dwell time, scroll depth, bounce marker, and retrieval rewriting time interval to generate a query-result interaction feature vector, which is used to describe the user's actual feedback to different results.
[0064] The initial scoring unit is connected to the candidate result vectorization unit and is used to calculate the initial relevance of the candidate results. This unit includes a ranking scoring head, which takes the retrieval request semantic vector, the candidate result semantic vector, and the query-result interaction feature vector as input, and outputs a relevance score for each candidate result. The candidate results are ranked according to this score to obtain the initial result list for the current retrieval request. This ranking result is recorded and associated with the user's subsequent click behavior, providing a basis for subsequent optimization.
[0065] The cross-request continuity calculation unit is connected to the session cache and the vector cache, and is used to analyze the relationship between adjacent requests in the same retrieval session.
[0066] Specifically, this unit calculates the keyword overlap rate between two adjacent search requests, reads the corresponding semantic vectors, calculates the semantic distance between the two click results, and converts it into a semantic distance compensation amount. Furthermore, it calculates changes in dwell time based on click logs and determines whether there are instances of repeated clicks on the same result. After comprehensive processing of the above information, a continuity coefficient is generated to describe whether the user is continuously adjusting their search expression around the same goal or has changed their search direction.
[0067] The sample selection and incremental update unit is connected to the initial scoring unit and the cross-request continuity calculation unit, and is used to construct training samples and update the ranking model.
[0068] The unit first filters out enhanced positive samples and difficult negative samples based on continuity coefficient, dwell time and retrieval rewriting, and stores them in the corresponding buffers.
[0069] Subsequently, the samples were divided into popular keyword samples and long-tail keyword samples based on historical retrieval frequency, and gradient accumulation was performed in each of the two channels. After processing, the gradients of the two channels were normalized and fused according to preset weights to update the ranking score header parameters, with long-tail keyword samples having relatively higher weights.
[0070] Furthermore, this unit can cluster semantically similar requests and statistically analyze click patterns across multiple users, increasing the weight of samples with high consistency. Simultaneously, samples with abnormal or significantly deviating interaction behaviors are removed or downweighted. It should be noted that throughout the update process, the semantic encoder parameters of the large language model remain unchanged; only the ranking and scoring header parameters are updated to reduce computational complexity.
[0071] The result reordering unit is connected to the initial scoring unit and the sample screening and incremental update unit, and is used to output the optimized search results. After completing a round of parameter updates, for a new search request, the result reordering unit calls the updated ranking scoring header to recalculate the relevance score, sorts the candidate results, and returns the sorted results to the user.
[0072] As the system continues to run, new user behaviors are constantly collected and used to update the model, thereby gradually optimizing search results.
[0073] Through the above system structure, each functional unit works collaboratively according to the process of "data collection, data processing, semantic representation, score calculation, behavior analysis, model update - result output". Without changing the main structure of the large language model, the search relevance score is continuously optimized only through lightweight parameter updates, so that the system can output results that meet the actual needs of users more stably in complex retrieval scenarios.
[0074] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for optimizing search relevance scoring based on a large language model, characterized in that, When applied to a search server, the following steps are included: S1. Log collection and session segmentation: Collect user identifier, retrieval request text, candidate result display sequence, click location, click timestamp, page dwell time, page scroll depth, bounce marker and retrieval rewrite time interval, and segment the session according to the continuous retrieval behavior of the same user within a preset idle time threshold, and write each session data into the session cache area. S2. Candidate Result Vectorization and Interaction Feature Construction: Read the candidate result text from the document index library, use the large language model semantic encoder to generate the retrieval request semantic vector and the candidate result semantic vector respectively, and normalize the click position, dwell time, scroll depth, bounce mark and retrieval rewriting time interval to form the query-result interaction feature vector. S3. Initial score calculation: Input the retrieval request semantic vector, candidate result semantic vector and query-result interaction feature vector into the ranking score head in the relevance scoring model to obtain the initial relevance score of each candidate result; The ranking scoring head is a lightweight ranking module deployed on the search server, with fewer parameters than the semantic encoder of a large language model. S4. Cross-request continuity calculation: For two adjacent search requests within the same search session, calculate the keyword overlap rate, semantic distance compensation of adjacent click results, normalized dwell ratio, and duplicate click marker, and generate a continuity coefficient accordingly. The continuity coefficient is used to describe whether, when a user continuously rewrites a search request, they are still gradually converging around the same topic, or whether they are repeatedly trying to find the right topic after a topic shift or when the results are unsatisfactory. S5. Sample Screening and Incremental Update: Based on the continuity coefficient, number of consecutive retrieval rewrites, and dwell time threshold, enhanced positive samples and difficult negative samples are screened. Retrieval requests are divided into popular word samples and long-tail word samples according to the historical retrieval frequency threshold. Popular word gradient accumulation channels and long-tail word gradient accumulation channels are established separately. The gradient vectors in both channels are normalized using norms before weighted fusion is performed to update the ranking score header parameters. The lower limit of the fusion weight for long-tail word samples is greater than the lower limit of the fusion weight for popular word samples. Within a preset statistical period, requests with similar semantics are clustered, candidate results are clustered according to semantic vectors, and the click concentration and average dwell time of different users for the same result cluster are counted. When the click concentration is higher than the fourth threshold and the average dwell time is higher than the fifth threshold, the corresponding sample is determined as a consensus enhancement sample and its sample weight is increased when the ranking score header parameters are updated. S6. Result Reordering Output: After the preset incremental update cycle ends, the relevance score of the candidate result list corresponding to the newly arrived retrieval request is recalculated using the updated relevance scoring model and the output is reordered.
2. The method for optimizing search relevance scoring based on a large language model according to claim 1, characterized in that, In step S1, sessions are segmented according to user identifier, retrieval time order, and idle time threshold. When the time interval between two adjacent retrieval requests is greater than the idle time threshold, a new retrieval session is determined, and the request sequence, click sequence, and page interaction sequence corresponding to each retrieval session are written into the session index table, click trajectory table, and interaction feature table in the session cache, respectively.
3. The method for optimizing search relevance scoring based on a large language model according to claim 1, characterized in that, The query-result interaction feature vector generated in step S2 includes at least: first-click position coefficient, normalized dwell time coefficient, normalized scroll depth coefficient, bounce marker and retrieval rewrite time interval coefficient; The retrieval request semantic vector and the candidate result semantic vector are fixed-dimensional vectors, generated by the same large language model semantic encoder and written into the vector cache for reuse in scoring and continuity calculations.
4. The method for optimizing search relevance scoring based on a large language model according to claim 1, characterized in that, The continuity coefficient in step S4 is obtained by weighted summation of keyword overlap rate, semantic distance compensation between two adjacent click results, normalized dwell ratio of two adjacent click results, and duplicate click markers. The semantic distance compensation is obtained by normalizing the distance between the semantic vectors of candidate results corresponding to two adjacent clicks; the duplicate click marker is generated according to the following rules: A click is considered a duplicate if the first click result of two adjacent search requests has the same document identifier or the same cluster label obtained by clustering the semantic vectors of candidate results; otherwise, it is considered a non-duplicate click.
5. The method for optimizing search relevance scoring based on a large language model according to claim 1, characterized in that, In step S5, when a sample meets the following conditions: the continuity coefficient is not lower than the first threshold, the dwell time of the first click result is not lower than the second threshold, and no new retrieval rewriting occurs within the preset observation time, the sample is determined as an enhanced positive sample. When a sample meets the following conditions: its continuity coefficient is lower than the first threshold, the number of consecutive retrievals and rewrites is not lower than the preset number, and the dwell time of each click is lower than the third threshold, the sample is identified as a difficult negative sample and written into the positive sample buffer and the negative sample buffer respectively.
6. The method for optimizing search relevance scoring based on a large language model according to claim 1, characterized in that, Step S5 also includes abnormal sample filtering: Samples with fewer than a preset minimum number of page interactions are removed, and samples whose click paths deviate from the center of the same search session sample set by more than a preset threshold are downweighted. The central path is calculated by taking the mean of the click position sequence, dwell time sequence, and scroll depth sequence within the same retrieval session, and the path deviation distance is calculated by taking the sequence distance between the path of the sample to be tested and the central path.
7. A search relevance scoring optimization system based on a large language model, used to implement the method as described in any one of claims 1-6, characterized in that, include: Search servers, document indexes, session caches, vector caches, and processors; The search server also includes a log collection unit, a session segmentation unit, a candidate result vectorization unit, an initial scoring unit, a cross-request continuous calculation unit, a sample screening and incremental update unit, and a result rearrangement unit. The session segmentation unit is connected to the session cache, the candidate result vectorization unit is connected to the document index and the vector cache, and the sample screening and incremental update unit is connected to the initial scoring unit and the cross-request continuity calculation unit.
8. The search relevance scoring optimization system based on a large language model according to claim 7, characterized in that, The candidate result vectorization unit includes a large language model semantic encoder, and the initial scoring unit includes a ranking scoring head; The sample screening and incremental update unit includes an enhanced positive sample screening subunit, a difficult negative sample screening subunit, a popular word gradient accumulation subunit, a long-tail word gradient accumulation subunit, a multi-user consensus enhancement subunit, and an abnormal sample filtering subunit. The incremental update process keeps the parameters of the semantic encoder of the large language model unchanged, and only updates the ranking score header parameters.
Citation Information
Patent Citations
Search result sorting method and device, electronic equipment and storage medium
CN112100482A
Standard substance and standard substance retrieval and sorting method and system based on search engine
CN119127970A