A retrieval method, device and medium based on large language model

Through the retrieval method based on the large language model, the shortcomings of traditional map retrieval in complex query scenarios are solved, and more accurate and personalized map information services are realized to adapt to users' multi-level query needs.

CN118277442BActive Publication Date: 2024-09-17浙江锦智人工智能科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410702673.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-17
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Traditional map retrieval has challenges in complex multi-level query scenarios, especially comprehensive queries, multi-dimensional statistical queries and correlation queries that are difficult to effectively handle.

Method used

Adopting a retrieval method based on a large language model, preprocessing, format conversion and division of training data, training the language model, and retrieval through the optimized model, supporting multi-round dialogue data structure and history caching, combined with user feedback mechanism to continuously optimization.

Benefits of technology

It improves the understanding of natural language queries, improves the accuracy and comprehensiveness of search results, can flexibly handle multi-level query requirements, provides more personalized and accurate search results, and enhances users' ability to obtain information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118277442B
    Figure CN118277442B
Patent Text Reader

Abstract

The present application discloses a retrieval method, device and medium based on a large language model, the method comprising: determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialogue structure; dividing the training data to obtain a training set, a validation set and a test set, determining a pre-set language model, and training the language model according to the divided training data; determining the hyperparameters of the language model, adjusting the language model according to the hyperparameters to optimize the language model; and searching through the optimized language model to obtain search results. The present application improves the ability to understand natural language queries through the application of a large language model, and can more deeply understand the user's query intent and semantics, thereby improving the accuracy and comprehensiveness of search results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of map retrieval technology, and in particular to a retrieval method, device and medium based on a large language model. Background Art

[0002] Traditional map retrieval is mainly based on searching for geographic information selected by the user and displaying the regular-shaped geographic range containing the geographic information at a predetermined display magnification with the geographic information as the center. However, there are still certain challenges for complex multi-level query scenarios such as comprehensive query, multi-dimensional statistical query and associated query. Summary of the invention

[0003] In order to solve the above problems, the present application proposes a retrieval method based on a large language model, including: determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialogue structure; dividing the training data to obtain a training set, a validation set and a test set, determining a preset language model, and performing model training on the language model according to the divided training data; determining hyperparameters of the language model, adjusting the language model according to the hyperparameters to optimize the language model; and performing retrieval through the optimized language model to obtain retrieval results.

[0004] In one example, the method further includes: collecting data according to pre-set data categories, cleaning the collected data, deduplicating the cleaned data, and annotating the deduplicated data to determine semantic features based on the data, wherein the data processing types of the deduplication processing include but are not limited to removing irrelevant characters, repairing format errors, and unifying coding formats, and the annotation types include but are not limited to case categories, key entities, and event relationships.

[0005] In one example, model training is performed on the language model, specifically including: determining a model task according to a preset language model, and structurally adjusting the language model according to the model task to obtain a model output layer; determining model parameters of the language model, and modifying the model output layer according to the model parameters; determining multiple model output layers, determining a preset frozen layer among the multiple model output layers, determining an update layer according to the frozen layer, and updating the model corresponding to the update layer according to the model task.

[0006] In one example, the hyperparameters include but are not limited to learning rate, batch, and number of iterations; before optimizing the language model, the method further includes: determining the model convergence speed, loss curve smoothness, validation and performance of the language model, and adjusting the learning rate according to the model convergence speed, the loss curve smoothness, and the validation set performance; determining the hardware video memory and model complexity of the language model, and determining the batch size according to the hardware video memory and the model complexity; determining the number of training cycles of the language model, and determining the number of iterations according to the number of training cycles.

[0007] In one example, the method further includes: determining error cases of the language model based on the validation set, and determining the accuracy and recall of the language model based on the error cases; determining an index score of the language model based on the accuracy and the recall, and determining an evaluation level of the language model based on the index score.

[0008] In one example, before searching through the optimized language model, the method also includes: acquiring voice information through the language model, converting the format of the voice information to obtain text information, and determining the key-value pairs corresponding to the text information through the language model; storing the text information according to the key-value pairs to obtain historical query information; determining a pre-set expiration procedure, and updating the historical query information according to the expiration procedure.

