Large language model tool enhancement method and device, equipment and storage medium

By combining the tool library and large language model, the problem of limited existing large language model tools is solved, the tool flexibility enhancement and adaptation optimization is achieved, and the performance of large language model and user needs satisfaction are improved.

CN119829248APending Publication Date: 2025-04-15DATAGRAND TECH INC
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411912617.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing large language model tools are limited and fixed, making it difficult to flexibly respond to diverse and complex user needs, and lack effective evaluation and optimization mechanisms for tool adaptation, which affects the processing effect.

Method used

By building a tool library, obtain user needs based on a large language model, split the task and generate target tasks, determine the adaptation between the target tools and the target tasks, and enhance the target tools when they are not adapted, generate enhancement tools, and add the tool library.

Benefits of technology

It has achieved the enhancement of existing tools according to user needs, improve the adaptability and efficiency of tools, improve the overall performance of large language models, and better meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829248A_ABST
    Figure CN119829248A_ABST
Patent Text Reader

Abstract

The invention discloses a large language model tool enhancement method and device, equipment and a storage medium. Comprising the following steps: constructing a tool library, obtaining a user demand based on a large language model, and performing task splitting on the user demand to generate a target task; when the target task needs to use the tool, determining a target tool corresponding to the target task from a tool library, and determining an adaptation condition of the target tool and the target task; and when the adaptive condition is unadaptive, enhancing the target tool to generate an enhanced tool, and adding the enhanced tool into the tool library. Various available tool resources can be integrated by constructing a tool library, rich choices are provided for meeting user demands, task splitting is performed on the user demands, complex demands can be more clearly understood and processed, the accuracy and efficiency of demand processing are improved, tools can be enhanced when the user demands are not matched, and the user experience is improved. The tool library is continuously optimized and expanded, the overall performance of the large language model is improved, and user requirements are better met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of large language models, and in particular to a large language model tool enhancement method, device, equipment and storage medium. Background Art

[0002] With the rapid development of artificial intelligence technology, large language models have shown powerful capabilities in the field of natural language processing. Large language models can understand and generate human language, providing strong support for various applications such as machine translation, text generation, question-answering systems, etc.

[0003] Although current large language models have powerful language understanding and generation capabilities, the tools they rely on are often limited and fixed, making it difficult to flexibly respond to diverse and complex user needs. When the tasks proposed by users are more special or beyond the capabilities of existing tools, the model may not be able to provide effective solutions. Moreover, due to the lack of effective evaluation and optimization mechanisms for tool adaptation, inappropriate tools may be used to handle tasks, thus affecting the final processing effect. Summary of the invention

[0004] The present invention provides a large language model tool enhancement method, apparatus, device and storage medium to enhance existing tools according to user needs without creating as many new tools as possible, and continuously iterate to optimize and improve the quality of existing tools.

[0005] According to one aspect of the present invention, a large language model tool enhancement method is provided, the method comprising:

[0006] Build a tool library, obtain user needs based on the large language model, and split the user needs into tasks to generate target tasks. The tool library includes various tool vectors.

[0007] When a target task requires the use of a tool, a target tool corresponding to the target task is determined from the tool library, and the compatibility of the target tool with the target task is determined;

[0008] When the adaptation situation is unsuitable, the target tool is enhanced to generate an enhanced tool, and the enhanced tool is added to the tool library.

[0009] Optionally, building a tool library includes: obtaining tool information, wherein the tool information includes tool description, implementation code and test cases; converting the tool information into a specified format to generate a tool document, and segmenting the tool document to generate segmented documents; vectorizing each segmented document to generate each tool vector, and building a tool library based on each tool vector.

[0010] Optionally, the user requirements are split into tasks to generate target tasks, including: obtaining splitting examples based on the large language model, and determining splitting rules corresponding to the splitting examples; splitting the user requirements into tasks according to the splitting rules to generate subtasks; and taking each subtask as the target task in turn.

[0011] Optionally, after splitting the user requirements into tasks to generate the target task, the method further includes: determining whether the large language model can directly process the target task, and if so, obtaining the answer to the target task through the large language model; otherwise, determining that the target task requires the use of a tool.

[0012] Optionally, determining a target tool corresponding to the target task from a tool library includes: determining a target tool vector corresponding to the target task from the tool library by using a retrieval enhanced generation technique; and generating the target tool according to the target tool vector.

