Non-training biomedical entity linking method and system based on large language model and retrieval enhancement generation

By using a method based on a large language model and retrieval-enhanced generation, utilizing the SAPBERT-PubMedBERT model and dimensionality reduction technology, combined with contextual information and prompt templates, the problem of insufficient generalization ability of biomedical named entity linking is solved, and high-performance entity linking without training is achieved, with the ability to quickly respond to knowledge base updates.

CN120632117APending Publication Date: 2025-09-12SUZHOU INST FOR ADVANCED STUDY USTC +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510679990.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing biomedical named entity linking methods suffer from insufficient generalization capabilities, reliance on large amounts of training data, and difficulty coping with dynamic terminology updates.

Method used

A method based on a large language model and retrieval-enhanced generation is adopted. The SAPBERT-PubMedBERT model is used to generate embedding vectors of entities and references. Dimensionality distillation is performed through dimensionality reduction technology. The optimal entity item is selected by combining the contextual information of the reference and a carefully designed prompt template to achieve entity linking without training.

Benefits of technology

It achieves high-performance entity linking on different datasets, has strong generalization capabilities, and can quickly respond to updates to the standard knowledge base without the need for frequent training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120632117A_ABST
    Figure CN120632117A_ABST
Patent Text Reader

Abstract

The invention discloses an untrained biomedical entity linking method based on a large language model and retrieval enhancement generation. The untrained biomedical entity linking method comprises the following steps: inputting references to be linked into an SAPBERT-PubMedBERT model pre-trained by a biomedical corpus, and converting the references into reference embedding vectors; carrying out dimensionality distillation on the reference embedded vector by adopting a dimensionality reduction technology; performing similarity calculation on the reference embedding vector and an entity embedding vector in a pre-constructed knowledge database to obtain a similarity score, and screening out a specified number of candidate item entities to construct a candidate entity item set; designing a prompt template comprising an instruction, a sample example and actual input; and inputting the content in the prompt template into a large language model so as to select an optimal entity item corresponding to the to-be-linked reference from the candidate entity item set. According to the method, high-performance entity linking can be realized on different data sets, and retraining for different tasks is not needed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a training-free biomedical entity linking technology based on a large language model and retrieval enhancement generation. Background Art

[0002] The sharing and dissemination of knowledge often relies on literature, and the biomedical field is no exception. These published texts often contain a large number of specialized terms and concepts, including a rich set of biomedical named entities (entities), such as genes, diseases, proteins, and drugs. Each biomedical entity is typically assigned a unique identifier in a standard knowledge base, such as the Unified Medical Language System (UMLS). However, in natural language text, entities appear in varying forms. These entities appearing in text are called entity references. Due to differences in author writing habits or context, there is no one-to-one correspondence between entities and references. An entity may correspond to multiple references, and a reference may represent multiple entities. This ambiguity poses challenges to entity identification and standardization. The goal of biomedical named entity linking (BNEL) is to accurately map entity references in natural language text to standard entities in a knowledge base, thereby improving computer understanding of biomedical text and providing high-quality data support for downstream tasks such as knowledge graph construction.

[0003] Traditional rule-based entity linking methods rely on complex feature engineering, pre-defining a set of matching rules to achieve linking. However, this approach is relatively rigid and difficult to adapt to emerging or evolving terminology. In contrast, current machine learning and deep learning models typically rely on large amounts of annotated data and classify or cluster entities by calculating similarities between entities and referents. However, because most referents and entities are short and carry limited deep semantic information, models struggle to accurately understand the true meaning of referents. Therefore, while deep learning methods perform well in terms of accuracy, their generalization capabilities remain limited. To improve performance, deep learning models often need to be trained separately for different types of entity data. This frequent retraining not only increases computational costs but also complicates practical applications. The recent rise of large language models has attracted widespread attention. Some researchers have adopted the approach of fine-tuning large language models to accomplish entity linking tasks. However, the high computational cost of fine-tuning and the resulting model fit issues make them difficult to adapt to updates to standard entity libraries.

[0004] Therefore, when dealing with biomedical entity linking tasks, existing technologies still have problems such as insufficient generalization ability, reliance on large amounts of training data, and difficulty in coping with dynamic terminology updates. Summary of the Invention

[0005] To address the issues of insufficient generalization and frequent training required by existing biomedical named entity linking methods, this paper provides a training-free biomedical entity linking method based on a large language model and retrieval-enhanced generation. This method achieves high-performance entity linking across diverse datasets without requiring retraining for different tasks. Furthermore, the present invention also discloses a corresponding system, electronic device, and computer-readable storage medium.