[0009] In one example, searching through the optimized language model specifically includes: determining the user's query information through the language model, determining a preset instruction format, and converting the query information into a format according to the instruction format to obtain a query instruction.

[0010] In one example, the method further includes: determining a prompt word through the language model, so that the user determines the query information according to the prompt word.

[0011] On the other hand, the present application also proposes a retrieval device based on a large language model, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the retrieval device based on the large language model can execute: determining training data, preprocessing the training data, and formatting the preprocessed training data so that the format of the training data is a dialogue structure; dividing the training data to obtain a training set, a validation set, and a test set, determining a pre-set language model, and performing model training on the language model according to the divided training data; determining the hyperparameters of the language model, and adjusting the language model according to the hyperparameters to optimize the language model; and performing retrieval through the optimized language model to obtain retrieval results.

[0012] On the other hand, the present application also proposes a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to: determine training data, preprocess the training data, and convert the format of the preprocessed training data so that the format of the training data is a dialogue structure; divide the training data to obtain a training set, a validation set, and a test set, determine a preset language model, and perform model training on the language model based on the divided training data; determine the hyperparameters of the language model, and adjust the language model based on the hyperparameters to optimize the language model; and perform retrieval using the optimized language model to obtain retrieval results.

[0013] This application improves the ability to understand natural language queries through the application of large language models, and can more deeply understand the user's query intent and semantics, thereby improving the accuracy and comprehensiveness of search results. It can support comprehensive query, multi-dimensional statistical query and related query scenario requirements, so that the system can flexibly handle the user's multi-level query needs and enhance the user's ability to obtain comprehensive information. This application combines multi-round dialogue data structure, historical cache and user feedback mechanism, and the model can better understand the user's intention and context, and then provide more personalized and accurate search results. The introduction of a result feedback mechanism and a continuous data iteration cycle enables the model to be continuously optimized and improved based on user feedback to adapt to changes in user needs. The map retrieval method and device based on a large language model in this application is expected to improve the intelligence and personalization level of map data retrieval, and provide users with higher quality map information services that are more in line with actual needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0015] Figure 1 A schematic diagram of a flow chart of a retrieval method based on a large language model in an embodiment of the present application;

[0016] Figure 2 This is a schematic diagram of a retrieval device based on a large language model in an embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0018] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0019] Traditional map retrieval methods have some challenges, such as complex multi-level query scenarios such as comprehensive query, multi-dimensional statistical query and association query. In order to overcome these challenges, the introduction of large language model technology into map retrieval has become an innovative way to improve the intelligence and adaptability of the system.

[0020] Large language models, such as the Generative Pre-trained Transformer (GPT), provide a solution for map retrieval with their natural language processing capabilities and understanding of context.

[0021] like Figure 1 As shown, in order to solve the above problems, an embodiment of the present application provides a retrieval method based on a large language model, the method comprising:

[0022] S101, determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure.

[0023] Collect Chinese and English text data, including but not limited to business documents, historical search data and actual demand search data, to ensure that the data covers the breadth and depth of the business. Clean the collected data, remove irrelevant characters, fix format errors, unify the encoding format, etc.; perform deduplication processing to ensure the uniqueness of the data set; perform annotations, such as case categories, key entities, event relationships, etc., so that the model can better capture semantic features. Clean and standardize the data to remove noise and irrelevant information; use data enhancement methods, such as data synthesis, adversarial generative networks, automatic text generation, etc., to expand the training data set.

[0024] Organize the data into sequence lengths and encoding requirements that fit the model input. In order to enhance the context-awareness of the model, a multi-round dialogue data format is designed. The multi-round dialogue format is: {"dialogue ID": "dialogue 1", "dialogue": [{"speaker": "user", "content": "user question 1"}, {"speaker": "model", "content": "model answer 1"}, {"speaker": "user", "content": "user question 2"}, {"speaker": "model", "content": "model answer 2"}, {"speaker": "user", "content": "user question N"}, {"speaker": "model", "content": "model answer N"}]}. The JSON format is used to represent the structure of multi-round dialogues. Each round of the dialogue contains the dialogue ID, speaker, and content. Each question asked by the user is based on the content of the previous dialogue. The model considers the context information and provides relevant answers based on the user's questions. This format can help large language models better understand the dialogue history and generate more coherent and relevant responses.

