Method and system for accurate and low-cost large language model use

By prioritizing the lowest-cost model in a large language model and gradually switching to a higher-cost model if the answer is unsatisfactory, and training the low-cost model, combined with local database matching and content compression, the problem of cost reduction while ensuring accuracy is solved, and efficient and low-cost answer generation is achieved.

CN116610789BActive Publication Date: 2026-02-06ZHONGKE HAOMENG (HANGZHOU) NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310836247.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-02-06
Estimated Expiration
2043-07-10

AI Technical Summary

Technical Problem

How can we reduce the cost of using large language models while ensuring the accuracy of responses, or improve the accuracy of language models at the same cost?

Method used

The system outputs the answer to the question using the lowest-cost large language model. If the answer is unsatisfactory, it gradually switches to a higher-cost large language model. After outputting the answer, the low-cost model with the output answer is trained. The system also combines local database matching and dialog box content compression to optimize the answer quality.

Benefits of technology

It effectively reduces the cost of using large language models, while improving the accuracy and coherence of answers, reducing reliance on high-cost models, and improving the performance of low-cost models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116610789B_ABST
    Figure CN116610789B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of text automatic generation of AI response system, and particularly relates to a low-cost large language model using method and system. The method comprises the following steps: S1, creating a dialogue box; S2, inputting a current question in the dialogue box; S3, using a large language model with the lowest cost to output an answer to the current question in the dialogue box; S4, judging whether the answer to the current question is qualified, if yes, taking the answer to the current question as the final answer to the current question, and returning to step S2, if not, executing step S5; S5, using a large language model with a higher cost to output an answer to the current question in the dialogue box, and returning to step S4; in step S4, the large language model which has output the answer to the current question is trained based on the current question and the final answer to the current question, for use when a question is input next time. The application can answer the question raised by the user on the basis of considering the accuracy and the use cost.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of text automatic generation of AI response system, and particularly relates to a large language model using method and system with high accuracy and low cost. BACKGROUND

[0002] Large language (GPT, Generative Pre-trained Transformer) refers to a class of large language models based on the Transformer architecture developed by OpenAI. These models are pre-trained on a large amount of text data to learn the structure, semantics and context information of language.

[0003] Large language models have strong language understanding and generation capabilities and can be applied to various natural language processing tasks such as text generation, machine translation, dialogue systems, question answering systems and abstract generation. These models not only can generate coherent text, but also can reason and answer questions based on context.

[0004] GPT model is a self-attention-based generation model, which works by learning the probability distribution of text sequences in the pre-training phase and generating the next word or character based on the context when generating text. This model has high flexibility and creativity and can generate natural language text consistent with the input context.

[0005] Currently, OpenAI has released several versions of large language models such as GPT-2, GPT-3, etc. These models have achieved remarkable results in natural language processing and have demonstrated strong generation and understanding capabilities in various application scenarios. The development of large language models is of great significance to natural language processing and artificial intelligence, providing powerful tools and technical support for various text-related tasks.

[0006] In addition to the above-mentioned GPT-2 and GPT-3, there are also many large language models, each with different characteristics in terms of cost, accuracy and domain specificity. For example, the popular GPT-4 has an accuracy of over 90%, but its usage fee is $30 per 10 million characters. GPT-J, on the other hand, only needs $0.2 for the same prompt character amount, but its overall accuracy is only about 78%.

[0007] Therefore, for a specific problem, how to choose a suitable language model or design a language model application scheme is a problem worth exploring. How to design a language model selection mechanism to greatly reduce the usage fee of the language model while ensuring the accuracy of the answer, or to improve the accuracy of the language model under the same fee is the problem we need to solve. SUMMARY

[0008] In view of the above problems existing in the prior art, the present application provides a large language model using method and system with high accuracy and low cost.

[0009] The present application adopts the following technical solutions:

[0010] The first aspect of the present application provides a large language model using method with high accuracy and low cost, comprising the following steps:

[0011] S1, creating a dialogue box;

[0012] S2, inputting a current question in the dialogue box;