[0006] The first aspect of the present invention discloses a training-free biomedical entity linking method based on a large language model and retrieval-enhanced generation, comprising the following steps:

[0007] Using an embedding vector generation model to convert batch entities in a specified standard knowledge base into entity embedding vectors; using dimensionality reduction technology to perform dimensionality distillation on the entity embedding vectors, and storing the distilled entity embedding vectors in a knowledge database;

[0008] receiving a reference to be linked, and converting the reference input embedding vector generation model into a reference embedding vector;

[0009] Performing dimensionality distillation on the referential embedding vector using a dimensionality reduction technique;

[0010] The referential embedding vector after dimension distillation is similarly calculated with the entity embedding vector in the knowledge database to obtain a similarity score. Based on the similarity score, a specified number of candidate entities are selected to construct a candidate entity item set.

[0011] Design a prompt template that includes instructions, sample examples, and actual input; the sample examples are pre-made samples used to provide input and output for the large language model, including "input reference", "context of the reference", "candidate entity set" pre-retrieved based on the input reference, and "expected output result of the large language model"; the composition of the actual input is consistent with the sample examples, where the input reference is the reference to be linked, and the expected output result of the large language model is set to be empty;

[0012] Inputting the content of the prompt template into the large language model to select the optimal entity item corresponding to the to-be-linked reference from the candidate entity item set;

[0013] The embedding vector generation model is a SAPBERT-PubMedBERT model pre-trained with a biomedical corpus.

[0014] As an optional solution, the dimensionality reduction technology uses any one of PCA, AutoEncoder or Kernel-PCA to compress the 768-dimensional embedding vector generated by the SAPBERT-PubMedBERT model to 384 dimensions.

[0015] As an optional solution, the similarity score is calculated by a method based on inner product measurement.

[0016] As an optional solution, during the similarity calculation process, the IndexFlatIP indexing method is used to perform cluster-free flat retrieval on the input referential embedding vector and entity embedding vector.

[0017] As an optional solution, when the designated standard knowledge base is a large-scale standard knowledge base, during the similarity calculation process, the IVF indexing method, the HNS indexing method, or the hybrid indexing method of IVF combined with IndexFlatIP is used to retrieve the input referential embedding vector and the entity embedding vector.

[0018] As an optional solution, the context information of the reference in the original text is limited to the length of the sentence in which the reference appears, or the length of the sentence in which the reference appears and the length of the sentences before and after it, or the length of the paragraph in which the reference appears.

[0019] As an optional solution, the large language model is any one of the Llama-3.1-8B-Instruct, DeepSeek, Qwen, and ChatGLM models.

[0020] The second aspect of the present invention discloses a training-free biomedical entity linking system based on a large language model and retrieval-enhanced generation, comprising:

[0021] The encoder module is constructed to: convert entities / referents to be linked in the input standard knowledge base into entity embedding vectors / referent embedding vectors based on SAPBERT-PubMedBERT pre-trained on a biomedical corpus;

[0022] The embedding distillation module is constructed to: perform dimension distillation on the entity embedding vector / referent embedding vector using dimensionality reduction technology;

[0023] The retrieval module is constructed to: calculate the similarity between the referential embedding vector after dimension distillation and the entity embedding vector in the knowledge database to obtain a similarity score, and filter out a specified number of candidate entities based on the similarity scores to construct a candidate entity set;

[0024] The prompt module is constructed to: design a prompt template including instructions, sample examples, and actual input. The sample examples are pre-made samples for providing input and output for the large language model, including "input reference", "context of the reference", "candidate entity set" retrieved in advance based on the input reference, and "expected output result of the large language model". The composition of the actual input is consistent with the sample examples, wherein the input reference is the reference to be linked, and the expected output result of the large language model is set to be empty.

[0025] The result output module is constructed as follows: based on the large language model, according to the content of the input prompt template, output the optimal entity item corresponding to the to-be-linked reference selected from the candidate entity item set.

[0026] The third aspect of the present invention discloses an electronic device comprising a processor and a memory; the processor is used to call a computer program stored in the memory to execute the untrained biomedical entity linking method based on a large language model and retrieval enhancement generation described in the first aspect of the present invention and any optional solution thereof.

[0027] The fourth aspect of the present invention discloses a computer-readable storage medium, which is used to store program code, and the program code is used to execute the untrained biomedical entity linking method based on a large language model and retrieval enhancement generation described in the first aspect of the present invention and any optional solution thereof.

[0028] The present invention has the following beneficial effects:

