Fine tuning method of large language model, false address identification method, device and equipment

By fine-tuning the large language model, using data augmentation and low-rank adaptive model technology, the problem of low false address recognition accuracy in the existing technology is solved, and higher recognition accuracy and generalization capabilities are achieved.

CN119784440AActive Publication Date: 2025-04-08BEIJING WODONG TIANJUN INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411910949.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-08
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art has low accuracy in false address recognition, especially when facing unknown types of false addresses, the recognition accuracy of rule engines and traditional machine learning models is insufficient.

Method used

Through a fine-tuning method based on the large language model, the initial address samples are generated and data augmented, the initial low-rank adaptive model is trained, the self-attention layer parameters of the large language model are adjusted, and the fine-tuned large language model is obtained. The model is able to perform multiple rounds of Q&A to identify fake addresses.

Benefits of technology

The insight accuracy and generalization ability of large language models in false address recognition has been improved, and the technical effect of identifying false addresses has been achieved more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784440A_ABST
    Figure CN119784440A_ABST
Patent Text Reader

Abstract

The invention provides a fine tuning method of a large language model, a false address identification method, a device and equipment, and relates to the technical field of artificial intelligence. The method comprises the steps of generating a plurality of initial address samples based on real addresses included in an order database; performing data enhancement processing on the plurality of initial address samples based on the plurality of abnormal modes to obtain a plurality of target address samples; training an initial low-rank adaptive model by using the plurality of target address samples to obtain a target low-rank adaptive model, the initial low-rank adaptive model being obtained by performing initialization based on a self-attention layer of a large language model; and adjusting the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and more specifically, to a fine-tuning method for a large language model, a false address recognition method, device, and equipment. Background Art

[0002] With the gradual development and popularization of mobile Internet services, online shopping has become a consumption habit of most netizens. The e-commerce advertising alliance promotion method (CPS, Cost Per Sales) can use portal-level network media to display products throughout the site to promote user awareness, preferences and purchasing behavior. Therefore, CPS has become the preferred advertising promotion method for e-commerce platforms. With the promotion and development of CPS, the use of false addresses to defraud advertising commissions has also increased, thereby increasing the operating risks of e-commerce platforms.

[0003] In the related technology, rule engines or traditional machine learning models can be used to identify false addresses. However, these methods are data-oriented identification methods, that is, their accuracy requires the support of a large number of rules or labeled data. When faced with unknown types of false addresses, the method of using rule engines or traditional machine learning models to identify false addresses has low accuracy. Summary of the invention

[0004] In view of this, the present disclosure provides a large language model fine-tuning method, a false address identification method, a device and a device.

[0005] One aspect of the present disclosure provides a method for fine-tuning a large language model, including: generating a plurality of initial address samples based on real addresses included in an order database, wherein the initial address samples include address text and an initial label of the address text; performing data enhancement processing on the plurality of initial address samples based on a plurality of abnormal patterns to obtain a plurality of target address samples; training an initial low-rank adaptive model using the plurality of target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on a self-attention layer of a large language model; and adjusting model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0006] Another aspect of the present disclosure provides a method for identifying a false address based on a large language model, comprising: in response to receiving a prompt text, when determining that a prompt word included in the prompt text matches a preset prompt word, extracting an address text to be identified from the prompt text; based on a preset thinking chain and the address text to be identified, performing multiple rounds of question and answer with a fine-tuned large language model to obtain a target answer text output by the fine-tuned large language model; and determining a false address recognition result of the address text to be identified based on the target answer text; wherein the fine-tuned large language model is obtained by fine-tuning the large language model according to the fine-tuning method of the large language model.

[0007] Another aspect of the present disclosure provides a fine-tuning device for a large language model, including: an initial address generation module, used to generate multiple initial address samples based on real addresses included in an order database, wherein the initial address samples include address text and initial labels of the address text; a first address generation module, used to perform data enhancement processing on the multiple initial address samples based on multiple abnormal patterns to obtain multiple target address samples; an initial model training module, used to train an initial low-rank adaptive model using the multiple target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on the self-attention layer of the large language model; and a model parameter adjustment module, used to adjust the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0008] Another aspect of the present disclosure provides a false address recognition device based on a large language model, including: an address text extraction module, which is used to extract the address text to be recognized from the prompt text in response to receiving a prompt text, when it is determined that the prompt word included in the prompt text matches the preset prompt word; an answer text output module, which is used to conduct multiple rounds of question and answer with the fine-tuned large language model based on a preset thinking chain and the address text to be recognized, to obtain the target answer text output by the fine-tuned large language model; and a false address recognition module, which is used to determine the false address recognition result of the address text to be recognized based on the target answer text; wherein the fine-tuned large language model is obtained by fine-tuning the large language model according to the fine-tuning method of the large language model.

[0009] Another aspect of the present disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.

[0010] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0011] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.

[0012] According to the embodiments of the present disclosure, by performing data enhancement on the real address through multiple abnormal modes, the corresponding address text form and content of each real address under multiple abnormal modes can be obtained, and by adopting the data enhancement method, the adaptability of the fine-tuning method of the large language model in the scenario of scarce labeled samples is enhanced. By training the initial low-rank adaptive model with multiple target address samples, the target low-rank adaptive model is obtained, and then the model parameters of the self-attention layer of the above-mentioned large language model are adjusted based on the model parameters of the target low-rank adaptive model, so that the fine-tuned large language model has the ability to associate the address text context, the ability to understand the complex address semantics and the ability to predict the address text context, so as to at least partially overcome the technical problem of low false address recognition accuracy of the existing false address recognition method, thereby achieving the purpose of improving the insight accuracy and generalization ability of the fine-tuned large language model, and achieving the technical effect of more accurate recognition of false addresses. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0014] Figure 1 An exemplary system architecture to which a fine-tuning method of a large language model and a false address identification method according to an embodiment of the present disclosure can be applied is schematically shown;

[0015] Figure 2 A flowchart of a method for fine-tuning a large language model according to an embodiment of the present disclosure is schematically shown;

[0016] Figure 3 A flowchart of a method for identifying a false address based on a large language model according to an embodiment of the present disclosure is schematically shown;

[0017] Figure 4 A flowchart of the training process of a fine-tuned large language model according to an embodiment of the present disclosure is schematically shown;

[0018] Figure 5 A flowchart of a method for applying a fine-tuned large language model according to an embodiment of the present disclosure is schematically shown;

[0019] Figure 6 A module diagram of a fine-tuning device for a large language model according to an embodiment of the present disclosure is schematically shown;

