Large-scale data generation method, device and equipment
Patent Information
- Application Number
- CN202510370436.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-27
AI Technical Summary
Traditional data generation methods are difficult to meet the needs of high efficiency, strong goal orientation and result diversity at the same time, and the computing resource utilization rate is low, resulting in insufficient quality and efficiency of generated data.
LLM is used to extend user input text to generate candidate content, and dynamically adjust parameters and resource allocation through multi-dimensional evaluation and Monte Carlo search tree optimization strategy to form an asynchronous parallelization architecture to improve data generation efficiency and quality.
It realizes efficient, diverse and goal-oriented data generation, improves the efficiency and quality of data generation, is suitable for large-scale data generation tasks, and optimizes the utilization rate of computing resources.
Smart Images

Figure CN119883657A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device and equipment for generating large-scale data. Background Art
[0002] In the field of artificial intelligence and data generation technology, as the demand for data continues to grow, the limitations of traditional data generation methods have gradually become apparent. On the one hand, although large models such as GPT and Stable Diffusion can generate rich and diverse data, in actual applications, due to the lack of an effective goal-oriented mechanism, it is often necessary to manually adjust the prompt word (Prompt) repeatedly to obtain data that meets the requirements. This process is not only inefficient, but also difficult to ensure the stability of the quality of the generated data. On the other hand, the Monte Carlo search method (MCTS), as an algorithm for optimizing decision paths, can provide certain optimization effects in data generation tasks, but its computational complexity is high, and the calculation of a single node takes too long, which makes it difficult to meet the speed requirements of large-scale data generation tasks.
[0003] In actual data generation tasks, the efficiency of data generation, the diversity of results, and the precise orientation to the goal are three key requirements. However, existing data generation methods have obvious deficiencies in these three aspects. Some methods often ignore the diversity and goal orientation of data when pursuing high generation speed, resulting in the generated data being of considerable quantity but poor quality and practicality. While other methods emphasize the diversity of results, it is difficult to balance generation efficiency and goal orientation, making the data generation process too time-consuming and unable to meet the timeliness requirements in practical applications. In addition, some methods, in the process of realizing data generation, lack effective integration and optimization of resources, resulting in insufficient utilization of computing resources such as GPUs, which increases the cost of data generation. Summary of the invention
[0004] In view of this, the purpose of the present invention is to propose a method, device and equipment for generating large-scale data, aiming to solve the problems that traditional data generation methods cannot simultaneously meet the requirements of high efficiency, strong goal orientation and result diversity.
[0005] To achieve the above object, the present invention provides a method for generating large-scale data, the method comprising: LLM is used to expand the text to be processed input by the user to generate multiple candidate contents, wherein each candidate content is used as an expansion node; Through LLM, multi-dimensional evaluation and suggestion evaluation are performed on the candidate content corresponding to each of the extension nodes to obtain evaluation scores and optimization suggestions; Creating a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree; Based on the evaluation score and the optimization suggestion, a strategy optimization including selection, expansion, simulation and backtracking is performed on each of the extended subtrees to obtain large-scale data.
[0006] Preferably, the LLM is used to expand the text to be processed input by the user to generate multiple candidate contents, including: According to N threads = N cpu * (1+W / E) to calculate the initial number of threads, where N cpu Indicates the number of CPU logical cores, W / E indicates the ratio of task waiting time to computing time; The corresponding thread request LLM is called respectively according to the initial thread number, and the temperature parameter and the seed parameter are dynamically adjusted to expand the text to be processed, so as to obtain candidate contents corresponding to the plurality of expansion nodes.
[0007] Preferably, the performing of multi-dimensional evaluation on the candidate content corresponding to each of the extension nodes through LLM to obtain an evaluation score includes: Through LLM, a multi-dimensional evaluation is performed on the candidate content corresponding to each of the extension nodes according to the preset grammatical correctness, contextual rationality and domain relevance to obtain a grammatical evaluation result, a contextual evaluation result and a professional evaluation result; The grammar evaluation result, the context evaluation result and the professionalism evaluation result are weightedly summed to obtain the evaluation score.
[0008] Preferably, the performing of strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion comprises: By calculating the score of each child node of the expanded subtree, and selecting the child node with the highest score as the target expanded node; The optimization suggestion is used as a prompt and input into the LLM to expand the target expansion node, and generate content to be evaluated corresponding to multiple branch nodes; Through LLM, multi-dimensional evaluation and suggestion evaluation are performed on the content to be evaluated corresponding to each branch node to obtain the current evaluation score and the current optimization suggestion, wherein the current evaluation score is used to retroactively update the score of the child node, and the current optimization suggestion is used as a prompt for the next expansion.
[0009] Preferably, the step of calculating the score of each child node of the extended subtree comprises: The score of each child node is calculated according to UCB(S,a)=Q(S,a) / N(S,a)+C * sqrt(ln(N(S)) / N(S,a)); where Q(S,a) / N(S,a) represents the average reward obtained by taking action a from state S, C * sqrt(ln(N(S)) / N(S,a)) represents the exploration reward, C represents the exploration coefficient, Q represents the cumulative reward, and N represents the number of visits.
[0010] Preferably, the method further comprises: The subnodes expanded by the expanded subtree are monitored within a preset period. When the average reward of the subnode is lower than a preset value and the number of visits exceeds a preset number, the subnode is deleted and the resources corresponding to the subnode are released.
[0011] To achieve the above object, the present invention further provides a large-scale data generation device, the device comprising: An expansion unit, used to expand the text to be processed input by the user by using LLM to generate multiple candidate contents, wherein each candidate content serves as an expansion node; An evaluation unit, configured to perform multi-dimensional evaluation and suggestion evaluation on the candidate content corresponding to each of the extension nodes through LLM to obtain an evaluation score and optimization suggestions; A creating unit, used for creating a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree; The optimization unit is used to perform strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion to obtain large-scale data.
[0012] Preferably, the device further comprises: The monitoring unit is used to monitor the child nodes expanded by the expanded subtree within a preset period. When the average reward of the child node is lower than a preset value and the number of visits exceeds a preset number, the child node is deleted and the resources corresponding to the child node are released.
[0013] In order to achieve the above objectives, the present invention also proposes a large-scale data generation device, including a processor, a memory and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of a large-scale data generation method as described in the above embodiment.
[0014] In order to achieve the above objectives, the present invention also proposes a computer-readable storage medium, on which a computer program is stored. The computer program is executed by a processor to implement the steps of a large-scale data generation method as described in the above embodiment.
[0015] In order to achieve the above objectives, the present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of a method for generating large-scale data as described in the above embodiment.
[0016] Beneficial effects: The above scheme decouples expansion and evaluation by building an asynchronous parallel architecture, improves search efficiency by using multi-threading and queue mechanisms, forms a dynamic feedback loop and self-iteration by using the evaluation suggestions generated by LLM as the optimization prompt for the next round of expansion, continuously optimizes the generated results, and regards each expansion node as an independent MCTS subtree for parallel search, and finally merges all subtree paths to achieve global optimization, which not only ensures the diversity of results, but also finds the optimal generation path, and generates efficiency and quality through large-scale data. This case integrates LLM and Monte Carlo tree search to meet the requirements of data generation efficiency, goal orientation and diversity, improve data generation quality and efficiency, and is suitable for large-scale data generation tasks.
[0017] The number of threads is dynamically calculated based on the number of CPU cores and the ratio of task waiting time to computing time (W / E), which achieves reasonable allocation of thread resources, ensures efficient use of computing resources in different hardware environments, and improves the efficiency of expanding nodes. Dynamically adjust temperature parameters and seed parameters during the expansion process, which can further improve the generation speed and reduce resource consumption while ensuring the generation quality.
[0018] A multi-dimensional scoring mechanism is adopted to conduct weighted evaluation by integrating grammatical correctness, contextual rationality and domain relevance, comprehensively measuring the quality of candidate content and ensuring that the generated data meets the requirements in terms of grammar, logic and professionalism, providing a reliable basis for subsequent strategy optimization and improving the overall quality of generated data. The evaluation score is obtained by weighted summation, and the weight of each dimension can be flexibly adjusted according to actual needs, making the evaluation more targeted and scientific, further improving the accuracy and practicality of the evaluation results.
[0019] During the strategy optimization process, the target expansion node is selected by calculating the score of the child node, and the optimization suggestion is used as a prompt for expansion, thereby realizing self-optimization and improvement of the generation process, continuously adjusting the generation direction, and improving the accuracy and conformity of the generation results; multi-dimensional evaluation and suggestion evaluation are performed on the content of the newly generated branch node to further optimize the data generation process. At the same time, the current evaluation score is used to retroactively update the score of the child node, and the current optimization suggestion is used as a prompt for the next expansion, forming a closed-loop optimization mechanism to continuously improve the quality and diversity of generated data.
[0020] By using the UCB formula to calculate the sub-node scores, the average reward and exploration reward are comprehensively considered, and the exploration and utilization are balanced. When selecting the expansion nodes, both historical performance and potential exploration value are considered, which helps to discover better generation paths and avoid falling into local optimality, improves search efficiency and the quality of generated data, and enhances global search capabilities.
[0021] By real-time monitoring of pruning, inefficient branches are pruned, resource allocation is optimized, and computing resources are avoided from being wasted on invalid or inefficient paths, further improving the efficiency and quality of large-scale data generation and ensuring that resources can be concentrated on exploring effective paths. Thread resources released by pruning are automatically allocated to high-potential subtrees, achieving dynamic optimization of resource allocation, improving overall search efficiency, and accelerating the process of large-scale data generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A flowchart of a method for generating large-scale data provided by an embodiment of the present invention.
[0024] Figure 2 A schematic diagram of the overall process of large-scale data generation provided by an embodiment of the present invention.
[0025] Figure 3 A schematic diagram of the structure of a large-scale data generation device provided by an embodiment of the present invention.
[0026] The realization of the purpose, functional features and advantages of the invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0028] The content of the present invention is described in detail below with reference to embodiments.
[0029] Reference Figure 1 The figure is a flow chart of a method for generating large-scale data provided by an embodiment of the present invention.
[0030] In this embodiment, the method includes: S11, using LLM to expand the text to be processed input by the user to generate multiple candidate contents, wherein each candidate content serves as an expansion node.
[0031] Furthermore, in step S11, the LLM is used to expand the text to be processed input by the user to generate multiple candidate contents, including: S11-1, according to N threads = N cpu * (1+W / E) to calculate the initial number of threads, where N cpu Indicates the number of CPU logical cores, W / E indicates the ratio of task waiting time to computing time; S11-2, calling the corresponding thread request LLM respectively according to the initial number of threads, and dynamically adjusting the temperature parameter and the seed parameter to expand the text to be processed, so as to obtain candidate contents corresponding to the plurality of expansion nodes.
[0032] In this embodiment, the method can be applied to question-answer pairs with reasoning process to generate high-quality data for model training and fine-tuning. Figure 2 As shown, an expansion node task queue is created based on the input text to be processed, and the tasks of generating child nodes are given to multiple threads for asynchronous node expansion through LLM. Specifically, according to formula N threads =N cpu * (1+W / E) determines the initial number of threads, where N cpuIndicates the number of CPU logical cores, and W / E indicates the ratio of task waiting time to computing time. Assume that generating each node requires 50ms of computing time and 150ms of IO waiting time, and the CPU has 4 cores, then the initial number of threads = 4 * (1 + 150 / 50) = 16 threads.
[0033] LLM is used to generate K1 extension nodes in batches through prompt, and LLM reasoning is realized through asynchronous calls. Specifically, a queue for extension node tasks is declared, and the tasks of extension nodes are stored in this queue. Threads are called to request LLM to generate corresponding extension nodes; and the generated extension nodes are initialized, including: recording the parent node, the number of visits (N, initially 0, plus 1 for each visit), the cumulative reward (Q), the evaluation score (W), and the optimization suggestions. When calling LLM for reasoning, the generated results (K1 extension nodes) are made more diverse by dynamically adjusting the parameters. The dynamic adjustment parameters include: Temperature (temperature parameter), which changes periodically between 0.3-0.8 to achieve a balanced exploration effect, and adjusting the seed parameter, which is a random seed based on time, to avoid pattern fixation and excessive repetition rate of K1 extension nodes. When a child node is expanded for the first time, prompt is the user's input. When expanding the child node for the first time, the previous optimization suggestion is used as prompt for feedback to achieve optimization expansion.
[0034] S12, performing multi-dimensional evaluation and suggestion evaluation on the candidate content corresponding to each of the extension nodes through LLM to obtain evaluation scores and optimization suggestions.
[0035] Furthermore, in step S12, the candidate content corresponding to each of the extension nodes is evaluated in multiple dimensions by LLM to obtain an evaluation score, including: S12-1, performing a multi-dimensional evaluation of the candidate content corresponding to each of the extension nodes according to preset grammatical correctness, contextual rationality, and domain relevance through LLM, and obtaining a grammatical evaluation result, a contextual evaluation result, and a professional evaluation result; S12-2, performing weighted summation on the grammar evaluation result, the context evaluation result and the professionalism evaluation result to obtain the evaluation score.
[0036] In this embodiment, the expanded nodes are prompted to LLM for evaluation based on grammatical correctness, contextual rationality, and domain relevance, and the scores and optimization suggestions of the corresponding nodes are obtained. When the next node is expanded, this optimization suggestion is used as a prompt to achieve the optimization effect; the evaluated tasks are also added to the evaluation queue, and the producer-consumer model (the producer generates tasks to the queue, and the consumer takes tasks from the queue to execute. That is, the evaluation tasks generated here are put into the queue, and when the thread is idle, the evaluation tasks are taken out of the queue for evaluation.) Asynchronous evaluation is implemented. The nodes that are about to be expanded (there is no need to wait for all nodes to be expanded, and the nodes that have been expanded can proceed directly to the next step) are evaluated asynchronously by prompting LLM, and the tasks to be evaluated are placed in the evaluation queue to implement asynchronous evaluation. LLM evaluation includes scoring evaluation and suggestion evaluation. The scoring evaluation backtracks to update the corresponding Q value and the number of visits N. The suggestion evaluation is used to inform the large model of the points to be optimized during the next expansion. For example: # Sentence quality assessment prompt [Input requirements] Please rate the following text in multiple dimensions and give suggestions for optimization: {{Sentence to be evaluated}} * The user's requirement is: {The text entered by the user at the beginning, for example: generate a medical dialogue for me} [Rating Dimensions] Weight distribution: - Grammatical correctness (30%): Check the subject-verb-object structure, punctuation usage, and sentence structure - Contextual plausibility (35%): evaluate logical coherence, scene fit, and information completeness - Domain relevance (35%): Determine the domain based on the initial requirements raised by the user [Output format] { "Syntax Evaluation": { "score": (0-30), "issues": ["List of specific syntax issues"], "suggestions": ["Passive voice conversion", "Professional sentence reconstruction"] }, "Contextual Assessment": { "score": (0-35), "logic_flow": "Excellent / Qualified / Broken", }, "Professional Assessment": { "score": (0-35), "term_accuracy": ["List of terms to be corrected"], "compliance_check": "Pass / Partially Pass / Fail" }, "Total score": (weighted calculation value), "Optimization suggestions": "Areas that need to be optimized and improved", } In the above, Suggestions are suggestions to be given in grammar evaluation. For example, passive voice conversion is to change active sentences into passive sentences to weaken the subjective text; professional sentence reconstruction is to replace colloquial expressions with neighborhood terms. Logic_flow: is the rating standard. Compliance_check: compliance check, whether it complies with industry regulations, if passed, it means compliance. With these guidance, it will be more specific when outputting optimization suggestions. That is, by guiding LLM to score from the perspectives of grammar, context, professionalism, etc., the corresponding optimization suggestions are then made through the scoring of these perspectives.
[0037] S13, creating a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree.
[0038] S14, performing strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion to obtain large-scale data.
[0039] Further, in step S14, the strategy optimization including selection, expansion, simulation and backtracking is performed on each of the extended subtrees based on the evaluation score and the optimization suggestion, including: S14-1, calculating the score of each child node of the extended subtree, and selecting the child node with the highest score as the target extended node; S14-2, inputting the optimization suggestion as a prompt into the LLM to expand the target expansion node, and generating content to be evaluated corresponding to a plurality of branch nodes; S14-3, through LLM, multi-dimensional evaluation and suggestion evaluation are performed on the content to be evaluated corresponding to each branch node to obtain the current evaluation score and the current optimization suggestion, wherein the current evaluation score is used to retroactively update the score of the child node, and the current optimization suggestion is used as a prompt for the next expansion.
[0040] Furthermore, in step S14-1, the step of calculating the score of each child node of the extended subtree includes: The score of each child node is calculated according to UCB(S,a)=Q(S,a) / N(S,a)+C * sqrt(ln(N(S)) / N(S,a)); where Q(S,a) / N(S,a) represents the average reward obtained by taking action a from state S, C * sqrt(ln(N(S)) / N(S,a)) represents the exploration reward, C represents the exploration coefficient, Q represents the cumulative reward, and N represents the number of visits; N(S) represents the total number of times state S is visited. For example, in Monte Carlo Tree Search (MCTS), each time an action is selected from state S, N(S) accumulates all actions; N(S,a) represents the number of visits when action a is selected in state S, and Q(S,a) represents the sum of all historical rewards after action a is selected in state S.
[0041] In this embodiment, the expanded node obtained by the above expansion and initialization is used as the root node of the subtree to be divided, each subtree is used as an independent Monte Carlo search tree, and each subtree is optimized including selection, expansion, simulation, and backtracking, that is, each subtree executes the complete selection → expansion → simulation → backtracking process, and explores diversified paths in parallel. Specifically: Phase 1: Selection (path selection): Based on the UCB formula (balanced exploration and utilization), the score of each sub-node is calculated (the higher the score, the greater the potential of this sub-node). That is, The score is calculated using the formula UCB(S,a)=Q(S,a) / N(S,a)+C * sqrt(ln(N(S)) / N(S,a)). The child node corresponding to the most potential target path is selected from all current child nodes for expansion based on the score. Q(s,a) / N(s,a): cumulative reward / number of visits, that is, the historical average reward of the path (biased towards high-reward paths, from the Simulation stage); C * sqrt(ln(N(S)) / N(s,a)): exploration reward (exploration item, encouraging paths with fewer visits, that is, when the number of visits is small, the larger the value, the priority is to visit); Cumulative reward (Q): the total reward value obtained from all paths starting from this child node; Number of visits (N): the number of times the child node is selected; C represents the exploration coefficient (a hyperparameter, increasing C in the early stage promotes exploration, and decreasing it in the later stage).
[0042] By dynamically adjusting the search direction, a suitable target path is selected, including: when the current path has a high cumulative reward Q but a small number of visits, the current path will be selected as the target path (the cumulative reward Q is high, and the number of visits is N hours, the UCB value calculated according to the formula will be large, and when the UCB value is large, it will be selected as the target path); when the current path has a large number of visits and the cumulative reward tends to be stable, the current path will be more likely to be selected as the target path.
[0043] Phase 2: Expansion (Extension Node - LLM core function): By calling the optimized prompt (the optimization suggestion obtained earlier is the optimized prompt), LLM generates K2 new nodes (source of diversity), that is, the optimization suggestion obtained in the previous evaluation is used as a new prompt to expand the new branch node, so as to achieve the effect of feedback optimization and self-correction. The tasks that need to be expanded are placed in the expansion node queue for asynchronous expansion. And by controlling the number of branches, the exploration efficiency is balanced. When the layer is shallow, such as within 5 layers, the branch exploration is increased. When the layer is deep, the optimization is focused and the number of branches is reduced. Termination conditions include: the large model feedback score value (the score of the large model evaluation) is high and there is no optimization content; the preset exploration path depth is reached; the number of nodes exceeds the preset maximum number.
[0044] Phase 3: Simulation (Simulation-Quality Assessment): Through the above evaluation prompt, the large model is given to asynchronously evaluate each branch node of the expansion, and two results are obtained, including evaluation score and optimization suggestions, to achieve the quality of the content to be evaluated corresponding to the evaluation branch node (instead of manual labeling). The evaluation score W is used to back-calculate the UCB value (the cumulative reward Q in UCB = Q+ W, when back-tracing to the parent node, Q+ W, the number of visits N+1, at this time, the UCB value is recalculated to achieve the back-tracking update of the UCB value), and the optimization suggestion is used as a prompt for optimization at the next expansion to realize the closed loop of LLM.
[0045] Phase 4: Backpropagation (Backtracking-Strategy Update): Operation: Back-propagate the reward value of this round (the score evaluated by the large model) to update the corresponding path weight; Effect: The Q value of high-frequency and high-reward paths is improved, and they are more likely to be selected in subsequent iterations.
[0046] Furthermore, the method further comprises: S15, monitoring the child nodes expanded by the expanded subtree within a preset period, when the average reward of the child nodes is lower than a preset value and the number of visits exceeds a preset number, the child nodes are deleted and the resources corresponding to the child nodes are released.
[0047] By setting up a monitoring service to monitor the changes in the Q value corresponding to each subtree node, low-value branches are deleted according to the changes in real-time Q value to optimize resource allocation. That is, monitoring is performed once every preset period s seconds. If the average reward of a child node (the historical average reward of the corresponding path) is continuously ranked below the threshold (such as nodes ranked in the bottom 20% of the Q value and with a visit count ≥ 5), and the visit count N exceeds the preset number (such as N greater than or equal to 5), pruning is performed. The thread resources released by pruning are automatically allocated to high-potential subtrees to improve overall search efficiency. For example, if a parent node has 10 child nodes, if a child node ranks 9th or 10th in average reward after multiple simulations, it is pruned.
[0048] Reference Figure 3 FIG. 1 is a schematic diagram of the structure of a large-scale data generation device provided by an embodiment of the present invention.
[0049] In this embodiment, the device 20 includes: An expansion unit 21 is used to expand the text to be processed input by the user by using LLM to generate multiple candidate contents, wherein each candidate content is used as an expansion node; An evaluation unit 22, configured to perform multi-dimensional evaluation and suggestion evaluation on the candidate content corresponding to each of the extension nodes through LLM to obtain an evaluation score and optimization suggestions; A creating unit 23, configured to create a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree; The optimization unit 24 is used to perform strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion to obtain large-scale data.
[0050] In another embodiment, the device 20 further comprises: The monitoring unit is used to monitor the child nodes expanded by the expanded subtree within a preset period. When the average reward of the child node is lower than a preset value and the number of visits exceeds a preset number, the child node is deleted and the resources corresponding to the child node are released.
[0051] Each unit module of the device 20 can respectively execute the corresponding steps in the above method embodiment, so each unit module will not be described in detail here. Please refer to the description of the above corresponding steps for details.
[0052] The embodiment of the present invention further provides a large-scale data generation device, the device comprising the large-scale data generation device as described above, wherein the large-scale data generation device can adopt Figure 3 The structure of the embodiment can be executed accordingly. Figure 1The technical solution of the method embodiment shown has similar implementation principles and technical effects. For details, please refer to the relevant records in the above embodiments, which will not be repeated here.
[0053] The device includes: a mobile phone, a digital camera, a tablet computer, or other devices with a camera function, or a device with an image processing function, or a device with an image display function. The device may include components such as a memory, a processor, an input unit, a display unit, and a power supply.
[0054] Among them, the memory can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory may also include a memory controller to provide the processor and the input unit with access to the memory.
[0055] The input unit can be used to receive input digital or character or image information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit of this embodiment includes not only a camera, but also a touch-sensitive surface (such as a touch display) and other input devices.
[0056] The display unit can be used to display information input by the user or information provided to the user and various graphical user interfaces of the device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit may include a display panel, and optionally, the display panel may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface may cover the display panel, and when the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor to determine the type of touch event, and then the processor provides a corresponding visual output on the display panel according to the type of touch event.
[0057] The embodiment of the present invention further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory in the above embodiment; or a computer-readable storage medium that exists independently and is not installed in a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement Figure 1 The computer readable storage medium may be a read-only memory, a magnetic disk or an optical disk.
[0058] The embodiment of the present invention also provides a computer program product, including a computer program / instruction, which is loaded and executed by a processor to implement Figure 1 A method for generating large-scale data is shown.
[0059] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, equipment embodiment and storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0060] Furthermore, in this document, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0061] The above description shows and describes the preferred embodiments of the present invention. It should be understood that the present invention is not limited to the form disclosed herein, and should not be regarded as excluding other embodiments, but can be used in various other combinations, modifications and environments, and can be modified within the scope of the invention, through the above teachings or the technology or knowledge of the relevant field. The changes and modifications made by those skilled in the art shall not depart from the spirit and scope of the present invention, and shall be within the scope of protection of the claims attached to the present invention.
Claims
1. A method for generating large-scale data, characterized in that: The method comprises: LLM is used to expand the text to be processed input by the user to generate multiple candidate contents, wherein each candidate content is used as an expansion node; Through LLM, multi-dimensional evaluation and suggestion evaluation are performed on the candidate content corresponding to each of the extension nodes to obtain evaluation scores and optimization suggestions; Creating a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree; Based on the evaluation score and the optimization suggestion, a strategy optimization including selection, expansion, simulation and backtracking is performed on each of the extended subtrees to obtain large-scale data.
2. A method for generating large-scale data according to claim 1, characterized in that: The LLM is used to expand the text to be processed input by the user to generate multiple candidate contents, including: According to N threads = N cpu * (1+W / E) to calculate the initial number of threads, where N cpu Indicates the number of CPU logical cores, W / E indicates the ratio of task waiting time to computing time; The corresponding thread request LLM is called respectively according to the initial thread number, and the temperature parameter and the seed parameter are dynamically adjusted to expand the text to be processed, so as to obtain candidate contents corresponding to the plurality of expansion nodes.
3. The method for generating large-scale data according to claim 1, characterized in that: The LLM is used to perform a multi-dimensional evaluation on the candidate content corresponding to each of the extension nodes to obtain an evaluation score, including: Through LLM, a multi-dimensional evaluation is performed on the candidate content corresponding to each of the extension nodes according to the preset grammatical correctness, contextual rationality and domain relevance to obtain a grammatical evaluation result, a contextual evaluation result and a professional evaluation result; The grammar evaluation result, the context evaluation result and the professionalism evaluation result are weightedly summed to obtain the evaluation score.
4. The method for generating large-scale data according to claim 1, characterized in that: The performing of strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion includes: By calculating the score of each child node of the expanded subtree, and selecting the child node with the highest score as the target expanded node; The optimization suggestion is used as a prompt and input into the LLM to expand the target expansion node, and generate content to be evaluated corresponding to multiple branch nodes; Through LLM, multi-dimensional evaluation and suggestion evaluation are performed on the content to be evaluated corresponding to each branch node to obtain the current evaluation score and the current optimization suggestion, wherein the current evaluation score is used to retroactively update the score of the child node, and the current optimization suggestion is used as a prompt for the next expansion.
5. A method for generating large-scale data according to claim 4, characterized in that: The step of calculating the score of each child node of the expanded subtree comprises: The score of each child node is calculated according to UCB(S,a)=Q(S,a) / N(S,a)+C * sqrt(ln(N(S)) / N(S,a)); where Q(S,a) / N(S,a) represents the average reward obtained by taking action a from state S, C * sqrt(ln(N(S)) / N(S,a)) represents the exploration reward, C represents the exploration coefficient, Q represents the cumulative reward, and N represents the number of visits.
6. The method for generating large-scale data according to claim 1, characterized in that: The method further comprises: The subnodes expanded by the expanded subtree are monitored within a preset period. When the average reward of the subnode is lower than a preset value and the number of visits exceeds a preset number, the subnode is deleted and the resources corresponding to the subnode are released.
7. A large-scale data generation device, characterized in that: The device comprises: An expansion unit, used to expand the text to be processed input by the user by using LLM to generate multiple candidate contents, wherein each candidate content serves as an expansion node; An evaluation unit, configured to perform multi-dimensional evaluation and suggestion evaluation on the candidate content corresponding to each of the extension nodes through LLM to obtain an evaluation score and optimization suggestions; A creating unit, used for creating a Monte Carlo search tree for each of the extended nodes to obtain a plurality of extended subtrees, wherein each of the extended nodes serves as a root node of the extended subtree; The optimization unit is used to perform strategy optimization including selection, expansion, simulation and backtracking on each of the extended subtrees based on the evaluation score and the optimization suggestion to obtain large-scale data.
8. The large-scale data generation device according to claim 7, characterized in that: The device also includes: The monitoring unit is used to monitor the child nodes expanded by the expanded subtree within a preset period. When the average reward of the child node is lower than a preset value and the number of visits exceeds a preset number, the child node is deleted and the resources corresponding to the child node are released.
9. A large-scale data generation device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of a method for generating large-scale data as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program / instruction, wherein the computer program / instruction is executed by a processor to implement the steps of a method for generating large-scale data as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Knowledge graph question and answer retrieval method based on large language model and MCTS algorithm
CN118296114A
Method and device for generating visual data story based on large language model
CN118503410A
Adaptive causal discovery method and device based on Monte Carlo tree
CN119539041A
Modifying A Storage System Configuration Using A Large Language Model (‘LLM’)
US20240394151A1
Cited By
Intention recognition method and device, electronic equipment and storage medium
CN120688515A
Intent recognition methods, devices, electronic devices and storage media
CN120688515B