[0029] (1) No training required: The present invention uses the SAPBERT-PubMedBERT model pre-trained on a biomedical corpus to embed vectors of standard knowledge base entities and references. Based on the inner product metric similarity, the embedding vectors are preliminarily screened to identify candidate entities. Then, by leveraging the powerful semantic understanding capabilities of the large language model itself and leveraging its understanding of references, the optimal standard entity that best represents the reference is selected from the preliminarily screened candidates, thereby achieving the linking task. This allows the present invention to achieve the current state-of-the-art in the field of biomedical entity linking without the need for separate training for different entity types.

[0030] (2) Powerful generalization capability: The present invention guides the large language model to accurately understand the biomedical entity linking task through the careful design of the prompt module. In particular, it combines the contextual information of the reference to make up for the knowledge deficiency of the model. Combined with the semantic understanding ability of the large language model, the model can fully cope with various types of biomedical entities and demonstrate powerful generalization performance.

[0031] (3) Rapid response to knowledge updates: The present invention benefits from the extensible advantage of the knowledge database of the retrieval enhancement generation framework. The present invention can cope with data updates of the standard knowledge base without the need to frequently adjust the model when knowledge updates or changes occur, as in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the overall process of the method of the present invention.

[0033] Figure 2 It is a link flow diagram for treating link references.

[0034] Figure 3 is an example of a prompt template. DETAILED DESCRIPTION

[0035] The technical solutions of the present invention will be described in more detail below with reference to specific embodiments and the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0036] An embodiment of the present invention proposes a training-free biomedical entity linking method based on a large language model (LLM) and retrieval-augmented generation (RAG). On the one hand, an embedding vector generation model is used to generate entity embedding vectors for batch entities in a specified standard knowledge base one by one. Then, a dimensionality reduction technique is used to perform dimensionality distillation on the entity embedding vectors, and the distilled entity embedding vectors are stored in a knowledge database. On the other hand, a reference to be linked is received, and the reference is first input into the embedding vector generation model to generate a reference embedding vector. Then, a dimensionality reduction technique is used to perform dimensionality distillation on the reference embedding vector. Then, a similarity calculation is performed between the reference embedding vector and the entity embedding vector in the knowledge database to obtain a similarity score. A specified number of candidate entities are screened based on the similarity scores to construct a candidate entity item set. Then, a prompt template including instructions, sample examples, and actual input is designed. Finally, the content of the prompt template is input into the large language model to select the optimal entity item corresponding to the reference to be linked in the specified standard knowledge base. The embedding vector generation model uses the SAPBERT-PubMedBERT model pre-trained on a biomedical corpus; the retrieval-enhanced generation mainly includes two parts: retrieval and enhanced generation. Enhanced generation mainly integrates external knowledge through carefully designed prompts to fill the knowledge blind spots of the large language model, thereby improving the accuracy of the content generated by the large language model and its relevance to the context.

[0037] The main operations in the above process of the present invention are respectively introduced as follows:

[0038] (1) Embedding vector generation.

[0039] The present invention uses the SAPBERT-PubMedBERT model pre-trained on a biomedical corpus as an embedding vector generation model to generate entity embedding vectors one by one for batch entities in a standard knowledge base (e.g., a standard entity library, a dataset dictionary).

[0040] Embedding vectors are generated by an encoder module that integrates the SAPBERT-PubMedBERT model. SAPBERT-PubMedBERT is a language model for pre-training on biomedical corpora, combining the key technologies of PubMedBERT and SAPBERT. The core of SAPBERT lies in its "self-alignment" pre-training mechanism. By training on large-scale data from the UMLS, the model's ability to understand and relate complex biomedical concepts is strengthened. This enables PubMedBERT, with the support of SAPBERT's pre-training mechanism, to better complete the biomedical entity linking task.

[0041] After preprocessing, the standard entities and their corresponding CUIs (Concept Unique Identifiers) contained in the standard knowledge base are formatted into entries such as "CUI||entity" and then processed by the encoder module. In addition to the embedding vector generation model, the encoder module also includes a WordPiece tokenizer, which primarily converts raw text into tokens or subwords that the model can process. These tokens are then mapped to corresponding input IDs (tokenIDs) for use by the SAPBERT-PubMedBERT model. For example, for the original word "unbelievable," the WordPiece tokenizer generates the following token segmentation results: ['un', '##believ', '##able'], where ## indicates that the subword is not an independent word but rather a part of the previous word. The token segmentation results are then converted into integer token IDs required by the model based on the mappings in the tokenizer's vocabulary (vocab.txt) for subsequent embedding processing and encoding calculation.

[0042] After being processed by the tokenizer, the formatted entries are fed into the SAPBERT-PubMedBERT model. The model embeds each formatted entry and generates an embedding vector for subsequent processing. The dimensionality of the embedding vector is typically determined by the embedding vector generation model. The embedding vector generated by the SAPBERT-PubMedBERT model is 768-dimensional.