[0020] Figure 7 A module diagram of a false address identification device based on a large language model according to an embodiment of the present disclosure is schematically shown; and

[0021] Figure 8 A block diagram of an electronic device suitable for implementing a fine-tuning method for a large language model and a false address identification method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0022] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0023] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0024] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0025] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0026] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security, and national security.

[0027] With the gradual development and popularization of mobile Internet services, online shopping has become a consumption habit of most netizens. The e-commerce advertising alliance promotion method (CPS, Cost Per Sales) can use portal-level network media to display products throughout the site to promote user awareness, preferences and purchasing behavior. Therefore, CPS has become the preferred advertising promotion method for e-commerce platforms. With the promotion and development of CPS, the use of false addresses to defraud advertising commissions has also increased, thereby increasing the operating risks of e-commerce platforms.

[0028] Existing methods for identifying fake addresses mainly rely on rule engines and machine learning models. The rule engine detects abnormal orders by setting static rules, and identifies fake addresses by analyzing special characters that appear frequently in historical addresses or abnormal words of fake addresses that are similar to historical abnormal addresses. Although this method is direct, the static rule design is easily circumvented by new cheating strategies and lacks adaptability to unknown or mutated cheating patterns. For example, check whether the recipient address contains special characters that have been identified by expert experience or is similar to the historical order address, so as to determine the fake address and its corresponding fake order. The machine learning model manually annotates historical addresses and trains a labeled fake address data set, so that the trained model has the ability to judge true and false addresses. However, these model training relies on a large amount of annotated data, and the abnormal events in the anomaly detection scenario are very sparse, and the positive and negative samples are seriously offset. It is often difficult to meet unbiased training in actual projects. In addition, the generalization ability of the model is limited by the distribution and quality of the training data, and it cannot effectively identify new or mutated cheating methods.

[0029] The current technologies have the following common deficiencies in false address identification:

[0030] (1) Reliance on a large number of real labeled samples: Both rule engines and traditional machine learning models require a large amount of historical data for training and updating. However, in the field of anomaly detection, positive and negative samples are unevenly distributed, and it is challenging to build an unbiased training set. A large amount of manual labeling may introduce labeling bias, affecting the recognition ability and practicality of the model.

[0031] (2) Limited context understanding ability: Existing technologies mainly use feature-based training methods, which lack in-depth understanding of addresses and context association capabilities. Simple pattern matching methods cannot effectively handle cheating addresses containing abnormal words, and cannot capture subtle differences and complex cheating patterns in fake addresses.

[0032] (3) Insufficient generalization ability: Supervised machine learning methods and rule engines are limited by historical data and cannot effectively identify new or mutated cheating methods. As cheating methods continue to evolve, models and rule engines need to be updated regularly to maintain effectiveness. Therefore, these methods have weak recognition flexibility and seriously insufficient model generalization ability when faced with ever-changing fake addresses.

[0033] The embodiments of the present disclosure provide a fine-tuning method for a large language model, a method, an apparatus and a device for identifying a false address. The method includes: generating multiple initial address samples based on the real addresses included in the order database, wherein the initial address samples include address text and the initial label of the address text; performing data enhancement processing on the multiple initial address samples based on multiple abnormal patterns to obtain multiple target address samples; training an initial low-rank adaptive model using multiple target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is obtained by initializing the self-attention layer of the large language model; and adjusting the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0034] Figure 1 The exemplary system architecture of the fine-tuning method of the large language model and the false address identification method according to the embodiment of the present disclosure is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0035] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0036] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).

[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0038] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0039] It should be noted that the fine-tuning method of the large language model and the false address identification method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the fine-tuning system of the large language model and the false address identification system provided in the embodiment of the present disclosure can generally be set in the server 105. The fine-tuning method of the large language model and the false address identification method provided in the embodiment of the present disclosure can also be performed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the fine-tuning system of the large language model and the false address identification system provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the fine-tuning method of the large language model and the false address identification method provided in the embodiments of the present disclosure may also be performed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be performed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the fine-tuning system of the large language model and the false address identification system provided in the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be provided in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.

[0040] For example, the real address and prompt text included in the order database may be originally stored in any one of the first terminal device 101, the second terminal device 102 or the third terminal device 103 (for example, the first terminal device 101, but not limited thereto), or stored in an external storage device and may be imported into the first terminal device 101. Then, the first terminal device 101 may locally execute the fine-tuning method of the large language model and the false address recognition method provided in the embodiment of the present disclosure, or send the real address and prompt text included in the order database to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the real address and prompt text included in the order database may execute the fine-tuning method of the large language model and the false address recognition method provided in the embodiment of the present disclosure.

[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0042] Figure 2 The flowchart of the method for fine-tuning a large language model according to an embodiment of the present disclosure is schematically shown.

[0043] like Figure 2 As shown, the method includes operations S201 to S204.

[0044] In operation S201, a plurality of initial address samples are generated based on real addresses included in an order database, wherein the initial address samples include address text and an initial label of the address text.

[0045] According to an embodiment of the present disclosure, the original address data can be obtained from the real address included in the order database of the CPS alliance order system to ensure the integrity and diversity of the data, and the original address data set D can be obtained through SQL query:

[0046] (1)

[0047] According to an embodiment of the present disclosure, a portion of address information is randomly extracted from the original address data set D, and the address information is used as address text to ensure that the address text is representative, and a sample set S is extracted:

[0048] (2)

[0049] Where S represents the extracted sample set, and n is the number of initial address samples.

[0050] According to an embodiment of the present disclosure, in order to ensure that the model can distinguish between positive examples and negative examples, positive sample annotation and negative sample annotation are performed on the address text to form a positive sample data set and a negative sample data set, wherein the positive sample data set represents a real and valid address, and the negative sample data set represents a false or invalid address. According to an embodiment of the present disclosure, the real address in the order database is used to generate an initial address sample, and the initial address sample is annotated so that the initial address sample can reflect the characteristics of the valid address, the characteristics of the invalid address, and the characteristics of the false address in the real address, and can also better reflect the association and distinction between the valid address, the invalid address, and the false address.

[0051] In operation S202, data enhancement processing is performed on a plurality of initial address samples based on a plurality of abnormal patterns to obtain a plurality of target address samples.

[0052] According to the embodiments of the present disclosure, various data enhancement processes can be performed on the labeled samples, such as random character replacement, spelling error simulation, abnormal word simulation and format conversion, etc., and diversified training samples are generated through data enhancement processing. Then, the format of the training samples is fine-tuned, and the enhanced data is converted into a fine-tuning dialogue format, which can be used for domain fine-tuning of large language models.

