CN117009443A - Hidden workflow construction method and device, electronic equipment and storage medium - Google Patents

Hidden workflow construction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117009443A
CN117009443A CN202310975363.6A CN202310975363A CN117009443A CN 117009443 A CN117009443 A CN 117009443A CN 202310975363 A CN202310975363 A CN 202310975363A CN 117009443 A CN117009443 A CN 117009443A
Authority
CN
China
Prior art keywords
workflow
data
flowlet
learning
flowlets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310975363.6A
Other languages
Chinese (zh)
Inventor
夏正勋
杨一帆
范豪钧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Xinghuan Intelligent Technology Co ltd
Original Assignee
Nanjing Xinghuan Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Xinghuan Intelligent Technology Co ltd filed Critical Nanjing Xinghuan Intelligent Technology Co ltd
Priority to CN202310975363.6A priority Critical patent/CN117009443A/en
Publication of CN117009443A publication Critical patent/CN117009443A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/285Clustering or classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a hidden workflow construction method, a device, electronic equipment and a storage medium. The method comprises the following steps: based on the existing workflow, constructing a hidden workflow, wherein the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series; generating training data sets of the plurality of flowlets; performing implicit workflow learning based on the training data set, wherein prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process; and carrying out combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, and realizing the function of implicit workflow. The invisible workload constructed by the method can realize the measurable and controllable process of processing complex problems by a large model, can correct errors in time based on the result of each step, and has stable and controllable performance and high implementation efficiency.

Description