[0043] For the reference to be linked received in the present invention, the corresponding embedding vector is also generated through the above process.

[0044] (2) Embedded distillation.

[0045] Since entities and references themselves are relatively short and have limited semantic information, the 768-dimensional vectors generated by the BERT-like model may contain some redundant information. This redundant information is not conducive to the accurate expression of the entity by the embedding vector and will also increase the computational overhead of subsequent retrieval. Therefore, the present invention uses principal component analysis (PCA) technology to perform dimensional distillation on the generated embedding vector, compressing the vector dimension from 768 dimensions to 384 dimensions, thereby significantly reducing the vector storage space while retaining key semantic information. This part can be completed by the embedding distillation module. After the distillation is completed, the standard entity embedding vector that has undergone dimensionality reduction processing is stored in the knowledge database and saved in an index format file for subsequent retrieval.

[0046] Regarding the optimization of vector storage space mentioned above, taking the index file finally generated by the BC5CDR-Disease dataset as an example, the file size generated without using embedding distillation is about 220MB, while the file size generated with embedding distillation is about 107MB, so it can be seen that about 51% space optimization has been achieved.

[0047] In addition to PCA, the present invention also uses dimensionality reduction techniques such as AutoEncoder and Kernel-PCA (kernel principal component analysis) to effectively reduce the dimensionality and complexity of the data while preserving the original data's characteristic information as much as possible. When choosing the distillation dimension, it is best not to choose a dimension that is too low, as this will cause the semantic information contained in the vector itself to be lost. It is also best not to choose a dimension that is too high, as this will not provide the optimization benefits of storage space and computational overhead brought about by dimensionality reduction.

[0048] It is worth noting that the aforementioned embedding vector generation and embedding distillation operations convert the text representation in the standard knowledge base into embedding vectors through a fixed model process, and store and call them independently of the downstream task modules, thus achieving the decoupling of vector generation and retrieval, which is the basis for the present invention to quickly respond to updates to the standard knowledge base. When the standard knowledge base is updated, it is only necessary to process the new data through the above two steps and then store and replace the index file. The replacement of the index file does not affect the subsequent work (such as retrieval). Therefore, it is possible to quickly respond to updates to the standard knowledge base, avoiding the problem faced by previous methods of requiring retraining when the knowledge base is updated.

[0049] (3) Search.

[0050] This operation carries the implementation of the retrieval part in RAG, corresponding to Figure 1 The process from "embedding vector retrieval" to "candidate entity set generation" is completed by the retrieval module. Figure 2 This process is described in detail. For the received input reference, it is first converted into a 384-dimensional embedding vector through the aforementioned embedding vector generation and embedding distillation process; then the embedding vector is compared with the standard entity embedding vector stored in the knowledge database to obtain a similarity score; based on the similarity score result, the top K standard entities most similar to the reference are screened from the knowledge database as candidate entities to construct a candidate entity set (also called "candidate entity list").

[0051] It's worth noting that, due to the widespread homonymy, inflectional variations, and abbreviations in biomedical terms, simply selecting the highest score based on similarity often fails to accurately capture the true meaning of a term in a specific context. Therefore, by constructing a candidate entity set, retaining multiple highly similar candidates, and considering the context in which the term is found, these candidates are fed into a large language model with strong language understanding capabilities. This model then identifies the candidate entities based on its understanding of the contextual semantics and outputs the final matching results.

[0052] by Figure 2 For example, the referent to be linked in the figure is vasculitis, which, in the corresponding context, represents a broad definition of "vasculitis." In the candidate set calculated solely based on similarity, we can see that the candidate entities "systemic vasculitis" and "vasculitis systemic" rank higher than "vasculitides." This is primarily because they are closer in surface form to the referent (e.g., they share the same stem). While "vasculitides," as the plural form of vasculitis, is semantically closer, its score is lower due to inflection. However, from a semantic perspective, "systemic vasculitis" is a specific subtype of vasculitis, with a narrower extension, making it inappropriate in the current context. Therefore, after semantic understanding and selection by the large language model, "vasculitides" is ranked higher in the final output.

[0053] The retrieval module primarily involves similarity calculation methods and retrieval strategies. Regarding similarity calculation methods, the present invention employs a scheme based on an inner product metric to assess the degree of similarity between references and entities. In this embodiment, the IndexFlatIP indexing method provided by the Faiss library is used to perform a cluster-free, flat retrieval of input reference and entity embedding vectors, while also avoiding additional computational overhead based on the aforementioned embedding distillation.

[0054] For similarity calculation, the present invention adopts a method based on inner product measurement, and its theoretical formula is as follows:

[0055]