[0013] Optionally, determine the compatibility of the target tool and the target task, including: extracting task parameters from the target task through the target tool; judging whether the large language model outputs a task answer based on the task parameters, and if so, determine that the adaptation is compatible, and directly use the task answer as the target task answer; otherwise, determine that the adaptation is incompatible.

[0014] Optionally, the target tool is enhanced to generate an enhanced tool, including: enhancing the target tool through a cyclic iterative algorithm to generate an alternative tool, and determining the number of iterations; judging whether the number of iterations reaches a threshold, and if so, determining that the enhancement has failed, and using the newly manufactured tool as the enhanced tool; otherwise, performing unit test verification on the alternative tool, and when the verification passes, using the alternative tool as the enhanced tool.

[0015] Optionally, after enhancing the target tool to generate the enhanced tool, the method further includes: obtaining a target task answer based on the enhanced tool; and aggregating the target task answers corresponding to each subtask to generate an output answer.

[0016] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0017] at least one processor;

[0018] and a memory communicatively coupled to the at least one processor;

[0019] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a large language model tool enhancement method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a large language model tool enhancement method described in any embodiment of the present invention when executed.

[0021] The technical solution of the embodiment of the present invention can integrate various available tool resources by building a tool library, providing rich choices to meet user needs. By splitting user needs into tasks, it helps to more clearly understand and process complex needs, improve the accuracy and efficiency of demand processing, and can enhance the tools when they are not suitable, continuously optimize and expand the tool library, which helps to improve the overall performance of the large language model and better adapt to user needs.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 is a flowchart of a large language model tool enhancement method provided according to Embodiment 1 of the present invention;

[0025] Figure 2 is a flowchart of another large language model tool enhancement method provided according to Embodiment 2 of the present invention;

[0026] Figure 3 is a structural diagram of a large language model tool enhancement device provided according to Embodiment 3 of the present invention;

[0027] Figure 4 It is a structural schematic diagram of an electronic device for implementing a large language model tool enhancement method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 A flowchart of a large language model tool enhancement method is provided for the first embodiment of the present invention. This embodiment is applicable to large language models. The method can be performed by a large language model tool enhancement device. The large language model tool enhancement device can be implemented in the form of hardware and / or software. The large language model tool enhancement device can be configured in a computer controller. Figure 1 As shown, the method includes:

[0032] S110, building a tool library, obtaining user requirements based on the large language model, splitting the user requirements into tasks to generate target tasks, wherein the tool library includes various tool vectors.

[0033] Among them, the tool library is a resource library that centrally stores various tools. Tools can be in different forms such as software programs, algorithm models, data processing modules, etc., which are used to meet different task requirements. User needs refer to the content expressed by users through natural language and other means, such as a certain goal to be achieved, a certain task to be completed, or a certain information to be obtained. Task splitting refers to the process of breaking down the more complex and holistic needs expressed by users into multiple relatively simple and independently executable subtasks according to certain logic and rules. For example, for the user demand of "making a video introducing tourist attractions", it can be split into multiple subtasks such as collecting tourist attraction materials, writing video copy, editing videos, adding background music, etc., so as to complete the entire user demand in a more organized manner later.

[0034] Specifically, the tool library is built to centrally manage various tools that may be used to meet user needs. By collecting tools with different functions and organizing them into a library, it is convenient to quickly find the right tool to perform related tasks according to user needs. The large language model has a strong natural language understanding ability and can parse the user needs entered by the user and identify the key information, intent and requirements. The large language model will analyze the user demand text and extract the core intent. For example, if the user says "I want to change the background of the person in this picture to the scenery of the seaside", the large language model can identify that the core intent is to replace the background of the picture, and the objects involved are the key information such as the person in the picture and the scenery of the seaside, so that it can be converted into specific executable tasks later.

[0035] Optionally, building a tool library includes: obtaining tool information, wherein the tool information includes tool description, implementation code and test cases; converting the tool information into a specified format to generate a tool document, and segmenting the tool document to generate segmented documents; vectorizing each segmented document to generate each tool vector, and building a tool library based on each tool vector.