[0025] S102: Divide the training data to obtain a training set, a validation set, and a test set, determine a pre-set language model, and perform model training on the language model according to the divided training data.

[0026] When processing text data, in order to ensure the adequacy of training data and the excellent generalization ability of the model, the first thing is to ensure the diversity and representativeness of the data and collect data from different scenarios. At the same time, carefully check the quality of text annotations to ensure that the label information is highly consistent with the text content and reduce the impact of noise on model training. Use text data enhancement technology, such as synonym replacement and sentence transformation, to broaden the learning field of the model and reduce the risk of overfitting.

[0027] Reasonably allocate the proportions of training set, validation set and test set, for example, follow the proportion of 70%, 15%, and 15%, to ensure that there is no data overlap between the sets, which are used for model training, optimization and final performance evaluation respectively. Use the validation set to tune the model parameters and use the cross-validation method to objectively evaluate the model performance, reduce the impact of the randomness of data division on the evaluation results, and help build training data suitable for fine-tuning large language models. Before fine-tuning, ensure the quality, diversity and representativeness of the data to improve the model's adaptability and accuracy to map retrieval tasks.

[0028] The constructed training set data is used for model training. The model selects Chinese and English pre-trained models with excellent language comprehension capabilities, such as LLaMA-2, Baichuan2, Yi, etc. of the LLaMA series. The model parameters are required to be more than 13 billion as the basic architecture of the large language model. Use mainstream deep learning frameworks, such as PyTorch, to load the selected Chinese and English pre-trained models and their supporting word segmenters, and retain the model weights in the pre-training stage. Clarify the specific requirements of multi-level map retrieval tasks, such as text classification, identifying the event types involved in the text; named entity recognition, extracting entity information such as people and places in the text; question-answering system, generating accurate answers to relevant questions; semantic retrieval, efficiently locating relevant information in massive data, etc.

[0029] Adjust the model structure and design the model output layer to match the pre-selected fine-tuning task. For example, for text classification tasks, add a classification head, i.e., a softmax layer; for named entity recognition tasks, use a sequence labeling decoder; for question-answering tasks, configure a generative decoder, such as a Transformer Decoder.

[0030] Perform full parameter fine-tuning, retain all parameters of the pre-trained model, and only add or modify the output layer parameters related to the fine-tuning task. Perform end-to-end full parameter fine-tuning on the entire model, and use the training set data to update all parameters to adapt it to the specific task.

[0031] Fine-tune some parameters, selectively freeze some layers of the pre-trained model, and only update the top-level parameters that are closely related to the fine-tuning task; combine a large-scale knowledge base for retrieval enhancement to improve the model's reasoning ability on specific problems.

[0032] Select Chinese and English pre-trained models, and train the models based on the constructed training dataset by fine-tuning all parameters or some parameters to enhance the capabilities in specific fields to meet the specific needs of map multi-level retrieval tasks.

[0033] S103: Determine hyperparameters of the language model, and adjust the language model according to the hyperparameters to optimize the language model.

[0034] Hyperparameters include learning rate, batch, and number of iterations. Set the initial learning rate, such as (1e-4, 1e-5), and dynamically adjust it according to the model convergence speed, the smoothness of the loss curve, and the changes in the performance of the validation set. The size of the batch is determined by hardware resources, such as GPU memory and model complexity. Larger batches help improve computational efficiency, but may limit the model's ability to capture subtle differences in data; smaller batches can make better use of data diversity, but may increase training time. Usually experiments are conducted between (8, 16, 32, 64), taking into account both training efficiency and model performance. The number of iterations needs to be set to a reasonable number of training cycles, such as 10 to 30 epochs. Combined with the early stopping strategy, training should be stopped when the performance of the validation set has not improved for a certain number of rounds, such as 5 consecutive rounds. Overfitting should be avoided and computing resources should be saved.