[0056] Where, and denotes the distilled embedding vectors of reference m and entity n, d denotes the dimension of the embedding vector, S similarity (m,n) means that the reference m and entity n will get a similarity score after the inner product operation.

[0057] Based on the similarity calculation method and the dimensional distillation of the embedded vector, the present invention achieves accurate and efficient retrieval by adopting the IndexFlatIP flat indexing method based on the inner product metric. Specifically, the IndexFlatIP index traverses all embedded vectors and performs S on each pair of vectors of the reference and entity during the traversal process. similarity The (m,n) inner product operation is performed to obtain a calculated score. After the traversal is completed, a certain number of candidate entities (hereinafter referred to as "candidates") are screened based on the scores. The search formula including the IndexFlatIP index used in the present invention is as follows:

[0058] E msimilar =Search(IndexFlatIP(S similarity (m,n)),k);

[0059] Where, E msimilar The number of candidate entity items in the candidate entity item set can be adjusted according to actual needs. In the embodiment of the present invention, the number of candidate entity items set is 20, that is, K=20.

[0060] It is understandable that the above indexing strategies can also be replaced with indexing strategies such as IVF (Inverted File) and HNSW (Hierarchical Navigable Small World). The emergence of these strategies is usually aimed at improving the retrieval performance in large-scale data. Their retrieval efficiency in large-scale data is relatively good, but they may bring varying degrees of accuracy loss. Unlike IndexFlatIP, these indexing strategies will have an extra step of index construction before use. This process usually requires different construction methods depending on the algorithm. Taking IVF-type indexes as an example, they rely on learning about data distribution and generate multiple cluster centers through clustering operations, thereby dividing vectors into different partitions, thereby improving retrieval efficiency. Although HNSW-type index construction does not require training, it generally requires dynamically constructing a hierarchical small-world graph structure when adding vectors to achieve efficient nearest neighbor search. In practical applications, when facing a large-scale standard knowledge base with millions of items, the search strategy of the present invention can be adjusted to a hybrid indexing method combining IVF and IndexFlatIP. That is, coarse-grained clustering is first completed through IVF, and then a flat index is performed within the cluster for retrieval. This balances retrieval efficiency and accuracy. The principle formula of hybrid retrieval is as follows:

[0061] E msimilar =Search(IndexFlatIP(IVF(S similarity(m,n))),k).

[0062] (4) Prompt design.

[0063] This operation carries the implementation of the enhanced generation part in RAG. The prompt design plays a key role in providing external knowledge to the large language model and guiding the large language model to generate the desired results. This operation can be completed by the prompt module.

[0064] It is worth noting that the prompt design of the present invention is different from the prompt design of the traditional retrieval enhancement generation method. The latter mainly focuses on splicing the retrieved candidate paragraphs with the input query, and then allows the large language model to perform inductive output based on the input query and the candidate paragraphs. Its purpose is to enhance the knowledge coverage ability of the language model by introducing external information, thereby alleviating the hallucination problem caused by lack of professional knowledge; the present invention emphasizes selecting the best item from the candidate items in the candidate entity item set. The context information provided in the prompt is not used to expand the generated content, but to help the language model accurately understand the meaning of the reference in a specific context, perform semantic comparison and identification from multiple similar candidates, and finally select the standard entity that best fits the context. This is significantly different from the tasks and goals of the traditional retrieval enhancement generation method.

[0065] In addition to including the reference to be normalized and the retrieved candidates in the prompt, the present invention also adds the context of the reference's location in the original text. The length of the context can be limited to the length of the sentence in which the reference appears. Optionally, when the current sentence containing the reference cannot accurately express the reference's actual meaning, the length of the context can be set to include the length of the sentence in which the reference appears and the sentences before and after it, or the length of the paragraph in which the reference appears. Because most references are relatively short, their surface features can only convey limited deep semantic information, making it difficult to accurately understand their true meaning based solely on the reference. However, the context of the reference can provide richer contextual information, helping to interpret the reference's actual meaning in the current context. The inclusion of context enables the large language model to more accurately understand the reference's actual meaning in the original text based on this additional contextual information, thereby making the correct choice from multiple candidates. This approach fully utilizes the large language model's excellent semantic understanding capabilities, allowing it to fully utilize its generalization capabilities without the need for fine-tuning the large language model, thus avoiding the increased computing power and time costs associated with fine-tuning.