[0036] Tool information includes tool description, implementation code, and test cases. Tool description mainly refers to the text description of the tool's functions, uses, applicable scenarios, etc., so that users can have a preliminary understanding of what the tool can do and under what circumstances it can be used. The implementation code is the program code that the tool actually runs. It determines how the tool specifically implements its functions and is the core part of the tool. Test cases are a set of input data and corresponding expected output results used to verify whether the tool can work properly and achieve the expected functions. By running test cases, possible problems and defects in the tool can be discovered to ensure the quality of the tool.

[0037] Specifically, the controller can convert the acquired tool information into a specified format to generate a tool document. The specified format can be stored in a JSON file format and displayed in the form of a Python function. The purpose of segmenting the tool document to generate each segmented document is to decompose it into smaller, easier-to-process units for subsequent vectorization and other operations. This can reduce the complexity of processing, improve processing efficiency, and enable each segmented document to be more targeted for subsequent vector generation and other processing. The segmented documents are stored in the database after vectorization, and each tool vector represents a quantitative representation of the tool information contained in the corresponding segmented document.

[0038] The segmentation can be based on different principles. For example, the tool description, implementation code, and test cases can be segmented into different documents according to different parts of the tool information. The tool description, implementation code, and test cases can also be segmented according to functional modules or logical units. If the tool consists of multiple functional modules, the information related to each functional module can be segmented into a separate document. For example, for an image processing tool, the information related to the image cropping function may be segmented into one document, and the information related to the image color adjustment function may be segmented into another document.

[0039] Optionally, the user requirements are split into tasks to generate target tasks, including: obtaining splitting examples based on the large language model, and determining splitting rules corresponding to the splitting examples; splitting the user requirements into tasks according to the splitting rules to generate subtasks; and taking each subtask as the target task in turn.

[0040] Among them, split examples refer to actual cases of reasonable task decomposition for different types of user needs, covering various fields and task complexity. The large language model can extract splitting rules from the splitting examples. The splitting rules are general guidelines for how to decompose a complex user need into specific subtasks. After determining the splitting rules, the large language model can apply them to specific user needs for task splitting, and use the subtasks obtained by the splitting as target tasks in turn, so that each subtask can be processed and completed in a targeted manner.

[0041] Optionally, after splitting the user requirements into tasks to generate the target task, the method further includes: determining whether the large language model can directly process the target task, and if so, obtaining the answer to the target task through the large language model; otherwise, determining that the target task requires the use of a tool.

[0042] Among them, the large language model has powerful natural language processing capabilities, but it cannot directly handle all types of tasks. Its core capabilities are to understand natural language text, generate logical text responses, and perform a certain degree of reasoning based on the knowledge learned. For example, it can answer some common sense questions, polish the text, and continue the story based on a given situation. However, for some tasks that require specific domain knowledge, precise calculations, and interaction with external systems, the large language model may not be able to handle them directly, so it is necessary to determine whether each target task falls within the direct processing capabilities of the large language model.

[0043] Specifically, by analyzing the specific nature, requirements, and types of operations involved in the target task, we can determine how it matches the capabilities of the large language model. For example, a target task is "explaining the meaning of a certain ancient poem", which belongs to the category of language understanding and knowledge interpretation. The large language model, with its storage and understanding of a large amount of textual knowledge, is likely to be able to handle it directly. However, if the target task is "object recognition based on images input by the user", it involves image processing and specific image recognition algorithms, which obviously exceeds the scope that the large language model can directly handle simply by relying on natural language processing capabilities.

[0044] Furthermore, when it is determined that the large language model can directly handle the target task, it will give full play to its natural language processing advantages to obtain the answer. For the target task that can be directly processed, it will generate a logical and required answer based on the relevant knowledge, language rules and its own reasoning mechanism. When it is determined that the target task is not within the direct processing capability of the large language model, it indicates that other means are needed to complete the task, that is, at this time it can be determined that the target task requires the use of tools.

[0045] S120: When the target task requires the use of a tool, a target tool corresponding to the target task is determined from a tool library, and the compatibility of the target tool with the target task is determined.

[0046] The target tool refers to the tool found in the tool library that corresponds to the target task and is considered to be most likely to meet the requirements of the target task. For example, for the target task "cropping pictures", the picture editing tool found in the tool library that has a cropping function and input and output formats that are compatible with the task is the target tool.