Hidden workflow construction method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of artificial intelligence, in particular to a hidden workflow construction method, a device, electronic equipment and a storage medium.
Background
With the rapid development of artificial intelligence, machine learning technology is also advancing continuously. From machine learning to deep learning to large-scale learning, the large model shows good performance in solving generalized and logical thinking problems which are not solved for a long time in the field of machine learning, and provides possibility for realizing general artificial intelligence. However, there is a lack of effective precautions in how to promote large model CoT capability, thus presenting a significant challenge to the application of large model technology.
The current methods for improving the large model CoT capability are as follows: 1. the CoT capacity of the model is improved through code training; 2. by providing prompts, a few-shot method guides a large model to think according to example logic and gives answers; 3. training a large model through corpus containing specific thinking logic, such as a problem solving process, a result and the like of mathematical arithmetic problems; 4. the large model is used as a control module, and a plurality of tools are used for training the large model, so that the capability of the large model for solving complex problems, such as AutoGPT, is realized.
The disadvantage of the above method 1 and method 2 is that the process of solving the complex logic problem is not intuitive and uncontrollable, so how to make the process of solving the complex logic problem by the large model controllable is a technical problem to be solved currently.
Disclosure of Invention
The invention provides a hidden workflow construction method, a device, electronic equipment and a storage medium, which are used for solving the problem that the process of solving the complex logic problem by a large model is not visual and uncontrollable.
According to an aspect of the present invention, there is provided a hidden workflow construction method, including:
based on the existing workflow, constructing a hidden workflow, wherein the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series;
generating training data sets of the plurality of flowlets;
performing implicit workflow learning based on the training data set, wherein prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process;
and carrying out combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, and realizing the function of implicit workflow.
According to another aspect of the present invention, there is provided an implicit workflow construction apparatus, including:
the building module is used for building the hidden workflow based on the existing workflow, and the built hidden workflow is formed by connecting a plurality of workflow modules flowlets in series;
a generation module for generating training data sets of the plurality of flowlets;
The learning module is used for carrying out implicit workflow learning based on the training data set, and prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process;
and carrying out combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, and realizing the function of implicit workflow.
According to another aspect of the present invention, there is provided an electronic apparatus including: at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the implicit workflow construction method of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the implicit workflow construction method according to any of the embodiments of the present invention when executed.
According to the technical scheme, the hidden workflow is constructed based on the existing workflow, and the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series; generating training data sets of the plurality of flowlets; performing implicit workflow learning based on the training data set, wherein prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process; the prompt information of the multiple virtual roles is combined and inferred with the original logic relation according to the arrangement sequence of the multiple flowlets, so that the function of the implicit workflow is realized, the problem that the process of solving the complex logic problem by the large model is not visual and uncontrollable is solved, and the beneficial effect that the process of processing the complex problem by the large model is measurable and controllable is achieved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for constructing a hidden workflow according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of implicit workflow construction based on existing workflows according to a first embodiment of the present invention;
FIG. 3 is a schematic flow chart of a training data set for generating a plurality of flowlets in an implicit workflow construction method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a hidden workflow construction method according to a second embodiment of the present invention;
FIG. 5 is a schematic flow chart of a method for constructing a hidden workflow according to an exemplary embodiment of the present invention;
FIG. 6 is a flowchart of a method for adapting a large NL2SQL model database according to the third embodiment of the invention;
FIG. 7 is a flowchart of a method for adapting a database of a large model of NL2SQL according to an embodiment of the invention;
FIG. 8 is a workflow diagram of NL2SQL database adaptation provided by an embodiment of the invention;
FIG. 9 is a schematic diagram of a post-segmentation operator according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a hidden workflow construction device according to a fourth embodiment of the present invention;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention. It should be understood that the various steps recited in the method embodiments of the present invention may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the invention is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those skilled in the art will appreciate that "one or more" is intended to be construed as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Example 1
Fig. 1 is a schematic flow chart of a hidden workflow construction method according to an embodiment of the present invention, where the method may be suitable for implementing a large model of complex logic processing capability, and the method may be implemented by a hidden workflow construction device, where the device may be implemented by software and/or hardware and is generally integrated on an electronic device, and in this embodiment, the electronic device includes but is not limited to: a computer device.
As shown in fig. 1, a method for constructing an implicit workflow according to a first embodiment of the present invention includes the following steps:
s110, constructing a hidden workflow based on the existing workflow, wherein the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series.
The existing workflow can be a workflow of a large model, the large model belongs to a generating model, and the existing workflow can be a manually self-defined workflow or an automatically generated workflow. To better adapt to multiple pipeline application scenarios, a flowlet may be executed for a non-large model, such as one flowlet in a workflow is executed for a script.
In this embodiment, the process of performing implicit workflow construction based on the existing workflow may be: and splitting the existing workflow according to the input data and the output data of operators in the existing workflow, and constructing a hidden workflow calculation graph based on a large model according to the splitting result.
It should be noted that, the existing workflow splitting manner is different from the conventional workflow splitting manner (such as a deep learning computing graph splitting method and a distributed data processing computing graph splitting method), and splitting is performed only based on the input data and the output data of the operators, without considering distributed computing splitting and functional module splitting.
Further, existing workflows are composed of multiple operators, each operator having corresponding input data and output data, the input data of an upstream operator being the output data of a downstream operator.
Fig. 2 is a schematic diagram of hidden workflow construction based on an existing workflow according to the first embodiment of the present invention, as shown in fig. 2, operator op-0 to operator op6 are strung up the entire existing workflow, in-1 is input data of op-1, out-1 is output data of op-1, and output data out-0 of an upstream operator op-0 can be used as input data in-1 of a downstream operator op-1.
Optionally, the implicit workflow construction based on the existing workflow includes: dividing the existing workflow based on the input data and the output data to obtain a plurality of operators; mapping the operators according to mapping rules in a hidden workflow mapping rule library to obtain a plurality of workflow module flowlets; and obtaining a hidden workflow based on a large model through serial construction of flowlets.
The method comprises the steps of mapping a plurality of operators obtained by segmentation into corresponding workflow module flowlets according to mapping rules, wherein the flowlets are virtual modules, defining functions and input and output requirements of the virtual modules through formal definition [ in ] - > flowlets- > [ out ], and constructing a hidden workflow based on a large model through serial connection of the flowlets.
Further, the mapping of the plurality of operators includes: and mapping part of the operators in the plurality of operators one to one, performing one to many decomposition mapping on part of the operators in the plurality of operators, and performing many to one merging mapping on part of the operators in the plurality of operators.
The merging rules of the merging mapping are merged by taking feasibility of a data generating task and data diversity maintenance as principles, and the merging rules comprise transverse operator merging and longitudinal operator merging. Taking fig. 2 as an example for illustration, the lateral operators merge: for example, if op-0 and op-1 cannot directly generate out-1 data from in-0, the data cannot be merged; for op-4 and op-5, out-5 may be generated directly from in-4, then op-4 and op-5 may be combined; longitudinal operator merging: for example, op-6, although in-6 is the same as in-0 and out-6 is the same as out-1, op-6 is not combined with op-0 or op-1 in order to maintain the diversity of the output data; and for the op-2 and the op-3, the input data is various, but the output data is the same, so that the input data and the output data can be combined.
Illustratively, as shown in FIG. 2, the operator op maps to the flowlet as indicated by the dashed arrow, op-0 maps to flowlet-1, and the input data [ in-1] and output data [ out-1] of flowlet-1 are consistent with the input data in-0 and output data out-0 of op-0, respectively; the op-1 is mapped into a flowlet-2, and input data [ in-2] and output data [ out-2] of the flowlet-2 are respectively consistent with the input data in-1 and the output data out-1 of the op-1; the op-6 is mapped into a flowlet-3, and the input data [ in-3] and the output data [ out-3] of the flowlet-3 are respectively consistent with the input data in-6 and the output data out-6 of the op-6; op-2 and op-3 are combined and mapped into a flowlet-4, input data [ in-4] =in-2+in-3 of the flowlet-4, and output data [ out-4] =out-2+out-3 of the flowlet-4; op-4 and op-5 are merged and mapped into flowlet-5, input data [ in-5] =in-4 of flowlet-5, and output data [ out-5] =out-5 of flowlet-5.
S120, generating training data sets of the plurality of flowlets.
The conventional data set management method is usually in the form of a data tag pair, for example, [ in ] in [ in ] - > -flowlet- > [ out ] is used as data, and [ out ] is used as a tag, and the embodiment classifies the training data set of the flowlet into 2 types according to the characteristics of a large model: the unlabeled background describes the training data set and the labeled indicating training data set. The background description training data corresponding to the flowlet-n is recorded as bg-n, and the labeled indication training data is recorded as data-n.
Wherein the background description training data is the instruction or logic class support data required to complete the flowlet-n task, e.g. the flowlet-n task is the prediction of gastric tumor suppressor genes and the bg-n content is the working principle of the P53 gene. It should be noted that, the tag data-n expands the input data [ in ] of the flowlet, and adds the logic description of the [ out ] data generated by [ in ], and the logic description can be generated manually or by means of query tools, question-answering systems, large generation models and the like.
In this embodiment, the background description training data set may be generated according to a preset module, which may be understood that the background description training data set may be generated according to the background description information. The labeled data-n in the labeled instruction training data set can be generated manually, and can also be generated based on a template, a large model and an evaluator of the template, the labeled data is required to be checked through a data verifier after being generated, and the qualified labeled data is generated into the instruction training data set according to the requirement of the instructt-template.
Further, the generating training data sets of the plurality of flowlets includes:
outputting a background description training data set according to a preset template based on the description information; taking a template of the prompt as input of a large model, so that the large model outputs tagged data of the plurality of flowlets, wherein the template of the prompt comprises input data and prompt description, the diversity of the input data is realized through a data template, and the data template is in a key value pair form; verifying the tagged data through a data verifier, and outputting qualified tagged data; generating an indication training data set according to the qualified label data and the instruct-sample requirement, wherein the content of the indication training data set is a set of [ input data ] - [ output data ] pairs in [ input data ] -flowlet- [ output data ].
FIG. 3 is a schematic flow chart of a training data set for generating a plurality of flowlets in an implicit workflow construction method according to an embodiment of the present invention, as shown in FIG. 3, in Step201, input data is generated by a data generator, i.e., [ in ], wherein [ in ] -template defines a data template of the input data, and diversity of the input data can be realized by the data template of the input data; the gene-template is input of LLM, namely a large model, and the role of the template is to guide the large model to generate [ out ] namely [ output data ] through a prompting method, wherein the gene-template mainly comprises [ in ] data and prompting description.
The method for generating diversified [ in ] data through the data template [ in ] -template of input data comprises the following specific steps: the content of the filling part required in the [ in-template ] is described as [ key ], and the specific content is [ value ]. In this step, the value may be extracted from the existing data, or may be sent to the LLM using a sample containing the key, thereby generating the value content.
As shown in fig. 3, in Step202, the [ in ] data generated in Step201 is verified by a data verifier, which performs checking verification on the [ in ] data based on a verification rule, i.e., eval-rules, and internally implements a rule executor, and the final result is divided into pass and fail. The eval-rules can support specific evaluation specifications and can also support the calling of external interfaces and external tools. Generating an indication training data set sft-dataset according to the output qualified labeled data and the instructt-prompt requirement, wherein the content of the indication training data set is a set of [ in ] - [ out ] pairs in [ in-n ] - > -flowlet-n- > [ out-n ].
S130, performing implicit workflow learning based on the training data set, wherein prompt information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process.
The implicit workflow learning may include flowlet background learning and flowlet function learning, the flowlet background learning may be performed on the large model by a plurality of algorithms based on a background description data set in the training data set, and after the flowlet background learning is completed on the large model, the flowlet function learning may be performed on the large model continuously based on an instruction training data set in the training data set, where the flowlet function learning mainly includes instruction learning.
In this embodiment, the instruction training data set is a set of [ in ] - [ out ] pairs in [ in-n ] - > -flowlet-n ] - [ out-n ], and multiple flowlet corresponding virtual roles need to be constructed during processing, so as to obtain functional training data of multiple flowlet corresponding virtual roles, and the functional training data of all flowlet corresponding virtual roles are combined into a large instruction fine tuning data set to perform instruction learning training on a large model.
Where a virtual character refers to a virtual character of a large model, for example, when using a large model, xxx in "please play xxx, …" appearing in the prompt is a virtual character and can be trained.
The stop condition of the learning process is that the loss function of the large model is stabilized at a constant value and cannot drop any more, and the implicit workflow learning is finished after the evaluation is passed.
It should be noted that, combining all the functional training data of the corresponding virtual roles of the flowlets into a large instruction fine-tuning data set realizes that the flowlet learning is changed from serial to parallel, improves the learning efficiency, and meanwhile, the combined data is more various, so that better robustness and stability can be obtained.
And S140, carrying out combined reasoning on prompt information of a plurality of virtual roles according to the arrangement sequence of the plurality of flowlets and the original logic relationship, and realizing the function of implicit workflow.
In this embodiment, the function of the whole implicit workflow can be implemented by performing combined reasoning on all the virtual role template according to the sequence from flowlet-1 to flowlet-n and the original logic relationship, which is not described in detail in the prior art. Wherein the virtual character template refers to a prompt message template of the virtual character.
The flowlet can also support the calling of a third party interface API, tools and the like, and workflow dispatcher completes the function of the whole workflow by interacting with the prompt connection module and the API connection module.
According to the hidden workflow construction method provided by the embodiment of the invention, firstly, the hidden workflow is constructed based on the existing workflow, and the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series; then generating a training dataset of the plurality of flowlets; then, based on the training data set, implicit workflow learning is carried out, and prompt information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process; and finally, carrying out combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, and realizing the function of the implicit workflow. The method provides a direct and process-controllable large-model workload construction method, and workflow logic is directly converted into large-model work logic, so that the method is more suitable for practical engineering application; the realization from business logic to basic algorithm logic in a large model can be covered through multi-level workflow logic refinement; the logic disassembly based on rules can realize the controllability of the intermediate process and different working flows in a combined mode, and is safe, controllable, easy to use and high in practicability.
On the basis of the above embodiments, modified embodiments of the above embodiments are proposed, and it is to be noted here that only the differences from the above embodiments are described in the modified embodiments for the sake of brevity of description.
Further, if the tagged data is not verified, adding an error code fed back by the data verifier into the template of the template, and continuously optimizing and outputting the tagged data of the flowlet through the large language model until the output tagged data is verified.
According to the error code fed back by the data validator in step S120, the error code is added into the template of the template, the output result is continuously optimized through LLM until the data validator validates, multiple times of validation can be performed on the tagged data according to the error code until the data with the tag are qualified after the validation is passed, the whole process is an automatic process, manual participation can be reduced, and the efficiency and quality of data generation are guaranteed.
Example two
Fig. 4 is a schematic flow chart of a hidden workflow construction method according to a second embodiment of the present invention, where the second embodiment is optimized based on the above embodiments. For details not yet described in detail in this embodiment, refer to embodiment one.
As shown in fig. 4, a method for constructing a hidden workflow according to a second embodiment of the present invention includes the following steps:
s210, constructing a hidden workflow based on the existing workflow, wherein the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series.
S220, generating training data sets of the plurality of flowlets.
S230, taking a background description data set in the training data set as input of a large model, and carrying out flowlet background learning on the large model in a MASK learning mode.
The MASK learning mode may be multi-level model learning methods such as MLM and FIM.
In the step, MASK learning is introduced into a large model learning stage, and the problem of reducing the complexity and the calculation cost of a system by using a vector database or an ultralong prompt can be effectively avoided through MASK learning of the learning stage.
S240, performing flowlet function learning on the large model based on the indication training data set in the training data set.
Further, performing flowlet function learning on the large model based on the indicated training data set in the training data set, including: constructing functional training data of a plurality of flowlets corresponding to virtual roles based on the indication training data set in the training data set; combining the functional training data of all the flowlets corresponding to the virtual roles into an instruction fine-tuning data set; instruction learning is performed on the large model using the instruction trim dataset.
Specifically, the constructing functional training data of multiple flowlets corresponding to virtual roles based on the indicated training data set in the training data set includes: processing [ input data ] - [ output data ] of a plurality of flowlets included in the indication training data set in the training data set to obtain functional training data of corresponding virtual roles of the plurality of flowlets;
wherein the processing is to perform the following for each flowlet: setting a virtual character for the flowlet, describing the name and function logic of the virtual character corresponding to the flowlet to obtain prompt information of the virtual character, combining the prompt information of the virtual character with the input data in the input data pair to form a virtual character template, and replacing the input data in the input data pair by using the virtual character template to obtain function training data of the virtual character corresponding to the flowlet.
For example, setting a virtual role for each flowlet, for example, setting the virtual role corresponding to the flowlet-n as role-n, describing the name of the role-n and the function logic thereof, and combining the description of the role-n with [ in ] to form a role-n-sample to replace [ in ] in the original [ in ] - [ out ], so as to obtain flowlet function training data [ role-n-sample ] - [ out-n ]; and combining the function training data [ roll-n-sample ] - [ out-n ] of all the flowlets corresponding to the virtual roles into a large instruction fine-tuning data set [ roll-sample ] - [ out ] to perform instruct-learning training on the large model.
In the model learning process, the flowlet function is implicitly realized through virtual character training; the plurality of flowlet function learning tasks are combined into one task to learn, so that learning efficiency is effectively improved, the combined data has diversity, and robustness and stability of a large model can be improved by utilizing the diversity data to perform model training.
S250, carrying out combined reasoning on prompt information of a plurality of virtual roles according to the arrangement sequence of the plurality of flowlets and the original logic relationship, and realizing the function of implicit workflow.
Furthermore, the workflow construction mode based on the prompt considers the expressive force difference of model scale, for example, a 10B model can only support the reasoning capability according to roles, but for a larger model, for example, a 100B model, multiple reasoning is not needed, the hidden reasoning of the large model is changed, and the prompt is only needed to be improved by adopting a combined description method, for example, the output of data A after being input into the rule-1 is input, and the 2 reasoning of the original rule-1 and the rule-2 is combined into 1 time after the result of the' prompt description.
The second embodiment of the invention provides a hidden workflow construction, which embodies the process of learning and learning of the hidden workflow. According to the method, MASK learning is introduced into a large model learning stage, and the problems of complexity and calculation cost of a system can be reduced by effectively avoiding using a vector database or an ultralong prompt through MASK learning of the learning stage; implicitly realizing the flowlet function through virtual character training; the plurality of flowlet function learning tasks are combined into one task to learn, so that learning efficiency is effectively improved, the combined data has diversity, and robustness and stability of a large model can be improved by utilizing the diversity data to perform model training.
The embodiment of the invention provides an exemplary implementation mode based on the technical scheme of each embodiment.
As shown in fig. 5, fig. 5 is a schematic flow chart of a method for constructing an implicit workflow according to an exemplary embodiment of the present invention, including the following 4 stages:
stage 1, flowlet construction.
As shown in section 1 of FIG. 5, the built implicit workflow is formed by concatenation of workflow modules Flowlet-0, flowlet-1, flowlet-2, flowlet-3 and Flowlet-4.
Stage 2, flowlet dataset generation.
As shown in stage 2 part of FIG. 5, in the data generator, the gene-sample is the input of the mature LLM, the function of the gene-sample is to guide the LLM to generate origin-data by a prompting method, and the origin-data input data verifier checks the data based on eval-rules to generate qualified tagged data.
Stage 3, flowlet learning.
As shown in stage 3 of fig. 5, implicit workflow learning is divided into two steps, flowlet background learning and flowlet function learning, bg represents unlabeled background description training data, and role represents a virtual character.
And 4, establishing a workflow.
As shown in stage 4 part of fig. 5, workflow dispatcher completes the function of the entire workflow by interacting with the prompt linker module and the API linker module.
Example III
The embodiment of the invention provides a self-adaptive method of a NL2SQL large model database based on the hidden workflow construction method provided by any embodiment of the invention, which is taken as a specific embodiment of the hidden workflow construction method, and is a self-adaptive application scene of the database in the NL2SQL (structured query language) large model.
In the function implementation of converting natural language into SQL query statement, the support of external knowledge such as database table information is needed, but a database often has a plurality of tables, and how to relate natural semantic problems to specific tables is a difficult problem in industry. The current methods of dealing with this problem are as follows: the method comprises the steps that 1, a user selects a range of a table, then questions are asked, and the system generates SQL sentences according to table information and questions selected by the user; the method 2, the database structure information is stored in a vector database, and a table related to the problem is recalled from the vector database in a semantic matching mode; the method 3, taking the table information as a part of the prompt, and improving the accuracy of the SQL sentence by enhancing the context; and 4, decomposing the SQL generating task into a plurality of intermediate tasks by using a traditional NL2SQL modeling mode, and respectively learning. The method 1 has higher requirements on user knowledge and capability; the SQL generation error rate in the methods 2 and 4 is high; the method 3 has the requirements on the context length, the performance is low, and the accuracy of the generated SQL sentence is still not high.
In the application scenario of the embodiment, the method of large model hidden workflow is used for accurately associating the large model hidden workflow with the related tables in the database according to the natural semantic problem, so that the self-adaptation capability of the NL2SQL model to the database is realized.
Fig. 6 is a flowchart of a NL2SQL big model database adaptation method according to a third embodiment of the present invention, as shown in fig. 6, including the following steps:
s310, constructing a hidden workflow for the self-adaptive full workflow of the NL2SQL database according to the input and output types of data, wherein the constructed hidden workflow is formed by serially connecting a plurality of workflow modules flowlets.
The full workflow of NL2SQL database adaptation may be implemented by a real pipeline or a virtual workflow. To better adapt to a variety of pipeline application scenarios, mapped flowlets may be executed for non-large models, such as one flowlet in a workflow is script-executed.
The self-adaptive full workflow of the NL2SQL database consists of a plurality of operators, each operator has corresponding input data and output data, the input data of an upstream operator is used as the output data of a downstream operator, and correspondingly, the self-adaptive full workflow of the NL2SQL database is constructed according to the input and output categories of the data, and the self-adaptive full workflow comprises the following steps:
Splitting the self-adaptive full workflow of the NL2SQL database based on the input data and the output data to obtain a plurality of operators;
mapping the operators according to mapping rules in a hidden workflow mapping rule library to obtain a plurality of workflow module flowlets;
and obtaining the NL2SQL database self-adaptive processing system based on the large model hidden workflow through the serial construction of the flowlets.
Wherein mapping the plurality of operators comprises: and mapping part of the operators in the plurality of operators one to one, performing one to many decomposition mapping on part of the operators in the plurality of operators, and performing many to one merging mapping on part of the operators in the plurality of operators.
S320, generating training data sets of the plurality of flowlets.
Wherein the training data set comprises a background description training data set without labels and an indication training data set with labels.
Generating a training data set of the plurality of flowlets, comprising:
outputting a background description training data set according to a preset template based on the description information;
taking a template of the promtt as input of a large model, so that the large model outputs tagged data of the plurality of flowlets, wherein the template of the prompt comprises input data and prompt description, the diversity of the input data is realized through a data template of the input data, the data template is in a key value pair form, and the template of the prompt is formed by combining a plurality of tables with field information through a flowlet execution script;
Extracting SQL sentences in the tagged data through an execution script of a flowlet, and sending the SQL sentences to an SQL engine for execution;
screening the tagged data through a data verifier according to the error codes returned after the SQL engine is executed;
outputting the screened tagged data as qualified tagged data;
generating an indication training data set according to the qualified label data and the instruct-sample requirement, wherein the content of the indication training data set is a set of [ input data ] - [ output data ] pairs in [ input data ] -flowlet- [ output data ].
Further, if the tagged data is not verified, adding an error code fed back by the data verifier into the template of the template, and continuously optimizing and outputting the tagged data of the flowlet through the large language model until the output tagged data is verified.
S330, performing implicit workflow learning based on the training data set, wherein prompt information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process.
Wherein the implicit workflow learning includes flowlet background learning and flowlet function learning.
In this embodiment, performing implicit workflow learning based on the training data set includes:
Performing flowlet background learning on the NL2SQL large model by adopting a MASK learning mode based on background description data in the NL2SQL database;
and carrying out the flowlet function learning on the large model subjected to the flowlet background learning based on the indication training data set in the training data set.
Further, the method for performing the flowlet function learning on the large model subjected to the flowlet background learning based on the indication training data set in the training data set comprises the following steps:
constructing functional training data of a plurality of flowlets corresponding to virtual roles based on the indication training data set in the training data set;
combining the functional training data of all the flowlets corresponding to the virtual roles into an instruction fine-tuning data set;
and using the instruction fine tuning data set to conduct instruction learning on the large model subjected to flowlet background learning.
Further, constructing functional training data of a plurality of flowlets corresponding to virtual roles based on the indicated training data set in the training data set, including:
processing [ input data ] - [ output data ] of a plurality of flowlets included in the indication training data set in the training data set to obtain functional training data of corresponding virtual roles of the plurality of flowlets;
wherein, the processing is as follows: the following is performed for each flowlet: setting a virtual character for the flowlet, describing the name and function logic of the virtual character corresponding to the flowlet to obtain prompt information of the virtual character, combining the prompt information of the virtual character with the input data in the input data pair to form a virtual character template, and replacing the input data in the input data pair by using the virtual character template to obtain function training data of the virtual character corresponding to the flowlet.
S340, carrying out combined reasoning on prompt information of a plurality of virtual roles according to the arrangement sequence of the plurality of flowlets and the original logic relationship, and realizing the function of implicit workflow.
According to the NL2SQL large model database self-adaption method provided by the third embodiment of the invention, through a large model recessive workflow method, the method can be used for accurately relating to related tables in a database according to natural semantic problems, so that the self-adaption capability of the NL2SQL model to the database is realized.
On the basis of the technical solutions of the foregoing embodiments, a specific implementation manner is provided in the embodiments of the present invention, and fig. 7 is a schematic flow chart of an NL2SQL large model database adaptation method provided in the specific embodiment of the present invention.
In this embodiment, the database name of the NL2SQL big model that needs to be automatically adapted is ACAD, and includes 15 data tables. As shown in fig. 7, the specific flow is as follows:
stage 1, workflow segmentation and flowlet construction.
Step 101: the workflow is sliced according to the input-output data.
In the step, processing logic inside and outside the model can be considered simultaneously, and hidden workflow modeling can be carried out on the adaptive full workflow of the NL2SQL database. Fig. 8 is a workflow diagram of NL2SQL database adaptation provided by the embodiments of the present invention, as shown in fig. 8, denoted as an orgin-workflow graph, where the orgin-workflow graph is segmented according to input and output types of data, where the segmentation method may use an existing DAG calculation graph segmentation method, and after segmentation, the graph is shown in fig. 9, and fig. 9 is a schematic diagram of a post-segmentation operator provided by the embodiments of the present invention.
Step 102: flowlet construction.
Based on a hidden workflow mapping rule base, namely Flowlet-combo-rule, the rule base can be manually configured or continuously and optimally output through a model, OP1 in the figure 9 is mapped into Flowlet-0, OP2 and OP3 are combined and mapped into Flowlet-1, OP4 is decomposed into Flowlet-2, flowlet-3, flowlet-4, OP5 and OP6 are combined and mapped into Flowlet-6, OP7 is mapped into Flowlet-7, so that a Flowlet flow diagram shown in a Stage1 part in the figure 7 is obtained, flowlet-0, flowlet-1 and Flowlet-4 in the Flowlet flow diagram are processed outside the model, and an NL2SQL database self-adaptive processing system based on a large model hidden workflow is constructed through the series connection of the flowlets.
Stage 2, flowlet dataset generation.
Step 201: the original data is generated through the gene-template, namely the tagged data.
This step is accomplished by the cooperation of flowlet-2, flowlet-3, the input of flowlet-2 being the original schema description, with an example of 1 table being as follows:
{
"table_name":"AUTHOR",
"create_table":"create table author(\naid int(11)primary ke
y,\nhomepage varchar(255),\nname varchar(255),\noid int(11)\n);",
"table_linking": "author information table",
"column meaning":{
"aid": "author ID",
"homepage",
"name": "name",
"oid": "organization ID"
}
flowlet-2 combines multiple tables with field information through script and forms a gene-template, i.e., a template, examples of which are as follows:
the goals of the "raise questions" game are: based on the known table and field information, a Chinese query question is generated. For example, the known data table a stores employee card-punching records, and specific fields include UserID, name, time, which respectively include employee ID, employee name, and card-punching time, so that based on the field names in the above information, questions can be raised: "query king to punch card at 3 months 6 days? ".
The rules for problem generation are: first, event information in a problem is generated according to the description of the table, and whether a card-punching event corresponds to the description of the data table A in an example. Secondly, generating query conditions of the problems according to the description of the fields, wherein the query conditions of the problems in the example are smaller than Wang Duiying Name fields and corresponding to Time fields of 3 months and 6 days.
Now, the game starts, and based on the "[ data table JOURNAL, the JOURNAL information table is stored, and specific fields include homepage and jid, and the meanings are homepage and JOURNAL ID respectively. The field name in the information, the generated Chinese query question and query SQL are … ….
The table and field combination generated by the script is supported by the contents [ in the above prompt ] and the complex combination of multiple tables, multiple fields, tables, diagrams and the like. Then, the flowlet-3 calls a mature large model interface by taking the gene-sample as input, and in the embodiment, a Solar large model which is independently developed by star-ring technology is called, and a large model interface such as chatGPT, bloom can be called, so that the implementation feasibility and innovation of the invention are not affected. The large model output query problem and SQL result are:
problems: what is the query journal ID 123456 home address?
SQL:SELECT homepage FROM JOURNAL WHERE jid='123456'。
Step 202: and checking the original data through the data-validizer, and outputting qualified label data.
Eval-springs in this implementation step are: the SQLite execution result is used as an evaluation standard of the original corpus, if the execution is passed, the SQLite execution result is accepted, and if the SQLite execution result is wrong, the SQLite execution result is rejected; the execution script in the Flowlet-4 extracts SQL sentences in the original data, sends the SQL sentences to SQLite for execution, screens corpus according to the execution return error codes, and the screened corpus is qualified corpus; then generating an instruct training corpus according to the instruct-template requirements by using the qualified corpus, wherein the step is also processing based on template rules; the final instruct training dataset, denoted as sft-dataset, is generated, taking one of the samples as an example, as follows:
{
the role of the "context" database table matcher is to return the tables used by the corresponding SQL statement according to the question, usually noted as: the table matcher- [ DBName ], such as table matcher-a, represents a table matcher that is database a. The table matcher is used as follows: query database a for "all singers older than 40 years old", after the above-mentioned questions are entered into table matcher-a,
the return result is table. The table matcher corresponding to the database academic is known as a table matcher-academic, and the paper of ' query meeting name\2022 Beijing international technological meeting\ "is queried in the database academic, wherein the author involved is the field where ' Wangdi\ '. After the problem is input into the table matcher-academic, the return result is: ",
"target":"“table”:['CONFERENCE','PUBLICATION']"
}
It should be noted that this step defines the virtual character table matcher and its formal definition by the prompt, which is of great importance in large model implementations. After the definition and training based on the virtual roles, more complex functions can be combined through the virtual roles in the stage 4.
Stage 3, flowlet learning.
The implementation of the stage is divided into two steps of flowlet background learning and flowlet function learning, and the method specifically comprises the following steps:
step 301: the flowlet-0 outputs a semantic table description according to a template in a script mode according to the schema information, and the semantic table description is recorded as table-bg dataset, namely background description data, which is used as input data for flowlet background learning, and one piece of table description data is taken as an example as follows:
the data table AUTHOR in the ACAD database is an AUTHOR information table, in which there is aid, homepage, name, oid field whose meaning is AUTHOR ID, homepage, name, organization ID, respectively.
And the flowlet-1 uses table-bg data to implement an MLM mask learning method to learn flowlet background knowledge. It should be noted that only table names, table descriptions, field names and field meaning descriptions are Mask, and no database names are Mask.
Step 302: the flowlet function learns.
In this step, instruction fine-tuning learning is continued based on the NL2SQL big model trained in step 301. The Flowlet-6 takes the sft-dataset as a data set, and continues to train the NL2SQL big model; when the Loss cannot be reduced and the flow is evaluated by the flowlet-7 model, training is finished. Wherein the promt format used for large model evaluation in flowlet-7 is consistent with reasoning.
And 4, constructing a workflow.
After the three-stage work, the NL2SQL in the implementation has the self-adaptive function of the ACAD database. In the step, the function use is completed by directly using a promtt mode, and the use of a third party API or a tool is not involved. When the method is specifically used, a database table matcher role can be firstly tried out to recall a table related to a problem according to the problem, and then the problem and the table description form a new prompt to be used; the role of the database table matcher can be implicitly used, and SQL sentences can be generated by only one reasoning. This step is implemented in the latter way, examples of relevant probes are as follows:
please act as DBA, generating SQL statements. What is the home page address of query journal ID 123 to query in database ACAD? Based on the return result of the question input table matcher-ACAD, the generated SQL is:
the NL2SQL model outputs the result: SELECT homepage FROM JOURNAL WHERE jid = '123'.
In the above example, "the return result after the ACAD is input to the table matcher based on the problem", if the call is displayed, the execution is divided into 2 steps: firstly, obtaining an output result of a table matcher, then taking the output result as a part of SQL generation campt, requesting the execution of a model, and obtaining an SQL generation result.
According to the method for constructing the hidden workflow provided by the embodiment of the invention, the NL2SQL large model can generate SQL sentences without inputting the relevant table information of the problems in an actual application scene and directly inputting the problems, so that the hidden processing of how to accurately match the relevant tables according to the problems is realized. The method can keep the simplicity of system architecture, flow and implementation, and has low cost and high efficiency.
Example IV
Fig. 10 is a schematic structural diagram of an implicit workflow construction apparatus according to a fourth embodiment of the present invention, where the apparatus may be adapted to implement a large model of complex logic processing capability, and the apparatus may be implemented by software and/or hardware and is generally integrated on an electronic device.
As shown in fig. 10, the apparatus includes: a construction module 110, a generation module 120, a learning module 130, and an implementation module 140.
The building module 110 is configured to perform hidden workflow building based on an existing workflow, where a hidden workflow obtained by the building is formed by connecting a plurality of workflow modules flowlets in series;
a generation module 120 for generating training data sets of the plurality of flowlets;
The learning module 130 is configured to perform implicit workflow learning based on the training data set, where prompt information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process;
and the implementation module 140 is used for carrying out combined reasoning on the prompt information of the plurality of virtual roles according to the arrangement sequence of the plurality of flowlets and the original logic relationship to realize the function of the implicit workflow.
In this embodiment, the device firstly performs hidden workflow construction based on the existing workflow through the construction module 110, and the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series; then generating a training data set of the plurality of flowlets by a generation module 120; then, performing implicit workflow learning based on the training data set through a learning module 130, wherein prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process; finally, the realization module 140 performs combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, so as to realize the function of the implicit workflow.
The embodiment provides a hidden workflow construction device, which can realize the measurable and controllable process of processing complex problems by a large model, correct errors in time based on the result of each step, and has stable and controllable performance and high implementation efficiency.
Further, the existing workflow is composed of a plurality of operators, each operator has corresponding input data and output data, the input data of the upstream operator is used as the output data of the downstream operator, and correspondingly, the construction module 110 is specifically configured to:
dividing the existing workflow based on the input data and the output data to obtain a plurality of operators;
mapping the operators according to mapping rules in a hidden workflow mapping rule library to obtain a plurality of workflow module flowlets;
and obtaining a hidden workflow based on a large model through serial construction of flowlets.
On the basis of the optimization, mapping the operators comprises: and mapping part of the operators in the plurality of operators one to one, performing one to many decomposition mapping on part of the operators in the plurality of operators, and performing many to one merging mapping on part of the operators in the plurality of operators.
Further, the training data set includes a background description training data set without labels and an indication training data set with labels, and the generating module 120 specifically includes:
the first output unit is used for outputting a background description training data set according to a preset template based on the description information;
The second output unit is used for taking a template of the prompt as the input of the large model so that the large model outputs the tagged data of the plurality of flowlets, the template of the prompt comprises input data and prompt description, the diversity of the input data is realized through a data template of the input data, and the data template is in a key value pair form;
the verification unit is used for verifying the tagged data through the data verifier and outputting qualified tagged data;
and the generating unit is used for generating an indication training data set according to the qualified label data and the instruct-sample requirement, wherein the content of the indication training data set is a set of [ input data ] - [ output data ] pairs in [ input data ] -flowlet- [ output data ].
And on the basis of the optimization, if the tagged data is not checked, adding an error code fed back by the data verifier into the template of the prompt, and continuously optimizing and outputting the tagged data of the flowlet through the large language model until the output tagged data is checked.
Further, the implicit workflow learning includes flowlet background learning and flowlet function learning, and the learning module 130 includes:
The first learning sub-module is used for taking a background description data set in the training data set as the input of the large model and carrying out flowlet background learning on the large model in a MASK learning mode;
and the second learning sub-module is used for carrying out flowlet function learning on the large model based on the indication training data set in the training data set.
On the basis of the scheme, the second learning submodule comprises:
the construction unit is used for constructing functional training data of a plurality of flowlets corresponding to the virtual roles based on the indication training data set in the training data set;
the merging unit is used for merging the functional training data of all the flowlets corresponding to the virtual roles into an instruction fine-tuning data set;
and the learning unit is used for performing instruction learning on the large model by using the instruction fine adjustment data set.
Based on the above scheme, the construction unit is specifically configured to: processing [ input data ] - [ output data ] of a plurality of flowlets included in the indication training data set in the training data set to obtain functional training data of corresponding virtual roles of the plurality of flowlets;
wherein, the processing is as follows: the following is performed for each flowlet: setting a virtual character for the flowlet, describing the name and function logic of the virtual character corresponding to the flowlet to obtain prompt information of the virtual character, combining the prompt information of the virtual character with the input data in the input data pair to form a virtual character template, and replacing the input data in the input data pair by using the virtual character template to obtain function training data of the virtual character corresponding to the flowlet.
Further, the building module 110 is further configured to: and constructing a hidden workflow for the self-adaptive full workflow of the NL2SQL database according to the input and output types of the data.
Further, the template is formed by combining a plurality of tables and field information through a flowlet execution script.
Further, the verification unit is further configured to: extracting SQL sentences in the tagged data through an execution script of a flowlet, and sending the SQL sentences to an SQL engine for execution; screening the tagged data through a data verifier according to the error codes returned after the SQL engine is executed; and outputting the screened tagged data as qualified tagged data.
Further, the first learning sub-module is further configured to: and carrying out flowlet background learning on the NL2SQL large model by adopting a MASK learning mode based on background description data in the NL2SQL database table.
The hidden workflow construction device can execute the hidden workflow construction method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 11 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 11, the electronic device 10 includes at least one processor 11, and a memory such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, wherein the memory stores a computer program executable by the 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the implicit workflow construction method.
In some embodiments, the implicit workflow construction method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of the implicit workflow construction method described above may be performed when the computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the implicit workflow construction method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (15)

