An adaptive fusion retrieval enhancement method for EDA technical document question answering
By constructing a multi-granularity semantic alignment mechanism and an adaptive fusion strategy with dynamic weight adjustment, the problem of unstable retrieval results in EDA technical document question answering is solved, and efficient and stable document retrieval enhancement effect is achieved.
Patent Information
- Application Number
- CN202610679931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-04
- Estimated Expiration
- 2046-05-18
AI Technical Summary
In EDA technical document question-answering scenarios, existing technologies struggle to achieve systematic alignment and unified modeling of multi-granular semantic information, leading to unstable search results. Furthermore, existing methods have high computational complexity, making it difficult to meet the requirements for efficient retrieval.
By constructing a multi-granularity semantic alignment mechanism at the keyword, sentence, and document levels, and combining it with a pre-trained generative language model for structured semantic parsing, the multi-granularity fusion weights are dynamically adjusted to achieve an adaptive retrieval enhancement method.
It improves the relevance accuracy and ranking stability of document retrieval in multi-scenario question answering tasks, reduces system complexity, and is suitable for application scenarios such as EDA technology document question answering, knowledge augmentation generation, and intelligent question answering.
Smart Images

Figure CN122220501B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electronic design automation, and in particular relates to an adaptive fusion retrieval enhancement method for EDA technical document question answering. Background Technology
[0002] In the field of electronic design automation (EDA), a large amount of technical knowledge exists in the form of design specification documents, IP core description documents, RTL module interface documents, and EDA tool user manuals. These technical documents usually contain complex design flow descriptions, a large number of technical terms, and module interface information. However, these documents are usually long, complex in structure, and contain a large number of technical terms, making it difficult for engineers to quickly locate the required technical information when performing design stages such as Register Transfer Level (RTL) design and low-power optimization. Traditional retrieval methods are difficult to accurately locate core information, resulting in reduced design efficiency.
[0003] With the rapid development of natural language processing and information retrieval technologies, document retrieval plays a crucial role in applications such as intelligent question answering systems and retrieval-augmented generation (RAG). The quality of relevance ranking during the retrieval phase directly affects the quality of contextual information provided by the retrieval-augmented generation system to the generative model, thus determining the overall performance of the question answering system. Currently, existing technologies for modeling the relevance between documents and queries mainly include the following methods: Traditional lexical matching-based retrieval methods measure relevance by comparing the literal matching of query terms with words in documents. These methods typically rely on inverted indexes and term frequency statistics for fast retrieval and ranking. Typical methods use metrics such as term frequency-inverse document frequency to weight the importance of keywords, thereby obtaining a matching score between the document and the query.
[0004] These methods are computationally efficient and simple to implement, making them suitable for fast retrieval scenarios in large-scale document databases. However, they rely solely on surface-level lexical matching, making it difficult to capture semantic relationships and effectively handle synonymous expressions or contextual semantic changes. Furthermore, by using the entire document as the basic matching unit, they lack the ability to finely characterize key information within the document, making them prone to missing highly relevant documents in complex query scenarios.
[0005] Vector retrieval methods based on semantic embedding utilize pre-trained language models (such as BERT) to map queries and documents to the same semantic vector space. They achieve semantic relevance retrieval through vector similarity calculation, thus overcoming the limitation of traditional lexical matching in handling semantically similar expressions. While this method can improve semantic coverage to some extent, it typically uses a single vector representation to model the entire document or paragraph, easily losing key information at the word or sentence level, and has limited ability to express long documents and complex semantic structures. Furthermore, the vector index construction and similarity search processes are computationally expensive, and the retrieval results lack interpretability, failing to clearly reflect which content within the document primarily contributes to the matching results.
[0006] Retrieval methods based on multi-searcher fusion ranking combine the ranking results of multiple base searchers to generate a fused ranking list, thereby improving overall retrieval performance and stability. Common approaches include ranking-based or weighted rule-based fusion strategies. While these methods can alleviate the performance fluctuations of a single searcher to some extent, they often rely on fixed weights or empirical rules for fusion, failing to fully utilize the differences in semantic matching strength among different search results. Furthermore, they lack targeted processing of multi-granular semantic information, making it difficult to dynamically adjust the fusion strategy according to different query scenarios, resulting in insufficient adaptability. The performance of fusion methods is highly dependent on the quality of the base searchers and the design of the fusion strategy, exhibiting significant fluctuations across different task scenarios.
[0007] Retrieval methods based on self-supervised training or feature memory mechanisms enhance the representation capabilities of documents or sentences through self-supervised training or the construction of feature memories to support efficient semantic matching retrieval. While these methods improve feature representation capabilities and retrieval efficiency to some extent, they typically require complex training processes or feature maintenance mechanisms, resulting in high system implementation costs. Furthermore, most methods still primarily rely on single-granularity semantic representations, lacking systematic fusion modeling of keyword-level, sentence-level, and document-level information, thus limiting their adaptability to diverse query requirements.
[0008] Retrieval methods based on sentence-level knowledge enhancement improve the accuracy and reliability of generated answers by filtering key sentences from candidate documents that are helpful for answer generation and guiding the model to focus on relevant sentence content during the generation stage.
[0009] This method effectively utilizes sentence-level key information during the generation stage, but it still mainly relies on document-level relevance results during the retrieval and ranking stage, lacking a unified modeling and fusion mechanism for keyword-level and sentence-level information. At the same time, its weighting strategy is usually set with fixed parameters, lacking the ability to adaptively adjust for the semantic matching strength of different candidate documents, and its stability is still insufficient in complex scenarios.
[0010] Semantic extraction methods based on pre-trained models leverage the semantic understanding capabilities of pre-trained language models to extract key information from documents. However, existing methods often employ general extraction strategies, lacking semantic guidance mechanisms tailored to specific query intents, and are not effectively integrated with multi-granularity retrieval ranking, making it difficult to achieve refined information filtering during the retrieval stage. In particular, existing methods often process all sentences in a document, resulting in high computational complexity and failing to meet the efficient retrieval requirements of large-scale document databases.
[0011] In summary, existing document retrieval methods still have shortcomings in terms of multi-granularity semantic information utilization, the fineness of relevance modeling, and the adaptive capability of fusion strategies, making it difficult to meet the high-precision retrieval requirements of EDA technology document question answering scenarios. Summary of the Invention
[0012] To address the aforementioned shortcomings in existing technologies, this invention provides an adaptive fusion retrieval enhancement method for EDA technical document question answering, which solves the problems of single semantic matching granularity, coarse relevance modeling, and insufficient utilization of key information within documents that are common in the retrieval stage of existing retrieval enhancement generation systems.
[0013] To achieve the above objectives, the technical solution adopted by this invention is: an adaptive fusion retrieval enhancement method for EDA technical document question answering, comprising the following steps: S1. Obtain the document set in the EDA application scenario, construct the semantic unit set by performing structured semantic parsing on the documents and query text, and obtain the confidence information of keywords and key sentences; S2. Based on the document set, use term matching relationships to calculate the document-level relevance score, and perform preliminary screening of the document set to obtain a candidate document set; S3. Based on the semantic unit set, according to the document-level relevance score and the confidence information of keywords and key sentences, a multi-granular semantic alignment mechanism at the keyword level, sentence level and document level is introduced into the candidate document set to calculate the comprehensive relevance score, and the candidate document set is sorted to obtain enhanced search results. S4. Input the enhanced search results into the preset generation model of the EDA application scenario to obtain answers assisted by multi-granular semantic information, and complete the adaptive fusion search enhancement.
[0014] The beneficial effects of this invention are as follows: By constructing a multi-granularity semantic alignment mechanism and an adaptive fusion strategy guided by discriminability perception and confidence, this invention effectively improves the relevance accuracy and ranking stability of document retrieval in multi-scenario question answering tasks without significantly increasing system complexity. It is applicable to various application scenarios such as EDA technology document question answering, knowledge enhancement generation, and intelligent question answering, and has high engineering value.
[0015] Further, S1 includes the following steps: S101. Obtain a collection of documents in the EDA application scenario, including EDA design specification documents, IP core description documents, register transfer level module interface description documents, chip design flow documents, and EDA tool user manuals. S102. Based on each document in the document set, use a pre-trained generative language model and pre-defined instruction constraints to perform structured semantic parsing processing for information extraction and semantic summarization operations on each document, and construct a document-side semantic unit containing a set of document keywords, a set of document key sentences, and a document summary sentence. S103. Based on the input query text, use a pre-trained generative language model to perform structured semantic parsing processing on the query text, including query expansion and semantic element extraction, and construct a query-end semantic unit that includes query rewriting and a set of query keywords. S104. Integrate the semantic units on the document side and the semantic units on the query side to obtain a set of semantic units; S105. In response to the extraction and generation of semantic unit sets, confidence information of keywords and key sentences is obtained by recording the word-level probability information of pre-trained generative language models in generating document keywords, document key sentences, document summary sentences and query keywords.
[0016] The beneficial effects of the above-mentioned further solutions are as follows: This invention uses a pre-trained generative language model to extract representative key sentences directly related to the question-answering target and a document summary sentence that summarizes the overall content of the document from the document based on the semantic association between the question-answering target and the document content. This replaces the processing of all sentences and avoids redundant calculations of irrelevant sentences, significantly improving computational efficiency in large-scale EDA document library scenarios.
[0017] Furthermore, S2 specifically refers to: Based on the document set, the frequency of keyword occurrence in a single document is obtained by using term matching relationships. Combined with the document length and the inverse document frequency of the term, a document-level relevance score is calculated. Based on the document-level relevance scores, the document set is sorted, and a predetermined number of documents with the highest scores are selected to obtain a candidate document set.
[0018] The beneficial effects of the above-mentioned further solutions are as follows: the present invention improves the accuracy of search results by calculating document-level relevance scores and completing preliminary retrieval, and by applying the document-level relevance scores to subsequent ranking.
[0019] Furthermore, step S3 includes the following steps: S301. Based on the query keyword set and document keyword set in the semantic unit set, by comparing the matching relationship between the query keyword set and the document keyword set, a keyword-level multi-granularity semantic alignment mechanism is set up to calculate the keyword-level alignment score. S302. Based on the set of query keywords and the set of key sentences in the semantic unit set, a sentence-level multi-granular semantic alignment mechanism is set up by matching query keywords and calculating semantic similarity to obtain a sentence-level alignment score. S303. Normalize the keyword-level alignment score and sentence-level alignment score to obtain the normalized keyword-level alignment score and sentence-level alignment score. S304. Based on the confidence information of keywords and key sentences, set the gating coefficients, and use the gating coefficients to perform gating fusion on the normalized keyword-level alignment scores and the normalized sentence-level alignment scores to obtain fine-grained fusion scores. S305. Based on the document-level relevance score and the fine-grained fusion score, combined with exponential normalization, the coefficient of variation weight is calculated and logically transformed to obtain the transformed coefficient of variation weight. Based on the confidence information of keywords and key sentences, the overall confidence offset term is obtained and fused to obtain the adaptive residual coefficient. S306. Calculate the comprehensive relevance score based on the document-level relevance score, the adaptive residual coefficient, and the fine-grained fusion score. S307. Rank the candidate documents using the comprehensive relevance score, and obtain enhanced search results by selecting a preset number of candidate documents.
[0020] Furthermore, the expression for the keyword-level alignment score is as follows: ; , , ; ; in, This indicates the keyword-level alignment score. , , Both represent weighting constants. Indicates recall rate, Indicates similarity. Indicates accuracy. This represents the set of query keywords covered by the document. This represents a set of query keywords. Represents a set of document keywords. This represents the set of query keywords that were matched by the set of document keywords through partial substring matching.
[0021] The beneficial effects of the above-mentioned further solutions are as follows: By simultaneously introducing three semantic granularity relevance calculation methods—keyword-level, sentence-level, and document-level—this invention models the matching relationship between the query and the document's keyword set, key sentence set, and overall semantic representation, respectively, thereby achieving cross-granularity semantic alignment processing. This enables more accurate capture of local key information in the document that is highly relevant to the query, and is particularly suitable for complex query scenarios where key information is distributed across multiple sentences or local paragraphs, thus improving the relevance accuracy of the retrieval results.
[0022] Furthermore, the expression for the sentence-level alignment score is as follows: ; ; in, This indicates the sentence-level alignment score. Indicates the total number of key sentences in the document. This indicates an adjustable weight parameter. Indicates query With document key sentences Semantic similarity between them Indicates the query text. Indicates the first One key sentence, Indicates key sentences in a document The proportion of keywords covered in the search query. Indicates the search keywords. This indicates the keyword hit rate for a single sentence.
[0023] The beneficial effects of the above-mentioned further solutions are as follows: Through keyword-level and sentence-level semantic alignment mechanisms, this invention can effectively identify technical statements and design specifications that are highly relevant to the query questions, thereby improving the retrieval accuracy and engineering application value of the EDA design question answering system, making it highly applicable to EDA technical document question answering scenarios, and solving the problem of difficulty in accurately locating key technical segments related to design questions.
[0024] Furthermore, the expression for the fine-grained fusion score is as follows: ; , ; ; ; in, This indicates the fine-grained fusion score. Indicates to Perform truncated gating weights. This represents the normalized keyword-level alignment score. This represents the normalized sentence-level alignment score. This represents min-max normalization. Indicates the gating coefficient. Indicates the benchmark weight. This indicates the gating sensitivity parameter.
[0025] The beneficial effects of the above-mentioned further solutions are as follows: By analyzing the dispersion of fine-grained semantic alignment scores and document-level relevance scores in the candidate set, this invention dynamically adjusts the weight ratio of different granularity scores in the final ranking result. This achieves the following: when the fine-grained alignment result has strong discriminative ability in the candidate documents, its weight in the fusion result is increased; when the fine-grained alignment score has insufficient discriminative ability, the influence of the overall document-level similarity is enhanced. Based on the discriminative ability of each granularity score under different query scenarios, the fusion weight is automatically adjusted to dynamically adapt to different query complexities and semantic expression differences, thus avoiding the problem of insufficient adaptability of fixed weight strategies under different query scenarios.
[0026] Furthermore, step S305 includes the following steps: S3051. Based on the document-level relevance score and the fine-grained fusion score, calculate the coefficient of variation of the fine-grained score and the coefficient of variation of the document-level score. S3052. Using exponential normalization, the fine-grained score coefficient of variation and the document-level score coefficient of variation are converted into coefficient of variation weights, and the coefficient of variation weights are logically transformed to obtain the transformed coefficient of variation weights. S3053. Based on the confidence information of keywords and key sentences, set a neutral threshold and calculate the overall confidence offset. S3054. Using the S-shaped growth curve, the transformed coefficient of variation weights are fused with the overall confidence bias term to obtain the adaptive residual coefficients.
[0027] Furthermore, the expression for the adaptive residual coefficient is as follows: ; , ; ; , ; in, Represents the adaptive residual coefficient. Indicates an S-shaped growth curve. The weights represent the transformed coefficients of variation. This represents the overall confidence offset term. This represents the confidence shift sensitivity parameter. This represents the average confidence level of the keywords and key sentences as a whole. Indicates the neutral threshold. Represents logical transformation, Indicates the weight of the coefficient of variation. This represents the coefficient of variation for fine-grained scores. The standard deviation of the fine-grained fusion score is represented by the following: This represents the mean of the fine-grained fusion score. This represents the coefficient of variation for document-level scores. The standard deviation of the document-level relevance score. This represents the mean of the document-level relevance scores.
[0028] Furthermore, the expression for the comprehensive relevance score is as follows: ; in, This represents the overall relevance score. This represents the document-level relevance score. Represents the adaptive residual coefficient. This indicates the fine-grained fusion score.
[0029] The beneficial effects of the above-mentioned further solutions are as follows: By combining semantic confidence to further adjust the fusion results, the present invention effectively improves the stability and reliability of the retrieval result ranking. Through a lightweight similarity calculation and weight adjustment mechanism, it achieves the ability to directly reuse existing retrieval and semantic coding models without relying on large-scale parameterized retrieval models or end-to-end training processes. It has good modular plug-and-play characteristics and engineering feasibility. Compared with retrieval enhancement methods that require complex model training and high computational resource consumption, it significantly reduces the system training cost and computational resource consumption, making it easy to deploy in application scenarios with limited resources or high requirements for response speed. By adjusting the alignment granularity type, fusion strategy, and query type classification rules, it can flexibly adapt to different data scales, different application fields, and different generation tasks, and has good versatility and scalability, achieving the goal of not needing to modify the downstream generation model structure. Attached Figure Description
[0030] Figure 1 This is a flowchart of the method of the present invention.
[0031] Figure 2 This is a flowchart of the semantic unit construction process in this embodiment.
[0032] Figure 3This is a flowchart of the fine-sorting stage in this embodiment.
[0033] Figure 4 This is a schematic diagram of candidate documents in this embodiment. Detailed Implementation
[0034] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0035] Before describing this embodiment, the following terms will be explained: min-max normalization: min-max normalization; softmax: Normalized exponential function; top-k: The top k best; Logit transformation: Logical transformation; sigmoid function: S-shaped growth curve; token: word element; logprob: Logarithmic probability.
[0036] Example The existing retrieval methods have the following main shortcomings: Document-level relevance modeling is too coarse-grained and fails to depict the correspondence between key local information. Existing retrieval methods based on keyword matching or vector similarity typically use the entire document or paragraph as the basic matching unit, which only reflects the semantic similarity between the query and the document as a whole. They are difficult to accurately capture local information such as keywords or key sentences that are highly relevant to the query within the document, and are prone to causing unstable ranking results in scenarios where key information is scattered or expressed in various forms.
[0037] Multi-granular semantic information lacks a systematic alignment modeling mechanism: While some existing methods have introduced sentence-level or word-level features to participate in retrieval ranking, they are mostly based on independent modeling at a single granularity or simple splicing. They lack a systematic semantic alignment and unified modeling mechanism for semantic information at the keyword level, sentence level, and document level, making it difficult to fully characterize the comprehensive impact of different semantic granularities on document relevance.
[0038] The fusion ranking strategy relies on fixed weights or empirical rules, which lacks adaptability. Existing multi-feature fusion methods mostly use manual weight setting or fusion based on ranking rules, without combining the candidate document score distribution characteristics to adaptively and dynamically adjust the matching results at different granularities. This makes it difficult to achieve adaptive optimization for different query complexities and semantic expression differences, and performance fluctuations are likely to occur in multi-scenario applications.
[0039] Some high-precision methods rely on complex model structures and large-scale training processes, resulting in high engineering costs. Some existing retrieval enhancement methods rely on complex deep neural network structures or end-to-end training mechanisms, which increases the complexity of system design and the consumption of computational resources, making it difficult to quickly integrate them into existing retrieval systems and deploy them in resource-constrained environments.
[0040] Existing methods based on large language models lack a refined information filtering mechanism in the retrieval stage: While existing methods utilize large language models for information extraction, they mostly employ full-processing or general extraction strategies, failing to target key information based on retrieval and ranking requirements. Furthermore, they lack deep integration with multi-granularity relevance modeling, making it difficult to reduce computational overhead while maintaining high recall.
[0041] Therefore, an adaptive retrieval method is needed that can simultaneously utilize keyword-level, sentence-level, and document-level semantic information for collaborative modeling while maintaining the basic retrieval structure, and dynamically and adaptively adjust multi-granularity fusion weights based on the candidate document score distribution discriminability and semantic confidence, so as to achieve refined and stable retrieval ranking. While maintaining the existing basic retrieval architecture, a fine-grained semantic alignment mechanism at the keyword and sentence levels is constructed, and adaptive fusion ranking is performed by combining document-level relevance scores. This enables refined matching and dynamic weight adjustment between queries and key document information, thereby obtaining more accurate, stable, and interpretable document retrieval ranking results and further improving the overall performance of the retrieval enhancement generation system in EDA technology document question answering scenarios.
[0042] like Figure 1 As shown, this invention provides an adaptive fusion retrieval enhancement method for EDA technical document question answering, the implementation method of which is as follows: S1. Obtain the document set in the EDA application scenario. By performing structured semantic parsing on the documents and query text, construct a semantic unit set and obtain the confidence information of keywords and key sentences. The specific steps are as follows: S101. Obtain a collection of documents in the EDA application scenario, including EDA design specification documents, IP core description documents, register transfer level module interface description documents, chip design flow documents, and EDA tool user manuals. S102. Based on each document in the document set, use a pre-trained generative language model and pre-defined instruction constraints to perform structured semantic parsing processing for information extraction and semantic summarization operations on each document, and construct a document-side semantic unit containing a set of document keywords, a set of document key sentences, and a document summary sentence.
[0043] In this embodiment, adaptive retrieval enhancement specifically improves the accuracy of the generative model's answers to EDA technical document question scenarios by using keyword-level and sentence-level semantic alignment and dynamically adjusting multi-granularity relevance scores using an adaptive weight fusion strategy. The overall process includes four stages: preprocessing and semantic unit construction, candidate document coarse screening, multi-granularity semantic alignment fine ranking, and sorting output. Preprocessing and semantic unit construction stage: In EDA application scenarios, the document collection may include EDA design specification documents, IP core specification documents, RTL module interface specification documents, chip design flow documents, and EDA tool user manuals; like Figure 2 As shown, in the preprocessing stage, structured semantic parsing is performed on the document and query text to construct the set of semantic units required for multi-granularity alignment, specifically: Document-level semantic unit construction is performed. For each document in the document collection, a pre-trained generative language model or other models with semantic generation capabilities are used to perform information extraction and semantic generalization operations under preset instruction constraints to construct multi-type semantic units for each document, including: The document keyword set K is obtained by generating a set of keywords or phrases that can represent the core semantics of the document through a language model based on the given document content, and integrating them into the document keyword set K, which is used to characterize the core conceptual information of the document. Document Key Sentence Collection The specific acquisition method is as follows: given the document content and the corresponding question-answering target, guide the language model to extract several (preferably 2-3) sentences (not all sentences) that are directly related to the question-answering target or have a semantic support relationship from the document based on semantic relevance, as a set of key sentences to represent the core semantic segments in the document; Document summary sentence The specific acquisition method is as follows: based on the overall content of the document, a summary sentence that can summarize the semantics of the document's theme is generated through a language model, and this summary sentence is incorporated into the key sentence set to enhance the overall semantic expression ability of the document.
[0044] S103. Based on the input query text, use a pre-trained generative language model to perform structured semantic parsing processing on the query text, including query expansion and semantic element extraction, and construct a query-end semantic unit that includes query rewriting and a set of query keywords. S104. Integrate the semantic units on the document side and the semantic units on the query side to obtain a set of semantic units; S105. In response to the extraction and generation of semantic unit sets, confidence information of keywords and key sentences is obtained by recording the word-level probability information of pre-trained generative language models in generating document keywords, document key sentences, document summary sentences and query keywords.
[0045] In this embodiment, query-side semantic units are constructed. For the input query, a pre-trained generative language model or other models with semantic generation capabilities are used to expand the query and extract semantic elements to construct query-side semantic units, including: Query rewriting: Under preset instruction constraints, generate multiple (preferably 3) semantically equivalent but differently expressed versions of the original query to expand the query expression space and enhance the semantic coverage, thereby reducing the impact of query wording differences on retrieval performance; Query keyword set The specific acquisition method is as follows: based on the original query and its rewritten results, the language model extracts keywords or phrases that can reflect the core semantics of the query, and after deduplication, a set of query keywords is formed. The semantic units from the document side and the semantic units from the query side are integrated to obtain a set of semantic units; In the above semantic unit extraction and generation process, the token-level probability information (logprob value, obtained from the token probability output by the language model during generation) of the language model when generating corresponding keywords, key sentences, and summary sentences is recorded to represent the generation confidence information of keywords and key sentences. This information is then retained as the confidence representation information of the corresponding semantic units, resulting in the confidence information of keywords and key sentences. This confidence information is used to assist in the subsequent judgment of the reliability of different semantic units. Specifically: For each keyword or key sentence corresponding word sequence Obtain the log probability values of each word generated by the pre-trained generative language model. ,in, , representing the logarithmic probability of the i-th word source; The average log probability is calculated and expressed as follows: ; in, Represents the average logarithmic probability; The average log probability is obtained through linear mapping and stage operations. Normalization to The interval is used to obtain the confidence scores of keywords and key sentences. C The expression is as follows: ; in, Indicates the confidence level of keywords and key sentences. This represents the preset offset constant, and its empirical value is usually taken as... Preferred , Indicates will Values are limited to interval, due to The closer to 0, the higher the probability of model generation (the stronger the determinism), therefore The closer to 1, the higher the confidence level of the semantic unit.
[0046] S2. Based on the document set, calculate the document-level relevance score using term matching relationships, and perform preliminary screening of the document set to obtain a candidate document set, specifically: Based on the document set, the frequency of keyword occurrence in a single document is obtained by using term matching relationships. Combined with the document length and the inverse document frequency of the term, a document-level relevance score is calculated. Based on the document-level relevance scores, the document set is sorted, and a predetermined number of documents with the highest scores are selected to obtain a candidate document set.
[0047] In this embodiment, the candidate document coarse screening stage: A preliminary search of the EDA technology document library was performed, and document-level relevance scores were calculated based on term matching relationships. The document collection was initially screened, and several candidate documents with the highest scores were selected. Used in the subsequent fine-tuning stage. Represents a set of candidate documents; Preferably, search indexes are established for design specification documents, IP core specification documents, and RTL module interface documents respectively, in order to improve the search efficiency and relevance during the candidate document recall stage; The initial screening of the document collection involves calculating a document-level relevance score based on the frequency and importance of the query keywords and related terms in the documents. Its calculation expression is as follows: ; in, This represents the document-level relevance score. Indicates keywords, This represents a set of query keywords. Keywords Inverse document frequency, Keywords In the document Frequency of occurrence in Represents a document. and Both indicate adjustable smoothing parameters. Indicates document length; The document set is sorted according to the document-level relevance score, and a number of documents with higher scores are selected to form a candidate document set.
[0048] S3. Based on the semantic unit set, and according to the document-level relevance score and the confidence information of keywords and key sentences, a multi-granular semantic alignment mechanism at the keyword level, sentence level, and document level is introduced into the candidate document set to calculate the comprehensive relevance score. The candidate document set is then sorted to obtain enhanced search results. The specific steps are as follows: S301. Based on the query keyword set and document keyword set in the semantic unit set, a keyword-level multi-granularity semantic alignment mechanism is set by comparing the matching relationship between the query keyword set and the document keyword set, and the keyword-level alignment score is calculated.
[0049] In this embodiment, as Figure 3 As shown, in the multi-granularity semantic alignment and ranking stage, a multi-granularity semantic alignment mechanism at the keyword level, sentence level, and document level is introduced within the candidate document set to perform refined relevance modeling on the candidate documents; Keyword-level alignment score calculation is performed as follows: At the keyword granularity level, the matching relationship between the query keyword set Q and the document keyword set K is compared to calculate the keyword-level alignment score. This alignment process comprehensively considers both exact matching between keywords and partial matching of multi-word phrases, as shown in the following expression: ; , , ; ; in, This indicates the keyword-level alignment score. This represents the set of query keywords covered by the document. This represents a set of query keywords. Represents a set of document keywords. This represents the set of query keywords that were matched by the set of document keywords through partial substring matching. Representing similarity, EDA documents often contain a large number of keywords, while queries typically only contain a few. The Jaccard coefficient, through union normalization, is used to balance the difference in the size of the keyword sets between the query and the document. Recall, or recall rate, is used to ensure that most keywords in a query are covered. In chip design scenarios, the cost of missing key technical documents is far greater than the cost of false positives. High recall ensures that the query intent is fully covered. Precision rate indicates the percentage of keywords in a document, ensuring that irrelevant words contribute to the overall content and preventing documents from achieving higher scores despite mentioning the query term only in peripheral content. , , This represents the weighting constants set to take into account the contribution of each indicator to the retrieval accuracy. Keyword alignment score It is used to measure the document's coverage of the query at the core concept level and is an important part of subsequent multi-granularity fusion calculation; Given the characteristics of EDA document terminology, the terminology typically presents the following features: a hierarchical and complex structure, such as clock and gating, which can be either clock or gating; and the coexistence of abbreviations and full names, such as UPF and Unified Power Format, which are variants of the same term, and isolation cell and isolation strategy. By incorporating PartialMatch substring matching, we can avoid the missed detection issues caused by the precise matching of the original complete terms.
[0050] S302. Based on the set of query keywords and the set of key sentences in the semantic unit set, a sentence-level multi-granular semantic alignment mechanism is set up by matching query keywords and calculating semantic similarity to obtain a sentence-level alignment score.
[0051] In this embodiment, sentence-level alignment scores are calculated. Specifically, at the sentence granularity level, the system calculates sentence-level alignment scores based on a combination of explicit keyword matching and implicit semantic similarity. By jointly modeling the explicit keyword hit ratio and implicit semantic vector similarity, matching accuracy is improved. The expression is as follows: ; ; in, This indicates the keyword hit rate for a single sentence. This indicates the sentence-level alignment score. Indicates the total number of key sentences in the document. This indicates an adjustable weight parameter. Indicates query With document key sentences Semantic similarity between them Indicates the query text. Indicates the first One key sentence, Indicates key sentences in a document The percentage of the query keywords covered in the sentence; a hit is considered achieved when the query keywords appear as substrings in the sentence. Indicates the search keywords; When the semantic model is unavailable or the similarity is low, it can fall back to the keyword matching method to complete the sentence-level alignment calculation; at the same time, the document summary sentence is included as part of the key sentence in the sentence-level alignment calculation to enhance the overall semantic expressiveness of the document.
[0052] S303. Normalize the keyword-level alignment score and sentence-level alignment score to obtain the normalized keyword-level alignment score and sentence-level alignment score. S304. Based on the confidence information of keywords and key sentences, set the gating coefficients. Using the gating coefficients, gating and fusing the normalized keyword-level alignment scores and the normalized sentence-level alignment scores, the fine-grained fusion scores are obtained.
[0053] In this embodiment, fine-grained alignment score fusion is performed by gating and fusing keyword-level alignment scores with sentence-level alignment scores to obtain a fine-grained fusion score. Specifically: The keyword-level alignment scores and sentence-level alignment scores of the candidate document set are min-max normalized to facilitate fusion, resulting in normalized keyword-level alignment scores and normalized sentence-level alignment scores, as shown in the following expressions: ; ; in, This represents the normalized keyword-level alignment score. This represents min-max normalization. This represents the normalized sentence-level alignment score. The gating is dynamically adjusted based on the confidence difference between keywords and sentences to achieve an adaptive balance between word-level and sentence-level metrics. The gating coefficient is set as shown in the following expression: ; ; in, Indicates the gating coefficient. Indicates the benchmark weight. This indicates the gating sensitivity parameter. This represents the difference between the average confidence score at the keyword level and the average confidence score at the sentence level. , This represents the average confidence score at the keyword level. This represents the average confidence score at the sentence level. Indicates to The truncated gating weights are used to... Controlled Within the range; The keyword-level average confidence score Sentence-level average confidence score The calculation expression is as follows: ; ; in, Indicates the search keywords confidence level Indicates the search keywords. Document keywords Confidence level, Indicates document keywords, Indicates key sentences in a document Confidence level, Indicates key sentences in the document; Fine-grained fusion is performed to obtain a fine-grained fusion score, as shown in the following expression: ; in, This indicates the fine-grained fusion score; Fine-grained fusion score Used to characterize the overall degree of match between candidate documents and the query at a fine-grained semantic level.
[0054] S305. Based on the document-level relevance score and the fine-grained fusion score, combined with exponential normalization, the coefficient of variation weights are calculated and logically transformed to obtain the transformed coefficient of variation weights. Then, based on the confidence information of keywords and key sentences, the overall confidence offset is obtained and fused to obtain the adaptive residual coefficients. The specific steps are as follows: S3051. Based on the document-level relevance score and the fine-grained fusion score, calculate the coefficient of variation of the fine-grained score and the coefficient of variation of the document-level score. S3052. Using exponential normalization, the fine-grained score coefficient of variation and the document-level score coefficient of variation are converted into coefficient of variation weights, and the coefficient of variation weights are logically transformed to obtain the transformed coefficient of variation weights. S3053. Based on the confidence information of keywords and key sentences, set a neutral threshold and calculate the overall confidence offset. S3054. Using the S-shaped growth curve, the transformed coefficient of variation weights are fused with the overall confidence bias term to obtain the adaptive residual coefficients.
[0055] In this embodiment, after performing document-level score fusion and adaptive weight calculation to obtain a fine-grained fusion score, the fine-grained fusion score is then... Document-level relevance score The process involves merging the data to obtain a comprehensive relevance score between the document and the query. The specific steps are as follows: Fine-grained fusion score in the candidate set Document-level relevance score The mean, standard deviation, and coefficient of variation are calculated separately. The fine-grained score coefficient of variation and the document-level score coefficient of variation are then obtained through calculation, as shown in the following expressions: , ; in, This represents the coefficient of variation for fine-grained scores. The standard deviation of the fine-grained fusion score is represented by the following: This represents the mean of the fine-grained fusion score. This represents the coefficient of variation for document-level scores. The standard deviation of the document-level relevance score. The mean of the document-level relevance score and the coefficient of variation of the fine-grained score represent the mean of the document-level relevance score. and document-level score coefficient of variation Used to measure the discriminative power between different score sequences; The weights of the coefficient of variation are calculated using softmax, as shown in the following expression: ; in, Indicates the weight of the coefficient of variation; like Then the coefficient of variation weight A score closer to 1 indicates a greater tendency to trust finer-grained fusion scores. ; like Then the coefficient of variation weight A score closer to 0 indicates a greater tendency to trust document-level relevance scores. ; Weights of the coefficient of variation To perform a logit transformation and avoid instability when the value is close to 0 or 1, the expression is as follows: ; ; in, The weights represent the transformed coefficients of variation. Represents logical transformation; The overall confidence offset is calculated based on the average confidence of keywords and key sentences as a whole, and the expression is as follows: ; in, This represents the overall confidence offset term. This represents the confidence shift sensitivity parameter. This represents the average confidence level of the keywords and key sentences as a whole. This represents the neutral threshold, which is set based on the overall document confidence level. like When the offset term is positive, it tends to increase the fine-grained weighting. like A negative offset term tends to reduce the fine-grained weighting. Weights based on the transformed coefficient of variation With overall confidence offset The adaptive residual coefficients are calculated using the sigmoid function, as shown in the following expression: ; in, This represents the adaptive residual coefficient.
[0056] S306. Calculate the comprehensive relevance score based on the document-level relevance score, the adaptive residual coefficient, and the fine-grained fusion score. S307. Rank the candidate documents using the comprehensive relevance score, and obtain enhanced search results by selecting a preset number of candidate documents.
[0057] Based on document-level relevance score Adaptive residual coefficient Fine-grained fusion score The comprehensive relevance score is calculated, as shown in the following expression: ; in, This indicates the overall relevance score; The adaptive weights are dynamically adjusted by calculating the discriminative and confidence scores of keyword-level matching scores and sentence-level matching scores. Through this mechanism, the contribution ratio of fine-grained information and overall document relevance to the final ranking is dynamically adjusted. Based on the comprehensive relevance score The candidate documents are sorted, and the top-k EDA technology documents with the highest scores are selected as enhanced search results.
[0058] S4. Input the enhanced search results into the preset generation model of the EDA application scenario to obtain answers assisted by multi-granular semantic information, and complete the adaptive fusion search enhancement.
[0059] In this embodiment, the enhanced search results, the query keyword set Q, and the document keyword set K and document key sentence set corresponding to the final search results are input into the preset generation model. The preset generation model generates the final answer with the assistance of multi-granular semantic information.
[0060] In this embodiment, existing retrieval methods, such as Best Match Retrieval (BM25), Dense Paragraph Retrieval (DPR), Reverse Ranking Fusion RRF (BM25-DPR), Contextualized Late Interaction Retrieval (ColBERT), Fine-Grained Knowledge Enhancement Method for RAG (FKE), Relevance Estimation Enhanced RAG Method (RE-RAG), and Question and Paragraph Enhancement Method (QPaug), are compared with the method of this invention on public datasets in the field of natural language processing, and the results are shown in Table 1.
[0061] Table 1
[0062] In Table 1, Ours represents the method of this invention. NQ, Triviaqa, and Covidqa are all public datasets in the field of natural language processing. Recall@20 represents the top 20 recall rate, which is the proportion of golden documents appearing in the top 20 search results. MRR@10 represents the average inverted index score of the top 10 results, which only considers whether there are golden documents in the top 10 search results, takes the inverse of its ranking, and averages the sum of all the inverted rankings. F1 represents the harmonic mean of precision P and recall R. Due to the differences in implementation details, parameter settings, and candidate set size among different retrieval methods, the fusion method RRF failed to fully utilize its ranking advantage under the experimental settings, resulting in some of its indicators being lower than those of the single retrieval model. This phenomenon may occur in cases of low-quality candidate sets or when the fusion weights are not optimized. The results in Table 1 are obtained under a unified reproduction experimental configuration and do not represent the upper limit of the method's performance. This demonstrates the advantages of the method of this invention.
[0063] In this embodiment, an example of the EDA low-power integrated question and answer process is provided, such as... Figure 4 The five candidate document sample fragments shown are document D1, document D2, document D3, document D4, and document D5. The top two are selected as the final documents. User question: Please provide a feasible low-power design flow: from RTL to implementation and signoff, focusing on power domain, gating, and common pitfalls.
[0064] core_keywords: ["low power", "clock gating", "power domain", "UPF", "isolation", "retention", "multi-Vt", "signoff"]; And calculate document-level relevance scores. Keyword alignment score and sentence-level alignment score As shown in Tables 2 and 3, Table 2 is the document-level relevance score and keyword-level alignment score, and Table 3 is the sentence-level alignment score. Table 2
[0065] Table 3
[0066] Keyword alignment score and sentence-level alignment score Normalization and fine-grained fusion are performed to obtain the fine-grained fusion score. As shown in Table 4, Table 4 is a table of normalization and fine-grained fusion; Table 4
[0067] Calculate adaptive residual coefficients Relevance score ; Through fine-grained score variation coefficient Document-level score coefficient of variation The confidence level was calculated to obtain And using the comprehensive relevance score expression To perform the calculation, taking D1 as an example, ; Similarly, D2-D5 are calculated to obtain the comprehensive relevance score, as shown in Table 5. Table 5 is the comprehensive relevance score table. Table 5
[0068] During the generation phase, information from D1 and D2 is used to construct the prompt (keyword): [Doc 1]: Keywords: ["low power", "clock gating", "data gating", "operandisolation", "switching activity", "multi-Vt", "multi-voltage"]; Key Sentence: ["Prioritize architecture and algorithm to reduce unnecessary switching activities", "Use clock gating, data gating, operand isolation, and other techniques at the RTL layer"]; Summary: ["From reducing activity through architecture / algorithms, to RTL gating and multi-threshold / multi-voltage, and then to..."]; Context: Original document fragment [Doc 2]: Keywords: ["power domain", "always-on", "switchable", "isolation", "retention", "level shifter", "UPF"]; Key Sentence: ["Insert isolation cell at the power domain boundary", "Use retention cell for registers that need to retain state"]; Summary: ["Multi-power domain implementation depends on the correct configuration of isolation / retention / level shifter and..."]; Context: The original document fragment; The generative model generates technical solutions to problems faced by chip design engineers, supported by multi-granular semantic information. For example: {"answer":"A feasible low-power process typically involves: first, reducing unnecessary switching activities at the architecture / algorithm level; second, systematically introducing clock gating, data gating, and operation isolation at the RTL layer, ensuring stable and fully verified control signals; then, dividing the power domain according to system requirements, clearly defining the always-on and turn-off domains in the UPF, configuring isolation / retention, and cross-voltage level shifters; finally, using power analysis tools to quantitatively evaluate and regress power consumption under different operating modes during the implementation and signoff phases. Common problems include sporadic gating without considering real stimuli, incomplete power domain boundary strategies, and inconsistencies between UPF and RTL / constraints leading to functional or timing anomalies in low-power modes."}
Claims
1. An adaptive fusion retrieval enhancement method for EDA technical document question answering, characterized in that, Includes the following steps: S1. Obtain the document set in the EDA application scenario, construct the semantic unit set by performing structured semantic parsing on the documents and query text, and obtain the confidence information of keywords and key sentences; The semantic unit set includes document-side semantic units and query-side semantic units; the document-side semantic units include a document keyword set, a document key sentence set, and a document summary sentence; the query-side semantic units include query rewriting and query keyword sets. S2. Based on the document set, use term matching relationships to calculate the document-level relevance score, and perform preliminary screening of the document set to obtain a candidate document set; S3. Based on the semantic unit set, and according to the document-level relevance score and the confidence information of keywords and key sentences, a multi-granularity semantic alignment mechanism at the keyword, sentence, and document levels is introduced into the candidate document set to calculate the comprehensive relevance score. The candidate document set is then ranked to obtain enhanced search results, specifically: S301. Based on the query keyword set and document keyword set in the semantic unit set, by comparing the matching relationship between the query keyword set and the document keyword set, a keyword-level multi-granularity semantic alignment mechanism is set up to calculate the keyword-level alignment score. S302. Based on the set of query keywords and the set of key sentences in the semantic unit set, a sentence-level multi-granular semantic alignment mechanism is set up by matching query keywords and calculating semantic similarity to obtain a sentence-level alignment score. S303. Normalize the keyword-level alignment score and sentence-level alignment score to obtain the normalized keyword-level alignment score and sentence-level alignment score. S304. Based on the confidence information of keywords and key sentences, set the gating coefficients, and use the gating coefficients to perform gating fusion on the normalized keyword-level alignment scores and the normalized sentence-level alignment scores to obtain fine-grained fusion scores. S305. Based on the document-level relevance score and the fine-grained fusion score, combined with exponential normalization, the coefficient of variation weights are calculated and logically transformed to obtain the transformed coefficient of variation weights. Then, based on the confidence information of keywords and key sentences, the overall confidence offset term is obtained and fused to obtain the adaptive residual coefficients, specifically: S3051. Based on the document-level relevance score and the fine-grained fusion score, calculate the coefficient of variation of the fine-grained score and the coefficient of variation of the document-level score. S3052. Using exponential normalization, the fine-grained score coefficient of variation and the document-level score coefficient of variation are converted into coefficient of variation weights, and the coefficient of variation weights are logically transformed to obtain the transformed coefficient of variation weights. S3053. Based on the confidence information of keywords and key sentences, set a neutral threshold and calculate the overall confidence offset. S3054. Using the S-shaped growth curve, the transformed coefficient of variation weights are fused with the overall confidence bias term to obtain the adaptive residual coefficients. S306. Calculate the comprehensive relevance score based on the document-level relevance score, the adaptive residual coefficient, and the fine-grained fusion score. S307. Rank the candidate documents using the comprehensive relevance score, and obtain enhanced search results by selecting a preset number of candidate documents; S4. Input the enhanced search results into the preset generation model of the EDA application scenario to obtain answers assisted by multi-granular semantic information, and complete the adaptive fusion search enhancement.
2. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 1, characterized in that, S1 includes the following steps: S101. Obtain a collection of documents in the EDA application scenario, including EDA design specification documents, IP core description documents, register transfer level module interface description documents, chip design flow documents, and EDA tool user manuals. S102. Based on each document in the document set, use a pre-trained generative language model and pre-defined instruction constraints to perform structured semantic parsing processing for information extraction and semantic summarization operations on each document, and construct a document-side semantic unit containing a set of document keywords, a set of document key sentences, and a document summary sentence. S103. Based on the input query text, use a pre-trained generative language model to perform structured semantic parsing processing on the query text, including query expansion and semantic element extraction, and construct a query-end semantic unit that includes query rewriting and a set of query keywords. S104. Integrate the semantic units on the document side and the semantic units on the query side to obtain a set of semantic units; S105. In response to the extraction and generation of semantic unit sets, confidence information of keywords and key sentences is obtained by recording the word-level probability information of pre-trained generative language models in generating document keywords, document key sentences, document summary sentences and query keywords.
3. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 1, characterized in that, Specifically, S2 is: Based on the document set, the frequency of keyword occurrence in a single document is obtained by using term matching relationships. Combined with the document length and the inverse document frequency of the term, a document-level relevance score is calculated. Based on the document-level relevance scores, the document set is sorted, and a predetermined number of documents with the highest scores are selected to obtain a candidate document set.
4. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 1, characterized in that, The expression for the keyword-level alignment score is as follows: , , in, This indicates the keyword-level alignment score. , , Both represent weighting constants. Indicates recall rate, Indicates similarity. Indicates accuracy. This represents the set of query keywords covered by the document. This represents a set of query keywords. Represents a set of document keywords. This represents the set of query keywords that were matched by the set of document keywords through partial substring matching.
5. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 4, characterized in that, The expression for the sentence-level alignment score is as follows: in, This indicates the sentence-level alignment score. Indicates the total number of key sentences in the document. This indicates an adjustable weight parameter. Indicates query With document key sentences Semantic similarity between them Indicates the query text. Indicates the first One key sentence, Indicates key sentences in a document The proportion of keywords covered in the search query. Indicates the search keywords. This indicates the keyword hit rate for a single sentence.
6. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 5, characterized in that, The expression for the fine-grained fusion score is as follows: , in, This indicates the fine-grained fusion score. Indicates to Perform truncated gating weights. This represents the normalized keyword-level alignment score. This represents the normalized sentence-level alignment score. This represents min-max normalization. Indicates the gating coefficient. Indicates the benchmark weight. This indicates the gating sensitivity parameter. This represents the difference between the average confidence score at the keyword level and the average confidence score at the sentence level.
7. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 6, characterized in that, The expression for the adaptive residual coefficient is as follows: , , in, Represents the adaptive residual coefficient. Indicates an S-shaped growth curve. The weights represent the transformed coefficients of variation. This represents the overall confidence offset term. This represents the confidence shift sensitivity parameter. This represents the average confidence level of the keywords and key sentences as a whole. Indicates the neutral threshold. Represents logical transformation, Indicates the weight of the coefficient of variation. This represents the coefficient of variation for fine-grained scores. The standard deviation of the fine-grained fusion score is represented by the following: This represents the mean of the fine-grained fusion score. This represents the coefficient of variation for document-level scores. The standard deviation of the document-level relevance score. This represents the mean of the document-level relevance scores.
8. The adaptive fusion retrieval enhancement method for EDA technical document question answering according to claim 7, characterized in that, The expression for the comprehensive relevance score is as follows: in, This represents the overall relevance score. This represents the document-level relevance score. Represents the adaptive residual coefficient. This indicates the fine-grained fusion score.