[0053] According to the embodiments of the present disclosure, data enhancement is performed on the initial address samples to achieve data enhancement of valid addresses, invalid addresses and false addresses in real addresses. Through a variety of data enhancement methods, different forms of valid addresses, invalid addresses and false addresses and contextual semantic association features of address texts can be generated. In subsequent model training, the model can learn a wider range of features of valid addresses, invalid addresses and false addresses, and by using real addresses as training samples, the stability of the model can be improved.

[0054] In operation S203, an initial low-rank adaptive model is trained using a plurality of target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on a self-attention layer of a large language model.

[0055] According to an embodiment of the present disclosure, multiple target address samples can be converted into input representations of a large language model to obtain word segmentation and encoding of the multiple target address samples, and then the LoRA technology is applied to adjust the model parameters of the initial low-rank adaptive model to obtain the target low-rank adaptive model.

[0056] According to the embodiments of the present disclosure, LoRA technology adjusts the weight matrix of the model parameters of the self-attention layer of the large language model by adding a target low-rank adaptive model, without directly modifying the original weights of the model parameters of the self-attention layer of the large language model. This can significantly reduce the number of parameters that need to be updated and reduce the computational and storage costs of fine-tuning the large language model, making it suitable for use in resource-constrained environments.

[0057] In operation S204, model parameters of the self-attention layer of the large language model are adjusted based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0058] According to an embodiment of the present disclosure, the model parameters of the target low-rank adaptive model can be fused with the model parameters of the large language model, and the fused model parameters can be saved as the model parameters of the fine-tuned large language model. Parameter fusion has multiple implementation methods, such as a linear weighted fusion method, a cross fusion method, and the like.

[0059] According to the embodiments of the present disclosure, by performing data enhancement on the real address through multiple abnormal modes, the corresponding address text form and content of each real address under multiple abnormal modes can be obtained. By adopting the data enhancement method, the adaptability of the fine-tuning method of the large language model in the scenario of scarce labeled samples is enhanced. By using multiple target address samples to train the initial low-rank adaptive model, the target low-rank adaptive model is obtained, and then the model parameters of the self-attention layer of the above-mentioned large language model are adjusted based on the model parameters of the target low-rank adaptive model, so that the fine-tuned large language model has the ability to associate the address text context, the ability to understand complex address semantics and the ability to predict the address text context, so as to at least partially overcome the technical problem of low accuracy of false address recognition in the existing false address recognition method, thereby achieving the purpose of improving the insight accuracy and generalization ability of the fine-tuned large language model, and achieving a more accurate technical effect of identifying false addresses.

[0060] According to an embodiment of the present disclosure, data enhancement processing is performed on multiple initial address samples based on multiple abnormal patterns to obtain multiple target address samples, including: for each abnormal pattern, based on a processing strategy corresponding to the abnormal pattern, data augmentation is performed on the address texts respectively included in the multiple initial address samples to obtain multiple abnormal address texts corresponding to the abnormal pattern; based on the initial labels and abnormal patterns respectively included in the multiple initial address samples, target labels of the multiple abnormal address texts are determined; and format conversion is performed based on the multiple abnormal address texts and the target labels of the multiple abnormal address texts to obtain multiple target address samples corresponding to the abnormal pattern.

[0061] According to the embodiments of the present disclosure, different abnormal modes include adjusting the order of characters in the address text. For example, the effective address is AB community, which is written as BA community. The adjustment strategy can be: reverse the order of characters in the effective address in the real address. The initial label before the initial address sample is augmented can be used as the target label of the abnormal address text after the initial address sample is augmented. This setting method can improve the training efficiency of the training model when the subsequent model is trained.

[0062] According to the embodiments of the present disclosure, the format conversion can be implemented in a variety of ways, for example, converting full-width characters into half-width characters, converting multiple abnormal address texts and target labels of multiple abnormal address texts into the same format, and converting the text format into GBK or ASCII format. In order to improve the accuracy of the model when multiple target address samples are subsequently applied for model training, the formats of multiple target address samples are consistent. In addition, sentence conversion can also be performed according to actual conditions, for example, converting abnormal address texts and target labels into fine-tuning dialogue formats.

[0063] According to the embodiments of the present disclosure, it is possible to simulate situations in which abnormal addresses such as false addresses and invalid addresses may appear in abnormal modes, so that multiple target address samples can include more abnormal address modes, so that when multiple target address samples are used as training samples, the model can learn the characteristics of false addresses and invalid addresses in more situations. At the same time, by unifying the formats of multiple target address samples, the accuracy of the trained model can be improved when multiple target address samples are subsequently applied for model training. In addition, for scenarios with a lack of labeled samples, data enhancement technology is used to significantly improve the model's ability to recognize false addresses. Data enhancement technology simulates address input errors and possible false address forms, and enhances the generalization ability of the model in diversified scenarios. By expanding the coverage of training data and increasing sample diversity, the sample adaptability in scenarios with a lack of labeled samples is effectively improved, assisting in efficient and accurate fine-tuning of large language models.

[0064] According to an embodiment of the present disclosure, format conversion is performed based on multiple exception address texts and respective target tags of the multiple exception address texts to obtain multiple target address samples corresponding to the exception pattern, including: for each exception address text, embedding the exception address text into a first instruction template to obtain a question text; embedding the target tag of the exception address text into a second instruction template to obtain an answer text; and combining the question text and the answer text to obtain a target address sample.

[0065] According to an embodiment of the present disclosure, after data enhancement, when the data is converted into a data format suitable for fine-tuning a large language model, an instruction format for fine-tuning training is designed based on the address, address discrimination result, and address abnormal words. For example, the address can be used as input, and the discrimination result and abnormal words can be used as output. The enhanced data is converted according to the designed instruction format to form a data set in a fine-tuning dialogue format. The first instruction template can convert the abnormal address into a preset format, for example, converting the abnormal address into the form of province, city, district, street, community, and abnormal word a; the second instruction template can convert the target label of the abnormal address into a preset format, for example, converting the target label of the abnormal address into the form of abnormal word a.

[0066] According to an embodiment of the present disclosure, by adopting a fine-tuning dialogue format to convert the format of multiple abnormal address texts and the target labels of each of the multiple abnormal address texts, the answer can be better targeted at the key part of the question, thereby enhancing the pertinence and effectiveness of the dialogue. The model trained with the training sample set using the fine-tuning dialogue format can better meet the needs of users based on different dialogue format preferences.