[0013] S3, using a large language model with the lowest cost to output an answer to the current question in the dialogue box;

[0014] S4, judging whether the answer to the current question is qualified, if yes, taking the answer to the current question as the final answer to the current question, and returning to step S2, if not, executing step S5;

[0015] S5, using a large language model with a higher cost to output an answer to the current question in the dialogue box, and returning to step S4;

[0016] In step S4, after outputting the final answer to the current question, if there is a large language model that has output an answer to the current question, the large language model is trained based on the current question and the final answer to the current question, so as to be used for inputting a question next time.

[0017] As a preferred solution, step S2 further comprises inputting a local database related to the question in the dialogue box.

[0018] Between step S2 and step S3, the following step is further included:

[0019] A, obtaining an initial answer to the question based on the current question and the local database;

[0020] B, judging whether the initial answer to the question is qualified, if yes, taking the initial answer to the question as the final answer to the current question, and returning to step S2, if not, executing step S3.

[0021] As a preferred solution, all large language models output answers to the current question based on all contents in the dialogue box.

[0022] As a preferred solution, before outputting the current question answer based on all contents in the dialogue box, the contents in the dialogue box are compressed, and during the compression process, the question for which the final answer is not output is not compressed, and the local database is not compressed during the dialogue turn of the local database input.

[0023] As a preferred solution, the compression of the contents in the dialogue box includes the steps of:

[0024] The compression rate of the contents of different turns is calculated based on the dialogue turn of the contents and the total dialogue turns that have been completed.

[0025] The contents of different turns are compressed based on the calculated multiple compression rates.

[0026] As a preferred solution, the compression rate of the contents of different turns is calculated according to the formula:

[0027]

[0028] P Kt represents the compression rate of the contents of the tth dialogue turn after K dialogue turns have been completed, t represents the dialogue turn of the contents, K represents the completed dialogue turns, and λ is a negative number, λ representing a preset compression rate adjustment value.

[0029] As a preferred solution, in step S4, when the next question is associated with the previous question, return to step S2, and when the next question is not associated with the previous question, return to step S1.

[0030] As a preferred solution, before step S3, there is also a step of selecting multiple preliminary screening large language models corresponding to the field of the current question.

[0031] In steps S3 and S5, the corresponding large language model is selected from the multiple preliminary screening large language models, and the current question answer is output in the dialogue box.

[0032] As a preferred solution, in steps S3 and S5, after outputting the answer, the output answer accuracy can be manually marked by the user or in the background by the background expert personnel.

[0033] In step S4, according to the historical answer accuracy marking data, it is automatically judged whether the current question answer is qualified.

[0034] The second aspect of the embodiment of the application provides a large language model use system with high accuracy and low cost, comprising a dialogue box creation module, a dialogue module, a large language model module, a training module and a judgment module, the dialogue module and the large language model module are connected with the dialogue box creation module, the training module is connected with the large language model module and the dialogue box creation module, and the judgment module is connected with the dialogue box creation module and the training module;

[0035] The dialogue box creation module is used for creating a dialogue box.

[0036] The dialogue module is used for inputting a question in the dialogue box.

[0037] The large language model module is used for sequentially adopting large language models with increasing use costs to output answers to the question in the dialogue box until the output answers to the question are qualified.

[0038] The judgment module is used for judging whether the output answers to the question in the dialogue box are qualified.

[0039] The training module is used for training the large language models that have output answers to the question according to the question and the final answer to the question for use in the next input of the question.

[0040] The application has the following beneficial effects:

[0041] In the application, the large language model with the lowest use cost is used to output answers to the question, if the answers are qualified, the large language models with higher use costs are not used, if the answers are not qualified, the large language models with higher use costs are used, and the use cost of the large language models is reduced as much as possible.

[0042] In the application, after the final answer to the current question is output, if there is a low-cost large language model that has output answers to the current question, the low-cost large language model that has output answers to the current question is trained based on the current question and the final answer to the current question, so that when the similar question is input next time, the low-cost large language model that has been trained can directly output qualified answers to the question without using the high-cost large language model. It should be noted that all the low-cost large language models that have output answers to the current question are trained to ensure that when the similar question is input next time, there is a low-cost large language model that has been trained and can directly output qualified answers to the question. The use cost of the large language model is further reduced.