[0047] Optionally, determining a target tool corresponding to the target task from a tool library includes: determining a target tool vector corresponding to the target task from the tool library by using a retrieval enhanced generation technique; and generating the target tool according to the target tool vector.

[0048] Among them, retrieval enhancement generation technology is a method that combines information retrieval and language generation capabilities. When faced with a target task, the controller will first represent the target task in some form of vector representation. Then, through retrieval enhancement generation technology, in the vector space of the tool library, similarity metrics such as cosine similarity and Euclidean distance are used to calculate the similarity between the target task vector and each tool vector. The higher the similarity, the more the tool corresponding to the tool vector matches the target task in terms of features. The controller can use the tool vector with the highest similarity to the target task as the target tool vector, and restore the vector representation to a specific tool entity to generate the target tool.

[0049] S130: When the adaptation condition is unmatched, the target tool is enhanced to generate an enhanced tool, and the enhanced tool is added to the tool library.

[0050] Among them, an enhanced tool refers to a tool generated by improving the target tool by expanding its functions, optimizing input and output formats, and adapting to scene expansion when the target tool is judged to be incompatible with the target task. For example, the original image editing tool can only crop images, but it is not suitable for the target task of "cropping images and adjusting colors". In this case, the tool generated by adding improvement measures such as color adjustment function is an enhanced tool.

[0051] Specifically, there are many ways to enhance the target tool. For example, in case of insufficient functions, its functions can be expanded by adding new algorithm modules, function codes, etc. For the problem of mismatching input and output formats, a conversion module can be developed to convert the input and output into a format that matches the task. In terms of adapting to scenarios, the tool can be parameterized or conditional judgments can be added to enable it to work properly in more scenarios. The purpose of adding the generated enhanced tools to the tool library is to enrich the content of the tool library so that when encountering similar task requirements in the future, suitable tools can be found directly from the tool library without the need to develop or enhance the tool again, thereby improving overall work efficiency and task processing capabilities.

[0052] Optionally, the target tool is enhanced to generate an enhanced tool, including: enhancing the target tool through a cyclic iterative algorithm to generate an alternative tool, and determining the number of iterations; judging whether the number of iterations reaches a threshold, and if so, determining that the enhancement has failed, and using the newly manufactured tool as the enhanced tool; otherwise, performing unit test verification on the alternative tool, and when the verification passes, using the alternative tool as the enhanced tool.

[0053] It can be known that when enhancing the target tool, the properties and functions of the target tool can be continuously adjusted and improved by using the loop iteration algorithm to generate an alternative tool that better meets the requirements. For example, each iteration may add new features to a functional module of the target tool, optimize its algorithm implementation, improve its input and output processing, etc.

[0054] Specifically, the controller can modify and improve the target tool according to the pre-set enhancement strategy during each iteration. For example, if the target tool is an image editing software, and the current target task is to achieve more complex image special effects synthesis, then during the iteration process, new special effects algorithms may be added to the special effects synthesis function module of the software, and the parameter setting range may be adjusted. After one iteration, an alternative tool different from the original target tool will be generated. As the number of iterations increases, the alternative tool will continue to develop in a direction that better meets the requirements of the target task.

[0055] The number of iterations can be set comprehensively according to the specific task situation, the initial state of the target tool, and the desired enhancement effect. The number threshold is a pre-set judgment standard used to measure whether the loop iteration has reached a reasonable limit. When the number of iterations reaches the number threshold, it indicates that enough attempts have been made to enhance the target tool according to the predetermined iteration plan, but due to various reasons, such as the limitations of the target tool itself, the initial enhancement strategy is not perfect, etc., a tool that can fully meet the requirements of the target task is still not obtained. At this time, the controller will determine that the enhancement has failed and call the large language model to use Tool_Maker to create a new tool for the target task.

[0056] It should be noted that after enhancing the target tool to generate an alternative tool, the alternative tool cannot be used directly as an enhancement tool, because it is also necessary to ensure that it is reliable in terms of function and performance. Through unit testing, functional defects, logical errors, performance problems, etc. that may exist in the alternative tool can be discovered, thereby ensuring its quality. When unit testing the alternative tool, test cases will be designed for each functional module to verify the tool. When all the designed test cases can pass smoothly, it means that the alternative tool has met the expected requirements in terms of function and performance. At this time, the alternative tool can be used as an enhancement tool.