[0067] According to an embodiment of the present disclosure, multiple abnormal patterns include a character replacement pattern, an input error simulation pattern, an abnormal word simulation pattern, a format transformation simulation pattern and an expression abnormality simulation pattern; wherein, based on a processing strategy corresponding to the abnormal pattern, data augmentation is performed on the address texts included in each of the multiple initial address samples to obtain multiple abnormal address texts corresponding to the abnormal pattern, including: for each initial address sample, the address text included in the initial address sample is processed using at least one of the following methods to obtain an abnormal address text.

[0068] According to an embodiment of the present disclosure, optional methods include: Method 1, determining a first target character from a plurality of characters included in the address text, and replacing the first target character with a random character to obtain an abnormal address text corresponding to the character replacement mode. Method 2, determining a second target character from a plurality of characters included in the address text, performing input error simulation based on the second target character to obtain an error character, and replacing the second target character with the error character to obtain an abnormal address text corresponding to the input error simulation mode. Method 3, determining a third target character from a plurality of characters included in the address text, deleting the third target character to obtain an abnormal address text corresponding to the input error simulation mode. Method 4, determining an insertion point in the address text, and inserting an abnormal word at the insertion point to obtain an abnormal address text corresponding to the abnormal word simulation mode. Method 5, determining a fourth target character having multiple expression formats from a plurality of characters included in the address text, and performing format conversion on the fourth target character to obtain an abnormal address text corresponding to the format conversion simulation mode. Method six, using the language of the address text as the initial language and the target language, determining the text translation link, and based on the text translation link, performing multiple translation processing on the address text to obtain an abnormal address text corresponding to the expression abnormal simulation mode.

[0069] According to an embodiment of the present disclosure, when performing character replacement, the English characters in the address text may be replaced by uppercase and lowercase characters, or Chinese characters may be replaced by corresponding English characters, or a specified character may be replaced by other characters whenever it appears in the address text. The other characters may be corresponding specified characters or random characters or characters dynamically transformed according to a preset rule. Some characters may also be randomly replaced in the address string to simulate user input errors. For example, the probability p of each character being replaced is set as follows:

[0070] (3)

[0071] Among them, A represents the original address, Indicates the address after character replacement.

[0072] According to an embodiment of the present disclosure, more abnormal addresses can be obtained by replacing characters in the address text. The abnormal addresses can simulate situations where the address is written incorrectly, characters in the address are omitted, the context of the address is reversed, the address error is caused by misoperation, or the address abnormality is caused by other factors, thereby enhancing the diversity of abnormal address samples.

[0073] According to the embodiments of the present disclosure, input error simulation methods include multiple forms, such as text input error simulation and digital input error simulation, and text input error simulation includes spelling error simulation, grammatical error simulation, and semantic error simulation, and digital input error simulation can select digital replacement, digital omission or digital addition, etc., and can also introduce common spelling errors, such as reversed order of letters, missing characters, etc., wherein error simulation can be implemented through a preset error pattern library, for example, a preset spelling error rule, one spelling error corresponds to one incorrect character.

[0074] (4)

[0075] in, Indicates the address after input error simulation.

[0076] According to an embodiment of the present disclosure, multiple target address samples obtained by performing data augmentation on address text in a manner of error simulation can simulate the input habits of different users and include a wider range of multiple target address samples with different characteristics. When the multiple target address samples are subsequently used to train the model, it helps to improve the stability and robustness of the model.

[0077] According to an embodiment of the present disclosure, when determining an insertion point in an address text, it is possible to select before or after the community name to insert the abnormal address text, or to select before the street name or before the two words "community" as the insertion point. It is also possible to extract the insertion point features of existing abnormal addresses, for example, the insertion point features may be commonly used insertion point positions or commonly used abnormal word categories. It is also possible to insert some common abnormal words into the address, such as "test test", "123456", "sdfsf", etc. Abnormal word insertion can be achieved by randomly selecting an insertion point in the address, and an abnormal word vocabulary can also be preset.

[0078] (5)

[0079] Where W represents the abnormal word library, Indicates the address after the exception word is simulated.

[0080] According to the embodiments of the present disclosure, by applying the abnormal word simulation mode to simulate the abnormal word characteristics of the actual abnormal address, the habit of setting abnormal words in the address text can be reproduced more purposefully, so that the abnormal address samples augmented by the common word simulation mode are closer to the real abnormal address. The model is trained with multiple target address samples augmented in this way, which helps to improve the accuracy of the model in identifying abnormal addresses.

[0081] According to an embodiment of the present disclosure, the format conversion simulation mode can convert the address text format into GBK or ASCII form, etc., and the format of the address can also be changed to convert full-width characters into half-width characters, or the numbers in the address can be expressed in Chinese characters. The format conversion can be achieved through regular expressions and replacement rules.

[0082] (6)

[0083] in, Indicates the address after format conversion simulation.

[0084] According to the embodiments of the present disclosure, by simulating false addresses through format transformation, various types of diversified training samples can be obtained, and the model trained using the training samples can improve the recognition ability of different types of false addresses.

[0085] According to an embodiment of the present disclosure, the expression abnormality simulation mode can translate address texts expressed in various languages ​​into a target language through language translation technology, for example, translating address texts expressed in English into Chinese addresses, or translating address texts expressed in a mixture of Japanese, English, Korean, etc. into a target language.

[0086] Optionally, the address text included in the initial address sample may be processed by combining the above methods to obtain abnormal address text, as shown in formulas (7) to (10):

[0087] (7)

[0088] (8)

[0089] (9)

[0090] (10)

[0091] in, It can represent the exception address text obtained after processing.

[0092] According to the embodiments of the present disclosure, the various target address sample data obtained by applying the abnormal simulation mode can characterize the situation where address texts are described in multiple languages. The various target address sample data obtained are used to train the model, which can enhance the model's ability to recognize abnormal addresses represented in multiple languages.

[0093] According to an embodiment of the present disclosure, the abnormal mode includes a character replacement mode, an input error simulation mode, an abnormal word simulation mode, a format conversion simulation mode, and an expression abnormality simulation mode. When data augmentation is performed on the address text included in the initial address sample, one mode or a combination of multiple modes can be selected from the multiple data augmentation modes included in the abnormal mode, so as to finally obtain multiple target address samples.

[0094] According to an embodiment of the present disclosure, a target address sample is subjected to word embedding processing to obtain a feature code of the target address sample, including: performing word segmentation processing on a text included in the target address sample to obtain a plurality of words; for each word, performing vector encoding on the word to obtain a first word code; obtaining a position code based on the position of the word in the text included in the target address sample; embedding the position code into the first word code to obtain a second word code; and combining the second word codes of the plurality of words to obtain a feature code of the target address sample.

[0095] According to an embodiment of the present disclosure, before performing domain fine-tuning, the data set needs to be converted into an input representation of a large language model, for example, by using text segmentation, vectorization representation, and position embedding representation to convert the data set into an input representation of a large language model. The word segmentation method may use the WordPiece word segmentation method of GLM4.

[0096] (11)

[0097] Among them, T represents the word sequence after word segmentation.

[0098] Vectorization can use the Embedding layer of the model.

[0099] (12)

[0100] Among them, V represents the vector representation of the word.

[0101] Position embedding means that you can use Rotary Embedding to add position information to the embedding vector, which is an important step when processing sequence data.

[0102] According to an embodiment of the present disclosure, text segmentation can segment the text in the conversation dataset to ensure that each word can be recognized by the model. The vectorized representation converts the input word ID into an embedding vector using the pre-trained base large language model GLM4 to obtain a vector representation of each word. The position embedding representation allows the model to understand the position of the word in the sequence. By converting the dataset into the input representation of the large language model, the recognition accuracy of the large language model can be improved.

[0103] According to an embodiment of the present disclosure, an initial low-rank adaptive model is trained using multiple target address samples to obtain a target low-rank adaptive model, including: performing word embedding processing on the target address samples to obtain feature encoding of the target address samples; adding the initial low-rank adaptive model to the large language model as a branch of the self-attention layer of the large language model to obtain the large language model to be adjusted; and inputting the feature encoding of the target address samples into the large language model to be adjusted, so as to feedback-adjust the model parameters of the initial low-rank adaptive model based on the forward propagation results of the feature encoding of the target address samples in the large language model to be adjusted, so as to obtain the target low-rank adaptive model.

[0104] According to an embodiment of the present disclosure, after data enhancement, the data needs to be converted into a data format suitable for fine-tuning a large language model. The instruction format for fine-tuning training is designed based on the address, address discrimination result, and address abnormal words. For example, the address can be used as input, and the discrimination result and abnormal words can be used as output. The instruction format can be expressed as:

[0105] (13)

[0106] Among them, I represents the instruction set, R represents the judgment result set, and W represents the abnormal word set.

[0107] The enhanced data is converted according to the designed instruction format to form a dataset in a fine-tuned dialogue format.

[0108] According to an embodiment of the present disclosure, the LoRA technology can be applied to the multiple target address samples obtained after data enhancement to fine-tune the large language model. The process of fine-tuning the large language model can adopt the following process:

[0109] First, initialize the LoRA matrix. Inject the trainable low-rank decomposition matrix into the self-attention mechanism layer of the GLM Block to obtain the adaptation matrix, and randomly initialize the adaptation matrix.

[0110] (14)

[0111] Among them, B and A are low-rank matrices, A represents the first low-rank matrix, B represents the second low-rank matrix, W0 is the frozen pre-trained weight matrix, the rank r of the matrix is ​​determined, and the adaptation matrix is ​​randomly initialized:

[0112] (15)

[0113] Then, the vector representation of the input data target address sample is forward propagated through the large language model to be adjusted to calculate the output of the large language model to be adjusted. The forward propagation can be implemented through the forward calculation graph of the large language model to be adjusted.

[0114] (16)

[0115] Among them, O represents the output of the model.

[0116] Next, the loss function is calculated based on the output of the large language model to be adjusted and the true label corresponding to the target address sample. The loss calculation formula is:

[0117] (17)

[0118] Among them, Y represents the true label.

[0119] Then, the gradient is calculated by the back-propagation algorithm, and the first low-rank matrix A and the second low-rank matrix B in the LoRA matrix are updated. Back-propagation is implemented by the automatic fine-tuning tool.

[0120] (18)

[0121] Finally, optimize the LoRA matrix. Repeat the process of forward propagation, loss calculation, and back propagation until the large language model to be adjusted converges. Using the Adam optimizer, the formula is:

[0122] (19)

[0123] Among them, η represents the learning rate.

[0124] According to the embodiments of the present disclosure, through the fine-tuning process of the large language model, the weights in the self-attention mechanism layer of the GLM4 large language model can be adjusted to better adapt to the false address discrimination scenario. For example, after the fine-tuning training is completed, the LoRA fine-tuning parameters are fused with the GLM4 model parameters. The fusion process includes parameter merging and model saving. Among them, parameter merging is to merge the fine-tuned LoRA matrix parameters B and A with the weight matrix W0 of the pre-trained model to obtain a new weight matrix , the formula is:

[0125] (20)

[0126] According to an embodiment of the present disclosure, model saving is to save the fused model parameters as a new model file, forming a large language model that has both general knowledge of large language models and domain knowledge of false address discrimination, for subsequent use in false address discrimination.

[0127] According to the embodiments of the present disclosure, the pre-trained GLM4 model is fine-tuned using LoRA technology. By introducing the first low-rank matrix and the second low-rank matrix, while keeping the pre-trained weights unchanged, only a small number of parameters are fine-tuned through 1 card A100 to adapt to specific tasks, reducing the number of model parameter training while maintaining the performance of the model. The fine-tuned model reduces the confusion of the false address scene by 17%. This enables the model to quickly adapt to new false address discrimination tasks and improves the understanding of complex address semantics and context prediction capabilities.

[0128] According to an embodiment of the present disclosure, the model parameters of the self-attention layer of the large language model are adjusted based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model, including: performing vector multiplication processing on the first low-rank matrix and the second low-rank matrix included in the target low-rank adaptive model to obtain a parameter matrix; based on the parameter matrix, adjusting the model parameters of the self-attention layer of the large language model to obtain the fine-tuned large language model.

[0129] According to an embodiment of the present disclosure, after the fine-tuning training is completed, the LoRA fine-tuning parameters are fused with the GLM4 model parameters. The fusion process can be performed as follows: First, the fine-tuned LoRA matrix parameters, the first low-rank matrix and the second low-rank matrix are vector-multiplied to obtain a parameter matrix, and the parameter matrix is ​​merged with the weight matrix of the pre-trained model to obtain a new weight matrix. The fused new weight matrix is ​​used as the model parameter of the fine-tuned large language model to obtain a large language model that has both general knowledge of the large language model and domain knowledge of false address discrimination.

[0130] Figure 3 The flowchart of the method for identifying false addresses based on a large language model according to an embodiment of the present disclosure is schematically shown.

[0131] like Figure 3 As shown, the method includes operations S301 to S303.

[0132] In operation S301, in response to receiving a prompt text, when it is determined that a prompt word included in the prompt text matches a preset prompt word, an address text to be recognized is extracted from the prompt text.

[0133] In operation S302, based on the preset thought chain and the address text to be recognized, multiple rounds of question and answer are conducted with the fine-tuned large language model to obtain the target answer text output by the fine-tuned large language model.

[0134] In operation S303, based on the target answer text, a false address recognition result of the address text to be recognized is determined; wherein the fine-tuned large language model is obtained by fine-tuning the large language model according to the fine-tuning method of the large language model described above.

[0135] According to the embodiments of the present disclosure, when false address recognition is performed, the trained GLM4 model can be combined with the prompt word engineering. Among them, reasonable false address prompt words are designed, such as "Is this a valid address?" or "Please check whether the following address is valid." The prompt words can be designed based on business needs and the model's understanding ability. It is also possible to combine the guidance method of the thinking chain to help the model understand the task, and guide the model to judge false addresses and identify abnormal words through step-by-step guidance of prompt words. Based on the prompt word engineering, the fine-tuned GLM4 model infers the delivery address.

[0136] For example, the delivery address is used as the address text to be recognized, the delivery address and prompt words are used as the input of the model, and the delivery address and prompt words are preprocessed and vectorized. The processed delivery address and prompt words are inferred through the fine-tuned GLM4 model to obtain the false address discrimination result. The reasoning process can be achieved through the forward propagation of the model. The false address discrimination result, semantic logical structure explanation and abnormal vocabulary are output to help users understand the judgment basis of the model. The result output can include the specific content of the abnormal words of the false address or the judgment of "normal".

[0137] According to the embodiments of the present disclosure, by designing specific prompt words and guiding thought chains, the model can understand the task requirements more deeply and effectively identify false addresses, with an address recognition accuracy of 99%. In the reasoning stage, the model combines the preprocessed address and prompt words for judgment, outputs false address discrimination results and abnormal vocabulary, and the accuracy of false address abnormal words reaches 98%. This method of using natural language processing technology guides the decision-making process of the model to specific task goals, thereby improving the insight accuracy and generalization ability of the false address detection model and the model's recognition accuracy for complex and hidden false addresses.

[0138] Figure 4 The flowchart of the training process of the fine-tuned large language model according to an embodiment of the present disclosure is schematically shown.

[0139] like Figure 4 As shown, the method includes operations S401 to S407.

[0140] In operation S401, original data of a preset number of order addresses is obtained from a library of CPS alliance business data.

[0141] In operation S402, the original data of a preset number of order addresses are labeled with positive and negative samples to obtain a plurality of initial address samples, wherein the initial address samples include positive samples labeled with normal addresses and negative samples consisting of false addresses containing abnormal words.

[0142] In operation S403, multiple data enhancement methods are applied to perform data enhancement on the initial address sample; wherein the multiple data enhancement methods include character replacement, input error simulation, abnormal word simulation, format change and expression abnormality simulation.

[0143] In operation S404, the format of the fine-tuning data set is converted for the initial address samples after data enhancement.

[0144] In operation S405, the format-converted initial address samples are vectorized to obtain a plurality of target address samples.

[0145] In operation S406, an initial low-rank adaptive model is trained using a plurality of target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on a self-attention layer of a large language model.

[0146] In operation S407, model parameters of the self-attention layer of the large language model are adjusted based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0147] Figure 5 The flowchart of the application method of the fine-tuned large language model according to the embodiment of the present disclosure is schematically shown.

[0148] like Figure 5 As shown, the method includes operations S501 to S503.

[0149] In operation S501, a reasonable false address prompt word is designed.

[0150] In operation S502, the fine-tuned GLM4 model is helped to understand the task through the guidance of thought chain.

[0151] According to the embodiment of the present disclosure, taking the input of a certain address as an example, in the design of prompt words and the guidance of thinking chains, according to the context understanding ability, the fine-tuned GLM4 model thinks in the following two steps: 1. Address standardization, based on the input address, think about the standardized delivery address, and ensure that the address contains the three-level addresses of province, city and district, and does not contain internal codes or abnormal words that may be secret codes. 2. Abnormal code identification, check the difference between the original address and the standardized delivery address. If the difference is meaningless letters or abnormal words, it represents an abnormal code. Through the above two steps of thinking, please determine whether the above address contains abnormal codes. If so, please return to "the specific content of the abnormal code"; if not, please return to "normal".

[0152] In operation S503, the delivery address is inferred using the fine-tuned GLM4 model, and a false address discrimination result is output.

[0153] Figure 6 The module diagram of the apparatus for fine-tuning a large language model according to an embodiment of the present disclosure is schematically shown.

[0154] like Figure 6 As shown, the fine-tuning device 600 for a large language model includes an initial address generating module 601 , a first address generating module 602 , an initial model training module 603 and a model parameter adjusting module 604 .

[0155] The initial address generation module 601 is used to generate a plurality of initial address samples based on the real addresses included in the order database, wherein the initial address samples include address text and an initial label of the address text.

[0156] The first address generation module 602 is used to perform data enhancement processing on multiple initial address samples based on multiple abnormal patterns to obtain multiple target address samples.

[0157] The initial model training module 603 is used to train an initial low-rank adaptive model using multiple target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on the self-attention layer of the large language model.

[0158] The model parameter adjustment module 604 is used to adjust the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

[0159] According to an embodiment of the present disclosure, the first address generation module 602 includes a data augmentation submodule, a label determination submodule, a text format conversion submodule and a sample determination submodule.

[0160] The data augmentation submodule is used to perform data augmentation on the address texts respectively included in the multiple initial address samples for each abnormal pattern based on the processing strategy corresponding to the abnormal pattern, so as to obtain multiple abnormal address texts corresponding to the abnormal pattern.

[0161] The label determination submodule is used to determine the target label of each of the multiple abnormal address texts based on the initial labels and abnormal patterns respectively included in the multiple initial address samples.

[0162] The text format conversion submodule is used to perform format conversion based on multiple abnormal address texts and respective target labels of the multiple abnormal address texts to obtain multiple target address samples corresponding to the abnormal patterns.

[0163] According to an embodiment of the present disclosure, the text format conversion submodule includes an address text embedding unit, a target tag embedding unit and a text combining unit.

[0164] The address text embedding unit is used to embed the abnormal address text into the first instruction template for each abnormal address text to obtain the problem text.

[0165] The target label embedding unit is used to embed the target label with the exception address text into the second instruction template to obtain the answer text.