[0043] In the application, before the large language model is used to output answers, the input local database is matched to output answers, if a qualified answer is matched, the large language model is not used, and the use cost of the large language model is further reduced.

[0044] In the present application, all large language models output the current question answer based on all the content in the dialogue box, ensuring the coherence and accuracy of the output question answer. However, this approach has the disadvantage of excessive prompt character quantity. To further reduce the cost of using large language models, a step of compressing the content in the dialogue box is added before the large language model outputs the current question answer based on all the content in the dialogue box.

[0045] Due to the differences in the specialized fields of large language models, in the present application, before step S3, there is also a step of selecting multiple preliminary screening large language models corresponding to the current question field. In steps S3 and S5, the corresponding large language model is selected from the multiple preliminary screening large language models to output the current question answer in the dialogue box. This reduces the number of inappropriate large language models tried before the appropriate large language model is selected. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0047] Figure 1 is a flowchart of an accurate and low-cost large language model use method according to the present application.

[0048] Figure 2 is a flowchart of the compression process.

[0049] Figure 3 is a compression rate diagram when the fourth dialogue round is executed.

[0050] Figure 4 is a compression rate diagram when the sixth dialogue round is executed.

[0051] Figure 5 is a structural diagram of an accurate and low-cost large language model use system according to the present application. DETAILED DESCRIPTION

[0052] The embodiments of the present application will be described below through specific specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in the present specification. The present application can also be implemented or applied by different specific embodiments, and the details in the present specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0053] Embodiment one:

[0054] Referring to Figure 1 The embodiment provides an accurate and low-cost large language model use method, which comprises the following steps:

[0055] S1, creating a dialogue box;

[0056] S2, inputting a current question in the dialogue box;

[0057] S3, using a large language model with the lowest cost to output an answer to the current question in the dialogue box;

[0058] S4, determining whether the answer to the current question is qualified, if yes, taking the answer to the current question as a final answer to the current question, and returning to step S2, and if not, executing step S5;

[0059] S5, using a large language model with a higher cost to output an answer to the current question in the dialogue box, and returning to step S4;

[0060] In step S4, after outputting the final answer to the current question, if there is a large language model that has output an answer to the current question, the large language model is trained based on the current question and the final answer to the current question for use in the next input question.

[0061] The determination of whether the answer to the current question is qualified can be performed in two ways:

[0062] The first way is:

[0063] The user directly judges the subjective answer to the current output question, and the advantage of this way is that the judgment process does not require cost, and the disadvantage is that only obviously incorrect answers can be excluded.

[0064] The second way is:

[0065] In steps S3 and S5, the output answer accuracy can be marked by the user after outputting the answer, or the output answer accuracy can be marked by a background expert in the background;

[0066] It should be noted that the marking of the output answer accuracy by the background expert is not performed every time, if there is no marking data for the question answer, the background expert is pushed to mark, and if the question answer has a preset number of expert marks, the background expert is not continuously pushed to mark, the number of expert marks is reduced, and the cost is controlled.

[0067] In step S4, whether the current question answer is qualified is automatically determined according to the historical answer accuracy marking data. In the automatic determination process, the background can set corresponding weights for the user marking data and the expert marking data to improve the credibility of the determination result.

[0068] It should be noted here that because different users have different ways of asking the same or similar questions, the answers output by the large language model also have some differences. Therefore, when the background automatically determines whether the current question answer is qualified according to the historical answer accuracy marking data, it determines the marking data of all answers corresponding to similar questions.

[0069] The advantage of this approach is that the accuracy of the final output answer is greatly improved.

[0070] As can be seen, in this embodiment, the large language model with the lowest cost is used to output the question answer first. If the answer is qualified, the large language model with higher cost is not used. If the answer is not qualified, the large language model with higher cost is used to reduce the use cost of the large language model as much as possible.

[0071] It should be noted here that in this embodiment, multiple low-cost large language models may be used before the high-cost large language model outputs the final answer. Compared with directly using the high-cost large language model to output the final answer, the cost of answering the question is improved. However, the use cost of different large language models differs greatly. For example, the popular GPT-4 currently has a usage fee of $30 per 10 million characters, while GPT-J only needs $0.2 for the same prompt character amount. Therefore, even if GPT-4 is finally used to answer the question, the cost generated by the previously used GPT-J can be ignored. This embodiment can avoid using a high-cost large language model to output an answer that can be output by a low-cost large language model as much as possible. For example, GPT-J can be used to output an answer, and GPT-4 is used to output an answer, which greatly increases the use cost.

[0072] And in this embodiment, after outputting the final answer to the current question, if there is a low-cost large language model that has output the answer to the current question, the low-cost large language model that has output the answer to the current question is trained (i.e. fine-tuned) based on the current question and the final answer to the current question, so that when a similar question is input next time, the trained low-cost large language model can directly output a qualified question answer without using a high-cost large language model. It should be noted here that all low-cost large language models that have output the answer to the current question are trained to ensure that there is a trained low-cost large language model that can directly output a qualified question answer when a similar question is input next time. Further reduce the cost of using large language models. It should be noted that the training mode in this embodiment is performed during use, which can continuously improve the performance of the low-cost large language model during use, but ensures the cost of answering questions.

[0073] Further, the low-cost large language model that has output the answer to the current question can also be optionally trained based on the current question and the final answer to the current question, specifically:

[0074] In step S4, after outputting the final answer to the current question, if there is a large language model that has output the answer to the current question, the multiple large language models that have output the answer to the current question and have high answer reasonableness are trained based on the current question and the final answer to the current question, and the large language models that have undergone this training are marked for use when a question is input next time.

[0075] In step S3, specifically: determine whether there are large language models that have undergone related training according to the mark before the current input question, if there are, use the large language model with the lowest cost among these large language models that have undergone related training, output the answer to the current question in the dialogue box, if there are not, use the large language model with the lowest cost among all large language models, output the answer to the current question in the dialogue box;

[0076] In step S5, similarly, if there are, use the next large language model with higher cost among these large language models that have undergone related training, output the answer to the current question in the dialogue box, if there are not, use the next large language model with higher cost among all large language models, output the answer to the current question in the dialogue box.

[0077] That is, when a similar question is input next time, the large language model with the lowest cost among the multiple large language models that have undergone related training can be directly selected to output the answer, further reducing the cost of answering questions, and the high and low of the answer reasonableness can also be automatically determined by the background according to the historical answer accuracy mark data.

[0078] It needs to be explained that the relevant training means training through similar questions and the corresponding answers of the similar questions.

[0079] The training process of the large language model is not the focus of the present embodiment, and will not be described in detail here.

[0080] More specifically:

[0081] Step S2 also includes inputting the local database related to the question in the dialogue box;

[0082] Between step S2 and step S3, there is also a step:

[0083] A, based on the current question, the initial question answer is matched from the local database;

[0084] B, judge whether the initial question answer is qualified, if qualified, take the initial question answer as the final answer of the current question, and return to step S2, if not qualified, execute step S3.

[0085] It can be seen that in the present embodiment, before the large language model is formally used to output the answer, the question answer is matched based on the input local database, if a qualified answer is matched, the large language model is not needed, further reducing the use cost of the large language model.

[0086] Further, all large language models output the current question answer based on all contents in the dialogue box.

[0087] Referring to Figure 2 , Figure 3 , Figure 4 Before the large language model outputs the current question answer based on all contents in the dialogue box, the contents in the dialogue box are compressed, and in the compression process, the question whose final answer is not output is not compressed, and the local database input is not compressed in the dialogue turn.

[0088] The compression process of the contents in the dialogue box includes the steps of:

[0089] The compression rate of the contents of different turns is calculated based on the content dialogue turn and the total dialogue turn that has been completed;

[0090] The contents of different turns are compressed based on the calculated multiple compression rates.