[0066] Figure 3A specific design for a prompt template is presented, consisting of three main parts: instructions, sample examples, and actual input. The instructions, which are fixed for each input to the large language model, primarily describe the task and guide the large language model to select the optimal candidate from the provided candidates by integrating the context of the current reference. The output conforms to the format specified in the sample examples, thus clarifying the task the large language model needs to process and complete. For example, the instructions could be designed as, "Select {} standard entities from the candidate list that are most semantically similar to the input reference and output them. Your answer must strictly follow the format of the following example and must not contain other task content or analysis." The sample examples serve to provide input and output samples for the large language model. Typically, one or two examples are selected and included in the prompt. The content includes "input reference," "context of the reference," a pre-retrieved "candidate entity set" based on the input reference, and "expected output from the large language model." The actual input requirements should be consistent with those of the sample examples, including "input reference," "context of the reference," "candidates," and "expected output from the large language model." The difference is that the three items of "input reference", "context of reference" and "candidate items", that is, the actual input, change with different references. The input reference refers to the reference to be linked; the candidate items are provided by the retrieval operation, that is, the candidate entity set, including a specified number of candidate entities (ID-entity pairs); the output result part is left blank, waiting for the large language model to generate the output result based on the actual input.

[0067] (5) Large language model processing.

[0068] This operation can be implemented by the result output module. The large language model, as the core of the result output module, is responsible for receiving the content transmitted by the aforementioned prompt module, namely the Prompt prompt, and clarifying the tasks that need to be completed according to the instruction guidance output by the prompt design operation (prompt module), and outputting the optimal entity item selected.

[0069] Figure 2The sample output of the large language model is demonstrated in the article. Through the sample examples in the prompt template, the large language model can visualize the understanding of the task and clarify the required form of input and output data, and then generate each task output according to the actual input in the prompt to complete the selection of the standard entity. In this process, the instruction following (i.e., clarifying the task to be completed according to the instruction guidance) ability of the large language model is crucial, which directly determines whether the model can complete the task in strict accordance with the prompt requirements. Therefore, the present invention focuses on the IFEval indicator (used to evaluate the instruction following ability of the model) of the open_llm_leaderboard ranking in the HuggingFace platform in the selection process of the large language model, and taking into account the cost control in the actual deployment application, the open source and parameter-moderate Llama-3.1-8B-Instruct model is selected. The Instruct version of Llama-3.1-8B is different from the Base version and the Chat version. It has undergone instruction tuning processing and can understand and execute complex natural language instructions to meet specific task requirements. This model can run smoothly when started in 4-bit quantization in a 1080TiGPU device.

[0070] It should be noted that in addition to the Llama-3.1-8B-Instruct model, other similar open-source large language models can also be used, such as DeepSeek, Qwen, and ChatGLM. The specific choice should be considered based on the computing power of the actual hardware device, such as the graphics card. Generally, a model with a parameter size of around 8B is selected. The parameter size should not be too small, as it requires a high computing power of the device. Based on this, a model with strong instruction-following capabilities is selected.

[0071] In addition to instructions, a small number of sample examples, and actual input, a prompt template typically includes "expected output of the large language model." This section is left blank, pending the large language model's generation of output based on the actual input. Regarding large language model execution, the present invention uses 4-bit quantization to run and infer the Llama-3.1-8B-Instruct model on a 1080 Ti GPU, achieving inference on a moderately sized large language model at a low cost.

[0072] Furthermore, the present invention discloses a training-free biomedical entity linking system based on a large language model and retrieval enhancement generation, comprising an encoder module for implementing an embedding vector generation operation, an embedding distillation module for implementing an embedding distillation operation, a retrieval module for implementing a retrieval operation, a prompting module for implementing a prompting design operation, and a result output module for implementing an optimal option output. The specific functions and features of the above functional modules have been described in Example 1 and will not be repeated here.

[0073] Furthermore, an embodiment of the present invention also discloses an electronic device, which mainly includes a processor and a memory. The processor is mainly used to call the computer program stored in the memory and execute the untrained biomedical entity linking method based on a large language model and retrieval enhancement generation provided in the above embodiment.

[0074] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the untrained biomedical entity linking method based on a large language model and retrieval enhancement generation provided by the present invention.

[0075] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the program code in the electronic device and computer-readable storage medium described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.

[0076] A specific comparative experiment is given below to demonstrate the significant advantages of the present invention. The biomedical datasets used in the experiment are NCBI-Disease, BC5CDR-Disease, BC5CDR-Chem, BC2GM-Gene, and SMM4H-2017. Among them, the three datasets of NCBI-Disease, BC5CDR-Disease, and BC5CDR-Chem are mainly used to verify that the method of the present invention performs on par with and surpasses the advanced methods in the current field, while the two datasets of BC2GM-Gene and SMM4H-2017 are used to verify the generalization performance of the model.