[0166] The text combination unit is used to combine the question text and the answer text to obtain a target address sample.

[0167] According to an embodiment of the present disclosure, the data augmentation submodule includes a character replacement unit, a replacement error simulation unit, a deletion error simulation unit, an abnormal word simulation unit, a format conversion simulation unit and a statement abnormality simulation unit.

[0168] The character replacement unit is used to determine a first target character from a plurality of characters included in the address text, and replace the first target character with a random character to obtain an abnormal address text corresponding to the character replacement pattern.

[0169] The replacement error simulation unit is used to determine a second target character from multiple characters included in the address text, perform input error simulation based on the second target character to obtain an error character, and use the error character to replace the second target character to obtain an abnormal address text corresponding to the input error simulation mode.

[0170] The deletion error simulation unit is used to determine a third target character from a plurality of characters included in the address text, and delete the third target character to obtain an abnormal address text corresponding to the input error simulation mode.

[0171] The abnormal word simulation unit is used to determine an insertion point in the address text and insert an abnormal word at the insertion point to obtain an abnormal address text corresponding to the abnormal word simulation mode. The format conversion simulation unit is used to determine a fourth target character with multiple expression formats from multiple characters included in the address text and perform format conversion on the fourth target character to obtain an abnormal address text corresponding to the format conversion simulation mode.

[0172] The expression abnormality simulation unit is used to determine the text translation link using the language of the address text as the initial language and the target language, and based on the text translation link, perform multiple translation processing on the address text to obtain an abnormal address text corresponding to the expression abnormality simulation mode.

[0173] According to an embodiment of the present disclosure, the initial model training module 603 includes a feature coding determination submodule, a model adding submodule and a model parameter adjustment submodule.

[0174] The feature coding determination submodule is used to perform word embedding processing on the target address sample to obtain the feature coding of the target address sample.

[0175] The model adding submodule is used to add the initial low-rank adaptive model as a branch of the self-attention layer of the large language model to the large language model to obtain the large language model to be adjusted.

[0176] The model parameter adjustment submodule is used to input the feature encoding of the target address sample into the large language model to be adjusted, so as to feedback adjust the model parameters of the initial low-rank adaptive model based on the forward propagation result of the feature encoding of the target address sample in the large language model to be adjusted, so as to obtain the target low-rank adaptive model.

[0177] According to an embodiment of the present disclosure, the feature coding determination submodule includes a text segmentation unit, a vector coding unit, a position coding unit, a position information embedding unit and a first address coding unit.

[0178] The text segmentation unit is used to perform segmentation processing on the text included in the target address sample to obtain multiple words.

[0179] The vector encoding unit is used to perform vector encoding on each word to obtain a first word code.

[0180] The position encoding unit is used to obtain the position encoding based on the position of the word in the text included in the target address sample.

[0181] The position information embedding unit is used to embed the position code into the first word code to obtain the target word code.

[0182] The first address encoding unit is used to combine the second word codes of the plurality of words to obtain a feature code of the target address sample.

[0183] According to an embodiment of the present disclosure, the model parameter adjustment module 604 includes a parameter matrix determination submodule and a parameter adjustment submodule.

[0184] The parameter matrix determination submodule is used to perform vector multiplication processing on the first low-rank matrix and the second low-rank matrix included in the target low-rank adaptive model to obtain a parameter matrix.

[0185] The parameter adjustment submodule is used to adjust the model parameters of the self-attention layer of the large language model based on the parameter matrix to obtain a fine-tuned large language model.

[0186] Figure 7 The module diagram of the false address recognition device based on the large language model according to the embodiment of the present disclosure is schematically shown.

[0187] like Figure 7 As shown, the false address recognition device 700 based on the large language model includes an address text extraction module 701, an answer text output module 702 and a false address recognition module 703.

[0188] The address text extraction module 701 is used for extracting the address text to be recognized from the prompt text in response to receiving the prompt text and when it is determined that the prompt word included in the prompt text matches the preset prompt word.

[0189] The answer text output module 702 is used to conduct multiple rounds of question and answer with the fine-tuned large language model based on the preset thought chain and the address text to be recognized, so as to obtain the target answer text output by the fine-tuned large language model.

[0190] The false address recognition module 703 is used to determine the false address recognition result of the address text to be recognized based on the target answer text; wherein the fine-tuned large language model is obtained by fine-tuning the large language model according to the fine-tuning method of the large language model mentioned above.

[0191] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0192] For example, any of the initial address generation module 601, the first address generation module 602, the initial model training module 603, the model parameter adjustment module 604, the address text extraction module 701, the answer text output module 702, and the false address identification module 703 can be combined in one module / unit / sub-unit for implementation, or any of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the initial address generation module 601, the first address generation module 602, the initial model training module 603, the model parameter adjustment module 604, the address text extraction module 701, the answer text output module 702, and the false address identification module 703 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in an appropriate combination of any of them. Alternatively, at least one of the initial address generation module 601, the first address generation module 602, the initial model training module 603, the model parameter adjustment module 604, the address text extraction module 701, the answer text output module 702, and the false address identification module 703 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0193] It should be noted that the data processing system part in the embodiments of the present disclosure corresponds to the data processing method part in the embodiments of the present disclosure. The description of the data processing system part specifically refers to the data processing method part, which will not be repeated here.

[0194] Figure 8 A block diagram of an electronic device suitable for implementing a fine-tuning method for a large language model and a false address identification method according to an embodiment of the present disclosure is schematically shown. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0195] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0196] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0197] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the input / output (I / O) interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that the computer program read therefrom is installed into the storage portion 808 as needed.

[0198] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0199] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0200] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0201] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 802 and / or the RAM 803 described above and / or one or more memories other than the ROM 802 and the RAM 803 .

[0202] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the large language model fine-tuning method and the false address recognition method based on the large language model provided by the embodiment of the present disclosure.

[0203] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0204] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0205] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0206] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0207] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A fine-tuning method for a large language model, comprising: Based on the real addresses included in the order database, generating a plurality of initial address samples, wherein the initial address samples include address text and an initial label of the address text; Based on the multiple abnormal patterns, data enhancement processing is performed on the multiple initial address samples respectively to obtain multiple target address samples; Using the multiple target address samples to train an initial low-rank adaptive model to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on a self-attention layer of a large language model; and Based on the model parameters of the target low-rank adaptive model, the model parameters of the self-attention layer of the large language model are adjusted to obtain a fine-tuned large language model.