[0091] The compression rate = (original data size - compressed data size) / original data size x 100%, that is, the larger the compression rate, the greater the compression amplitude, and the smaller the compressed data.

[0092] The compression rate calculation formula of the contents of different turns is:

[0093]

[0094] P Kt This represents the compression rate of the content in the t-th dialogue round after K dialogue rounds have been completed, where t represents the number of dialogue rounds, K represents the number of dialogue rounds completed, and λ represents the preset compression rate adjustment value, which is used to adjust the compression rate change between different dialogue rounds. It is a negative value less than 0 and can be set as needed.

[0095] It should be noted that a dialogue turn is marked as the completion of an answer in the dialog box, and the input question, the local database, and the initial question answer output based on the local database all belong to the same dialogue turn.

[0096] Reference Figure 2 As shown, compression only occurs after at least one dialog round has been completed in the dialog box; otherwise, compression is not performed. (Note: To simplify the accompanying diagram, ...) Figure 2 (The game does not include dialogue rounds that match questions and answers based on a local database).

[0097] The following explains the compression ratio; please refer to [reference needed]. Figure 3 As shown, for example, if three dialogue rounds have been completed, when executing the fourth dialogue round, the compression rate of the first dialogue round will be [missing information]. The compression rate of the second round of dialogue The compression rate of the third dialogue round is e λ .

[0098] Reference Figure 4 As shown, for example, if five dialogue rounds have been completed, when executing the sixth dialogue round, the compression rate of the first dialogue round will be... The compression rate of the second round of dialogue The compression rate of the third round of dialogue The compression rate of the fourth dialogue round The compression rate of the fifth dialogue round is e λ .

[0099] As can be seen from the above, the compression rate and the magnitude of compression decrease as the dialogue rounds progress. For dialogue within the same round, the compression rate and the magnitude of compression gradually increase as more rounds of dialogue have been completed. For example, the compression rate of the two rounds in the first dialogue round...

[0100] It needs to be added here that the compression rate calculation formula actually used can be adjusted according to actual conditions or requirements, as long as the following conditions are met: 1. The further the dialogue turn is, the smaller the compression rate of its content is, and the smaller the compression amplitude is; 2. For the same turn of dialogue content, as the number of completed dialogue turns increases, the compression rate gradually increases, and the compression amplitude gradually increases. The preferred compression rate calculation formula used in this embodiment is as follows.

[0101] The above-mentioned does not compress the question without outputting the final answer in the compression process (which can ensure the integrity of the content of the question before the final answer is output), and does not perform compression processing on the local database in the dialogue turn input by the local database. The following will be described in detail with reference to Figure 4 For example:

[0102] If the first to fifth dialogue turns are all performed for the first question, and the final answer of the first question has been output after the completion of the fifth dialogue turn, the second question and the local database corresponding to the second question need to be re-input when the sixth dialogue turn is performed. At this time, the first question and the local database input in the first dialogue turn need to be compressed based on The first question and the local database input in the first dialogue turn are compressed, but the second question and the local database input in the sixth dialogue turn are not compressed;

[0103] If the first to fifth dialogue turns are all performed for the first question, and the final answer of the first question has not been output after the completion of the fifth dialogue turn, the first question is not compressed based on The first question is not compressed, but the local database input in the first dialogue turn needs to be compressed based on The local database input in the first dialogue turn is compressed.

[0104] It should be noted that the compression processing in this embodiment is compressed in a sectioning manner, which can directly start from the start character of the content to cut off the corresponding percentage of the field, or randomly select a middle character in the content as the start character to cut off the corresponding percentage of the field. Such compression operation cost is lower. In this embodiment, the original text can also be summarized and compressed. Generally, such a method involves a machine learning model, and when the cost of using a machine learning model for summarization and reasoning is low, it can also be used.