1. A method of implicit workflow construction, the method comprising:
based on the existing workflow, constructing a hidden workflow, wherein the constructed hidden workflow is formed by connecting a plurality of workflow modules flowlets in series;
generating training data sets of the plurality of flowlets;
performing implicit workflow learning based on the training data set, wherein prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process;
And carrying out combined reasoning on the prompt information of the multiple virtual roles according to the arrangement sequence of the multiple flowlets and the original logic relationship, and realizing the function of implicit workflow.
2. The method of claim 1, wherein the existing workflow is composed of a plurality of operators, each operator having corresponding input data and output data, the input data of an upstream operator being the output data of a downstream operator, and the recessive workflow construction based on the existing workflow, respectively, comprises:
dividing the existing workflow based on the input data and the output data to obtain a plurality of operators;
mapping the operators according to mapping rules in a hidden workflow mapping rule library to obtain a plurality of workflow module flowlets;
and obtaining a hidden workflow based on a large model through serial construction of flowlets.
3. The method of claim 2, wherein mapping the plurality of operators comprises:
and mapping part of the operators in the plurality of operators one to one, performing one to many decomposition mapping on part of the operators in the plurality of operators, and performing many to one merging mapping on part of the operators in the plurality of operators.
4. The method of claim 1, wherein the training data set comprises a non-tagged background description training data set and a tagged indication training data set, and wherein generating the training data sets of the plurality of flowlets, respectively, comprises:
outputting a background description training data set according to a preset template based on the description information;
taking a template of the prompt as input of a large model, so that the large model outputs tagged data of the plurality of flowlets, wherein the template of the prompt comprises input data and prompt description, the diversity of the input data is realized through a data template of the input data, and the data template is in a key value pair form;
verifying the tagged data through a data verifier, and outputting qualified tagged data;
generating an indication training data set according to the qualified label data and the instruct-sample requirement, wherein the content of the indication training data set is a set of [ input data ] - [ output data ] pairs in [ input data ] -flowlet- [ output data ].
5. The method of claim 4, wherein if the tagged data check fails, adding an error code fed back by the data validator to the template, and continuously optimizing the tagged data of the output flowlet through the large language model until the output tagged data check passes.
6. The method of claim 1, wherein the implicit workflow learning comprises flowlet background learning and flowlet function learning, and wherein the performing implicit workflow learning based on the training dataset, accordingly, comprises:
taking a background description data set in the training data set as input of a large model, and carrying out flowlet background learning on the large model in a MASK learning mode;
and performing flowlet function learning on the large model based on the indication training data set in the training data set.
7. The method of claim 6, wherein the flowlet function learning of the large model based on the indicated one of the training data sets comprises:
constructing functional training data of a plurality of flowlets corresponding to virtual roles based on the indication training data set in the training data set;
combining the functional training data of all the flowlets corresponding to the virtual roles into an instruction fine-tuning data set;
instruction learning is performed on the large model using the instruction trim dataset.
8. The method of claim 7, wherein constructing functional training data for a plurality of flowlet corresponding virtual characters based on the indicated training data set of the training data sets comprises:
Processing [ input data ] - [ output data ] of a plurality of flowlets included in the indication training data set in the training data set to obtain functional training data of corresponding virtual roles of the plurality of flowlets;
wherein, the processing is as follows: the following is performed for each flowlet: setting a virtual character for the flowlet, describing the name and function logic of the virtual character corresponding to the flowlet to obtain prompt information of the virtual character, combining the prompt information of the virtual character with the input data in the input data pair to form a virtual character template, and replacing the input data in the input data pair by using the virtual character template to obtain function training data of the virtual character corresponding to the flowlet.
9. The method of claim 1, wherein the implicit workflow construction based on existing workflows comprises: and constructing a hidden workflow for the self-adaptive full workflow of the NL2SQL database according to the input and output types of the data.
10. The method of claim 4, wherein the template is formed by combining a plurality of tables with field information through a flowlet execution script.
11. The method of claim 4, wherein the verifying the tagged data by the data validator outputs qualified tagged data, comprising:
extracting SQL sentences in the tagged data through an execution script of a flowlet, and sending the SQL sentences to an SQL engine for execution;
screening the tagged data through a data verifier according to the error codes returned after the SQL engine is executed;
and outputting the screened tagged data as qualified tagged data.
12. The method of claim 6, wherein using the background description dataset in the training dataset as an input to a large model, performing flowlet background learning on the large model by MASK learning, comprises:
and carrying out flowlet background learning on the NL2SQL large model by adopting a MASK learning mode based on background description data in the NL2SQL database table.
13. An implicit workflow construction apparatus, the apparatus comprising:
the building module is used for building the hidden workflow based on the existing workflow, and the built hidden workflow is formed by connecting a plurality of workflow modules flowlets in series;
A generation module for generating training data sets of the plurality of flowlets;
the learning module is used for carrying out implicit workflow learning based on the training data set, and prompting information of virtual roles corresponding to the plurality of flowlets is constructed in the learning process;
and the realization module is used for carrying out combined reasoning on the prompt information of the plurality of virtual roles according to the arrangement sequence of the plurality of flowlets and the original logic relationship to realize the function of the implicit workflow.
14. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the implicit workflow construction method of any of claims 1-12.
15. A computer readable storage medium storing computer instructions for causing a processor to implement the implicit workflow construction method of any of claims 1-12 when executed.
CN202310975363.6A 2023-08-03 2023-08-03 Hidden workflow construction method and device, electronic equipment and storage medium Pending CN117009443A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310975363.6A CN117009443A (en) 2023-08-03 2023-08-03 Hidden workflow construction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310975363.6A CN117009443A (en) 2023-08-03 2023-08-03 Hidden workflow construction method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117009443A true CN117009443A (en) 2023-11-07