2. The method according to claim 1, wherein: The performing data enhancement processing on the multiple initial address samples based on the multiple abnormal patterns to obtain multiple target address samples includes: For each abnormal pattern, based on a processing strategy corresponding to the abnormal pattern, data augmentation is performed on the address texts respectively included in the multiple initial address samples to obtain multiple abnormal address texts corresponding to the abnormal pattern; Determining a target label for each of the plurality of abnormal address texts based on the initial label included in each of the plurality of initial address samples and the abnormal pattern; and Format conversion is performed based on the multiple abnormal address texts and the target tags of the multiple abnormal address texts to obtain multiple target address samples corresponding to the abnormal pattern.

3. The method according to claim 2, wherein: The performing format conversion based on the multiple abnormal address texts and the target tags of the multiple abnormal address texts to obtain multiple target address samples corresponding to the abnormal pattern includes: For each exception address text, embed the exception address text into the first instruction template to obtain a question text; embedding the target tag corresponding to the abnormal address text into the second instruction template to obtain an answer text; and The question text and the answer text are combined to obtain the target address sample.

4. The method according to claim 2, wherein: The multiple abnormal modes include a character replacement mode, an input error simulation mode, an abnormal word simulation mode, a format conversion simulation mode and an expression abnormality simulation mode; Wherein, based on the processing strategy corresponding to the abnormal pattern, data augmentation is performed on the address texts respectively included in the multiple initial address samples to obtain multiple abnormal address texts corresponding to the abnormal pattern, including: For each initial address sample, the address text included in the initial address sample is processed using at least one of the following methods to obtain the abnormal address text: Determining a first target character from a plurality of characters included in the address text, and replacing the first target character with a random character to obtain an abnormal address text corresponding to the character replacement pattern; Determine a second target character from a plurality of characters included in the address text, perform input error simulation based on the second target character to obtain an error character, and use the error character to replace the second target character to obtain an abnormal address text corresponding to the input error simulation mode; Determining a third target character from a plurality of characters included in the address text, and deleting the third target character to obtain an abnormal address text corresponding to the input error simulation mode; Determining an insertion point in the address text, and inserting an abnormal word at the insertion point to obtain an abnormal address text corresponding to the abnormal word simulation pattern; Determining a fourth target character having multiple expression formats from a plurality of characters included in the address text, and performing format conversion on the fourth target character to obtain an abnormal address text corresponding to the format conversion simulation mode; The language of the address text is used as the initial language and the target language, a text translation link is determined, and based on the text translation link, the address text is translated multiple times to obtain an abnormal address text corresponding to the expression abnormality simulation mode.

5. The method according to claim 1, wherein: The using the multiple target address samples to train the initial low-rank adaptive model to obtain the target low-rank adaptive model includes: Performing word embedding processing on each target address sample to obtain a feature code of the target address sample; Adding the initial low-rank adaptive model to the large language model as a branch of the self-attention layer of the large language model to obtain the large language model to be adjusted; and The feature encoding of the target address sample is input into the large language model to be adjusted, and the model parameters of the initial low-rank adaptive model are feedback-adjusted based on the forward propagation result of the feature encoding of the target address sample in the large language model to be adjusted to obtain the target low-rank adaptive model.

6. The method according to claim 5, wherein: The word embedding process is performed on each target address sample to obtain a feature code of the target address sample, including: Performing word segmentation processing on the text included in the target address sample to obtain multiple words; For each word, vector encoding is performed on the word to obtain a first word encoding; Obtaining a position code based on the position of the word in the text included in the target address sample; embedding the position code into the first word code to obtain a second word code; and The second word codes of the multiple words are combined to obtain the feature code of the target address sample.

7. The method according to claim 1, wherein: The step of adjusting the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model includes: Performing vector multiplication processing on a first low-rank matrix and a second low-rank matrix included in the target low-rank adaptive model to obtain a parameter matrix; Based on the parameter matrix, the model parameters of the self-attention layer of the large language model are adjusted to obtain the fine-tuned large language model.

8. A method for identifying false addresses based on a large language model, comprising: In response to receiving the prompt text, if it is determined that the prompt word included in the prompt text matches the preset prompt word, extracting the address text to be recognized from the prompt text; Based on the preset thought chain and the address text to be recognized, multiple rounds of question and answer are performed with the fine-tuned large language model to obtain the target answer text output by the fine-tuned large language model; as well as Based on the target answer text, determining a false address recognition result of the address text to be recognized; The fine-tuned large language model is obtained by fine-tuning the large language model using the fine-tuning method for a large language model according to any one of claims 1 to 7.

9. A fine-tuning device for a large language model, comprising: An initial address generation module, used to generate a plurality of initial address samples based on the real addresses included in the order database, wherein the initial address samples include address text and an initial label of the address text; A first address generation module, configured to perform data enhancement processing on the plurality of initial address samples based on a plurality of abnormal patterns to obtain a plurality of target address samples; An initial model training module, used to train an initial low-rank adaptive model using the multiple target address samples to obtain a target low-rank adaptive model, wherein the initial low-rank adaptive model is initialized based on a self-attention layer of a large language model; and A model parameter adjustment module is used to adjust the model parameters of the self-attention layer of the large language model based on the model parameters of the target low-rank adaptive model to obtain a fine-tuned large language model.

10. A false address recognition device based on a large language model, comprising: An address text extraction module, configured to extract the address text to be identified from the prompt text in response to receiving the prompt text and if it is determined that the prompt word included in the prompt text matches the preset prompt word; An answer text output module is used to conduct multiple rounds of question and answer with the fine-tuned large language model based on a preset thought chain and the address text to be recognized, so as to obtain a target answer text output by the fine-tuned large language model; as well as A false address recognition module, used for determining a false address recognition result of the address text to be recognized based on the target answer text; The fine-tuned large language model is obtained by fine-tuning the large language model using the fine-tuning method for a large language model according to any one of claims 1 to 7.

11. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 8.

13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Address standardization method based on knowledge graph and natural language processing technology

    CN114492438A

  • Express weight abnormity identification method, device and equipment and storage medium

    CN115393627A

  • Abnormality detection method and device for dialogue system

    CN117076654A

  • Large anesthesia model training method and device

    CN117095827A

  • Anomaly detection method and device based on large visual language model

    CN117745680A

Cited By

  • Method, computing program product and device for identifying specific type of user address

    CN120499150A

  • Address text correlation analysis method, system and equipment and storage medium

    CN120850955A

  • Small-sample contrast enhancement fine tuning method and system based on large language model

    CN121052322A

  • Method and system for enhancing investment suggestion suitability review agent, equipment and storage medium

    CN121211016A