[0077] It is understandable that the above biomedical datasets are mainly used to test the performance of the method of the present invention. In practical applications in the field of biomedical entity linking, the above datasets can be replaced with more comprehensive standard entity libraries, such as the Unified Medical Language System.

[0078] Table 1 shows the comparison results of the method of the present invention and other methods on the three data sets of NCBI-Disease, BC5CDR-Disease, and BC5CDR-Chemical. The indicator Acc@1 (Accuracy at 1) indicates the proportion of the candidate predicted by the model to be the correct answer among all test samples, and the indicator Acc@5 (Accuracyat 5) indicates the proportion of the correct answer among the top 5 candidates predicted by the model among all test samples. It should also be noted that in Table 1, except for the method of the present invention, all other deep learning model methods are the results obtained after training on the corresponding data sets or formulating matching rules, while the results obtained by the method of the present invention are not trained separately for each data set, thereby demonstrating the characteristics of the method of the present invention that it does not require training and has strong generalization ability.

[0079] From the experimental results in Table 1, it can be seen that the method of the present invention has achieved leading results in the comparison indicators of most data sets without the need for training (the bold value represents the highest item in the current column), reflecting the advantages of the method of the present invention.

[0080] Table 1 Comparative experimental results

[0081]

[0082]

[0083] Table 2 shows the test results of our method and other methods in the field on the unseen dataset. The unseen dataset refers to the comparison methods other than our method. The unseen dataset requires that other comparison methods be consistent with our method and cannot be pre-trained on the dataset or have matching rules defined. The purpose of this experiment is to emphasize the comparison of the generalization performance of each method.

[0084] Table 2 Comparative performance of unseen dataset

[0085]

[0086] The experimental results in Table 2 show that the method of the present invention also achieves an advantage in this experimental comparison. The results of the two experimental tables above prove that the method of the present invention achieves better performance than the method that requires training without training, demonstrating the high generalization characteristics of the method.

[0087] In order to further illustrate the content of the present invention, a specific case is given below.

[0088] Before performing a specific entity linking task, a standard entity library needs to be selected for processing. In the standard entity library, each entity is assigned a unique ID in the database. The present invention needs to extract the entities and their IDs in the standard library and process them into the format of "ID||entity". Then, for each "ID||entity", it is first passed through the embedding vector generation module, and then through the embedding distillation module to generate an embedding vector with a dimension of 384, for example, [0.1372, 0.0826, 0.2951,..., 0.0217, 0.0544, 0.1435]. Finally, each generated embedding vector is stored in the vector database as a knowledge database for subsequent retrieval.

[0089] The following is an example of the entity linking task. For an input term "vasculitis" extracted from biomedical literature, the present invention will input this term into the encoder module based on the SAPBERT-PubMedBERT model. The tokenizer first converts the text into corresponding tokenIDs. For example, the tokenID generated by the current tokenizer for vasculitis is 21548 (because vasculitis does not need further subword splitting and can be directly mapped to a tokenID); then, the tokenID is mapped to An embedding vector with a dimension of 768, such as [0.1234, 0.0821, 0.4523, ..., 0.2175, 0.0312, 0.1087], is then input into the embedding distillation module and distilled into a dimension of 384. The distilled embedding vector then reaches the retrieval module. The knowledge database in the retrieval module contains entities extracted from the standard knowledge base and converted into vectors and their IDs (corresponding to CUI). The inner product similarity calculation and IndexFlatIP retrieval strategy are then applied to the embedding vector generated by the reference and the embedding vector generated by each entity in the database to obtain a similarity score and screen out a specified number of candidates to form a candidate entity set.

[0090] During the aforementioned referent extraction process, the referent's position in the original text is located. Based on this position, the context sentence is extracted to complete entity recognition. For example, the context sentence for the referent "vasculitis" is "Of clinical interest are (a) the documentation of membranous glomerulonephritis, vasculitis, and arthritis in an individual lacking C5 (and its biologic functions), and (b) a remarkable propensity to bacterial infections in the proband, even during periods of low-dose or alternate-day corticosteroid therapy." After extracting the context sentence corresponding to the referent, the referent, the candidate selected in the search phase, and the context sentence are all added to the "actual input" section of the prompt. Once the prompt is populated, it can be input into the large language model, which will produce the final output based on the prompt's instructions, example style, and actual input. For the case of "vasculitis", the output given by the large language model is Best-1: vasculitis:D014657; Best-5: vasculitis:D014657, vasculitides:D014657, angiitis:D014657, vasculitis systemic:D056647, systemic vasculitis:D056647.

[0091] Finally, it should be noted that although the embodiments of the present invention have been described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields. The above-mentioned specific embodiments are merely illustrative and instructive, and not restrictive. Under the guidance of this specification, those skilled in the art can also make many forms without departing from the scope of protection of the claims of the present invention, and all of these forms are protected by the present invention.

