Large model generation control method and apparatus, electronic device, and storage medium
By generating thought chain statements and using intelligent agents to replace text blocks, the problem of missing context in the generation control of large models is solved, the accuracy control of large models is realized, and the generation effect is improved.
Patent Information
- Application Number
- PCT/CN2026/083585
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-08
- Filing Date
- 2026-03-16
- Publication Date
- 2026-11-12
AI Technical Summary
Existing technologies in large model generation control cannot effectively address the inaccuracy of generation results caused by missing context information or untimely database updates, making it difficult to fundamentally improve generation control performance.
By acquiring the question text to be processed, a thought chain statement is generated using a preset reasoning model, and each text block is processed. Replacement text is generated using an agent with functional features to replace the text blocks in the thought chain statement, and then a response text is generated using a preset large model.
It enables intervention in the reasoning process of large models, corrects logical errors, reduces semantic pollution and knowledge illusion, ensures the accuracy of generated results, breaks through the limitations of traditional black boxes, and improves generation effects.
Smart Images

Figure CN2026083585_12112026_PF_FP_ABST
Abstract
Description
Large model generation control methods, devices, electronic equipment and storage media
[0001] Related applications
[0002] This application claims priority to Chinese patent application filed on May 8, 2025, with application number 202510592098.2, entitled "A method, apparatus, electronic device and storage medium for generating large models", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device and storage medium for generating and controlling large models. Background Technology
[0004] With the development of large model technology, question-answering tasks can be completed very well with the help of large models.
[0005] Currently, to improve the generation control of large models, optimizations are typically made to the model's input content. Specifically, contextual information can be added to the prompt template, or relevant knowledge retrieved based on the input content can be added to the prompt module. This can improve the output performance of large models to some extent.
[0006] However, the above optimization and adjustment methods can only add auxiliary information related to the input content outside the processing of the large model. Therefore, if there is a lack of contextual information or the database is not updated in time, it cannot provide an effective reasoning basis for the large model, thus failing to fundamentally improve the generation control effect of the large model, and consequently making it difficult to guarantee the accuracy of the model generation results. Summary of the Invention
[0007] This application provides a method, apparatus, electronic device, and storage medium for generating and controlling large models.
[0008] Firstly, a method for generating and controlling large models is proposed, executed by electronic devices, including:
[0009] Get the question text to be processed;
[0010] Using a pre-defined reasoning model, thought chain statements are generated based on the question text;
[0011] Each text block in the thought chain statement is processed separately to obtain the processed thought chain statement; the text block processing includes: when there is a functional feature in the preset functional feature set that satisfies the feature similarity condition with the text feature of a text block, the agent corresponding to the functional feature is used to generate replacement text based on the text block; wherein, the functional feature set includes: the functional features of each agent that implements the function of generating content in the same domain; and the replacement text is used to replace the text block in the thought chain statement; and
[0012] Using a pre-defined large model, and based on the processed thought chain statements, the response text to the question text is generated.
[0013] Secondly, a large-scale model generation control device is proposed, comprising:
[0014] The acquisition unit is used to acquire the question text to be processed;
[0015] The first generation unit is used to generate thought chain statements based on the question text using a preset reasoning model;
[0016] An execution unit is configured to process each text block in a thought chain statement to obtain a processed thought chain statement. The text block processing includes: when a preset set of functional features contains a feature that satisfies a feature similarity condition to the text features of a text block, the agent corresponding to that functional feature generates replacement text based on the text block; wherein the set of functional features includes the functional features of each agent that implements the function of generating content in the same domain; and the replacement text is used to replace the text block in the thought chain statement.
[0017] The second generation unit is used to generate the response text to the question text based on the processed thought chain statements using a preset large model.
[0018] Thirdly, an electronic device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-described method when executing the computer program.
[0019] Fourthly, a computer-readable storage medium is proposed, on which a computer program is stored, which, when executed by a processor, implements the above-described method.
[0020] Fifthly, a computer program product is proposed, comprising a computer program that, when executed by a processor, implements the above-described method.
[0021] The beneficial effects of this application are as follows:
[0022] This application proposes a method, apparatus, electronic device, and storage medium for generating and controlling a large model. It proposes first acquiring the question text to be processed; then, using a preset inference model, generating thought chain statements based on the question text; subsequently, for each text block obtained by splitting the thought chain statements, the following operations are performed: when a preset set of functional features contains a feature that satisfies the feature similarity condition with the text features of a text block, the agent corresponding to that functional feature is used to generate replacement text based on the text block; wherein, the set of functional features includes: the functional features of each agent that implements the content generation function in the same domain; and the replacement text is used to replace a text block in the thought chain statement. This block demonstrates how, by generating thought chain statements based on the question text, we can obtain the reasoning process and task analysis results based on the question text. Then, for each text block in the thought chain statement, feature similarity filtering allows for flexible triggering of matching agents. Furthermore, when a matching agent is identified for a text block, replacing the text block in the thought chain statement with replacement text generated by the agent based on the text block enables adjustments to the thought chain statement, thereby intervening in the model's reasoning process. This allows for timely correction of logical errors in the thought chain statement, significantly reducing the impact of problems such as semantic pollution and knowledge illusion on reasoning.
[0023] Furthermore, a pre-defined large model is used to generate response texts to questions based on the processed thought chain statements. In this way, the final response file is generated by the large model based on the adjusted thought chain statements. This allows us to break through the black-box limitation of the traditional large model reasoning process by adjusting the thought chain statements, thereby fundamentally realizing the generation control of the large model, ensuring the accuracy of the model generation results, and improving the generation effect of the large model. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the published drawings without creative effort.
[0025] Figure 1 is a schematic diagram of possible application scenarios in the embodiments of this application;
[0026] Figure 2 is a schematic diagram of the generation control process of the large model in the embodiments of this application;
[0027] Figure 3 is a schematic diagram of an input page for a question text in an embodiment of this application;
[0028] Figure 4 is a schematic diagram of another question text input page in an embodiment of this application;
[0029] Figure 5 is a schematic diagram of the matching agent selection process in an embodiment of this application;
[0030] Figure 6 is a schematic diagram of an adjustment to the thought chain statement in an embodiment of this application;
[0031] Figure 7 is a schematic diagram of the internal composition of the processing device in an embodiment of this application;
[0032] Figure 8 is a schematic diagram of the generation control process of the large model in the embodiments of this application;
[0033] Figure 9 is a schematic diagram of the process of determining the matching agent in an embodiment of this application;
[0034] Figure 10 is a schematic diagram of the result after adjusting the thought chain statement in the embodiment of this application;
[0035] Figure 11 is a schematic diagram of the logic structure of the large model generation control device in the embodiment of this application;
[0036] Figure 12 is a schematic diagram of the hardware composition structure of an electronic device applying an embodiment of this application;
[0037] Figure 13 is a schematic diagram of the hardware composition structure of another electronic device using an embodiment of this application. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0039] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in sequences other than those illustrated or described herein.
[0040] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0041] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0042] An intelligent agent is an entity capable of autonomously perceiving its environment, making decisions, and executing corresponding actions to achieve a specific task. It can be pure software or a combination of software and hardware. Furthermore, an intelligent agent can achieve a closed loop of perception, decision-making, and execution. In the decision-making stage, the perceived information can be deeply processed to ultimately obtain a decision result. In the embodiments of this application, the intelligent agent involved can rely on a large model for decision-making, or on preset logic or strategies; this application does not impose specific limitations in this regard.
[0043] Large models, also known as large language models (LLMs), are ultra-large deep learning models that are pre-trained on a large amount of data.
[0044] Chain-of-Thought (CoT) is an artificial intelligence approach that enables large models to reason step-by-step. It breaks down complex tasks into a series of logical steps to ultimately achieve a solution, simulating a human-like reasoning process. This approach reflects a fundamental characteristic of artificial intelligence, providing a structured problem-solving mechanism; in other words, based on cognitive strategies, CoT decomposes complex problems into manageable intermediate ideas, thereby guiding the model sequentially to the final result.
[0045] Thought chain statements refer to the statement content obtained by the reasoning model based on the question text using thought chain technology. In some feasible embodiments of this application, the reasoning model and the preset large model can be the same model. In this case, it can be understood that content generation is performed separately under different thinking models of a large model. For example, assuming that thought chain statements can be generated in deep thinking mode, in the generation control method claimed in this application, it can be set to first use the large model in deep thinking mode to obtain thought chain statements generated based on the question text, and set the large model to stop generating after outputting the thought chain statements. Then, after the processing of the thought chain statements is completed, the large model under the thinking model that does not need to generate thought chain statements is used to generate the final response text based on the processed thought chain statements. In other feasible embodiments of this application, the reasoning model and the preset large model can be different models.
[0046] Context loss refers to the inconsistency in responses caused by models forgetting or confusing previous information when processing long texts or multi-turn dialogues.
[0047] Knowledge hallucination refers to content generated by a model that does not conform to the facts but appears reasonable. In essence, it is knowledge "fabricated" by the model rather than the result of real retrieval or reasoning.
[0048] Semantic pollution refers to the phenomenon in natural language processing (NLP) where the semantic understanding of words, phrases, or sentences is distorted or polluted due to low-quality data, noisy input, or model bias. It manifests as the model making incorrect associations with certain words or concepts, and outputting content that does not meet expectations or is biased.
[0049] The design concept of the embodiments of this application is briefly introduced below:
[0050] With the development of artificial intelligence (AI) technology, large models can be used to complete question-answering tasks very well.
[0051] Currently, in order to improve the generation control effect of large models, contextual information can be added to the prompt template, or relevant knowledge retrieved based on the input content can be added to the prompt template, which can improve the output effect of large models to a certain extent.
[0052] However, the above optimization and adjustment methods can only insert relevant knowledge or contextual information before inference. Therefore, they can only intervene in the input content of the large model. As a result, if there is a lack of contextual information or the database is not updated in time, they cannot provide effective reasoning basis for the large model, thus failing to fundamentally improve the generation control effect of the large model and making it difficult to guarantee the accuracy of the model generation results.
[0053] In view of this, this application proposes a method, apparatus, electronic device, and storage medium for generating and controlling a large model. The method involves first acquiring the question text to be processed; then, using a preset inference model, generating thought chain statements based on the question text; subsequently, for each text block obtained by splitting the thought chain statements, the following operations are performed: when a preset set of functional features contains a functional feature that satisfies the feature similarity condition with the text features of a text block, the agent corresponding to that functional feature is used to generate replacement text based on the text block; wherein, the set of functional features includes: the functional features of each agent that implements the content generation function in the same domain; and the replacement text is used to replace the text in the thought chain statements. A text block; thus, by generating thought chain statements based on the question text, the reasoning process and task analysis results based on the question text can be obtained; then, for each text block in the thought chain statement, by performing feature similarity filtering, the matching agent can be flexibly triggered. Moreover, when it is determined that a matching agent exists for a text block, by using the replacement text generated by the agent based on the text block to replace the text block in the thought chain statement, the thought chain statement can be adjusted, thereby intervening in the model's reasoning process. This allows for timely correction of logical errors in the thought chain statement, greatly reducing the impact of reasoning caused by problems such as semantic pollution and knowledge illusion.
[0054] Furthermore, a pre-defined large model is used to generate response texts to questions based on the processed thought chain statements. In this way, the final response file is generated by the large model based on the adjusted thought chain statements. This allows us to break through the black-box limitation of the traditional large model reasoning process by adjusting the thought chain statements, thereby fundamentally realizing the generation control of the large model, ensuring the accuracy of the model generation results, and improving the generation effect of the large model.
[0055] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0056] Referring to Figure 1, which is a schematic diagram of a possible application scenario in an embodiment of this application, the schematic diagram includes a client device 110 and a processing device 120.
[0057] In feasible embodiments of this application, the processing device 120 can receive a question text sent by the target object on the client device 110, and perform the following processing based on the question text: using a preset inference model, generate a thought chain statement based on the question text; for each text block obtained by splitting the thought chain statement, perform the following operations respectively: when there is a functional feature in the preset functional feature set that satisfies the feature similarity condition with the text feature of a text block, use the agent corresponding to the functional feature to generate a replacement text based on a text block; wherein, the functional feature set includes: the functional features of each agent that implements the function of generating content in the same domain; replace a text block in the thought chain statement with the replacement text; use a preset large model to generate a response text to the question text based on the processed thought chain statement.
[0058] Optionally, in some feasible embodiments of this application, after obtaining the processed thought chain statement, the processing device can use a preset large model to generate a response text to the question text based on the question text and the processed thought chain statement.
[0059] Then, the processing device 120 sends the response text to the client device 110 for display to the target object.
[0060] Optionally, in feasible embodiments of this application, after the processing device receives the response text, it can add additional determined multimodal data to the response text to obtain comprehensive data, and send the comprehensive data to the client device 110 to display it to the target object. The multimodal data can cover any one or a combination of the following data types: video, audio, and images.
[0061] Client devices 110 include, but are not limited to, mobile phones, tablets, laptops, e-book readers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.
[0062] The processing device 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0063] In this embodiment, the client device 110 and the processing device 120 can communicate via a wired network or a wireless network. The following description focuses solely on the generation and control process of the large model from the perspective of the processing device 120.
[0064] The following section provides an illustrative explanation of the generation and control process for large models, taking into account possible application scenarios:
[0065] Application Scenario 1: In the question-and-answer scenario of intelligent robots, generate and control the intelligent robot.
[0066] Specifically, intelligent robots can be intelligent customer service robots or any type of question-and-answer robots in various fields; these fields include, but are not limited to, education, healthcare, catering, and travel; intelligent robots can be software built on large models.
[0067] Specifically, after obtaining the question text sent by the target object through the chat window associated with the intelligent robot, the processing device can first obtain the thought chain statements obtained by the intelligent robot in deep thinking mode, and then break down the thought chain statements into individual text blocks. The following operations are then performed: by calculating feature similarity, if a matching intelligent agent exists among the agents that generate content in the same domain, a replacement text generated by the matching agent based on the text block is used to replace one text block in the thought chain statement. Afterwards, in a mode where the thought chain statements do not need to be output, the device obtains the response text output by the intelligent robot based on the processed thought chain statements.
[0068] Then, the processing device displays the response text to the target audience through a chat window associated with the intelligent robot.
[0069] Application Scenario 2: In the content generation scenario of a dedicated large model, control the generation of the large model.
[0070] The processing device can develop a large model to implement specified business processing functions according to the processing needs of the developers. Then, after the large model is trained, it can be used for generation control in the content generation scenario.
[0071] Specifically, after the processing device acquires the question text sent by the target object, it uses a preset inference model to generate a thought chain statement based on the question text. Then, for each text block obtained by splitting the thought chain statement, the following operations are performed: by calculating feature similarity, if a matching agent exists among the agents that perform the function of generating content in the same domain, a replacement text generated by the matching agent based on the text block is used to replace one text block in the thought chain statement. Afterwards, a response text is generated based on the processed thought chain statement using a preset large model.
[0072] Then, the response text is displayed to the target audience; the target audience may be the users of the large model's generation function.
[0073] In addition, it should be understood that the specific implementation of this application involves the generation and control process of large models. When the embodiments described in this application are applied to specific products or technologies, the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0074] The following description, with reference to the accompanying drawings, explains the generation and control process of the large model from the perspective of the processing equipment:
[0075] Referring to Figure 2, which is a schematic diagram of the generation control process of the large model in this embodiment of the application, the following is a detailed description with reference to Figure 2:
[0076] Step 201: The processing device acquires the query text to be processed.
[0077] In this embodiment of the application, the processing device can obtain the question text on which the large model processing is based, according to the actual processing needs, in any scenario that requires large model processing.
[0078] For example, the question text may be entered into a chat window associated with the large model; or, the question text may be entered into a web page associated with the large model; or, the question text may be received by other devices and forwarded to the processing device. This application does not impose specific restrictions on this.
[0079] For example, referring to Figure 3, which is a schematic diagram of an input page for a question text in an embodiment of this application, it can be seen from the content shown in Figure 3 that the processing device can obtain the question text entered by the target object on the web page.
[0080] For example, referring to Figure 4, which is a schematic diagram of another question text input page in an embodiment of this application, it can be seen from the content shown in Figure 4 that the processing device can obtain the question text entered by the target object in the chat window.
[0081] Step 202: The processing device uses a preset reasoning model to generate thought chain statements based on the question text.
[0082] The processing device employs a pre-defined reasoning model. Based on the question text and leveraging the reasoning capabilities of the model, it generates thought chain statements using thought chain technology. Specifically, the reasoning model first segments the question text, extracting keywords and analyzing the semantic relationships between them. Next, according to the logical rules of thought chains, it breaks down complex problems into a series of sequential logical steps. For example, for questions involving cause-and-effect relationships, the steps are divided according to the cause-and-effect logical order; for questions involving processes, they are decomposed according to the sequence of processes. Then, thought chain statements are generated step by step based on these logical steps. For instance, for the question text "How to improve writing skills," the reasoning model extracts keywords such as "improve" and "writing skills," analyzes their semantic relationships, and generates a thought chain statement like "First, analyze the current state of writing skills; second, determine the aspects that need improvement; third, find relevant learning resources; and finally, practice and provide feedback," following the logical steps of first analyzing the current situation, then determining the direction for improvement, then finding resources, and finally practicing and providing feedback.
[0083] In some feasible embodiments of this application, the preset reasoning model can be the same as the large model on which the final response text is based; at this time, the large model has at least two reasoning modes, namely a reasoning mode that can output thought chain statements and a reasoning mode that does not need to output thought chain statements, so that by adjusting the thought chain statements obtained by the large model itself, the generation control of the large model can be realized.
[0084] It should be understood that in a reasoning mode that can output thought chain statements, the generated reasoning results typically include thought chain statements and output text. However, this application controls the large model to stop generating content after outputting thought chain statements in a reasoning mode that can output thought chain statements through pre-programmed settings.
[0085] In other feasible embodiments of this application, the preset reasoning model may be different from the large model on which the final response text is generated; in this case, the large model for generating control in this application is different from the large model for generating thought chain statements, which enables the generation control of the preset large model in this application to be realized based on the internal reasoning process of other large models.
[0086] In the specific process of generating thought chain statements, the processing device can obtain the thought chain statements obtained by the reasoning model based on the question text, under the action of thought chain technology, based on the reasoning ability of the reasoning model.
[0087] Step 203: Process each text block in the thought chain statement separately to obtain the processed thought chain statement.
[0088] In this embodiment of the application, after the processing device obtains the thought chain statement, it can split the thought chain statement to obtain each text block; wherein, a text block refers to a paragraph in the thought chain statement; or, refers to a processing step in the thought chain statement.
[0089] When splitting a thought chain statement to obtain text blocks, in some feasible embodiments, the processing device can split the statement content based on preset identifiers in the thought chain statement to obtain text blocks separated by the identifiers; in other feasible embodiments, the processing device can split the statement content based on preset statement keywords in the thought chain statement to obtain text blocks starting with the statement keywords.
[0090] It should be noted that, in the embodiments of this application, a text block can be understood as a logical unit derived from a thought chain statement, wherein a logical unit includes a reasoning step, or a sub-problem conclusion, or a content paragraph; in addition, when the processing device splits the thought chain statement to obtain each text block, it may optionally use a preset parsing engine for processing, so as to realize the real-time block processing of the thought chain statement.
[0091] In this embodiment of the application, the preset identifier may be a symbol indicating a segment.
[0092] For example, paragraph breaks, periods, semicolons, etc.
[0093] In this embodiment of the application, the preset statement keywords can be words that can distinguish the logical processing level; or, in other words, words that can reflect the order of execution.
[0094] For example, first, second, then, next, next..., first, second, third...
[0095] In this way, the thought chain statements generated by the reasoning model during the reasoning process can be segmented in real time to obtain text blocks that can be processed independently.
[0096] Optionally, in this embodiment of the application, after generating the thought chain statement, before performing text block processing on each text block separately, the processing device can split the text block based on the thought chain statement to obtain each text block; and then use a preset text feature extraction method to extract the corresponding text features for each text block.
[0097] The preset text feature extraction method can be any encoding algorithm that can achieve text encoding, and this application does not impose any specific restrictions on it. Depending on the actual processing needs, the encoding algorithm used to obtain text features can be the same as or different from the algorithm used to extract the functional features of the agent, but it is necessary to ensure that the text features and the functional features of the agent are in the same vector space so as to conduct similarity comparison. This application does not impose any specific restrictions on it.
[0098] For example, the encoding algorithms that can be used include, but are not limited to, any of the following: Simple Contrastive Learning of Sentence Embeddings (SimCSE), Bidirectional Encoder Representations from Transformers (BERT), Robust Optimized BERT (RoBERTa), A Lite BERT (ALBERT), Distilled BERT (DistilBERT), Embeddings from Language Models (ELMo), Universal Sentence Encoder (USE), and Document to Vector (Doc2Vec), etc.
[0099] Simple contrastive learning for sentence embeddings is an algorithm for text encoding, which can be used as a pre-defined text feature extraction method to extract text features from text blocks, enabling the text blocks to be represented with high-dimensional features for similarity comparison with the functional features of the agent. Transformer-based bidirectional encoder representation is a pre-trained language model that can be used as a text feature extraction method. By encoding text, it extracts text features, and in this application, it is used to obtain text features from text blocks and functional features of the agent, etc., and can be trained in an unsupervised manner to obtain the text feature extraction network. Robust optimized BERT is an improved and optimized version of the BERT model, which can be used as a text feature extraction method to extract features from text blocks and functional descriptions of the agent, achieving high-dimensional feature representation of the text for easy feature similarity comparison. Lightweight BERT is a lightweight BERT model that reduces the number of model parameters through techniques such as parameter sharing, reducing computational resource requirements while maintaining certain performance. In this application, it can be used as a text feature extraction method to extract text features for subsequent feature similarity comparison and other operations. Distilled BERT is a lightweight model extracted from the BERT model using knowledge distillation technology. It retains most of the performance of the BERT model while reducing its size and computational cost. In this application, it can be used as a text feature extraction method to extract features from text blocks and agent function description text for feature encoding. Language model-based embedding is a word vector representation method based on deep learning language models. It can dynamically generate word vector representations according to context. In this application, it can be used as a preset text feature extraction method to extract features from text blocks and agent function description text to obtain high-dimensional feature representations of the text, facilitating feature similarity calculation. A general sentence encoder is a model that encodes sentences into fixed-length vectors, converting text into high-dimensional feature representations. In this application, it can be used as a text feature extraction method to extract features from text blocks and agent function description text for feature similarity comparison, thereby selecting matching agents. Document vectorization is a technique that converts documents into vector representations. It maps the entire document to a vector space, thus achieving a numerical representation of the document. In this application, it can be used as a preset text feature extraction method to extract features of text blocks and agent function description text for subsequent feature similarity analysis and agent matching.
[0100] In this way, by encoding the features of each text block, we can obtain the high-dimensional feature representation of each text block, that is, obtain the text features.
[0101] The following explanation uses text processing performed on any single text block as an example to illustrate the relevant processes:
[0102] Step 2031: When there is a functional feature in the preset functional feature set that satisfies the feature similarity condition with the text features of a text block, the processing device uses the agent corresponding to the functional feature to generate replacement text based on a text block; wherein, the functional feature set includes: the functional features of each agent that implements the content generation function in the same domain.
[0103] Specifically, the agent can perform semantic analysis and grammar checks on text blocks, combining its own knowledge and algorithms to generate more accurate and reasonable replacement text. The agent first segments the text block into words, then analyzes the semantics of each word to determine the core semantics and logical structure of the text block. Next, it performs grammar checks, identifies and corrects grammatical errors. Afterward, the agent reorganizes and expresses the text block based on its stored knowledge and pre-set algorithms. For example, if the text block is semantically ambiguous, the agent can clarify its precise meaning and express it clearly based on the context and its knowledge reserves; if the text block is too lengthy, the agent can simplify and optimize it. If the text block is "Apple is a fruit that is very delicious and very nutritious," the agent, through the above operations, replaces it with "Apple is a popular fruit that tastes delicious and is rich in various nutrients."
[0104] In some feasible embodiments of this application, when performing text block processing on a text block, the processing based on the intelligent agent can be the generation of replacement text. In this case, the processing device needs to first obtain a preset functional feature set to determine each intelligent agent that can generate replaceable content (i.e., replacement text). The functional feature set includes the functional features of each intelligent agent that implements the function of generating content in the same domain. Content in the same domain refers to content in the same domain as the content of the text block.
[0105] Optionally, in order to ensure the diversity and effectiveness of the selectable agents in the feature set, the processing device may, in response to an update operation on the feature set, add feature features of available agents and delete feature features of unavailable agents.
[0106] Furthermore, the functional feature set can be constructed as follows: using a trained text feature extraction network, functional features are extracted based on the functional description text of each agent, resulting in the functional feature set. The training method for the text feature extraction network will be explained in detail later; the functional description text describes the processing functions that an agent can perform.
[0107] It should be understood that the construction method of the intelligent agent is not specifically limited in the embodiments of this application. Moreover, in the embodiments of this application, intelligent agents that realize the content generation function of various domains can be flexibly obtained, thereby generating replacement text that can effectively replace text blocks. Furthermore, an intelligent agent is used to generate content in at least one domain, so it has a very good generation effect in the generation of content in a specified domain. This can ensure the accuracy of the replacement content to a certain extent, thereby effectively realizing the correction of the content of text blocks in the thought chain statement.
[0108] In some feasible agent generation methods, after determining the processing tasks that the agent can perform, the processing device constructs a training sample set adapted to the processing tasks and selects a base model from various available large models. Then, using the training sample set, the base model is trained iteratively in multiple rounds to obtain the trained target model, and the trained target model is used as the agent. Here, a training sample includes: a sample input statement of a domain, and a sample output statement obtained by regenerating the content of the sample input statement. The sample output statement in a training sample is usually more accurate than the sample input statement. This application does not impose specific restrictions on the selection method of the base model, such as arbitrarily selecting one as the base model.
[0109] In other feasible agent generation schemes, after determining the processing tasks that the agent can perform, different prompt templates can be constructed according to the differences in different processing tasks, so that different task processing can be guided under the action of different prompt templates.
[0110] When determining whether there are functional features in a preset set of functional features that satisfy the feature similarity condition with the text features of a text block, in some feasible embodiments, the processing device can process based on feature similarity and take the agent with the highest feature similarity as the agent that satisfies the feature similarity condition; in other feasible embodiments, the processing device can process based on feature similarity and associated priority information and take the agent with the highest priority that satisfies the feature similarity condition as the agent that satisfies the feature similarity condition.
[0111] When filtering based on feature similarity, the processing device can select the agent with the highest feature similarity between the corresponding functional feature and text feature as the agent that meets the feature similarity condition. The processing device can use a cosine similarity algorithm to calculate the similarity between the corresponding functional feature and text feature. The formula for calculating cosine similarity is: Where A represents the functional feature vector, B represents the text feature vector, A·B represents the dot product of the two vectors, and ||A|| and ||B|| represent the magnitudes of the two vectors, respectively. The processing device selects the agent with the highest calculated feature similarity as the agent that satisfies the feature similarity condition.
[0112] When filtering based on feature similarity and associated priority information, the processing device can calculate the feature similarity between each functional feature in the functional feature set and the text feature of a text block. Then, when there is a functional feature whose corresponding feature similarity reaches a preset data threshold and whose associated priority information meets the preset filtering conditions, it is determined that there is a functional feature that meets the feature similarity condition with the text feature, and the agent corresponding to the functional feature is taken as the agent that meets the feature similarity condition.
[0113] Among them, there are relative priorities among agents of the same type; priority information is used to indicate the degree of reference for the output content of different agents; the preset filtering condition can be: determine the highest relative priority based on the associated priority information; the data threshold is set according to the actual processing needs, and this application does not impose specific restrictions on it. The highest relative priority is relative to agents whose feature similarity meets the data threshold, so as to determine the agent with the highest priority among agents whose feature similarity meets the data threshold.
[0114] For example, agents that generate content in a fixed domain are preferred over agents that generate content in a general domain.
[0115] For example, an agent that performs "pathological analysis" has a higher priority than an agent that performs "general question answering".
[0116] Optionally, when filtering agents whose feature similarity reaches a preset threshold, the processing device can employ various retrieval algorithms to quickly match agents whose functions are similar to the content of the text block from the perspective of feature similarity. The retrieval algorithms employed include, but are not limited to, any of the following: Hierarchical Navigable Small World (HNSW), Facebook AI Similarity Search (FAISS), and Locality-Sensitive Hashing (LSH). HNSW is a graph algorithm for quickly searching for nearest neighbors and can be used as a retrieval algorithm in this application to quickly match agents whose functions are similar to the content of the text block from the perspective of feature similarity. FISS is an algorithm for efficiently performing similarity searches and can be used as a retrieval algorithm in this application to help the processing device quickly match agents whose feature similarity reaches a preset threshold and whose content is similar to the text block. LSH is an algorithm that maps similar data to similar hash values using a hash function, thereby achieving a fast approximate search for similar data. In this application, it can be used as a retrieval algorithm to filter agents whose feature similarity reaches a preset data threshold, and quickly match agents similar to the content of text blocks.
[0117] For example, referring to Figure 5, which is a schematic diagram of the matching agent selection process in an embodiment of this application, it can be seen from the content shown in Figure 5 that for each agent that implements the function of generating content in the same domain, a functional feature set and priority information associated with each agent are determined respectively; then, after selecting agents that reach the data threshold (assumed to be agents s1 and agents s2) by calculating the feature similarity between the text features of the text block and each functional feature, by comparing the difference in priority information between the two selected agents, the agent with the highest relative priority is selected as the agent that meets the feature similarity condition, namely agent s1.
[0118] In this way, each functional feature in the feature set is equivalent to the feature anchor point of each agent to be matched, so that by comparing feature similarity and filtering priority information, the final selected agent can be greatly suited to the processing needs of text blocks; moreover, by defining priority information, there is a trigger priority between different agents, which can resolve the competition conflict between multiple agents.
[0119] Furthermore, among the agents that perform the function of generating content in the same domain, after determining an agent that matches a text block, the matching agent can be used to generate replacement text based on a text block.
[0120] Specifically, if there is no functional feature in the preset functional feature set that satisfies the feature similarity condition with the text features of a text block, it can be determined that among the agents that implement the content generation function in the same domain, there is no agent that matches the text block. Therefore, the processing of the current text block can be stopped, and the operation of step 2031 can be performed for the next text block.
[0121] In other feasible embodiments of this application, when performing text block processing on a text block, the agent-based processing may generate, in addition to generating replacement text, any one or a combination of the following: recommendation text, various types of knowledge text, and multimodal data.
[0122] Based on this, when performing text block processing on a text block, before replacing a text block in the thought chain statement with replacement text, any one or a combination of the following generation operations can be performed: Using agents that implement content recommendation functions and whose agents meet feature matching conditions with a text block, generate recommended text based on a text block; Using agents that implement each type of knowledge acquisition function and whose agents meet feature filtering conditions with a text block, generate related knowledge text with insertion positions based on a text block; Using agents that implement multimodal data generation functions and whose agents meet feature hitting conditions with a text block, generate related multimodal data based on a text block.
[0123] In other words, the types of intelligent agents used in this application embodiment may also include any one or a combination of the following: intelligent agents that implement content recommendation functions, various intelligent agents that implement knowledge recommendation functions, and intelligent agents that implement multimodal data generation functions. Furthermore, each intelligent agent is associated with priority information, and there is a priority relationship between intelligent agents of the same type. Optionally, according to actual processing needs, for each type of intelligent agent implementing knowledge acquisition functions, a corresponding insertion position can be configured to indicate the insertion position of the knowledge text processed and obtained by the intelligent agent in the thought chain statement.
[0124] Specifically, the agent can analyze information such as the topic and keywords of a text block, and combine its own recommendation algorithm and database to filter recommended text that matches the text block from a category of recommended content. For example, if the text block involves sports-related content, the agent can filter suitable advertising statements from a sports product advertising library as recommended text. For each type of knowledge acquisition function, the agent that meets the feature selection criteria with a text block generates related knowledge text with an insertion position based on the text block. Taking the real-time knowledge search agent as an example, the agent can search for real-time knowledge related to the text block on the Internet through an application programming interface (API) and determine the insertion position of the knowledge text in the thought chain statement according to preset rules. For the multimodal data generation function, the agent that meets the feature matching criteria with a text block generates related multimodal data based on the text block. For example, for an image generation agent, it can generate related images using an image generation algorithm based on the description of the text block.
[0125] When generating recommended text, the processing device can calculate the feature similarity between each descriptive feature in the feature set and the text features of a text block, and select agents whose feature similarity reaches a preset recommendation threshold and whose associated priority information meets preset matching conditions as agents that meet the feature matching conditions. The feature set includes: the descriptive features of each agent that implements the content recommendation function; a pre-configured priority information to indicate the degree of reference for the output result of an agent; and then using the selected agent, recommended text is generated based on a text block.
[0126] In one feasible embodiment, the content recommendation function can specifically be manifested as advertising content recommendation, enabling the recommendation of advertising content that matches the text block; the value of the recommendation threshold is set according to the actual processing needs, and the preset matching condition can be: the highest priority, so as to determine the agent with the highest priority among the agents whose feature similarity reaches the recommendation threshold.
[0127] A smart agent implementing content recommendation functionality specifically determines the recommended text that matches a given text block within a category of recommended content. The agent first performs deep semantic analysis on the text block, extracting features such as its core theme, key information, and sentiment. Then, it matches these features with each recommendation item in the category of recommended content. This matching process can be achieved by calculating feature similarity, for example, using a cosine similarity algorithm to calculate the similarity between the text block's feature vector and the recommendation item's feature vector. Higher similarity indicates a better match between the recommendation item and the text block. Finally, the agent selects the most suitable recommended text from the highly matched recommendations. For example, if the text block involves sports-related content, the agent determines that the core theme of the text block is sports equipment recommendations, and the key information is cost-effective sports shoes. Then, it calculates the similarity between each advertisement statement and the text block's features in a sports shoe advertisement database, selecting the advertisement statement with the highest similarity as the recommended text.
[0128] In this way, from the perspective of content recommendation, it is possible to determine the recommended text that matches the text block.
[0129] When generating specific knowledge texts, the processing device performs the following operations for each agent feature set corresponding to each type of knowledge acquisition function: calculate the feature similarity between each agent feature in an agent feature set and the text features of a text block, and select agents whose corresponding feature similarity reaches a preset functional threshold and whose associated priority information meets preset filtering conditions as agents that meet the feature filtering conditions; an agent feature set includes: the agent features of each agent that implements a type of knowledge acquisition function; and then, using the selected agents, knowledge text with an associated insertion position is generated based on a text block.
[0130] In this embodiment, there may be agents with multiple knowledge acquisition functions, enabling the provision of knowledge texts in different dimensions. These multiple knowledge acquisition functions include, but are not limited to, real-time knowledge search, formula calculation knowledge acquisition, and database knowledge search and generation. When determining the matching agent under different types of knowledge acquisition functions, the functional thresholds used may be the same or different, and the specific values are set according to actual processing needs. The preset filtering condition may be: the highest priority, so that among the agents with a knowledge acquisition function, if there is an agent that meets the feature filtering condition, the agent selected based on the feature filtering condition is specifically the agent with the highest priority among those whose feature similarity between the agent's features and the text features reaches the functional threshold.
[0131] In addition, real-time knowledge can be the real-time knowledge acquired by intelligent agents through application programming interfaces (APIs). This includes various intelligent agents within a certain category, such as agents that acquire real-time weather information and agents that acquire real-time location information. Another category of intelligent agents can acquire formula calculation knowledge, which can use pre-built calculation program formulas to process and obtain corresponding calculation results. This includes various intelligent agents within a certain category, such as agents that perform calculations based on formula 1 and agents that perform calculations based on formula 2. Finally, intelligent agents can generate knowledge by searching databases, which can search for relevant knowledge in text blocks within databases. This includes various intelligent agents within a certain category, such as agents that search in the database of domain 1 and agents that search in the database of domain 2.
[0132] In this way, intelligent agents with the help of various knowledge acquisition functions can acquire knowledge content that matches the text blocks from different knowledge dimensions, thereby realizing the expansion of knowledge content based on text blocks, and thus providing more reference for the analysis and generation of subsequent large models.
[0133] When generating multimodal data, the processing device can calculate the feature similarity between each identifier feature in the identifier feature set and the text features of a text block, and select the agent whose corresponding feature similarity reaches a preset data threshold and whose associated priority information meets the preset hit condition as the agent that meets the feature hit condition; the identifier feature set includes the identifier features of each agent that implements the multimodal data generation function; and then the selected agent generates multimodal data based on a text block.
[0134] In one feasible embodiment, the multimodal data generation function is specifically used to generate multimodal data related to text blocks, such as images, videos, and audio. The data threshold value is set according to the actual processing needs. The preset hit condition can be: the highest priority, so that when there are agents that meet the feature hit condition, the agent selected according to the feature hit condition is the agent with the highest priority among the agents whose feature similarity between the descriptive features and the text features reaches the data threshold.
[0135] The specific function of an agent that implements multimodal data generation can be to generate a type of multimodal data related to text blocks.
[0136] For example, the agents that generate multimodal data may include agents that generate various types of multimodal data, such as agents that generate images, agents that generate audio, and agents that generate video.
[0137] This allows for the generation of related multimodal data based on text blocks, thereby greatly enhancing the richness of the content.
[0138] In summary, while performing text block processing on a text block, the processing device can also selectively generate recommendation text, various knowledge texts, and any one or a combination of multimodal data, thereby improving the flexibility of content generation and enabling the content expansion of the text block from different dimensions. Moreover, it can determine whether there is an agent matching the text block from the perspective of different agent types, thus increasing the range of agents involved in adjusting the thought chain statements.
[0139] In addition, in the embodiments of this application, when a descriptive feature set is constructed for each agent implementing the content recommendation function, the descriptive feature set is constructed in the following way: using a text feature extraction network, descriptive features are extracted based on the functional description text of each agent to obtain the descriptive feature set; when an agent feature set is constructed for each agent implementing each knowledge acquisition function, each agent feature set is constructed in the following way: using a text feature extraction network, agent features are extracted based on the functional description text of each agent to obtain the agent feature set; when an identifier feature set is constructed for each agent implementing the multimodal data generation function, the identifier feature set is constructed in the following way: using a text feature extraction network, identifier features are extracted based on the functional description text of each agent to obtain the identifier feature set.
[0140] It should be understood that in the embodiments of this application, the features extracted for each intelligent agent can all be extracted using the same feature extraction network; optionally, the processing device can train different feature extraction networks to extract features for different types of intelligent agents, but it is necessary to ensure that the features extracted for the intelligent agent and the text features of the text block are in the same vector space so as to calculate the feature similarity. This application does not impose specific restrictions on this.
[0141] In this way, the trained text feature extraction network can be used to extract features for each agent based on the functional description text of each agent.
[0142] In other words, in feasible embodiments of this application, when performing text block processing on a text block, in addition to using the functional feature set, any one or combination of the following feature sets may also be used: description feature set, each agent feature set, and identification feature set; in order to ensure the validity of the content in each feature set, the processing device can update the feature sets used during the operation execution.
[0143] Specifically, the processing device can, in response to a content removal instruction triggered for a target feature set, delete at least one target feature in the target feature set that matches the content removal instruction; and, in response to a content addition instruction triggered for a target feature set, for a candidate agent to be added to the database, obtain the corresponding functional description text, and add the target features extracted by the trained text feature extraction network based on the functional description text to the target feature set; wherein the target feature set is at least one of the description feature set, functional feature set, agent feature sets, and identifier feature set.
[0144] The intelligent agent to be added to the database can be acquired by the processing device or developed by the processing device itself; this application does not impose specific restrictions on this. The update process of the target feature set can be performed in real time or before the operation is executed; this application does not impose specific restrictions on this.
[0145] In this way, by updating the target feature set that may be used during the operation, the target feature set used during the operation is always up-to-date, ensuring the reliability of the content in the target feature set and thus improving the matching effect of the agent. Moreover, it can realize hot updating of agents, thereby adding and removing usable agents in real time.
[0146] Furthermore, in feasible embodiments of this application, the text feature extraction network used can be trained in an unsupervised or supervised manner. A text feature extraction network, also known as a text encoding network, is used to extract features from text content. For example, assuming the text feature extraction network is BERT, it can be trained in an unsupervised manner to obtain the text feature extraction network; this application does not specifically limit the training method of the text feature extraction network.
[0147] Text feature extraction networks can be trained in a supervised manner, with the following steps: First, prepare a training dataset containing a large number of text samples and their corresponding feature labels; then, select a suitable neural network architecture, such as BERT; next, input the training dataset into the neural network and continuously adjust the network parameters using the backpropagation algorithm to make the network output features as close as possible to the labels. The specific process of the backpropagation algorithm is as follows: calculate the loss function between the network output features and the labels, such as the cross-entropy loss function. Where y i Indicates the real label, p i This represents the probability predicted by the network. Then, the partial derivatives of the loss function with respect to each parameter in the network are calculated to obtain the gradient of the parameters. Finally, the network parameters are updated based on the gradients, using the following update formula: Where θ represents the network parameters and α represents the learning rate. After multiple rounds of training, a well-trained text feature extraction network is obtained.
[0148] In other feasible embodiments of this application, the text feature extraction network used may be obtained directly from other devices. For example, in some scenarios, a pre-trained text feature extraction network may be obtained directly from a professional model library device.
[0149] Step 2032: The processing device replaces a block of text in the thought chain statement with replacement text.
[0150] In some feasible embodiments of this application, during the process of performing text block processing on a text block, if the agent can only generate replacement text, the generated replacement text can be used to replace the text block in the thought chain.
[0151] In other feasible embodiments of this application, during the text block processing for a text block, if in addition to generating replacement text, recommended text, various knowledge texts, and any one or combination of multimodal data are also generated, it is also necessary to configure other statements besides the replacement text in the thought chain statement.
[0152] Specifically, for recommended text, it can be directly inserted into the thought chain statement; for each type of knowledge text, it can be inserted into the thought chain statement according to the associated insertion position; for multimodal data, corresponding control text can be generated and inserted into the thought chain statement. The control text is used to indicate the large model to reserve the embedding position of multimodal data in the output result.
[0153] Taking the process of performing text block processing on a text block as an example, the generated content also includes recommendation text, at least one knowledge text, and multimodal data. When performing step 2032, the processing device can generate control text based on the multimodal data; then, in the thought chain statement, the corresponding knowledge text is inserted according to the insertion position, and the recommendation text and control text are concatenated with the generated replacement text to obtain the processed replacement text; then, the processed replacement text is used to replace a text block in the thought chain statement.
[0154] Referring to Figure 6, which is a schematic diagram of an adjustment to the thought chain statement in an embodiment of this application, as shown in Figure 6, assuming that the currently processed text block is text block 1, when performing text block processing on text block 1, the following are generated: replacement text 1, recommended text 1, knowledge text 1 (associated insertion position: after the text block), knowledge text 2 (associated insertion position: after the thought chain statement), and control text generated corresponding to multimodal data. Therefore, during the operation on text block 1, when adjusting the thought chain statement, the concatenation result of replacement text 1, recommended text 1, control text, and knowledge text 1 can be used to replace text block 1, and knowledge text 2 can be added to the end of the thought chain statement.
[0155] In this way, each time an operation is performed on a text block, if a statement is generated during the operation, an adjustment operation can be performed on the thought chain statement, so that the content of the text block in the thought chain statement can be adjusted based on the regenerated statement.
[0156] Similarly, the processing device can perform text block processing on each text block in the thought chain statement separately until all text blocks in the thought chain statement have been processed, and the processed thought chain statement is obtained.
[0157] Step 204: The processing device uses a preset large model to generate the response text to the question text based on the processed thought chain statements.
[0158] In some feasible embodiments of this application, after the processing device obtains the processed thought chain statement, it can use a preset large model to generate the response text to the question text based on the processed thought chain statement.
[0159] In other feasible embodiments of this application, after the processing device obtains the processed thought chain statement, it can use a preset large model to generate the response text to the question text based on the processed thought chain statement and the question text.
[0160] This application does not impose specific restrictions on the types of large models that can be selected.
[0161] Specifically, if the processed thought chain statement contains control text, it means that the response text output by the large model has reserved embedding positions for multimodal data. In this case, after generating the response text, the processing device adds at least one corresponding multimodal data to at least one of the reserved embedding positions for multimodal data in the response text to obtain the processed comprehensive data. Then, the comprehensive data is displayed to the target object that sent the question text.
[0162] It should be noted that the reason for having at least one embedding position in the response text is that multimodal data may be generated for each text block. Therefore, from an overall perspective, it may be necessary to reserve multiple embedding positions for multimodal data.
[0163] In this way, in the context of generating large models, the data presented to the target object is no longer limited to text content, but can also present multimodal data, which greatly improves the diversity of content generated by large models.
[0164] The following section explains the core components included in the processing equipment from the perspective of its internal functions.
[0165] Referring to Figure 7, which is a schematic diagram of the internal composition of the processing device in this embodiment, as shown in Figure 7, the internal components of the processing device include: an input content receiving component, a thought chain statement parsing engine, an agent collaboration component, a dynamic semantic routing component, a hybrid generation control component, and a large model result output component; wherein,
[0166] Input content receiving component: Used to receive the question text input by the target object.
[0167] The thought chain statement parsing engine includes real-time block processing, as well as state extraction and encoding. Real-time block processing refers to the real-time segmentation of the thought chain text stream (or thought chain statement) according to logical units (such as reasoning steps and sub-problem conclusions) during the model reasoning process, generating text blocks that can be processed independently. State extraction and encoding refers to the feature encoding of the segmented thought chain fragments (i.e., text blocks), thereby transforming them into high-dimensional semantic representations (i.e., text features).
[0168] The dynamic semantic routing component includes features anchor library maintenance and feature similarity matching. Features anchor library maintenance refers to extracting features from the functional description text for each matchable agent, thereby forming the feature anchors corresponding to each agent. Feature similarity matching refers to quickly determining the agents that match the text blocks based on efficient retrieval algorithms. The thresholds for measuring feature similarity (such as data thresholds) can be dynamically adjusted according to actual processing needs.
[0169] The agent collaboration component includes plug-and-play agents and a priority scheduling mechanism. The plug-and-play agent pool supports the access of diverse agents, including those with functions such as knowledge retrieval, data analysis, and domain expertise. Each agent can independently process input and return structured results. The priority scheduling mechanism can trigger priorities based on defined agents to resolve conflicts between multiple agents.
[0170] Hybrid generation control component: Its internal functions include multi-source result fusion and agent selection process optimization; multi-source result fusion refers to merging statements generated by various agents to ensure that the generated content is both general and professional; agent selection process optimization refers to adjusting the various thresholds used when evaluating feature similarity, wherein the various thresholds involved can be any one or a combination of the recommendation threshold, functional threshold, and data threshold mentioned above.
[0171] Thus, the technical solution proposed in this application enables efficient collaboration between a large language model (or large model) and external intelligent agents. Leveraging the features of dynamically added intelligent agents and the "bus"-based processing surrounding thought chain statements, the reasoning process of the large model can be transformed into a programmable and controllable modular system. Furthermore, when the reasoning model and the large model controlling generation are a single model, by real-time parsing of thought chain statements generated within the large model based on thought chain technology, dynamically triggering pre-configured intelligent agents according to feature similarity, and integrating the outputs of intelligent agents matching multiple aspects, the accuracy and professionalism of the generated results can be enhanced.
[0172] The following section, with reference to the accompanying diagrams and using a specific application scenario as an example, explains the generation and control process of the large model:
[0173] Assuming the reasoning model and the preset large model are the same model, and that it can generate thought chain statements and response text in deep thinking mode, and directly generate response text in normal thinking mode.
[0174] Referring to Figure 8, which is a schematic diagram of the generation control process of the large model in this embodiment, it can be seen from the generation control process shown in Figure 8 that the processing device first obtains the question text input by the user; then, it obtains the thought chain statements generated based on the question text in the deep thinking mode of the large model; then, it performs real-time block parsing on the thought chain statements to determine the text blocks included in the thought chain statements; and then it performs text vectorization processing on each text block to obtain the text features of each text block.
[0175] Furthermore, in the feature anchor point library of various agents, the anchor point features matched for each text block are determined, as well as the agents corresponding to the matched anchor point features are determined. Taking the processing of a text block as an example, assuming that the matched feature anchor points are functional feature 1 and descriptive feature 1, the agents corresponding to the two feature anchor points can be determined in the agent pool that can be configured and updated in real time. Then, each matched agent can be used to output content based on a text block, and the thought chain statement can be adjusted based on the output results of each agent.
[0176] Furthermore, the processing device can employ a large model to generate response text based on the processed thought chain statements in a normal thinking mode where no thought chain statements are required. In particular, depending on the actual processing needs, in the case of generating multimodal data, the response text and multimodal data can be fused to obtain comprehensive data.
[0177] Referring to Figure 9, which is a schematic diagram of the process of determining the matching agent in an embodiment of this application, as shown in Figure 9, the feature anchor library includes features extracted for different types of agents. The feature anchors in the feature anchor library include: descriptive features extracted for each agent that implements the content recommendation function, agent features extracted for each agent that implements each type of knowledge generation function, identifier features extracted for each agent that implements the multimodal feature generation function, and functional features extracted for each agent that implements the same domain content generation function.
[0178] Continuing with the explanation in Figure 9, it can be seen that in the feature space, the influence range of each feature anchor point can be understood as a circle. After a text feature triggers the influence range of a feature anchor point, it is equivalent to matching a corresponding agent in terms of feature similarity. For example, the feature similarity between the agent corresponding to text block i and the descriptive feature q meets the requirements. Furthermore, after the agent selection is completed, the configured agent can be triggered to process the text, enabling the agent to generate sentences based on specific thinking logic and integrate the generated sentences into the thought chain statements. Each feature anchor point in the feature anchor point library corresponds one-to-one with each agent in the agent pool.
[0179] In this way, by leveraging various intelligent agents, a single model can possess both breadth and depth of domain knowledge. This also allows the thought process of large models to be adjusted through intelligent agents, avoiding the problem of overly chaotic thinking in large models due to the "black box" of thought.
[0180] Furthermore, the technical solution proposed in this application considers that large models often encounter situations where, under deep thinking mode, the content obtained through deep thinking cannot be found using the existing search methods of the large model. By utilizing the technical solution proposed in this application, the processing device can asynchronously employ an intelligent agent to process the thinking results of the large model, thereby achieving knowledge completion. This significantly reduces knowledge illusions and corpus contamination in large models, achieving good generation results even in areas where previous large model processing performance was poor, thus improving the overall accuracy of the model.
[0181] Furthermore, by adopting the technical solution proposed in this application, the intelligent agents that can be used when modifying thought chain statements can be adjusted through a real-time updated feature anchor point library, thereby indirectly modifying the associative content of the large model. For example, if advertisers want to place user-buying ads for a specific game, traditional large models cannot effectively embed game-related content, and adding game-related promotional copy through templates will also affect the user's original question text due to template pollution. However, by adopting the thought chain statement adjustment method proposed in this application, the model's ability to understand question text and advertising push can be improved, reducing the possibility of advertising content replacing user input. At the same time, by constructing a feature anchor point library and supporting it with an intelligent agent pool, this application enables the processing device to dynamically configure the intelligent agents contained in the intelligent agent pool during the operation of the large model, thereby achieving hot updates of intelligent agents, enabling them to be activated and deactivated in real time, without affecting the user experience. Specifically, for trending issues, there's no need to configure separate text filters or make compliance tweaks to the large model. Only the corresponding compliance agent needs to be configured to generate content-compliant statements. By adjusting the thought chain statements based on these generated statements, the output of the large model can meet the expectations of the platform and developers without intruding on the model itself, thus improving the output value and ensuring accuracy. A compliance agent is an intelligent agent that can generate content-compliant statements based on specific compliance requirements. In this application, for trending issues, there's no need to configure separate text filters or make compliance tweaks to the large model. Only the corresponding compliance agent needs to be configured to generate compliant statements. Adjusting the thought chain statements based on these statements ensures that the output of the large model meets the expectations of the platform and developers, guaranteeing the accuracy and compliance of the large model's output.
[0182] Referring to Figure 10, which is a schematic diagram of the result after adjusting the thought chain statement in the embodiment of this application, as shown in Figure 10, assuming the target object's question text is "What should I pay attention to when traveling to City A at the end of April", then the thought chain statement of the large model in deep thinking mode can be obtained. Furthermore, by adopting the processing method claimed in this application, after adjustment, the adjusted thought chain statement shown in Figure 10 can be obtained. Compared to the initially obtained thought chain statement, knowledge text is added to text block 1, text block 3 is replaced with replacement text to correct errors in text block 3, and knowledge text is added at the end of the thought chain statement to increase restrictions on the output format and content. The tags for knowledge text, recommended text, etc., in the processed thought chain statement are only illustrative descriptions to enhance readability and do not need to be marked during the actual generation process.
[0183] Moreover, taking scenic area tourism as an example, by associating specific scenic areas with performance activities in the corresponding smart agents, the system can link to the backend configuration when relevant scenic areas are involved.
[0184] This allows for adjustments to thought chain statements without the target audience's awareness, significantly improving the accuracy of the large-scale model's generated results. Furthermore, depending on actual processing needs, the final comprehensive data displayed to the target audience may include images, links, and other content, enabling targeted content delivery and improving advertising effectiveness. Additionally, the processed thought chain statements provide the ability to control generation outside the large model. By dynamically using various intelligent agents to adjust the model's associative content, the processed thought chain statements are obtained, ensuring the final quality of the large model's generation. Moreover, this opens up possibilities for large-scale deployment of AI large-scale models combined with advertising. Based on thought chain statements and aided by intelligent agent functions, traditional large-scale models can achieve more dynamic and richer model capabilities. Furthermore, processing devices can adjust the direction and results of large-scale model generation in real time according to actual processing needs, broadening business prospects.
[0185] In summary, this application proposes a generation control method based on the thought chain of a large language model. It determines agents for processing different text blocks based on text features and effectively integrates the output of the matched agents with the thought chain statements of the large model to obtain adjusted thought chain statements. Specifically, each agent of the large language model is assigned a specific feature. When the text features of a text block are close to this feature, the agent is triggered. Furthermore, the thought chain statements during deep thinking in the large model are detected in real time. Based on these thought chain statements, feature similarity matching is performed on each text block obtained from real-time segmentation to determine if an agent can be matched. The output of the matched agent is then integrated with the thought chain statements to obtain the processed thought chain statements. This enables dynamic programmability of the large model, improves the interpretability of the generated results, and significantly enhances the accuracy and customizability of the model's conclusions.
[0186] Furthermore, this application employs an engineering approach, embedding real-time editable thought processes into different thought content (i.e., different text blocks). Real-time editability is reflected in the plug-and-play nature of the intelligent agents, allowing for flexible addition of available agents. For a single text block, a matching intelligent agent can execute a specific thought process to generate a statement. By supplementing the generated statement into the thought chain, adjustments to the thought chain can be achieved. For the platform or user, only specific task-specific agents need to be set up to solve the task. Simultaneously, since most data injection and generation can be observed within the thought chain, the model's knowledge illusion is largely avoided, and desired content or specific results can be implanted into the thought chain without affecting the input.
[0187] Therefore, this application abstracts the internal reasoning process of a large model into a "bus"-like data flow, which yields thought chain statements. Moreover, by adjusting the thought chain statements, it can break through the black box limitations of traditional end-to-end generation, enhance the controllability of the model, and support key scenarios such as manual correction (e.g., detecting logical errors) and compliance review (e.g., content filtering) in feasible implementation methods. Furthermore, by replacing hard-coded rules with feature similarity, flexible matching and triggering of agents can be achieved, making it adaptable to complex tasks in open domains and achieving excellent generation results in various generation tasks. For example, it can automatically call data analysis toolchains during report analysis, thereby reducing the cost of domain migration. Only feature anchors need to be updated to quickly adapt to new scenarios, such as migrating from medical consultation to legal consultation, or from development assistance to advertising. In addition, by dynamically integrating the general capabilities of large models with the domain expertise of agents, the breadth and accuracy of generated content can be balanced, solving problems such as knowledge lag in traditional RAG and bloated hybrid expert models. While ensuring real-time performance, the professionalism of the content is improved, realizing a leap from single output to collaborative enhancement. Moreover, thanks to the scalability of agents, processing devices can support hot-swapping and distributed deployment of agents, and the capability boundaries can be dynamically expanded according to needs. This enables cross-departmental collaboration in the processing of complex enterprise-level systems, thereby achieving content generation control with a flexible processing architecture.
[0188] Based on the same inventive concept, referring to Figure 11, which is a schematic diagram of the logical structure of the large model generation control device in an embodiment of this application, the large model generation control device 1100 includes an acquisition unit 1101, a first generation unit 1102, an execution unit 1103, and a second generation unit 1104, wherein,
[0189] Acquisition unit 1101 is used to acquire the question text to be processed;
[0190] The first generation unit 1102 is used to generate thought chain statements based on the question text using a preset reasoning model;
[0191] Execution unit 1103 is used to process each text block in the thought chain statement to obtain the processed thought chain statement; the text block processing includes: when there is a functional feature in the preset functional feature set that satisfies the feature similarity condition with the text feature of a text block, the agent corresponding to the functional feature is used to generate replacement text based on the text block; wherein, the functional feature set includes: the functional features of each agent that implements the function of generating content in the same domain; and the replacement text is used to replace the text block in the thought chain statement.
[0192] The second generation unit 1104 is used to generate the response text to the question text based on the processed thought chain statement using a preset large model.
[0193] Optionally, for a text block obtained by splitting the thought chain statement, before replacing a text block in the thought chain statement with replacement text during text block processing, execution unit 1103 is also used to perform any one or a combination of the following generation operations:
[0194] Among the agents that implement the content recommendation function, the agent that meets the feature matching condition with a text block generates recommended text based on the text block;
[0195] Each agent that performs each knowledge acquisition function is selected from those agents that meet the feature selection criteria with a text block. Based on a text block, knowledge text with an insertion position is generated.
[0196] Among the agents that implement multimodal data generation, the agent that satisfies the feature matching condition with a text block generates associated multimodal data based on a text block.
[0197] Optionally, the generated content may also include recommendation text, at least one knowledge text, and multimodal data; when replacing a text block in a thought chain statement with replacement text, execution unit 1103 is used to:
[0198] Based on multimodal data, control text is generated; the control text is used to indicate the embedding position of multimodal data in the output results of the large model.
[0199] In the thought chain statement, insert the corresponding knowledge text according to the insertion position, and concatenate the recommended text and control text with the replacement text to obtain the processed replacement text;
[0200] Replace a block of text in the thought chain statement with the processed replacement text.
[0201] Optionally, after generating the corresponding response text, the execution unit 1103 is further configured to:
[0202] In the response text, at least one corresponding multimodal data point is added to at least one reserved embedding position for multimodal data to obtain the processed composite data;
[0203] Display comprehensive data to the target audience who sent the question text.
[0204] Optionally, among the agents implementing the content recommendation function, when an agent that satisfies the feature matching condition with a text block generates recommended text based on a text block, the execution unit is used to:
[0205] The feature similarity between each descriptive feature in the feature set and the text features of a text block is calculated. Agents whose corresponding feature similarity reaches a preset recommendation threshold and whose associated priority information meets the preset matching conditions are identified as agents that meet the feature matching conditions. The descriptive feature set includes: the descriptive features of each agent that implements the content recommendation function; and a pre-configured priority information to indicate the degree of reference for the output results of an agent.
[0206] The selected agent generates recommended text based on a text block.
[0207] Optionally, when the agent that implements each knowledge acquisition function satisfies the feature selection condition with a text block, and generates knowledge text associated with an insertion position based on a text block, the execution unit 1103 is used to:
[0208] For each type of knowledge acquisition function and its corresponding agent feature set, perform the following operations:
[0209] Calculate the feature similarity between each agent feature in an agent feature set and the text features of a text block. Agents whose corresponding feature similarity reaches a preset functional threshold and whose associated priority information meets preset filtering conditions are considered to meet the feature filtering conditions. An agent feature set includes: the agent features of each agent that implements a type of knowledge acquisition function.
[0210] Using the selected agents, knowledge text with associated insertion positions is generated based on a text block.
[0211] Optionally, when an agent among the agents implementing the multimodal data generation function that satisfies the feature matching condition with a text block generates associated multimodal data based on a text block, the execution unit 1103 is used to:
[0212] Calculate the feature similarity between each identifier feature in the identifier feature set and the text features of a text block. Then, identify the agents whose corresponding feature similarity reaches a preset data threshold and whose associated priority information meets the preset hit conditions as agents that meet the feature hit conditions. The identifier feature set includes the identifier features of each agent that implements the multimodal data generation function.
[0213] Using the selected agents, multimodal data is generated based on a text block.
[0214] Optionally, the device also includes a building unit 1105, which is further configured to:
[0215] The functional feature set is constructed in the following way: the trained text feature extraction network is used to extract functional features based on the functional description text of each agent to obtain the functional feature set;
[0216] When a descriptive feature set is constructed for each agent that implements the content recommendation function, the descriptive feature set is constructed in the following way: a text feature extraction network is used to extract descriptive features based on the functional description text of each agent to obtain the descriptive feature set.
[0217] When constructing agent feature sets for each agent that performs each knowledge acquisition function, the following method is used to construct each agent feature set: using a text feature extraction network, based on the functional description text of each agent, agent features are extracted to obtain agent feature sets;
[0218] When an identification feature set is constructed for each agent that performs multimodal data generation, the identification feature set is constructed in the following way: a text feature extraction network is used to extract identification features based on the functional description text of each agent to obtain the identification feature set.
[0219] Optionally, building unit 1105 is also used for:
[0220] In response to a content removal instruction triggered for a target feature set, at least one target feature matching the content removal instruction is deleted from the target feature set; and,
[0221] In response to a content addition instruction triggered for a target feature set, for a candidate agent to be added to the database, the corresponding functional description text is obtained, and the target features extracted by the trained text feature extraction network based on the functional description text are added to the target feature set; wherein, the target feature set is at least one of the description feature set, the functional feature set, the feature sets of each agent, and the identifier feature set.
[0222] Optionally, the functional features that satisfy the feature similarity condition with the text features of a text block are determined by the execution unit 1103 in the following manner:
[0223] Calculate the feature similarity between each functional feature in the feature set and the text features of a text block;
[0224] When there is a functional feature whose corresponding feature similarity reaches the preset data threshold and whose associated priority information meets the preset filtering conditions, it is determined that there is a functional feature that meets the feature similarity condition with the text feature, and the agent corresponding to the functional feature is taken as the agent that meets the feature similarity condition.
[0225] Optionally, each text block is obtained by the execution unit 1103 by splitting it using any of the following methods:
[0226] In the thought chain statement, the statement content is split based on preset identifiers to obtain each text block separated by the identifiers;
[0227] In the thought chain statement, the statement content is split based on preset statement keywords to obtain each text block starting with the statement keyword.
[0228] Optionally, after generating the thought chain statement, before performing text block processing on each text block obtained by splitting the thought chain statement, the execution unit 1103 is also used for:
[0229] Based on the thought chain statement, the text blocks are obtained by splitting it;
[0230] Using a preset text feature extraction method, corresponding text features are extracted for each text block.
[0231] For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, in implementing this application, the functions of each module (or unit) can be implemented in one or more software or hardware components.
[0232] Having introduced the method and apparatus for generating and controlling large models according to exemplary embodiments of this application, we will now introduce an electronic device according to another exemplary embodiment of this application.
[0233] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."
[0234] Based on the same inventive concept as the above-described method embodiments, this application also provides an electronic device. Referring to Figure 12, which is a schematic diagram of the hardware structure of an electronic device applying an embodiment of this application, in one embodiment, the electronic device may be the processing device 120 shown in Figure 1. In this embodiment, the structure of the electronic device may be as shown in Figure 12, including a memory 1201, a communication module 1203, and one or more processors 1202.
[0235] The memory 1201 is used to store computer programs executed by the processor 1202. The memory 1201 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0236] Memory 1201 may be volatile memory, such as random-access memory (RAM); memory 1201 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 1201 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1201 may be a combination of the above-described memories.
[0237] Processor 1202 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 1202 is used to implement the above-described large model generation control method when calling the computer program stored in memory 1201.
[0238] The communication module 1203 is used to communicate with client devices and servers.
[0239] This application embodiment does not limit the specific connection medium between the memory 1201, communication module 1203, and processor 1202. In Figure 12, the memory 1201 and processor 1202 are connected via a bus 1204, which is depicted as a thick line. The connection methods between other components are merely illustrative and not intended to be limiting. The bus 1204 can be an address bus, data bus, control bus, etc. For ease of description, only one thick line is used in Figure 12, but this does not imply that there is only one bus or one type of bus.
[0240] The memory 1201 stores a computer storage medium containing computer-executable instructions for implementing the large model generation control method of this application embodiment. The processor 1202 executes the above-described large model generation control method, as shown in FIG2.
[0241] In another embodiment, the electronic device can also be other electronic devices. Referring to Figure 13, which is a schematic diagram of the hardware composition structure of another electronic device applying the embodiments of this application, the electronic device can specifically be the client device 110 shown in Figure 1. In this embodiment, the structure of the electronic device can be as shown in Figure 13, including: a communication component 1310, a memory 1320, a display unit 1330, a camera 1340, a sensor 1350, an audio circuit 1360, a Bluetooth module 1370, a processor 1380, and other components.
[0242] The communication component 1310 is used to communicate with the server. In some embodiments, it may include a Circuit-Wireless Fidelity (WiFi) module, which is a short-range wireless transmission technology. Electronic devices can use the WiFi module to help users send and receive information.
[0243] The memory 1320 can be used to store software programs and data. The processor 1380 executes various functions of the client device 110 and performs data processing by running the software programs or data stored in the memory 1320. In this application, the memory 1320 can store the operating system and various application programs, and can also store computer programs related to the generation control method of the large model in the embodiments of this application.
[0244] The display unit 1330 can also be used to display information input by the user or information provided to the user, as well as various menus of the client device 110, in a graphical user interface (GUI). Specifically, the display unit 1330 may include a display screen 1332 disposed on the front of the client device 110. The display unit 1330 can be used to display pages, etc.
[0245] The display unit 1330 can also be used to receive input digital or character information and generate signal inputs related to user settings and function control of the client device 110. Specifically, the display unit 1330 may include a touch screen 1331 disposed on the front of the client device 110, which can collect touch operations of the user on or near it.
[0246] The touchscreen 1331 can be placed over the display screen 1332, or the touchscreen 1331 and the display screen 1332 can be integrated to realize the input and output functions of the client device 110. After integration, it can be referred to as a touch display screen. In this application, the display unit 1330 can display the application program and the corresponding operation steps.
[0247] Camera 1340 can be used to capture still images, which users can then post comments on via an application. An object is projected onto a photosensitive element through a lens, generating an optical image. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to processor 1380 for conversion into a digital image signal.
[0248] The client device may also include at least one sensor 1350, such as an accelerometer 1351, a proximity sensor 1352, a fingerprint sensor 1353, and a temperature sensor 1354. The client device may also be configured with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, and motion sensor.
[0249] Audio circuitry 1360, speaker 1361, and microphone 1362 provide an audio interface between the user and client device 110. Audio circuitry 1360 converts received audio data into electrical signals and transmits them to speaker 1361, where speaker 1361 converts them into sound signals for output. Conversely, microphone 1362 converts collected sound signals into electrical signals, which are then received by audio circuitry 1360, converted back into audio data, and output to communication component 1310 for transmission to, for example, another client device 110, or to memory 1320 for further processing.
[0250] The Bluetooth module 1370 is used to exchange information with other Bluetooth devices that have Bluetooth modules via the Bluetooth protocol.
[0251] The processor 1380 is the control center of the client device, connecting various parts of the terminal via various interfaces and lines. It executes software programs stored in the memory 1320 and calls data stored in the memory 1320 to perform various functions and process data for the client device. In some embodiments, the processor 1380 may include at least one processing unit; the processor 1380 may also integrate an application processor and a baseband processor. In this application, the processor 1380 can run an operating system, applications, user interface display and touch response, and methods related to the generation and control of large models in the embodiments of this application. Furthermore, the processor 1380 is coupled to the display unit 1330.
[0252] In some possible implementations, various aspects of the large model generation control method provided in this application can also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to cause the electronic device to perform the steps in the large model generation control method according to various exemplary embodiments of this application described above. For example, the electronic device can perform the steps shown in FIG2.
[0253] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0254] The program product of the embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include a computer program, and may run on an electronic device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with a command execution system, apparatus, or device.
[0255] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a readable computer program. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with a command execution system, apparatus, or device.
[0256] Computer programs contained on readable media may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0257] Computer programs for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The computer program can execute entirely on the user's electronic device, partially on the user's electronic device, as a standalone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user's electronic device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external electronic device (e.g., via the Internet using an Internet service provider).
[0258] In summary, this application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating and controlling large-scale models. After acquiring the question text to be processed, the electronic device uses a preset reasoning model to generate thought chain statements based on the question text. During this process, the reasoning model, based on its own reasoning ability and thought chain technology, decomposes complex problems into logical steps, obtaining the reasoning process and task analysis results, providing a structured basis for subsequent processing. The thought chain statements are broken down into text blocks. When a preset set of functional features contains a feature that satisfies the feature similarity condition to the text block, the corresponding intelligent agent generates a replacement text based on the text block and replaces that text block in the thought chain statement. The intelligent agent generates accurate and reasonable replacement text through semantic analysis, syntax checking, and other operations, which can promptly correct logical errors in the thought chain statements, reduce the influence of semantic pollution, knowledge illusions, and other problems on reasoning, and improve the accuracy and reliability of reasoning. Finally, the preset large-scale model generates the response text to the question text based on the processed thought chain statements, breaking through the black-box limitation of traditional large-scale model reasoning, fundamentally realizing the generation control of large-scale models, ensuring the accuracy of model generation results, and improving the generation efficiency of large-scale models.
[0259] Furthermore, before replacing text blocks in the thought chain statements with replacement text, the text block processing performs multiple generation operations, including using agents that implement content recommendation, knowledge acquisition, and multimodal data generation functions to generate recommended text, knowledge text, and multimodal data, respectively. From a technical perspective, the agent for content recommendation generates recommended text based on text blocks. By analyzing information such as the topic and keywords of the text blocks, and combining recommendation algorithms and databases to filter matching recommended text, it increases the information richness and relevance of the text blocks, providing more reference information for large-scale model generation. The agent for knowledge acquisition acquires knowledge content matching the text blocks from different knowledge dimensions, such as real-time knowledge search, formula calculation knowledge acquisition, and database knowledge search generation, providing more comprehensive and accurate knowledge support for large-scale models and improving their professional knowledge processing capabilities. The agent for multimodal data generation generates multimodal data based on text blocks, such as images, videos, and audio, enriching the content presentation and making the content generated by the large-scale model more diverse and intuitive, thus enhancing the effectiveness of information expression.
[0260] When the generated content includes recommendation text, knowledge text, and multimodal data, control text is generated based on the multimodal data. This control text instructs the large model to reserve embedding positions in the output, and then the recommendation text, control text, and replacement text are concatenated to replace the text blocks in the thought chain statement. This operation achieves the fusion of multiple types of data, making the thought chain statement contain richer information, improving the large model's ability to process different types of data, and enhancing the comprehensiveness and accuracy of the generated results.
[0261] After generating the response text, multimodal data is added to the pre-defined multimodal data embedding locations within the response text and displayed to the target audience. From a technical perspective, this increases the diversity of content generated by the large model, making information presentation more comprehensive and intuitive, improving users' efficiency in receiving and understanding information, and also enhancing the large model's capabilities in multimodal data processing.
[0262] When generating recommended text using agents that perform content recommendation functions, agents that meet the criteria are selected by calculating the similarity between the descriptive feature set and the text features of the text block. This feature similarity-based selection method improves the accuracy and relevance of recommendations, making the recommended text more closely match the theme and needs of the text block. It also helps large models better integrate relevant information when generating content, thereby improving the quality of the generated content.
[0263] When generating knowledge text using agents that perform knowledge acquisition functions, the similarity between the agent features and the text block features is calculated for the agent feature sets corresponding to various knowledge acquisition functions. Agents that meet the criteria are selected to generate knowledge text with associated insertion positions. Different types of knowledge acquisition agents acquire knowledge from different dimensions. For example, a real-time knowledge search agent acquires real-time knowledge through an application programming interface (API), a formula calculation agent obtains calculation results using pre-built calculation program formulas, and a database knowledge search agent searches for relevant knowledge in a database. These operations enrich the knowledge sources, providing more comprehensive and accurate knowledge support for large models, improving the knowledge processing capabilities of large models and the professionalism of the generated results.
[0264] When generating multimodal data using agents capable of multimodal data generation, agents that meet certain criteria are selected by calculating the similarity between the identifier feature set and the text features of the text blocks. This selection method ensures the relevance of the generated multimodal data to the text blocks, improves the quality and relevance of the generated multimodal data, enriches the presentation of content generated by large models, and enhances the effectiveness of information expression.
[0265] The functional feature set, description feature set, agent feature set, and identifier feature set are all obtained by extracting features from the functional description text of each agent using a trained text feature extraction network. The unified text feature extraction network ensures that all features reside in the same vector space, facilitating feature similarity comparisons and improving the accuracy and efficiency of agent matching. This enables the system to more accurately find suitable agents for processing text blocks, thus enhancing the overall system processing performance.
[0266] This method updates the target feature set, with response content removal indicating the deletion of target features and response content addition indicating the addition of target features. This update mechanism ensures the reliability and timeliness of the content in the target feature set, enabling the system to adjust the available agents in real time to adapt to different processing needs, improving the system's flexibility and adaptability, and enhancing its dynamic processing capabilities.
[0267] When identifying functional features that satisfy the feature similarity condition with the text features of a text block, the similarity between the functional feature set and the text features of the text block is calculated, and priority information is used to select agents that meet the conditions. This selection method based on feature similarity and priority information resolves the competition conflict between multiple agents, improves the efficiency and processing effect of agents, ensures that the most suitable agent for text block processing is selected from among many agents, and improves the processing quality of the system.
[0268] Each text block is obtained by splitting thought chain statements based on preset identifiers or statement keywords. This splitting method can achieve real-time segmentation of thought chain statements generated by the reasoning model, resulting in independently processable text blocks. Real-time block processing improves processing efficiency, enabling the system to perform targeted processing on each text block. At the same time, state extraction and encoding transform the segmented text blocks into high-dimensional semantic representations, facilitating subsequent feature similarity matching and agent selection, thereby improving the system's processing accuracy.
[0269] After generating the thought chain statements, text features are extracted from each of the split text blocks using a preset text feature extraction method. By encoding the features of each text block, a high-dimensional feature representation corresponding to each text block is obtained, providing effective data support for subsequent feature similarity comparison and agent matching. This improves the accuracy and efficiency of agent matching, enabling the system to more accurately select the appropriate agent to process the text block, and enhancing the effect of large model generation control.
[0270] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0271] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0272] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing a computer-usable computer program.
[0273] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0274] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0275] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for generating and controlling a large model, executed by an electronic device, comprising: Get the question text to be processed; Using a pre-defined reasoning model, thought chain statements are generated based on the question text; Each text block in the thought chain statement is processed separately to obtain the processed thought chain statement; the text block processing includes: when there is a functional feature in the preset functional feature set that satisfies the feature similarity condition with the text feature of a text block, the agent corresponding to the functional feature is used to generate replacement text based on the text block; wherein, the functional feature set includes: the functional features of each agent that implements the function of generating content in the same domain; and the replacement text is used to replace the text block in the thought chain statement; and Using a pre-defined large model, and based on the processed thought chain statements, the response text to the question text is generated.
2. The method of claim 1, wherein before replacing the text block in the thought chain statement with the replacement text, the text block processing further includes a generation operation of any one or more of the following combinations: Among the various agents that implement the content recommendation function, the agent that meets the feature matching condition with the text block generates recommended text based on the text block; Each agent that performs each knowledge acquisition function is selected from those that meet the feature selection criteria with respect to the text block. Based on the text block, knowledge text with an insertion position is generated. Among the agents that implement multimodal data generation, the agent that satisfies the feature matching condition with the text block generates associated multimodal data based on the text block.
3. The method as described in claim 2, wherein the content generated by the generation operation includes recommended text, at least one knowledge text, and multimodal data, and the step of replacing the text block in the thought chain statement with the replacement text includes: Based on the multimodal data, control text is generated; wherein, the control text is used to indicate the embedding position of the multimodal data in the output result of the large model; In the thought chain statement, the corresponding knowledge text is inserted according to the insertion position, and the recommended text and the control text are concatenated with the replacement text to obtain the processed replacement text; The processed replacement text is used to replace one of the text blocks in the thought chain statement.
4. The method of claim 3, further comprising: In the response text, at least one corresponding multimodal data point is added to at least one reserved embedding position for multimodal data to obtain the processed composite data; The comprehensive data is displayed to the target object that sent the question text.
5. The method according to any one of claims 2 to 4, wherein the agent among the agents implementing the content recommendation function that satisfies the feature matching condition with the text block generates recommended text based on the text block, comprising: The feature similarity between each descriptive feature in the feature set and the text features of the text block is calculated. Agents whose corresponding feature similarity reaches a preset recommendation threshold and whose associated priority information meets preset matching conditions are identified as agents that meet the feature matching conditions. The feature set includes: the descriptive features of each agent that implements the content recommendation function; and a pre-configured priority information to indicate the degree of reference for the output result of an agent. Using the selected agent, recommended text is generated based on the selected text block.
6. The method according to any one of claims 2 to 5, wherein the step of employing agents that implement each knowledge acquisition function, and which agents satisfy feature selection conditions with respect to the text block, to generate knowledge text associated with the insertion position based on the text block, includes: For each type of knowledge acquisition function and its corresponding agent feature set, perform the following operations: Calculate the feature similarity between each feature in the feature set of an agent and the text features of the text block. Then, the agents whose corresponding feature similarity reaches a preset functional threshold and whose associated priority information meets the preset filtering conditions are identified as agents that meet the feature filtering conditions. An agent feature set includes: the individual agent features of each agent that implements a certain type of knowledge acquisition function; Using the selected agent, knowledge text with an associated insertion position is generated based on the text block.
7. The method according to any one of claims 2 to 6, wherein an agent among the agents implementing multimodal data generation functions that satisfies a feature-matching condition with the text block is used to generate associated multimodal data based on the text block, comprising: The feature similarity between each identifier feature in the identifier feature set and the text feature of the text block is calculated respectively. The agent whose corresponding feature similarity reaches a preset data threshold and whose associated priority information meets the preset hit condition is regarded as the agent that meets the feature hit condition. The identifier feature set includes the identifier features of each agent that implements the multimodal data generation function. Using the selected agent, multimodal data is generated based on the text block.
8. The method according to any one of claims 1-7, wherein the functional feature set is constructed in the following manner: The trained text feature extraction network is used to extract functional features based on the functional description text of each agent, resulting in a functional feature set. When a descriptive feature set is constructed for each agent implementing the content recommendation function, the descriptive feature set is constructed in the following manner: Using the aforementioned text feature extraction network, descriptive features are extracted from the functional description text of each corresponding agent to obtain a descriptive feature set; When constructing agent feature sets for each agent implementing each knowledge acquisition function, each agent feature set is constructed in the following manner: Using the aforementioned text feature extraction network, based on the functional description text of each agent, agent features are extracted to obtain agent feature sets; When an identifier feature set is constructed for each intelligent agent that implements the multimodal data generation function, the identifier feature set is constructed in the following manner: Using the text feature extraction network, identification features are extracted from the functional description text of each agent to obtain an identification feature set.
9. The method of claim 8, further comprising: In response to a content removal instruction triggered for a target feature set, at least one target feature matching the content removal instruction is deleted from the target feature set; as well as, In response to a content addition instruction triggered for a target feature set, for a candidate agent to be added to the database, the corresponding functional description text is obtained, and the target features extracted by the trained text feature extraction network based on the functional description text are added to the target feature set; wherein, the target feature set is at least one of the description feature set, the functional feature set, the agent feature sets, and the identifier feature set.
10. The method according to any one of claims 1-9, wherein the functional feature that satisfies the feature similarity condition with the text features of a text block is determined in the following manner: Calculate the feature similarity between each functional feature in the feature set and the text features of the text block; When there is a functional feature whose corresponding feature similarity reaches a preset data threshold and whose associated priority information meets the preset filtering conditions, it is determined that there is a functional feature that meets the feature similarity condition with the text feature, and the agent corresponding to the functional feature is taken as the agent that meets the feature similarity condition.
11. The method as described in any one of claims 1-10, wherein each text block is obtained by splitting it using any of the following methods: In the thought chain statement, the statement content is split based on preset identifiers to obtain each text block separated by the identifiers; In the thought chain statement, the statement content is split based on preset statement keywords to obtain text blocks starting with the statement keywords.
12. The method according to any one of claims 1-11, wherein the method further comprises: Based on the aforementioned thought chain statement, each text block is obtained by splitting it; Using a preset text feature extraction method, corresponding text features are extracted for each text block.
13. A large model generation control device, comprising: The acquisition unit is used to acquire the question text to be processed; The first generation unit is used to generate thought chain statements based on the question text using a preset reasoning model; An execution unit is configured to process each text block in a thought chain statement to obtain a processed thought chain statement. The text block processing includes: when a preset set of functional features contains a feature that satisfies a feature similarity condition to the text features of a text block, the agent corresponding to that functional feature generates replacement text based on the text block; wherein the set of functional features includes the functional features of each agent that implements the function of generating content in the same domain; and the replacement text is used to replace the text block in the thought chain statement. The second generation unit is used to generate the response text to the question text based on the processed thought chain statements using a preset large model.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1-12.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-12.
16. A computer program product comprising a computer program that, when executed by a processor, implements the method as claimed in any one of claims 1-12.