Family

ID=88563160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310975363.6A Pending CN117009443A (en) 2023-08-03 2023-08-03 Hidden workflow construction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117009443A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118093641A (en) * 2024-04-29 2024-05-28 创意信息技术股份有限公司 Method and device for converting natural language into SQL query statement based on causal inference

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118093641A (en) * 2024-04-29 2024-05-28 创意信息技术股份有限公司 Method and device for converting natural language into SQL query statement based on causal inference

Similar Documents

Publication Publication Date Title
US11487952B2 (en) Method and terminal for generating a text based on self-encoding neural network, and medium
CN109918499A (en) A kind of file classification method, device, computer equipment and storage medium
CN117009443A (en) Hidden workflow construction method and device, electronic equipment and storage medium
US11416678B2 (en) Question group extraction method, question group extraction device, and recording medium
CN110837356A (en) Data processing method and device
CN114357195A (en) Knowledge graph-based question-answer pair generation method, device, equipment and medium
CN113722441B (en) Similar text generation method, device, equipment and storage medium
WO2024146468A1 (en) Model generation method and apparatus, entity recognition method and apparatus, electronic device, and storage medium
CN117194730B (en) Intention recognition and question answering method and device, electronic equipment and storage medium
CN113326367A (en) Task type dialogue method and system based on end-to-end text generation
CN117807204A (en) Question-answering diagnosis method, device, equipment and medium for engineering machinery fault problems
CN112101423A (en) Multi-model fused FAQ matching method and device
CN111753554A (en) Method and device for generating intention knowledge base
CN117009113A (en) Method and device for calling artificial intelligent model, computer equipment and storage medium
US20240037345A1 (en) System and method for artificial intelligence cleaning transform
CN116186219A (en) Man-machine dialogue interaction method, system and storage medium
CN115757720A (en) Project information searching method, device, equipment and medium based on knowledge graph
CN113392220B (en) Knowledge graph generation method and device, computer equipment and storage medium
CN114610743A (en) Structured query language statement processing method, system, device, and medium
CN108255826A (en) A kind of common question and answer are to FAQ generation methods, apparatus and system
CN111401074A (en) Short text emotion tendency analysis method, system and device based on Hadoop
CN112948561A (en) Method and device for automatically expanding question-answer knowledge base
CN112328871A (en) Reply generation method, device, equipment and storage medium based on RPA module
CN115510203B (en) Method, device, equipment, storage medium and program product for determining answers to questions
US20240037344A1 (en) Generating conversational ai response suggestions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination