Search

CN-121997942-A - Domain tool call conflict-oriented large model prompt word optimization method and system

CN121997942ACN 121997942 ACN121997942 ACN 121997942ACN-121997942-A

Abstract

The invention relates to a large model prompt word optimization method and a large model prompt word optimization system for field tool call conflict, and belongs to the technical field of artificial intelligence and natural language processing. The method comprises the steps of carrying out semantic analysis on a user natural language instruction to generate a structural semantic representation, carrying out conflict diagnosis from different dimensions based on the structural semantic representation to obtain structural conflict diagnosis information, determining a processing priority and a coordination strategy to be executed according to the conflict diagnosis information, generating an optimized prompting word structure set according to the coordination strategy, and finally inputting the optimized prompting word structure set to a tool call interface to construct and execute a standardized call request containing a target tool identifier, parameter filling content and an operation sequence, and carrying out tool call according to the standardized call request. The method effectively relieves the problem of prompt word conflict in multi-tool calling, and improves the calling accuracy and scheduling stability of the system under a complex task scene.

Inventors

  • XU MINGLIANG
  • Hua Chengqi
  • GAO CHENCHEN
  • LIU JUNNAN
  • GUO XUAN
  • Lv pei

Assignees

  • 郑州大学

Dates

Publication Date
20260508
Application Date
20260209

Claims (10)

  1. 1. A large model prompt word optimization method for calling conflict by a domain tool is characterized by comprising the following steps: 1) Acquiring a natural language instruction input by a user and associated context meta information thereof, and generating a structural semantic representation; 2) Identifying a candidate tool according to the structural semantic representation, and identifying and generating structural conflict diagnosis data containing conflict types, conflict field positions and semantic difference information according to the functional intention, parameter interfaces and call preconditions of the candidate tool; 3) Determining the processing priority and the coordination strategy to be executed according to the structured conflict diagnosis data, executing at least one operation including semantic rewriting, intention disassembly, parameter complementation and calling sequence adjustment according to the coordination strategy, and generating an optimized prompting word structure set; 4) And inputting the optimized prompt word structure set to a tool call interface, and constructing and executing a standardized call request containing a target tool identifier, parameter filling content and an operation sequence.
  2. 2. The large model prompt word optimization method for domain-oriented tool call conflict according to claim 1, further comprising receiving call response data including call states and processing results after standardized call requests, analyzing the call response data of the call states and the processing results, evaluating the effectiveness of the determined coordination strategy according to analysis results, and adjusting parameters of the coordination strategy based on evaluation results.
  3. 3. The method for optimizing large model hint words for domain-oriented tool call conflicts according to claim 1, wherein the process for generating structured conflict diagnostic data in step 2) comprises: extracting the function label, parameter interface definition and calling context dependent condition of each tool in the candidate tool set to construct each tool semantic vector, and identifying the candidate tool by semantic matching between the user command semantic vector and each tool semantic vector; Diagnosing functional conflict, parameter conflict and context conflict of the candidate tools, wherein the functional conflict refers to that the similarity between the current tool and the candidate tools exceeds a set threshold, the parameter conflict refers to that the two candidate tools have similar parameter field names but inconsistent types or have missing parameters, and the context conflict refers to that the current environment does not meet the context condition required by the execution of the candidate tools; The detected target function conflict, parameter conflict and context conflict are organized into structural conflict diagnosis data, wherein the structural conflict diagnosis data comprises conflict types, conflict field positions, related tool identifiers, similarity values, parameter difference metrics, context precondition satisfaction rates and semantic deviation descriptions.
  4. 4. The domain-oriented tool call conflict large model hint word optimization method of claim 1, wherein the generating of the optimized hint word structure set includes: Quantitatively evaluating the structured conflict diagnosis data to generate an evaluation value representing the severity of the conflict, wherein a scoring function adopted by the quantitatively evaluating comprises a target function conflict measure, a parameter conflict measure and a context conflict measure; Setting a coordination strategy set, and selecting a coordination strategy by at least one mode of screening conflict severity, matching conflict types and sequencing priority of strategies or strategy combinations based on historical success rate, execution cost and user feedback; And executing optimization processing on the prompt word structure according to the selected coordination strategy to obtain an optimized prompt word structure set.
  5. 5. The large model prompt word optimization method for domain-oriented tool call conflict as claimed in claim 4, wherein the coordination policy set comprises part or all of semantic rewriting, parameter complementation, intent resolution and order adjustment; The method comprises the steps of executing optimization processing on a prompt word structure according to a selected coordination strategy, wherein the optimization processing comprises the steps of carrying out semantic rewriting on semantic expressions of corrected conflict fields to resolve functional ambiguity, carrying out parameter complementation on filling or deducing missing fields to ensure call integrity, carrying out intention disassembly on analyzing a compound instruction into atomic-level task units, carrying out sequential adjustment on a call path for reconstructing a dependency relationship, and carrying out multiple strategies in a combined mode when the conflict relates to multiple dimensions.
  6. 6. The domain-oriented tool call conflict large model hint word optimization method of claim 4, further comprising performing completeness verification on the optimized hint word structure set, wherein the verification comprises semantic consistency verification, uniqueness verification and model suitability verification, wherein the semantic consistency verification is used for confirming that the optimized hint word structure is consistent with original intention of a user, the uniqueness verification is used for ensuring that output only corresponds to a unique tool call path so as to avoid ambiguity or ambiguity, and the model suitability verification is used for checking whether parameter types, field constraints and protocol formats meet interface requirements of a target tool.
  7. 7. The domain-oriented tool call conflict big model hint word optimization method of claim 1, wherein step 4) further comprises: Inputting the coordinated and optimized prompting word structure set to a language model interface to generate a standardized call request containing target tool identification, parameter filling content and operation sequence information; Converting the standardized call request into a communication protocol format required by the adaptation target tool, and constructing a cross-platform call request; executing the call request, and acquiring response data which is generated after executing the call request and contains a call state identifier, processing result data and response time.
  8. 8. The domain-oriented tool call conflict large model hint word optimization method of claim 7, wherein when a preset exception type occurs during a call, triggering a rollback mechanism that includes at least one of executing a standby tool call, rewriting hint words to generate a new call request, or repeating that is originally a request.
  9. 9. The domain-oriented tool call conflict big model hint word optimization method of claim 2, wherein the adjusting of the coordination policy parameters includes: The method comprises the steps of obtaining user feedback information and call response data, wherein the user feedback information comprises part or all of user satisfaction degree scores of call results, prompting word manual correction records and tool selection preferences; carrying out structured coding and feature extraction operation on user feedback information and call response data to generate a prompt word optimization effect evaluation matrix; Performing performance comparison analysis on the obtained prompt word optimization effect evaluation matrix and a historical strategy baseline, identifying a coordination strategy with reduced performance or insufficient robustness, and outputting strategy optimization suggestions according to preset rules or training models; And executing policy parameter adjustment operation according to the policy optimization suggestion, and updating rule configuration, parameter weight and template priority in a policy library by adopting reinforcement learning, self-supervision learning or heuristic optimization algorithm to generate a new coordination policy.
  10. 10. A domain-oriented tool call conflict large model hint word optimization system comprising a processor, wherein the processor is configured to execute a corresponding computing program to implement the domain-oriented tool call conflict large model hint word optimization method of any of claims 1-9.

Description

Domain tool call conflict-oriented large model prompt word optimization method and system Technical Field The invention relates to a large model prompt word optimization method and a large model prompt word optimization system for field tool call conflict, and belongs to the technical field of artificial intelligence and natural language processing. Background With the continuous development of large language model driven natural language processing technology, intelligent systems gradually have cross-tool collaboration capability when performing complex tasks. In the application scenarios of AI assistants, automated flow scheduling, tool enhancement models, etc., the system guides the model to select and invoke external tools by relying on natural language prompt words to complete subtasks such as searching, computing, analyzing, etc. However, in a multi-tool collaborative work scenario, functional overlapping, interface differences and state dependencies between tools often cause call conflicts, thereby causing stability problems such as reduced task execution efficiency and flow interruption. Therefore, the prompt word is not used as a carrier of language input any more, but becomes a core control element in multi-tool scheduling, and the optimization capability of the prompt word becomes a key influence factor of system performance. Most of the existing prompt word design methods are based on static templates, rule matching or manual construction, and are difficult to deal with dynamic task changes and multi-tool combination scenes. In the process of calling multiple tools, the problems of typical conflicts often occur that firstly, target function ambiguity conflicts, namely, the semantics of user instructions can be mapped to functions of multiple candidate tools, so that a system cannot uniquely determine a calling tool, the sources are non-unique mapping relations between ambiguity expressed by natural language of a user and tool function definitions, secondly, parameter field conflicts, namely, parameters with the same names but inconsistent technical attributes such as data types, value ranges or business meanings exist in different tool interfaces, and if the parameters are not effectively distinguished, data mismatch or execution errors can be caused, thirdly, calling context inconsistency, namely, the execution of part of tools has prepositions, calling needs to be performed after a specific system state or a prepositions task is completed, and calling logic generated by a prompting word cannot meet the prepositions. The above-mentioned conflict may not only cause tool selection errors, but also may cause logic confusion and execution delay of the system, and in severe cases, affect the overall completion of the task. Although the existing methods introduce tool capability description or function signature prompt to promote the structural degree of prompt word generation, the methods mainly focus on promoting the adaptation capability of a user instruction and a single tool, and cannot effectively identify and coordinate conflicts generated in the cooperative execution of multiple tools, particularly in the case of complex tasks, the timely identification and dynamic adjustment of the conflicts cannot be guaranteed, so that the accuracy and stability of task execution are affected, and the task execution is interrupted or failed. Disclosure of Invention The invention aims to provide a large model prompt word optimization method and a large model prompt word optimization system for calling conflict by a domain tool, so as to solve the problem that task execution is interrupted or failed due to conflict generated in cooperative execution of multiple tools cannot be effectively identified and coordinated at present. The invention provides a large model prompt word optimization method for solving the technical problems, which is oriented to the calling conflict of domain tools, and comprises the following steps: 1) Acquiring a natural language instruction input by a user and associated context meta information thereof, and generating a structural semantic representation; 2) Identifying a candidate tool according to the structural semantic representation, and identifying and generating structural conflict diagnosis data containing conflict types, conflict field positions and semantic difference information according to the functional intention, parameter interfaces and call preconditions of the candidate tool; 3) Determining the processing priority and the coordination strategy to be executed according to the structured conflict diagnosis data, executing at least one operation including semantic rewriting, intention disassembly, parameter complementation and calling sequence adjustment according to the coordination strategy, and generating an optimized prompting word structure set; 4) And inputting the optimized prompt word structure set to a tool call interface, and constructing and executing a sta