[0035] Choose regularization technology to reduce overfitting, add Dropout layers to the hidden layers of the model, especially the fully connected layers or attention mechanism layers, and set an appropriate Dropout ratio, such as 0.1 to 0.5. The Dropout layer randomly discards part of the neuron output during each forward propagation, effectively preventing the model from over-relying on specific features, reducing the risk of overfitting, and improving the model's generalization ability.

[0036] Select AdamW as the optimizer and set the relevant parameters of AdamW, such as β1 (momentum factor, usually set to 0.9), β2 (second-order moment estimation factor, usually set to 0.999), ε (numerical stability constant, usually set to 1e-8), etc. In addition, enable the built-in weight decay function of AdamW and set a suitable weight decay coefficient, such as the same coefficient as L2 regularization.

[0037] In one embodiment, the model is validated using validation set data, which contains a variety of typical scenarios and difficulty levels to truly reflect the performance of the model on new data. Look up specific cases where the model predicts errors on the validation set, understand the context in which the error occurred, the difference between the model output and the actual label, and analyze the specific causes of the error, such as vocabulary comprehension errors, improper syntactic structure processing, semantic understanding deviations, etc. Continue to iterate the model until the performance of the model on the validation set reaches more than 85% of the expected standard.

[0038] In one embodiment, accuracy refers to the ratio of the number of samples correctly predicted by the model to the total number of samples. An accuracy of more than 85% to 90% may be considered good; recall refers to the ratio of the number of positive samples successfully identified by the model to the number of all positive samples. It measures the ability of the model in identifying positive samples. A recall of more than 80% may be considered good. The F1 score (referred to herein as the evaluation grade) is the weighted harmonic mean of the accuracy and recall, which takes into account the accuracy and completeness of the model. The higher the F1 score, the better the balance between accuracy and recall. An F1 score above 0.8 is generally considered good.

[0039] In one embodiment, the model weights are quantized by mapping 32-bit floating point numbers to 8-bit or 4-bit integers for INT8 / INT4 quantization, compressing storage and approximate operations, reducing the model size and speeding up the reasoning speed. While ensuring the accuracy of the model, the resources consumed by the large model and the reasoning performance are optimized to ensure the efficiency of the model's implementation. Through digital model training, model optimization, training evaluation and model quantization, more accurate and reliable prediction results can be provided, enhancing the model's prediction ability. Make it more in line with actual application scenarios and bring better solutions for complex multi-level queries.

[0040] S104: Perform search using the optimized language model to obtain search results.

[0041] Convert speech into text information and clean the text information, including removing special characters and punctuation, removing stop words, converting uppercase and lowercase, stemming or word form restoration, removing duplicates and noise, and processing null or missing values. Through these steps, ensure the consistency of the data format and standardize it to ensure that the model can recognize and process this data more effectively.

[0042] The system stores the geographic information in each text message of the user in the form of a key-value pair as historical query information, where the session ID is used as the key, and the geographic information, associated information, and dimensional statistical information generated by the model each time based on the text information constitute the value corresponding to the key. At the same time, the system sets a certain time expiration strategy to regularly clean and maintain the cache to ensure that the latest historical query information can be added to the cache in a timely manner. When a user initiates a query request, the system first checks the historical cache. This design helps to improve the model's context-awareness and enable it to more effectively understand the user's query intent. This approach enables the system to better utilize previous interaction information and provide users with services that are more in line with their needs, thereby enhancing the overall user experience.

[0043] Hints can serve as a guide for the model to understand user queries. By providing clear and specific hints, the model can more accurately grasp the user's query needs and intent. Multi-level queries usually involve multiple conditions or restrictions, and hints can help the model focus more on the key information at each stage. This helps the model effectively filter and process a large amount of query information. Appropriate hints can reduce the ambiguity and misunderstanding of the model in understanding user intent. This helps avoid misunderstandings or misinterpretations of user intent that may occur in the model. The hint format is: {"session ID":"session ID","type":"geo-query","content":"query content","background":"context background","requirements":"output formatted time, distance, statistics, etc."}. The hint structure is represented in JSON format, and context information at different stages is used to guide the model to understand the user's multiple requirements in a step-by-step iterative manner.

