Multi-domain information query method and device based on large model, equipment and storage medium

CN118885500BActive Publication Date: 2026-09-15CHINA MERCHANTS BANK
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410936152.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2026-09-15
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种基于大模型的面向多领域的信息查询方法、装置、设备及存储介质,旨在解决现有面向多领域的基于大模型的信息查询方法部署成本高,对搭载设备的显卡要求高,适用范围小的技术问题

Benefits of technology

[0040] This application provides a method, apparatus, device, and storage medium for multi-domain information retrieval based on a large model. The method includes: acquiring a user-inputted information query request; performing semantic analysis on the information query request to obtain target keywords; routing a preset query model according to the target keywords to obtain a target query model; the preset query model is a large model composed of several expert sub-models, each expert sub-model corresponding to a different domain; and performing data analysis on the information query request through the target query model to obtain target query information. This application integrates expert sub-models from different domains into a preset query model, eliminating the need to load multiple large models and reducing GPU memory requirements. Furthermore, by routing the preset query model and performing forward computation only based on the routed target query model, this application further reduces GPU memory computation. Therefore, this application can reduce GPU memory requirements and expand its applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885500B_ABST
    Figure CN118885500B_ABST
Patent Text Reader

Abstract

The application discloses a multi-field-oriented information query method and device based on a large model, equipment and a storage medium, and relates to the technical field of information query. The method comprises the following steps: obtaining an information query request input by a user; performing semantic analysis on the information query request to obtain a target keyword; performing model routing on a preset query model according to the target keyword to obtain a target query model; the preset query model is a large model composed of a plurality of expert sub-models, and each expert sub-model corresponds to one field; and performing data analysis on the information query request by using the target query model to obtain target query information. The application integrates expert sub-models of different fields into a preset query model, so that multiple large models are not needed, and the demand for display memory is reduced. The application further reduces the display memory calculation by performing model routing on the preset query model and performing forward calculation only based on the target query model. Therefore, the application can reduce the demand for display memory and expand the application range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information retrieval technology, and in particular to a method, apparatus, device and storage medium for multi-domain information retrieval based on a large model. Background Technology

[0002] Currently, large models, specifically large language models (LLMs), not only perform exceptionally well in intelligent question answering but can also be applied to other specific fields, such as technology specification detection, search intent recognition, and advertising copy generation. However, large models occupy a significant amount of space, thus requiring high-performance devices. Even smaller 7B (referring to models with 7 billion trainable parameters) base models typically require approximately 14GB of dedicated video memory.

[0003] When deploying large models across multiple domains (assuming there are n domains), existing methods often involve loading the same pre-trained model parameters, then independently fine-tuning them to obtain n large models for each domain, and finally deploying them on the same graphics card, resulting in a dramatic increase in GPU memory requirements. Therefore, existing multi-domain information retrieval methods based on large models have high deployment costs, high requirements for the graphics cards of the devices they run on, and limited applicability.

[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, device, and storage medium for multi-domain information retrieval based on a large model, aiming to solve the technical problems of existing multi-domain information retrieval methods based on large models having high deployment costs, high requirements for the graphics cards of the devices they are equipped with, and limited applicability.

[0006] To achieve the above objectives, this application proposes a multi-domain information query method based on a large model, the method comprising:

[0007] Obtain the user's input information query request;

[0008] Perform semantic analysis on the information query request to obtain target keywords;

[0009] Based on the target keywords, the preset query model is routed to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain.

[0010] The target query information is obtained by analyzing the data of the information query request through the target query model.

[0011] In one embodiment, before performing model routing on the preset query model based on the target keyword, the method further includes:

[0012] Obtain the initial configuration file corresponding to the initial base model;

[0013] Based on the initial configuration file, several expert sub-models are loaded into the initial base model to obtain a preset query model.

[0014] In one embodiment, the step of loading several expert sub-models into the initial base model based on the initial configuration file to obtain a preset query model includes:

[0015] Obtain domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords;

[0016] The domain configuration parameters are loaded into the initial configuration file to obtain the target configuration file;

[0017] Several expert sub-models are loaded into the initial base model according to the target configuration file to obtain a preset query model.

[0018] In one embodiment, the step of loading several expert sub-models into the initial base model according to the target configuration file to obtain a preset query model includes:

[0019] The initial base model is traversed to obtain module identification information;

[0020] The modules to be updated in the initial base model are determined based on the module identification information and the preset module update table.

[0021] Based on the target configuration file and the module to be updated, a replacement expert model is determined from several expert sub-models;

[0022] The module to be updated in the initial base model is replaced with the corresponding replacement expert model to obtain the preset query model.

[0023] In one embodiment, the step of replacing the module to be updated in the initial base model with a corresponding replacement expert model to obtain a preset query model includes:

[0024] The module to be updated in the initial base model is replaced with the corresponding replacement expert model to obtain the intermediate query model;

[0025] Obtain the target expert layer parameters corresponding to the replacement expert model based on the target configuration file;

[0026] Based on the target expert layer parameters, the intermediate query model is loaded with model parameters to obtain a preset query model.

[0027] In one embodiment, the step of loading model parameters onto the intermediate query model based on the target expert layer parameters to obtain a preset query model includes:

[0028] Obtain target fine-tuning mode information;

[0029] Based on the target fine-tuning mode information and preset mapping rules, the target expert layer parameters are loaded into the corresponding replacement expert model in the intermediate query model to obtain the preset query model.

[0030] In one embodiment, the step of performing model routing on a preset query model based on the target keywords to obtain a target query model includes:

[0031] Based on the target keywords, the preset query model is traversed and matched to obtain the target expert sub-model that matches the functional keywords with the target keywords;

[0032] The target query model is determined based on the target expert sub-model.

[0033] Furthermore, to achieve the above objectives, this application also proposes a multi-domain information query device based on a large model, which includes:

[0034] The information acquisition module is used to acquire information query requests input by the user;

[0035] The information analysis module is used to perform semantic analysis on the information query request to obtain target keywords;

[0036] The model routing module is used to perform model routing on the preset query model according to the target keywords to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain.

[0037] The information query module is used to perform data analysis on the information query request through the target query model to obtain the target query information.

[0038] Furthermore, to achieve the above objectives, this application also proposes a large-model-based multi-domain information query device, the device comprising: a memory, a processor, and a large-model-based multi-domain information query program stored in the memory and executable on the processor, the large-model-based multi-domain information query program being configured to implement the steps of the large-model-based multi-domain information query method described above.

[0039] In addition, to achieve the above objectives, this application also proposes a storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the multi-domain information query method based on a large model as described above.

[0040] This application provides a method, apparatus, device, and storage medium for multi-domain information retrieval based on a large model. The method includes: acquiring a user-inputted information query request; performing semantic analysis on the information query request to obtain target keywords; routing a preset query model according to the target keywords to obtain a target query model; the preset query model is a large model composed of several expert sub-models, each expert sub-model corresponding to a different domain; and performing data analysis on the information query request through the target query model to obtain target query information. This application integrates expert sub-models from different domains into a preset query model, eliminating the need to load multiple large models and reducing GPU memory requirements. Furthermore, by routing the preset query model and performing forward computation only based on the routed target query model, this application further reduces GPU memory computation. Therefore, this application can reduce GPU memory requirements and expand its applicability. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a first flowchart illustrating the first embodiment of the multi-domain information retrieval method based on a large model according to this application.

[0044] Figure 2 This is a second flowchart illustrating the first embodiment of the multi-domain information retrieval method based on a large model in this application.

[0045] Figure 3 This is a schematic diagram of the architecture of the preset query model in the first embodiment of the information query method for multiple fields based on a large model in this application;

[0046] Figure 4 This is a schematic diagram of the first process of the second embodiment of the multi-domain information query method based on a large model in this application;

[0047] Figure 5This is a second flowchart illustrating the second embodiment of the multi-domain information retrieval method based on a large model in this application.

[0048] Figure 6 This is a schematic diagram of the third process of the second embodiment of the information query method for multiple fields based on a large model in this application;

[0049] Figure 7 This is a schematic diagram of the fourth process of the second embodiment of the multi-domain information retrieval method based on a large model in this application.

[0050] Figure 8 This is a schematic diagram of the module structure of a multi-domain information query device based on a large model, as described in an embodiment of this application.

[0051] Figure 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the information query method for multiple fields based on a large model in the embodiments of this application.

[0052] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0053] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0054] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0055] The main solution of this application is as follows: to obtain the information query request input by the user; to perform semantic analysis on the information query request to obtain the target keywords; to perform model routing on the preset query model according to the target keywords to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain; to perform data analysis on the information query request through the target query model to obtain the target query information.

[0056] Current methods for information retrieval across multiple domains based on large models employ the following approach: loading the same pre-trained model parameters, then independently fine-tuning them to obtain n large models corresponding to each domain, and finally deploying them on the same graphics card for information retrieval, resulting in a dramatic increase in GPU memory requirements. This method is not only costly to deploy but also places high demands on the graphics card of the device, posing challenges to deployment when resources are insufficient, thus limiting its applicability.

[0057] Considering the problem of limited production resources, this invention proposes a resource-intensive MoE (Mixture-of-Experts) deployment architecture for multi-vertical domain large model deployment scenarios, which can efficiently utilize video memory to load multi-vertical domain large models under the premise of limited video memory resources.

[0058] Specifically, in this embodiment, expert models from different fields are integrated into the same base model to form a preset query model. Therefore, it is not necessary to train multiple large models, thus reducing the demand for video memory. At the same time, during computation, this application further reduces video memory computation by routing the preset query model and performing forward computation based on the routed target query model. Therefore, this embodiment can reduce the demand for video memory and expand the scope of application.

[0059] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, data communication, program execution, and equipped with a large model, capable of realizing information query functions, such as a tablet computer, personal computer, or mobile phone, or an information query device based on a large model and oriented towards multiple fields that can realize the above functions. This embodiment does not specifically limit it. The following uses an information query device based on a large model and oriented towards multiple fields (hereinafter referred to as a query device) as an example to describe this embodiment and the following embodiments.

[0060] Based on this, embodiments of this application provide a method for multi-domain information retrieval based on a large model, referring to... Figure 1 , Figure 1 This is a first flowchart illustrating the first embodiment of the multi-domain information query method based on a large model according to this application.

[0061] In this embodiment, the information query method for multiple domains based on a large model includes steps S10 to S40:

[0062] Step S10: Obtain the information query request input by the user;

[0063] Step S20: Perform semantic analysis on the information query request to obtain target keywords;

[0064] It should be understood that the above-mentioned information query request can be a query statement entered by the user into the query device. This query statement may contain the user's query purpose, such as technology foreign regulation detection, search intent recognition, advertising copy generation, etc. Therefore, after receiving the information query request, the query device can perform semantic analysis on it to obtain the purpose keywords (or purpose keyword phrases) in the query statement that correspond to the user's query purpose.

[0065] Step S30: Based on the target keywords, perform model routing on the preset query model to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain.

[0066] Understandably, considering the limited production resources, this embodiment can construct a preset query model based on a resource-intensive MoE (Mixture-of-Experts) deployment architecture. Specifically, corresponding expert sub-models are configured for different domains, and then several expert sub-models are loaded onto the same base model to form the aforementioned preset query model.

[0067] The aforementioned expert sub-models share the base model parameters, which saves deployment resources. For example, if two finely tuned Qwen1.5-1.8B models are deployed separately, they require 20024MB of video memory (10012MB for a single model); however, with the MoE architecture proposed in this embodiment, since the experts share the base model parameters, the video memory resources required are only 10068MB (only 56MB of video memory is required for a single Lora (Low-Rank Adaptation of Large Language Models)) expert model).

[0068] Therefore, this embodiment can avoid mounting multiple large models in low memory in the query device's video memory, reduce video memory load, thereby reducing video memory requirements, reducing deployment costs, and expanding the scope of information query applicability. If a single card has 16GB of video memory, up to 114 Lora fine-tuning models with the same configuration can be deployed.

[0069] In one feasible implementation, refer to Figure 2 , Figure 2 This is a second flowchart illustrating the first embodiment of the multi-domain information query method based on a large model in this application. Step S30 may include steps A1 to A2:

[0070] Step A1: Traverse and match the preset query model according to the target keywords to obtain the target expert sub-model that matches the functional keywords with the target keywords;

[0071] Step A2: Determine the target query model based on the target expert sub-model.

[0072] It is easy to understand that the above functional keywords are the phrases corresponding to the problems or functions that each expert sub-model deals with in the corresponding field. Each expert sub-model can be assigned functional keywords during configuration.

[0073] Based on the above principles, in this embodiment, to reduce the computational load on video memory, when predicting and analyzing the target query information corresponding to the target query request, this embodiment can perform model routing based on the target keywords to obtain the domain-related expert sub-models corresponding to the target keywords, i.e., the aforementioned target expert sub-models. This process can involve traversing and matching the target keywords and the functional keywords corresponding to each expert sub-model, thereby determining the expert sub-models whose own functional keywords match the target keywords as the target expert sub-models. Then, the query device can participate in the final forward computation through the specified target expert sub-models, thereby saving video memory computational resources and reducing the demand for video memory.

[0074] In the specific implementation, assuming that the query request "Where can I change my mobile phone number, what is the mapping intent of this sentence" is based on the information entered by the user, the target keyword "mapping intent" is extracted. Since the functional keyword "mapping intent" configured in the expert sub-model "moe_search_intent" is matched, only the expert sub-model "moe_search_intent" participates in the calculation in the subsequent forward calculation, thereby saving computing resources.

[0075] Step S40: Perform data analysis on the information query request using the target query model to obtain the target query information.

[0076] It is important to understand that the target query model described above can be an information query model reconstructed based on the target expert sub-model obtained through traversal matching. In this case, the subsequent forward computation is relatively fast and stable, but the memory consumption is high. Alternatively, the target query model can be a preset query model in which only the target expert sub-model works and participates in the subsequent forward computation. In this case, the memory consumption is low, but the computation speed is slower. Therefore, the specific means of data analysis can be determined according to the actual situation, and this embodiment does not impose any restrictions on it.

[0077] It should be noted that, after determining the target expert sub-model, this embodiment can perform context learning and structural attribute analysis on the information query request through the target expert sub-model. Specifically, the query device can extract attributes from the text information corresponding to the information query request according to the information structure of the query domain, target keywords, query logic, and query sub-tasks, and output it in JSON format. Then, matching information is obtained from a preset information database through the obtained structural attributes, and the obtained information is arranged according to the structural attributes to obtain the target query information.

[0078] For example, suppose a user's query request is for advertising copy generation. The query device can determine that the query domain is text generation, the target keywords are advertising copy and advertising elements included in the user's query request, the query logic can be the logic for generating advertising copy, and the query subtasks can be the subtasks for obtaining advertising elements. In this process, to generate clear and organized copy, the query device can also sort the obtained target keywords according to their name and type attribute values, constructing connections. These connections and the query logic can include hierarchical relationships, inclusion relationships, and referencing relationships, thereby further generating the final target query information based on the information structure of connections, query domain, target keywords, query logic, and query subtasks.

[0079] In summary, considering the limited production resources, this invention proposes a multi-domain information query method based on large models, implemented through a resource-intensive MoE deployment architecture, specifically for multi-vertical domain large-scale model deployment scenarios. It should be understood that while expert routing and expert networks in current mainstream MoE architectures can participate in training during the training phase, a drawback is the lack of clear boundaries between different experts.

[0080] In this embodiment, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the architecture of the preset query model in the first embodiment of the information query method for multiple domains based on a large model according to this application. The preset query model proposed in this embodiment can obtain the input text (such as...) in the information query request. Figure 3 When inputting text, semantic analysis and word segmentation can be performed to obtain target keywords (such as...). Figure 3 The Input Token is then used to transform the target keywords into vectors (i.e., ...). Figure 3 The system uses Input Embedding to perform information retrieval based on the target keywords after vector transformation. Furthermore, in this embodiment, before information analysis, the query device can also match a specific expert sub-model based on the target keywords. Figure 3 The system uses an expert selector to determine the target expert sub-model that matches the functional keywords and the target keywords, thus implementing expert routing. Then, it determines the target query model from the preset query models based on the expert name corresponding to the target expert sub-model.

[0081] Furthermore, different expert sub-models can be deployed in arbitrary linear layers within the decoder structure of the predefined query model's MLP (Multilayer Perceptron) or Attention module, such as... Figure 3As shown, the multi-expert structure of the preset query model means that any linear layer in the preset query model can be set as the original linear layer, the MOE expert linear layer corresponding to domain one, the MOE expert linear layer corresponding to domain two, and / or the MOE expert linear layer corresponding to domain n.

[0082] Therefore, in the multi-expert structure preset query model proposed in this embodiment, each expert can be trained, loaded, and calculated independently, and the multiple experts do not affect each other. The horizontal expansion cost is low, and it is more suitable for multi-vertical domain fine-tuning deployment scenarios.

[0083] Therefore, the resource-intensive MoE deployment architecture proposed in this embodiment can fully reuse model parameters, loading multiple expert sub-models in parallel onto the same base model and sharing base model parameters. Multiple experts operate independently and can be horizontally expanded based on the same base model, exhibiting strong scalability. This effectively saves graphics card resources. While sharing base model parameters, experts from different domains participate in calculations as needed, achieving resource reuse. This allows for efficient use of graphics memory to load large models across multiple vertical domains for information retrieval, even with limited graphics memory resources, saving computational resources and reducing graphics memory requirements.

[0084] This embodiment provides a multi-domain information query method based on a large model. The method includes: acquiring a user-inputted information query request; performing semantic analysis on the information query request to obtain target keywords; traversing and matching a preset query model based on the target keywords to obtain target expert sub-models that match the functional keywords with the target keywords; determining a target query model based on the target expert sub-models; the preset query model is a large model composed of several expert sub-models, each corresponding to a domain; and performing data analysis on the information query request through the target query model to obtain target query information. This embodiment avoids mounting multiple large models in the low-memory video memory of the query device, reducing video memory load, thereby reducing video memory requirements, lowering deployment costs, and expanding the applicability of information queries. Furthermore, to reduce the computational load on video memory, this embodiment can perform model routing based on the target keywords when predicting and analyzing the target query information corresponding to the target query request, obtaining expert sub-models related to the domain corresponding to the target keywords, i.e., the aforementioned target expert sub-models. This process can involve traversing and matching the target keywords and the functional keywords corresponding to each expert sub-model, thereby determining the expert sub-model whose functional keywords match the target keywords as the target expert sub-model. Then the query device can participate in the final forward computation through the specified target expert sub-model, thereby saving the computing resources of the video memory and reducing the demand for video memory.

[0085] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the first embodiment can be referred to the above description, and will not be repeated hereafter.

[0086] See the reference. Figure 4 This is a first flowchart illustrating the second embodiment of the multi-domain information query method based on a large model according to this application. Steps S00 to S01 are included before step S10:

[0087] Step S00: Obtain the initial configuration file corresponding to the initial base model;

[0088] Step S01: Based on the initial configuration file, load several expert sub-models into the initial base model to obtain a preset query model.

[0089] As can be seen from the above analysis, this application can load several expert sub-models corresponding to different fields into the same base model to form the aforementioned preset query model, and the aforementioned initial base model can be the final base model. Therefore, this embodiment can load several expert sub-models into the initial base model by configuring the expert model information of each expert sub-model in the initial configuration file experts.yml corresponding to the initial base model, thereby obtaining the preset query model.

[0090] In one feasible implementation, refer to Figure 5 , Figure 5 This is a second flowchart illustrating the second embodiment of the multi-domain information retrieval method based on a large model according to this application. Step S01 includes steps B1 to B3:

[0091] Step B1: Obtain the domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords;

[0092] Step B2: Load the domain configuration parameters into the initial configuration file to obtain the target configuration file;

[0093] Step B3: Load several expert sub-models into the initial base model according to the target configuration file to obtain the preset query model.

[0094] It is understood that in this embodiment, several expert sub-models can be loaded into the initial base model by loading the domain configuration parameters corresponding to each expert sub-model into the initial configuration file, thereby obtaining a preset query model.

[0095] It is easy to understand that, in order to facilitate the reduction of forward computation through model routing in the future, this embodiment can set functional keywords corresponding to the domain and function of each expert sub-model in the domain configuration parameters of the expert sub-model. This makes it easier for the query device to route to different experts according to the functional keywords when performing data analysis, so that only the specified expert sub-models participate in the forward computation in the preset query model, thus saving computing resources.

[0096] In one feasible implementation, refer to Figure 6 , Figure 6 This is a third flowchart illustrating the second embodiment of the multi-domain information retrieval method based on a large model in this application. Step B3 includes steps B31 to B34:

[0097] Step B31: Traverse the initial base model to obtain module identification information;

[0098] Step B32: Determine the modules to be updated in the initial base model based on the module identification information and the preset module update table;

[0099] Step B33: Based on the target configuration file and the module to be updated, determine the replacement expert model from several expert sub-models;

[0100] Step B34: Replace the module to be updated in the initial base model with the corresponding replacement expert model to obtain the preset query model.

[0101] It is important to understand that during the process of loading the expert sub-model into the initial base model, the query can first obtain the module identification information corresponding to all modules in the initial base model, such as module name and module number.

[0102] Then, the device can query the target_modules list in the target configuration file, which is the preset module update table mentioned above. The target_modules list contains module information that the user can selectively fine-tune according to task requirements, model architecture and computing resources. Therefore, the device can query the module to be updated in the initial base model that needs to be replaced.

[0103] Afterwards, combined Figure 3 It can be seen that the query device can dynamically create MOE expert linear layers based on the target configuration file to obtain the above-mentioned replacement expert models, and then replace each module to be updated in the initial base model with the corresponding replacement expert model, that is, replace the original linear layer in the initial base model with the MOE expert linear layer corresponding to each domain (such as...). Figure 3 By using the expert linear layers (domains 1 to n) in the MOE (Multi-Level Expert Model), the preset query model can be loaded. Therefore, in this embodiment, the preset query model can be constructed by sharing a single base model among different expert models, reducing memory consumption.

[0104] In one feasible implementation, refer to Figure 7 , Figure 7 This is a fourth flowchart of the second embodiment of the multi-domain information query method based on a large model in this application. Step B34 includes steps B341 to B343:

[0105] Step B341: Replace the module to be updated in the initial base model with the corresponding replacement expert model to obtain the intermediate query model;

[0106] Step B342: Obtain the target expert layer parameters corresponding to the replacement expert model according to the target configuration file;

[0107] Step B343: Load model parameters into the intermediate query model based on the target expert layer parameters to obtain a preset query model.

[0108] It is easy to understand that after replacing the module to be updated with the replacement expert model to obtain the intermediate query model, the query device can also configure the overall model parameters of the intermediate query model according to the expert layer parameters corresponding to each replacement expert model. The target expert layer parameters can be the weight parameters corresponding to each replacement expert model. Therefore, in this embodiment, the query device can, based on the target configuration file and the loaded MoE architecture model, iteratively load the expert model weight file (configured by the model_file field) into the MoE expert layer corresponding to the intermediate query model to obtain the preset query model.

[0109] In addition, since the MoE expert layer corresponding to the replaced expert model has different parameter names from the original model of the initial query model, the query device needs to perform mapping according to the rules.

[0110] It is readily understood that in this embodiment, both the dynamic replacement of modules and the rule mapping described above can support hybrid configurations of Lora / freeze experts. Therefore, in a feasible implementation, step B343 in this embodiment includes steps b1 to b2:

[0111] Step b1: Obtain target fine-tuning mode information;

[0112] Step b2: Based on the target fine-tuning mode information and the preset mapping rules, load the target expert layer parameters into the corresponding replacement expert model in the intermediate query model to obtain the preset query model.

[0113] It should be noted that the aforementioned target fine-tuning mode information can be Lora and / or freeze configuration modes. That is, in this embodiment, the query device can support mixed loading of Lora / freeze fine-tuned expert models. During the Freeze fine-tuning configuration, num_layer_trainable can be the training layer number; target_modules can be the target linear layers to be fine-tuned; and model_file is the file path. In the Lora fine-tuning configuration, all parameters of the LoraConfig in the peft library can be configured. This hybrid configuration meets most fine-tuning deployment needs and expands the applicable scenarios.

[0114] In summary, the process of generating the preset query model in this embodiment can be as follows: loading the MOE architecture model parameters of the initial query model, obtaining the domain configuration information of all expert sub-models, iterating the configuration information of each expert sub-model into the initial query model, and obtaining the intermediate query model after module replacement at the end of the iteration loop. Then, after determining that the current expert layer mode is LoRa fine-tuning and / or freeze single-linear layer fine-tuning, loading the model file and loading the expert layer parameters in the file into the intermediate query model of the MOE architecture, thus completing the loading of the model parameters of the preset query model and obtaining the preset query model. Therefore, the multiple expert sub-models in the preset query model constructed in this embodiment are independent of each other and can be horizontally expanded on the same base model, with strong scalability; at the same time, this embodiment supports a hybrid configuration of LoRa fine-tuning / freeze single-linear layer fine-tuning, which can meet most fine-tuning deployment scenarios and further expand the applicable scenarios.

[0115] This embodiment also discloses the following steps: obtaining the initial configuration file corresponding to the initial base model; obtaining domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords; loading the domain configuration parameters into the initial configuration file to obtain the target configuration file; traversing the initial base model to obtain module identification information; determining the modules to be updated in the initial base model based on the module identification information and a preset module update table; determining replacement expert models from several expert sub-models based on the target configuration file and the modules to be updated; replacing the modules to be updated in the initial base model with the corresponding replacement expert models to obtain the intermediate query model; obtaining the target expert layer parameters corresponding to the replacement expert models based on the target configuration file; obtaining target fine-tuning mode information; and loading the target expert layer parameters into the corresponding replacement expert models in the intermediate query model based on the target fine-tuning mode information and preset mapping rules to obtain the preset query model. In this embodiment, by loading the MOE architecture model parameters of the initial query model, the domain configuration information of all expert sub-models is obtained, the configuration information of each expert sub-model is iterated into the initial query model, and the intermediate query model with completed module replacement is obtained at the end of the iteration loop. Then, after determining that the current expert layer mode is LoRa fine-tuning and / or freeze single-linear layer fine-tuning, the model file is loaded, and the expert layer parameters in the file are loaded into the intermediate query model of the MOE architecture. This completes the loading of the model parameters for the preset query model, resulting in the preset query model. Therefore, the multiple expert sub-models in the preset query model constructed in this embodiment are independent of each other and can be horizontally expanded on the same base model, exhibiting strong scalability. Furthermore, this embodiment supports a hybrid configuration of LoRa fine-tuning and freeze single-linear layer fine-tuning, which can meet the needs of most fine-tuning deployment scenarios, further expanding the applicable scenarios.

[0116] This application also provides a multi-domain information query device based on a large model; please refer to [reference needed]. Figure 8 , Figure 8 This is a schematic diagram of the module structure of a multi-domain information query device based on a large model, as described in an embodiment of this application. Figure 8 As shown, the information query device based on a large model and oriented towards multiple domains includes:

[0117] Information acquisition module 801 is used to acquire information query requests input by the user;

[0118] Information analysis module 802 is used to perform semantic analysis on the information query request to obtain target keywords;

[0119] The model routing module 803 is used to perform model routing on the preset query model according to the target keywords to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain.

[0120] The information query module 804 is used to perform data analysis on the information query request through the target query model to obtain the target query information.

[0121] As one possible implementation, in this embodiment, the model routing module 803 is further used to traverse and match the preset query model according to the target keyword to obtain the target expert sub-model that matches the functional keyword with the target keyword;

[0122] The model routing module 803 is also used to determine the target query model based on the target expert sub-model.

[0123] As one possible implementation, in this embodiment, the information query module 804 is also used to obtain the initial configuration file corresponding to the initial base model;

[0124] The information query module 804 is also used to load several expert sub-models into the initial base model based on the initial configuration file to obtain a preset query model.

[0125] As one possible implementation, in this embodiment, the information query module 804 is further used to obtain domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords;

[0126] The information query module 804 is also used to load the domain configuration parameters into the initial configuration file to obtain the target configuration file;

[0127] The information query module 804 is also used to load several expert sub-models into the initial base model according to the target configuration file to obtain a preset query model.

[0128] As one possible implementation, in this embodiment, the information query module 804 is also used to traverse the initial base model to obtain module identification information;

[0129] The information query module 804 is also used to determine the module to be updated in the initial base model based on the module identification information and the preset module update table;

[0130] The information query module 804 is also used to determine the replacement expert model from several expert sub-models based on the target configuration file and the module to be updated;

[0131] The information query module 804 is also used to replace the module to be updated in the initial base model with the corresponding replacement expert model to obtain a preset query model.

[0132] As one possible implementation, in this embodiment, the information query module 804 is further used to replace the module to be updated in the initial base model with the corresponding replacement expert model to obtain an intermediate query model;

[0133] The information query module 804 is also used to obtain the target expert layer parameters corresponding to the replacement expert model according to the target configuration file;

[0134] The information query module 804 is also used to load model parameters of the intermediate query model based on the target expert layer parameters to obtain a preset query model.

[0135] As one possible implementation, in this embodiment, the information query module 804 is also used to obtain target fine-tuning mode information;

[0136] The information query module 804 is also used to load the target expert layer parameters into the corresponding replacement expert model in the intermediate query model based on the target fine-tuning mode information and the preset mapping rules, so as to obtain the preset query model.

[0137] The large-model-based multi-domain information query device provided in this application, employing the large-model-based multi-domain information query method described in the above embodiments, can solve the technical problem of multi-domain information query. Compared with the prior art, the beneficial effects of the large-model-based multi-domain information query device provided in this application are the same as those of the large-model-based multi-domain information query method provided in the above embodiments, and other technical features in the large-model-based multi-domain information query device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0138] This application provides a large-scale model-based multi-domain information query device, which includes: 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 to enable the at least one processor to execute the large-scale model-based multi-domain information query method in Embodiment 1 above.

[0139] The following is for reference. Figure 9 This document illustrates a structural diagram of a multi-domain information query device based on a large model, suitable for implementing embodiments of this application. The multi-domain information query device based on a large model in this application can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The illustrated information query device based on a large model and oriented towards multiple fields is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0140] like Figure 9As shown, the large-model-based, multi-domain information query device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the large-model-based, multi-domain information query device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the large-scale, multi-domain information retrieval device to exchange data with other devices via wireless or wired communication. Although a large-scale, multi-domain information retrieval device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0141] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0142] The large-model-based multi-domain information query device provided in this application, employing the large-model-based multi-domain information query method described in the above embodiments, solves the technical problems of high deployment cost, high requirements for graphics cards in existing large-model-based multi-domain information query methods, and limited applicability. Compared with the prior art, the beneficial effects of the large-model-based multi-domain information query device provided in this application are the same as those of the large-model-based multi-domain information query method provided in the above embodiments, and other technical features of this large-model-based multi-domain information query device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0143] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0144] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0145] This application provides a storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the large-model-based, multi-domain information query method in the above embodiments.

[0146] The storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0147] The aforementioned storage medium may be included in a multi-domain information retrieval device based on a large model; or it may exist independently and not be assembled into a multi-domain information retrieval device based on a large model.

[0148] The aforementioned storage medium carries one or more programs. When these programs are executed by a large-model-based, multi-domain information query device, the large-model-based, multi-domain information query device can reduce its demand for video memory and achieve low-deployment-cost large-model-based, multi-domain information query.

[0149] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0150] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0151] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0152] The readable storage medium provided in this application is a storage medium storing computer-readable program instructions (i.e., a large-model-based multi-domain information query program) for executing the aforementioned large-model-based multi-domain information query method. This solves the technical problems of existing large-model-based multi-domain information query methods, such as high deployment costs, high requirements for the graphics card of the device, and limited applicability. Compared with the prior art, the beneficial effects of the storage medium provided in this application are the same as those of the large-model-based multi-domain information query method provided in the above embodiments, and will not be repeated here.

[0153] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A multi-domain information retrieval method based on a large model, characterized in that, The method includes: Obtain the user's input information query request; Perform semantic analysis on the information query request to obtain target keywords; Based on the target keywords, the preset query model is routed to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain. The target query information is obtained by analyzing the data of the information query request through the target query model. Before obtaining the user-inputted information query request, the method further includes: Obtain the initial configuration file corresponding to the initial base model; Based on the initial configuration file, several expert sub-models are loaded into the initial base model to obtain a preset query model; The step of loading several expert sub-models into the initial base model based on the initial configuration file to obtain a preset query model includes: Obtain domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords; The domain configuration parameters are loaded into the initial configuration file to obtain the target configuration file; According to the target configuration file, several expert sub-models are loaded into the initial base model to obtain a preset query model; The step of performing model routing on the preset query model based on the target keywords to obtain the target query model includes: Based on the target keywords, the preset query model is traversed and matched to obtain the target expert sub-model that matches the functional keywords with the target keywords; The target query model is determined based on the target expert sub-model.

2. The information query method for multiple domains based on a large model as described in claim 1, characterized in that, The step of loading several expert sub-models into the initial base model according to the target configuration file to obtain a preset query model includes: The initial base model is traversed to obtain module identification information; The modules to be updated in the initial base model are determined based on the module identification information and the preset module update table. Based on the target configuration file and the module to be updated, a replacement expert model is determined from several expert sub-models; The module to be updated in the initial base model is replaced with the corresponding replacement expert model to obtain the preset query model.

3. The information query method for multiple domains based on a large model as described in claim 2, characterized in that, The step of replacing the module to be updated in the initial base model with the corresponding replacement expert model to obtain the preset query model includes: The module to be updated in the initial base model is replaced with the corresponding replacement expert model to obtain the intermediate query model; Obtain the target expert layer parameters corresponding to the replacement expert model based on the target configuration file; Based on the target expert layer parameters, the intermediate query model is loaded with model parameters to obtain a preset query model.

4. The information query method for multiple domains based on a large model as described in claim 3, characterized in that, The step of loading model parameters into the intermediate query model based on the target expert layer parameters to obtain a preset query model includes: Obtain target fine-tuning mode information; Based on the target fine-tuning mode information and preset mapping rules, the target expert layer parameters are loaded into the corresponding replacement expert model in the intermediate query model to obtain the preset query model.

5. A multi-domain information query device based on a large model, characterized in that, The large-model-based, multi-domain information query device includes: The information acquisition module is used to acquire information query requests input by the user; The information analysis module is used to perform semantic analysis on the information query request to obtain target keywords; The model routing module is used to perform model routing on the preset query model according to the target keywords to obtain the target query model; the preset query model is a large model composed of several expert sub-models, and each expert sub-model corresponds to a domain. The information query module is used to perform data analysis on the information query request through the target query model to obtain the target query information; The information acquisition module is also used to acquire the initial configuration file corresponding to the initial base model; and load several expert sub-models into the initial base model based on the initial configuration file to obtain a preset query model; The information acquisition module is also used to acquire domain configuration parameters corresponding to several expert sub-models; the domain configuration parameters include functional keywords; load the domain configuration parameters into the initial configuration file to obtain a target configuration file; load several expert sub-models into the initial base model according to the target configuration file to obtain a preset query model; The model routing module is further configured to traverse and match the preset query model according to the target keyword to obtain the target expert sub-model that matches the functional keyword with the target keyword; and determine the target query model according to the target expert sub-model.

6. A multi-domain information query device based on a large model, characterized in that, The device includes: a memory, a processor, and a large-model-based multi-domain information query program stored in the memory and executable on the processor, the large-model-based multi-domain information query program being configured to implement the steps of the large-model-based multi-domain information query method as described in any one of claims 1 to 4.

7. A storage medium, characterized in that, The storage medium stores a multi-domain information query program based on a large model, which, when executed by a processor, implements the steps of the multi-domain information query method based on a large model as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-task model reasoning method and device and multi-task information processing method and device

    CN115114439A

  • Neural network model training method and device, and data processing method and device

    CN115600635A

  • Large model training deployment method and system combining fine tuning technology and distributed scheduling

    CN117632381A

  • Intelligent question answering system and method based on multiple models and knowledge graph

    CN118035403A