[0057] Optionally, after enhancing the target tool to generate the enhanced tool, the method further includes: obtaining a target task answer based on the enhanced tool; and aggregating the target task answers corresponding to each subtask to generate an output answer.

[0058] When the input data related to the target task is provided to the enhancement tool, the enhancement tool will process the input data according to its own improved functional modules, algorithm logic, etc., and finally generate a target task answer related to the target task. Different types of enhancement tools will perform tasks and generate corresponding answers in different ways according to their specific functions and the nature of the target task.

[0059] Specifically, since the user needs were previously divided into tasks and various subtasks were obtained, each subtask has its corresponding target task answer. Summarizing the target task answers corresponding to each subtask is to combine these scattered answers for each subtask according to a certain logic and order to form a complete output answer that can meet the entire user needs. For example, in the above video production example, the collected materials, written copy, and edited video versions will be integrated according to the process and requirements of video production, and finally a complete video product will be generated as the output answer to present to the user. The summarization process needs to consider the connection and coordination between the answers to each subtask to ensure that the generated output answer is a coherent, complete result that meets the user's original needs.

[0060] The technical solution of the embodiment of the present invention can integrate various available tool resources by building a tool library, providing rich choices to meet user needs. By splitting user needs into tasks, it helps to more clearly understand and process complex needs, improve the accuracy and efficiency of demand processing, and can enhance the tools when they are not suitable, continuously optimize and expand the tool library, which helps to improve the overall performance of the large language model and better adapt to user needs.

[0061] Embodiment 2

[0062] Figure 2 This is a flowchart of a large language model tool enhancement method provided in Example 2 of the present invention. This example adds a specific process for determining the adaptation of the target tool and the target task on the basis of the above Example 1. Among them, the specific contents of steps S210 and S260 are roughly the same as steps S110 and S130 in Example 1, so they will not be repeated in this embodiment. Figure 2 As shown, the method includes:

[0063] S210, building a tool library, obtaining user requirements based on the large language model, splitting the user requirements into tasks to generate target tasks, wherein the tool library includes various tool vectors.

[0064] Optionally, building a tool library includes: obtaining tool information, wherein the tool information includes tool description, implementation code and test cases; converting the tool information into a specified format to generate a tool document, and segmenting the tool document to generate segmented documents; vectorizing each segmented document to generate each tool vector, and building a tool library based on each tool vector.

[0065] Optionally, the user requirements are split into tasks to generate target tasks, including: obtaining splitting examples based on the large language model, and determining splitting rules corresponding to the splitting examples; splitting the user requirements into tasks according to the splitting rules to generate subtasks; and taking each subtask as the target task in turn.

[0066] Optionally, after splitting the user requirements into tasks to generate the target task, the method further includes: determining whether the large language model can directly process the target task, and if so, obtaining the answer to the target task through the large language model; otherwise, determining that the target task requires the use of a tool.

[0067] S220: When the target task requires the use of a tool, determine a target tool corresponding to the target task from a tool library.

[0068] Optionally, determining a target tool corresponding to the target task from a tool library includes: determining a target tool vector corresponding to the target task from the tool library by using a retrieval enhanced generation technique; and generating the target tool according to the target tool vector.

[0069] S230: extracting task parameters from the target task through the target tool.

[0070] Specifically, the large language model can use the functions of the target tool to try to extract relevant task parameters from the target task. For example, if the target tool is a data analysis software used to process and analyze data tables, and the target task is "analyze the quarterly changes in sales in each region of a sales data set", then the data analysis tool can extract key task parameters from the target task description based on its built-in functional modules, such as "sales data set" as the input data source, "regions" and "quarters" as analysis dimensions, etc.

[0071] S240. Determine whether the large language model outputs a task answer based on the task parameters. If so, execute S250; otherwise, execute S260.

[0072] Specifically, when the task parameters are extracted from the target task and provided to the large language model in an appropriate form, it is necessary to determine whether the large language model can output a task answer that meets the requirements based on these parameters. For example, for a target task of "explaining the background and impact of a historical event", if the extracted task parameters, such as the name of the historical event, relevant era background keywords, etc., allow the large language model to find the corresponding content in its huge knowledge reserve, then it is possible for it to output a reasonable answer about the background and impact of the historical event.