[0044] In one embodiment, the model converts the user's natural language query into a domain-specific language (herein referred to as an instruction format), such as a DSL, that the system can understand to ensure that the system accurately understands and executes the corresponding search operation. This conversion generates clear query instructions, ensures the accuracy of the search operation, meets complex and multi-level query and analysis requirements, avoids ambiguity or misunderstanding, and keeps the search results consistent with the user's intentions. Figure 1 The generation of DSL covers specific search keywords, conditions, screening requirements, etc., which helps map search engines to execute queries more accurately and improve the relevance and quality of search results. The process of DSL generated by query scenarios is as follows: First, query the activity trajectory of a person and the driving trajectory of a vehicle in a certain area, for example, {"response status":"success or failure","behavior":["drawing person trajectory","drawing vehicle trajectory"],"category":["monitoring","camera"],"response content":{"query information":{"document number":["someone"],"area":["certain area"]},"associated information":{},"statistical information":{}}}. Second, count the number of times he and the vehicle appear in the area and display the location information where they appear more than 3 times, for example, {"Response status":"Success or failure","Behavior":["Number of statistics","Location"],"Category":["Monitoring","Camera"],"Response content":{"Query information":{"ID number":["Someone"]},"Related information":{},"Statistical information":{"Statistical area":["A certain area"],"Statistical frequency":[{"Comparison operator":"Greater than","Comparison value":"3"}]}}}

[0045] In one embodiment, geographic information, statistical information, and associated information are visualized on a map to present the data more intuitively.

[0046] In one embodiment, a result feedback mechanism is used for continuous optimization and improvement of the model. The mechanism includes collecting user feedback on search results, user behavior data, and evaluation indicators. Through information such as user clicks, browsing behavior, and satisfaction ratings given by users, the interaction between users and search results is tracked and analyzed to understand user satisfaction and the quality of search results. These feedback data are used to optimize the model, for example, to adjust the search algorithm, improve result ranking, or retrain the model. This closed-loop process enables the model to continuously learn and adapt to user needs and behaviors, thereby providing more accurate and relevant search results and continuously improving the user experience. The model retrieval and result feedback module plays a vital role in the map retrieval system, realizing complex multi-level query scenarios, which directly affects the user experience and system performance, and also provides an important basis for the continuous optimization of the system.

[0047] like Figure 2 As shown, the embodiment of the present application also provides a retrieval device based on a large language model, including:

[0048] at least one processor; and,

[0049] a memory communicatively connected to at least one processor; wherein,

[0050] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable a retrieval device based on a large language model to perform:

[0051] Determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure;

[0052] The training data is divided to obtain a training set, a validation set and a test set, a pre-set language model is determined, and model training is performed on the language model according to the divided training data;

[0053] Determining hyperparameters of the language model, and adjusting the language model according to the hyperparameters to optimize the language model;

[0054] The optimized language model is used for retrieval to obtain retrieval results.

[0055] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:

[0056] Determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure;

[0057] The training data is divided to obtain a training set, a validation set and a test set, a pre-set language model is determined, and model training is performed on the language model according to the divided training data;

[0058] Determining hyperparameters of the language model, and adjusting the language model according to the hyperparameters to optimize the language model;

[0059] The optimized language model is used for retrieval to obtain retrieval results.