[0105] The compression processing is similar to the time-decaying method, which is a method for processing time series data. It is based on the assumption that past data has less influence on current prediction over time. Therefore, in time series analysis, earlier data points are given lower weights, while newer data points are given higher weights. The time-decaying method is a method for modeling time series data using time information. It fully considers the decaying influence of past data points, thereby improving the prediction ability of future values. By using such a method, the amount of prompt characters can be reduced as much as possible while ensuring the continuity and accuracy of the output problem answers. In particular, in this embodiment, a local database needs to be input for the question, and such compression processing can further reduce the use cost of the large language model.

[0106] Further, in step S4, when the next question is associated with the previous question, return to step S2, and when the next question is not associated with the previous question, return to step S1. That is, for each set of questions with association, a dialog box is created separately to avoid content redundancy.

[0107] Further, before step S3, there is also a step of selecting a plurality of preliminary screening large language models corresponding to the field of the current question;

[0108] In steps S3 and S5, a corresponding large language model is selected from the plurality of preliminary screening large language models, and the current question answer is output in the dialog box.

[0109] Since the specialized fields of large language models differ, starting with the large language model with the lowest use cost for any question will increase the use cost of the large language model to some extent. Therefore, in this embodiment, all large language models are classified by field, and after inputting the question, a plurality of preliminary screening large language models corresponding to the field of the current question are selected according to the field to which the question belongs. Subsequently, a corresponding large language model is selected from the plurality of preliminary screening large language models, and the current question answer is output in the dialog box. This reduces the number of inappropriate large language models tried before a suitable large language model is selected, thereby further reducing the use cost of the large language model.

[0110] Embodiment Two:

[0111] Reference Figure 5As shown, the embodiment provides an accurate and low-cost large language model use system, based on the accurate and low-cost large language model use method of embodiment one, including a dialogue box creation module, a dialogue module, a large language model module, a training module, a judgment module, the dialogue module and the large language model module are connected with the dialogue box creation module, the training module is connected with the large language model module and the dialogue box creation module, and the judgment module is connected with the dialogue box creation module and the training module.

[0112] The dialogue box creation module is used to create a dialogue box.

[0113] The dialogue module is used to input a question in the dialogue box.

[0114] The large language model module is used to sequentially use large language models with increasing use costs to output answers to the question in the dialogue box until the output answer to the question is qualified.

[0115] The judgment module is used to judge whether the output answer to the question in the dialogue box is qualified.

[0116] The training module is used to train the large language model that has output an answer to the question according to the question and the final answer to the question for use next time when a question is input.

[0117] Further, the dialogue module is also used to input a local database in the dialogue box.

[0118] The large language model module is also used to match an answer to the question based on the question and the local database, and if the matching is successful, output the matched answer (i.e. the initial answer to the question) in the dialogue box, and if the matching fails, use a large language model with a corresponding use cost and output an answer to the question in the dialogue box based on all the contents in the dialogue box.

[0119] The large language model module includes a dialogue turn recording unit and a compression unit connected with the dialogue box creation module, the dialogue turn recording unit is used to assign a dialogue turn of content generation in the dialogue box and record the total dialogue turns that have been completed, and the compression unit is used to calculate the compression rate of the content generated in different turns according to the dialogue turn of content generation and the total dialogue turns that have been completed, and perform compression processing on the content generated in different turns based on the calculated multiple compression rates.

[0120] Further, the system further includes a domain division module connected with the dialogue module and the large language model module, the domain division module is used to divide the domain to which the question input by the user belongs, and the domain division module is also used to divide the specialized domain of the large language model.

[0121] The large language model module further comprises a preliminary screening unit, the preliminary screening unit is used for selecting a plurality of preliminary screening large language models corresponding to the problem field, and a corresponding large language model is subsequently selected from the plurality of preliminary screening large language models to output an answer to the current question in the dialogue box.

[0122] The system further comprises a front-end marking module and a back-end marking module. The front-end marking module is used for marking the accuracy of the output answer by a user after the output answer is output. The back-end marking module is used for marking the accuracy of the output answer by a back-end expert. A judging module is connected with the front-end marking module and the back-end marking module. The judging module automatically judges whether the answer to the current question is qualified according to historical answer accuracy marking data.