[0073] S250: Determine that the adaptation condition is adaptation, and directly use the task answer as the target task answer.

[0074] Specifically, if the large language model can output a complete answer that meets the requirements of the target task based on the provided task parameters, it indicates that the target tool performs well in extracting task parameters, so that the large language model can effectively use the task parameters to complete the task. Therefore, at this time, the adaptation situation can be determined as adaptation, and the task answer output by the large language model can be directly used as the target task answer.

[0075] S260: Determine that the adaptation condition is not suitable, enhance the target tool to generate an enhanced tool, and add the enhanced tool to the tool library.

[0076] Specifically, after the task parameters are extracted from the target task and provided to the large language model, if the large language model cannot output an answer that meets the requirements of the target task based on the task parameters, it indicates that the target tool did not accurately grasp the key information of the target task when extracting the task parameters, resulting in incomplete or inaccurate parameters provided to the large language model. At this time, it can be determined that the adaptation situation is not suitable.

[0077] Optionally, the target tool is enhanced to generate an enhanced tool, including: enhancing the target tool through a cyclic iterative algorithm to generate an alternative tool, and determining the number of iterations; judging whether the number of iterations reaches a threshold, and if so, determining that the enhancement has failed, and using the newly manufactured tool as the enhanced tool; otherwise, performing unit test verification on the alternative tool, and when the verification passes, using the alternative tool as the enhanced tool.

[0078] Optionally, after enhancing the target tool to generate the enhanced tool, the method further includes: obtaining a target task answer based on the enhanced tool; and aggregating the target task answers corresponding to each subtask to generate an output answer.

[0079] The technical solution of the embodiment of the present invention can integrate various available tool resources by building a tool library, providing rich choices to meet user needs. By splitting user needs into tasks, it helps to more clearly understand and process complex needs, improve the accuracy and efficiency of demand processing, and can enhance the tools when they are not suitable, continuously optimize and expand the tool library, which helps to improve the overall performance of the large language model and better adapt to user needs.

[0080] Embodiment 3

[0081] Figure 3 This is a schematic diagram of the structure of a large language model tool enhancement device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a target task generation module 310, which is used to build a tool library, obtain user needs based on a large language model, and perform task splitting on the user needs to generate a target task, wherein the tool library includes various tool vectors;

[0082] The target tool determination module 320 is used to determine the target tool corresponding to the target task from the tool library when the target task requires the use of a tool, and to determine the compatibility of the target tool with the target task;

[0083] The tool enhancement module 330 is used to enhance the target tool to generate an enhanced tool when the adaptation situation is unmatched, and add the enhanced tool to the tool library.

[0084] Optionally, the target task generation module 310 specifically includes: a tool library construction unit, which is used to: obtain tool information, wherein the tool information includes tool description, implementation code and test cases; convert the tool information into a specified format to generate a tool document, and segment the tool document to generate segmented documents; vectorize each segmented document to generate each tool vector, and build a tool library based on each tool vector.

[0085] Optionally, the target task generation module 310 specifically includes: a target task generation unit, which is used to: obtain splitting examples based on a large language model, and determine splitting rules corresponding to the splitting examples; split the user requirements according to the splitting rules to generate subtasks; and take each subtask as the target task in turn.

[0086] Optionally, the device also includes: a target task processing module, which is used to determine whether the large language model directly processes the target task after splitting the user requirements into tasks to generate the target task. If so, obtain the answer to the target task through the large language model; otherwise, determine that the target task requires the use of tools.

[0087] Optionally, the target tool determination module 320 specifically includes: a target tool determination unit, used to: determine a target tool vector corresponding to the target task from a tool library by using a search enhancement generation technology; and generate a target tool according to the target tool vector.

[0088] Optionally, the target tool determination module 320 specifically includes: an adaptation situation determination unit, which is used to: extract task parameters from the target task through the target tool; determine whether the large language model outputs a task answer based on the task parameters, and if so, determine that the adaptation situation is adapted, and directly use the task answer as the target task answer; otherwise, determine that the adaptation situation is unsuitable.

[0089] Optionally, the tool enhancement module 330 is specifically used to: enhance the target tool through a cyclic iterative algorithm to generate an alternative tool, and determine the number of iterations; determine whether the number of iterations reaches a threshold, and if so, determine that the enhancement has failed, and use the newly manufactured tool as the enhanced tool; otherwise, perform unit test verification on the alternative tool, and when the verification passes, use the alternative tool as the enhanced tool.

[0090] Optionally, the device also includes: a task answer aggregation module, which is used to obtain the target task answer based on the enhanced tool after enhancing the target tool to generate the enhanced tool; and aggregate the target task answers corresponding to each subtask to generate an output answer.

[0091] The technical solution of the embodiment of the present invention can integrate various available tool resources by building a tool library, providing rich choices to meet user needs. By splitting user needs into tasks, it helps to more clearly understand and process complex needs, improve the accuracy and efficiency of demand processing, and can enhance the tools when they are not suitable, continuously optimize and expand the tool library, which helps to improve the overall performance of the large language model and better adapt to user needs.

[0092] A large language model tool enhancement device provided in an embodiment of the present invention can execute a large language model tool enhancement method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.

[0093] Embodiment 4

[0094] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0095] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as a large language model tool enhancement method.

[0098] In some embodiments, a large language model tool enhancement method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the large language model tool enhancement method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform a large language model tool enhancement method in any other appropriate manner (e.g., by means of firmware).

[0099] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0100] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0101] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0102] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0103] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A large language model tool enhancement method, characterized in that: include: Building a tool library, obtaining user requirements based on a large language model, and performing task splitting on the user requirements to generate target tasks, wherein the tool library includes various tool vectors; When the target task requires the use of a tool, determining a target tool corresponding to the target task from the tool library, and determining the compatibility of the target tool with the target task; When the adaptation condition is unmatched, the target tool is enhanced to generate an enhanced tool, and the enhanced tool is added to the tool library.

2. The method according to claim 1, characterized in that The construction tool library includes: Obtaining tool information, wherein the tool information includes tool description, implementation code, and test cases; Converting the tool information into a specified format to generate a tool document, and segmenting the tool document to generate segmented documents; Each of the segmented documents is vectorized to generate each tool vector, and the tool library is constructed according to each of the tool vectors.

3. The method according to claim 1, characterized in that The step of performing task splitting on the user requirements to generate target tasks includes: Acquire a split example based on the large language model, and determine a split rule corresponding to the split example; Splitting the user requirements into tasks according to the splitting rules to generate subtasks; Each of the subtasks is taken as the target task in turn.

4. The method according to claim 3, characterized in that After splitting the user requirements into tasks to generate target tasks, the method further includes: Determine whether the large language model directly processes the target task, and if so, obtain the answer to the target task through the large language model; Otherwise, it is determined that the target task requires the use of a tool.

5. The method according to claim 4, characterized in that Determining a target tool corresponding to a target task from the tool library includes: Determining a target tool vector corresponding to a target task from the tool library by using a retrieval-enhanced generation technique; A target tool is generated according to the target tool vector.

6. The method according to claim 4, characterized in that The determining the compatibility of the target tool with the target task includes: extracting task parameters from the target task by the target tool; Based on the task parameters, determine whether the large language model outputs a task answer, and if so, determine that the adaptation condition is adaptation, and directly use the task answer as the target task answer; Otherwise, the adaptation situation is determined to be unsuitable.

7. The method according to claim 1, characterized in that The step of enhancing the target tool to generate an enhanced tool includes: Enhance the target tool through a loop iterative algorithm to generate an alternative tool, and determine the number of iterations; Determining whether the number of iterations reaches a number threshold, and if so, determining that the enhancement fails, and using the manufactured new tool as the enhancement tool; Otherwise, the candidate tool is subjected to unit test verification, and when the verification passes, the candidate tool is used as the enhanced tool.

8. The method according to claim 6, characterized in that After enhancing the target tool to generate an enhanced tool, the method further includes: Obtaining a target task answer based on the enhanced tool; The target task answers corresponding to each of the subtasks are aggregated to generate an output answer.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 8.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 8 when executed.

Citation Information

Cited By

  • Text information visualization method and device, equipment and readable storage medium

    CN121433785A

  • A text information visualization method, device, equipment and readable storage medium

    CN121433785B