Claims

1. A training-free biomedical entity linking method based on a large language model and retrieval-enhanced generation, characterized by: The following steps are involved: receiving a reference to be linked, and converting the reference input embedding vector generation model into a reference embedding vector; Performing dimensionality distillation on the referential embedding vector using a dimensionality reduction technique; The referential embedding vector after dimension distillation is similarly calculated with the entity embedding vector in the pre-built knowledge database to obtain a similarity score. Based on the similarity score, a specified number of candidate entities are selected to construct a candidate entity item set. Design prompt templates that include instructions, sample examples, and actual input; The sample examples are pre-made samples used to provide input and output for the large language model, including "input reference", "context of the reference", "candidate entity set" retrieved in advance based on the input reference, and "expected output result of the large language model". The composition of the actual input is consistent with the sample examples, where the input reference is the reference to be linked, and the expected output result of the large language model is set to be empty. Inputting the content of the prompt template into the large language model to select the optimal entity item corresponding to the to-be-linked reference from the candidate entity item set; The knowledge database is constructed as follows: using an embedding vector generation model to convert batch entities in a specified standard knowledge base into entity embedding vectors; using a dimensionality reduction technique to perform dimensionality distillation on the entity embedding vectors, storing the distilled entity embedding vectors and obtaining the knowledge database; The embedding vector generation model is a SAPBERT-PubMedBERT model pre-trained with a biomedical corpus.

2. The untrained biomedical entity linking method according to claim 1, wherein: The dimensionality reduction technique uses any one of PCA, AutoEncoder, or Kernel-PCA to compress the 768-dimensional embedding vector generated by the SAPBERT-PubMedBERT model to 384 dimensions.

3. The untrained biomedical entity linking method according to claim 1, wherein: The similarity score is calculated using an inner product metric-based method.

4. The untrained biomedical entity linking method according to claim 1, wherein: During the similarity calculation process, the IndexFlatIP indexing method is used to perform cluster-free flat retrieval on the input referential embedding vector and entity embedding vector.

5. The untrained biomedical entity linking method according to claim 1, wherein: When the designated standard knowledge base is a large-scale standard knowledge base, during the similarity calculation process, the input referential embedding vector and the entity embedding vector are retrieved using the IVF indexing method, the HNS indexing method, or the hybrid indexing method of IVF combined with IndexFlatIP.

6. The untrained biomedical entity linking method according to claim 1, wherein: The context information of the reference in the original text is limited to the length of the sentence in which the reference appears, or the length of the sentence in which the reference appears and the length of the sentences before and after it, or the length of the paragraph in which the reference appears.

7. The untrained biomedical entity linking method according to claim 1, wherein: The large language model is any one of the Llama-3.1-8B-Instruct, DeepSeek, Qwen, and ChatGLM models.

8. A training-free biomedical entity linking system based on a large language model and retrieval-enhanced generation, characterized by: include: The encoder module is constructed to: convert entities / referents to be linked in the input standard knowledge base into entity embedding vectors / referent embedding vectors based on SAPBERT-PubMedBERT pre-trained on a biomedical corpus; The embedding distillation module is constructed to: perform dimension distillation on the entity embedding vector / referent embedding vector using dimensionality reduction technology; The retrieval module is constructed to: calculate the similarity between the referential embedding vector after dimension distillation and the entity embedding vector in the knowledge database to obtain a similarity score, and filter out a specified number of candidate entities based on the similarity scores to construct a candidate entity set; The prompt module is constructed to: design a prompt template including instructions, sample examples, and actual input. The sample examples are pre-made samples for providing input and output for the large language model, including "input reference", "context of the reference", "candidate entity set" pre-retrieved based on the input reference, and "expected output result of the large language model". The composition of the actual input is consistent with the sample examples, wherein the input reference is the reference to be linked, and the expected output result of the large language model is set to be empty. The result output module is constructed as follows: based on the large language model, according to the content of the input prompt template, output the optimal entity item corresponding to the to-be-linked reference selected from the candidate entity item set.

9. An electronic device, characterized in that: It comprises a processor and a memory; the processor is used to call the computer program stored in the memory to execute the untrained biomedical entity linking method based on a large language model and retrieval enhancement generation as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store program code, and the program code is used to execute the training-free biomedical entity linking method based on a large language model and retrieval enhancement generation according to any one of claims 1 to 7.

Citation Information

Cited By

  • Vector retrieval method and device, computer equipment, readable storage medium and program product

    CN121542272A

  • Vector retrieval method, device, computer equipment, readable storage medium and program product

    CN121542272B