[0123] It should be noted that the large language model using system provided in the embodiment is similar to the first embodiment, and thus is not described in detail herein.

[0124] The above-described embodiments are merely preferred embodiments of the present application, and are not intended to limit the scope of the present application. Various modifications and improvements to the technical solutions of the present application made by those of ordinary skill in the art without departing from the design spirit of the present application shall fall within the protection scope of the present application.

Claims

1. A method for using an accurate and low-cost large language model, characterized in that, Including the following steps: S1. Create a dialog box; S2. Enter the current question in the dialog box; S3. Using the lowest-cost large language model, output the answer to the current question in the dialog box; S4. Determine whether the answer to the current question is acceptable. If it is acceptable, take the answer to the current question as the final answer to the current question and return to step S2. If it is unacceptable, proceed to step S5. S5. Use the next, more expensive large language model, output the answer to the current question in the dialog box, and return to step S4; In step S4, after outputting the final answer to the current question, if there is a large language model that has already output the answer to the current question, then the large language model that has already output the answer to the current question is trained based on the current question and the final answer to the current question, so that it can be used for the next input question; All large language models output the answer to the current question based on all the content in the dialog box; Before outputting the answer to the current question based on all the content in the dialog box, the large language model compresses the content of the dialog box. The compression process includes the following steps: The compression rate of content for different rounds is calculated based on the number of dialogue rounds and the total number of dialogue rounds completed so far. The content from different rounds is compressed based on multiple calculated compression ratios.

2. The method for using an accurate and low-cost large language model according to claim 1, characterized in that, Step S2 also includes: entering local database information related to the problem in the dialog box; The steps between step S2 and step S3 include: A. Obtain the initial question answer based on the current question and matching with the local database; B. Determine whether the answer to the initial question is acceptable. If it is acceptable, use the answer to the initial question as the final answer to the current question and return to step S2. If it is unacceptable, proceed to step S3.

3. The method for using an accurate and low-cost large language model according to claim 2, characterized in that, During the compression process, questions that have not yet output a final answer are not compressed, nor is the local database compressed during the dialogue rounds that execute local database input.

4. The method for using an accurate and low-cost large language model according to claim 1, characterized in that, The formula for calculating the compression rate of content from different rounds is as follows: , Indicates that it has been completed After the first round of dialogue, the... Compression rate of content in each dialogue round The dialogue turn that indicates the content. This indicates that the dialogue round has been completed. It is a negative number. This indicates the preset compression ratio adjustment value.

5. The method for using an accurate and low-cost large language model according to claim 1, characterized in that, In step S4, if the next question is related to the previous question, return to step S2; if the next question is not related to the previous question, return to step S1.

6. The method for using an accurate and low-cost large language model according to claim 1, characterized in that, Before step S3, there is also the step of selecting multiple preliminary large language models corresponding to the current problem domain; In steps S3 and S5, the corresponding large language model is selected from multiple initial screening large language models, and the answer to the current question is output in the dialog box.

7. The method for using an accurate and low-cost large language model according to claim 1, characterized in that, In steps S3 and S5, after the answer is output, the accuracy of the output answer can be manually marked by the user or marked by experts in the background. In step S4, based on the historical accuracy data of the answers, the system automatically determines whether the answer to the current question is acceptable.

8. An accurate and low-cost large language model usage system, based on the accurate and low-cost large language model usage method according to any one of claims 1 to 7, characterized in that, It includes a dialog box creation module, a dialogue module, a large language model module, a training module, and a judgment module. The dialogue module and the large language model module are connected to the dialog box creation module, the training module is connected to the large language model module and the dialog box creation module, and the judgment module is connected to the dialog box creation module and the training module. The dialog box creation module is used to create dialog boxes; The dialog module is used to input questions in a dialog box; The large language model module is used to sequentially employ large language models with increasing usage costs, and output the answer to the question in the dialog box until the output answer is satisfactory. The judgment module is used to determine whether the answer to the question output in the dialog box is acceptable. The training module is used to train a large language model that has already output the answers to questions, based on the questions and the final answers to the questions, so that it can be used for the next input question.