[0060] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0061] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0062] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0063] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0064] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0065] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0066] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0067] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0070] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0071] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0072] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0073] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0074] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A retrieval method based on a large language model, characterized in that: include: Determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure; The training data is divided to obtain a training set, a validation set and a test set, a pre-set language model is determined, and model training is performed on the language model according to the divided training data; Performing model training on the language model specifically includes: Determine a model task according to the preset language model, and adjust the structure of the language model according to the model task to obtain a model output layer; Determining model parameters of the language model, and modifying the model output layer according to the model parameters; Determine a plurality of the model output layers, determine a preset frozen layer in the plurality of the model output layers, determine an update layer according to the frozen layer, and update the model corresponding to the update layer according to the model task; Determining hyperparameters of the language model, and adjusting the language model according to the hyperparameters to optimize the language model; Performing a search using the optimized language model to obtain a search result; The hyperparameters include but are not limited to learning rate, batch, and number of iterations; Before optimizing the language model, the method further includes: Determining a model convergence speed, a loss curve smoothness, a validation set performance of the language model, and adjusting the learning rate according to the model convergence speed, the loss curve smoothness, and the validation set performance; Determine the hardware memory and model complexity of the language model, and determine the size of the batch according to the hardware memory and the model complexity; Determining the number of training cycles of the language model, and determining the number of iterations according to the number of training cycles; Determining error cases of the language model according to the validation set, and determining the accuracy and recall of the language model according to the error cases; Determining an index score of the language model according to the precision and the recall, so as to determine an evaluation level of the language model according to the index score; Before searching by using the optimized language model, the method further includes: Acquire voice information through the language model, convert the voice information into a format to obtain text information, and determine a key-value pair corresponding to the text information through the language model; The text information is stored according to the key-value pair to obtain historical query information; Determine a preset expiration procedure, and update the historical query information according to the expiration procedure; The training data is organized into a multi-round dialogue data format adapted for model input, where each round of the multi-round dialogue data format includes a dialogue ID, a speaker, and a content; each question asked by a user is based on the content of the previous dialogue; the language model considers context information and provides relevant answers based on the user's question; Structural adjustment is performed on the language model, and according to a pre-selected fine-tuning task, a model output layer is designed to match the fine-tuning task; Regularization technology is selected to reduce overfitting, and a Dropout layer is added to the hidden layer of the language model, and the Dropout ratio is set; the Dropout layer randomly discards part of the neuron output during each forward propagation; The geographic information in each text message of the user is stored in the form of key-value pairs as historical query information, where the session ID is used as the key, and the geographic information, associated information and dimension statistical information generated by the model based on the text information each time constitute the value corresponding to the key; at the same time, the system sets a time expiration strategy to regularly clean and maintain the cache to ensure that the latest historical query information can be added to the cache in time; when the user initiates a query request, the system first checks the historical cache.

2. The method according to claim 1, characterized in that The method further comprises: Data is collected according to pre-set data categories, the collected data is cleaned, the cleaned data is deduplicated, and the deduplicated data is labeled to determine semantic features based on the data, wherein the data processing types of the deduplication processing include but are not limited to removing irrelevant characters, repairing format errors, and unifying coding formats, and the types of annotations include but are not limited to case categories, key entities, and event relationships.

3. The method according to claim 1, characterized in that Retrieval is performed using the optimized language model, specifically including: The user's query information is determined through the language model, a preset instruction format is determined, and the query information is formatted according to the instruction format to obtain a query instruction.

4. The method according to claim 1, characterized in that The method further comprises: The prompt word is determined by the language model, so that the user determines the query information according to the prompt word.

5. A retrieval device based on a large language model, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the retrieval device based on a large language model to perform: Determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure; The training data is divided to obtain a training set, a validation set and a test set, a pre-set language model is determined, and model training is performed on the language model according to the divided training data; Performing model training on the language model specifically includes: Determine a model task according to the preset language model, and adjust the structure of the language model according to the model task to obtain a model output layer; Determining model parameters of the language model, and modifying the model output layer according to the model parameters; Determine a plurality of the model output layers, determine a preset frozen layer in the plurality of the model output layers, determine an update layer according to the frozen layer, and update the model corresponding to the update layer according to the model task; Determining hyperparameters of the language model, and adjusting the language model according to the hyperparameters to optimize the language model; Performing a search using the optimized language model to obtain a search result; The hyperparameters include but are not limited to learning rate, batch, and number of iterations; Before optimizing the language model, Determining a model convergence speed, a loss curve smoothness, a validation set performance of the language model, and adjusting the learning rate according to the model convergence speed, the loss curve smoothness, and the validation set performance; Determine the hardware memory and model complexity of the language model, and determine the size of the batch according to the hardware memory and the model complexity; Determining the number of training cycles of the language model, and determining the number of iterations according to the number of training cycles; Determining error cases of the language model according to the validation set, and determining the accuracy and recall of the language model according to the error cases; Determining an index score of the language model according to the precision and the recall, so as to determine an evaluation level of the language model according to the index score; Before searching through the optimized language model, Acquire voice information through the language model, convert the voice information into a format to obtain text information, and determine a key-value pair corresponding to the text information through the language model; The text information is stored according to the key-value pair to obtain historical query information; Determine a preset expiration procedure, and update the historical query information according to the expiration procedure; The training data is organized into a multi-round dialogue data format adapted for model input, where each round of the multi-round dialogue data format includes a dialogue ID, a speaker, and a content; each question asked by a user is based on the content of the previous dialogue; the language model considers context information and provides relevant answers based on the user's question; Structural adjustment is performed on the language model, and according to a pre-selected fine-tuning task, a model output layer is designed to match the fine-tuning task; Regularization technology is selected to reduce overfitting, and a Dropout layer is added to the hidden layer of the language model, and the Dropout ratio is set; the Dropout layer randomly discards part of the neuron output during each forward propagation; The geographic information in each text message of the user is stored in the form of key-value pairs as historical query information, where the session ID is used as the key, and the geographic information, associated information and dimension statistical information generated by the model based on the text information each time constitute the value corresponding to the key; at the same time, the system sets a time expiration strategy to regularly clean and maintain the cache to ensure that the latest historical query information can be added to the cache in time; when the user initiates a query request, the system first checks the historical cache.

6. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Determining training data, preprocessing the training data, and converting the format of the preprocessed training data so that the format of the training data is a dialog structure; The training data is divided to obtain a training set, a validation set and a test set, a pre-set language model is determined, and model training is performed on the language model according to the divided training data; Performing model training on the language model specifically includes: Determine a model task according to the preset language model, and adjust the structure of the language model according to the model task to obtain a model output layer; Determining model parameters of the language model, and modifying the model output layer according to the model parameters; Determine a plurality of the model output layers, determine a pre-set frozen layer in the plurality of the model output layers, determine an update layer according to the frozen layer, and update the model corresponding to the update layer according to the model task; determine a hyperparameter of the language model, and adjust the language model according to the hyperparameter to optimize the language model; Performing a search using the optimized language model to obtain a search result; The hyperparameters include but are not limited to learning rate, batch, and number of iterations; Before optimizing the language model, Determining a model convergence speed, a loss curve smoothness, a validation set performance of the language model, and adjusting the learning rate according to the model convergence speed, the loss curve smoothness, and the validation set performance; Determine the hardware memory and model complexity of the language model, and determine the size of the batch according to the hardware memory and the model complexity; Determining the number of training cycles of the language model, and determining the number of iterations according to the number of training cycles; Determining error cases of the language model according to the validation set, and determining the accuracy and recall of the language model according to the error cases; Determining an index score of the language model according to the precision and the recall, so as to determine an evaluation level of the language model according to the index score; Before searching through the optimized language model, Acquire voice information through the language model, convert the voice information into a format to obtain text information, and determine a key-value pair corresponding to the text information through the language model; The text information is stored according to the key-value pair to obtain historical query information; Determine a preset expiration procedure, and update the historical query information according to the expiration procedure; The training data is organized into a multi-round dialogue data format adapted for model input, where each round of the multi-round dialogue data format includes a dialogue ID, a speaker, and a content; each question asked by a user is based on the content of the previous dialogue; the language model considers context information and provides relevant answers based on the user's question; Structural adjustment is performed on the language model, and according to a pre-selected fine-tuning task, a model output layer is designed to match the fine-tuning task; Regularization technology is selected to reduce overfitting, and a Dropout layer is added to the hidden layer of the language model, and the Dropout ratio is set; the Dropout layer randomly discards part of the neuron output during each forward propagation; The geographic information in each text message of the user is stored in the form of key-value pairs as historical query information, where the session ID is used as the key, and the geographic information, associated information and dimension statistical information generated by the model based on the text information each time constitute the value corresponding to the key; at the same time, the system sets a time expiration strategy to regularly clean and maintain the cache to ensure that the latest historical query information can be added to the cache in time; when the user initiates a query request, the system first checks the historical cache.