Method for improving performance of large language model in social field without fine tuning of large language model

By building a social language knowledge base and using vector search database to improve the performance of large language models, the problem of large language models performing poorly in the social field is solved, and high-quality social text generation is achieved without fine-tuning the model.

CN120012931AInactive Publication Date: 2025-05-16HARBIN INST OF TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510092521.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The performance of existing large language models in the social field is not ideal, and fine-tuning the model requires high costs, which will lose the general capabilities of the model.

Method used

By building a high-quality social language knowledge base, using vector search database to improve the performance of large language models, assisting the model to generate text in the social field. The specific steps include: collecting social field corpus, filtering the highest quality text, building a knowledge base based on a vector database, and improving the generated text quality of the model through the knowledge base.

Benefits of technology

Without fine-tuning of large language models, the quality of generated text in the social field will be significantly improved, the probability of generating low-quality social text will be reduced, and the quality of generated text will be further improved by continuously updating the knowledge base.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012931A_ABST
    Figure CN120012931A_ABST
Patent Text Reader

Abstract

The invention discloses a method for improving the performance of a large language model in the social field under the condition that the large language model is not finely adjusted, and belongs to the technical field of large language model optimization. The problem that in the prior art, the social contact quality of texts generated by a traditional large language model in the social contact field is poor is solved. The method comprises the following steps: S1, constructing a large language model, and collecting a comment corpus to be generated and a social field corpus corresponding to the comment corpus; s2, a text with the highest quality is screened out by analyzing corpora in the social field, and a knowledge base of mainstream social languages is constructed in combination with the vector retrieval library; and S3, improving the performance of the large language model through the knowledge base, inputting the current comment corpus to be generated into the large language model, and outputting a generated text suitable for the social environment. According to the method, the social contact quality of the generated text output by the large language model in the social contact field is effectively improved, the large language model does not need to be finely adjusted, and the method can be applied to speaking through the large language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for improving the performance of a large language model in a social field, and in particular to a method for improving the performance of a large language model in a social field without fine-tuning the large language model, and belongs to the technical field of large language model optimization. Background Art

[0002] Large Language Models (LLMs) are one of the hot topics in the current field of artificial intelligence. By learning a large amount of text data, they can generate coherent and meaningful texts, and can even perform some tasks that require understanding and reasoning. With the emergence of more and more powerful general model bases, the abundance of model fine-tuning data, and the maturity of fine-tuning technology, large models have produced many excellent applications in scientific research, education, medicine, automobiles and other fields, which have had a great impact and greatly promoted the development of related industries.

[0003] However, fine-tuning a large language model requires a high cost and will lose the general capabilities of the large language model to a certain extent. Therefore, it is an important task to improve the performance of the model without fine-tuning the model. Prompt Engineering and Retrieval-Augmented Generation (RAG) can significantly improve the quality of model output without fine-tuning the large model. However, since the text generated by the large language model is highly written and has great differences from the language used in people's daily lives, the performance of the large model in the social field is always not ideal.

[0004] In summary, there is a need for a method to improve the performance of large language models in the social domain without fine-tuning them. Summary of the invention

[0005] A brief overview of the present invention is provided below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to a more detailed description discussed later.

[0006] In view of this, in order to solve the problem in the prior art that the traditional large language model generates text with poor social quality in the social field, the present invention provides a method for improving the performance of the large language model in the social field without fine-tuning the large language model.

[0007] The technical solution is as follows: A method for improving the performance of a large language model in the social domain without fine-tuning the large language model, comprising the following steps:

[0008] S1. Build a large language model and collect the comment corpus to be generated and its corresponding social domain corpus;

[0009] S2. Filter out the highest quality texts by analyzing social domain corpus, and build a knowledge base of mainstream social language by combining vector retrieval library;

[0010] S3. Improve the performance of the large language model through the knowledge base, input the current comment corpus to be generated into the large language model, and output the generated text suitable for the social environment.

[0011] Furthermore, the step S2 specifically includes the following steps:

[0012] S21. Conduct statistics on social domain corpus, check data distribution, and determine quantiles;

[0013] S22. Formulate a screening strategy for the highest quality texts based on the quantiles to ensure that the set screening quantity is met and the highest quality texts are selected;

[0014] S23. Using the topics of the review corpus to be generated and the highest quality text as keys and the text itself as values, a knowledge base based on a vector database is constructed;

[0015] In S22, the screening strategy is represented as follows: setting the screening index as the evaluation between people on the social field corpus, setting an evaluation range according to which the higher the evaluation, the higher the quality of the social field corpus, deleting the texts in the social field corpus that do not meet the evaluation range, and screening out the highest quality texts in the social field corpus;

[0016] In S23, a vector database is used as a carrier of the knowledge base, and the subject of the highest quality text is vectorized using an embedding model according to the comment corpus to be generated and the highest quality text, and the corresponding comment corpus to be generated and the highest quality text are stored in the vector database as metadata, so that each subject-text key-value pair corresponds to a piece of data in the knowledge base, thereby obtaining a knowledge base based on the vector database.

[0017] Furthermore, the step S3 specifically includes the following steps:

[0018] S31. Referring to the knowledge base, the generated text is obtained through the large language model;

[0019] S32. Self-evaluation of the quality of generated texts, and the large language model publishes generated texts suitable for social environments;

[0020] In the S31, the current comment corpus to be generated is converted into a vector through the embedding model, the vector is queried according to the knowledge base to obtain the similarity between the vectors, the social field corpus with the highest similarity is output from the knowledge base, the social field corpus with the highest similarity and the current comment corpus to be generated are input into the large language model, and the generated text is output;

[0021] In S32, the generated text is evaluated by a preset standard to verify the quality of the generated text. If the generated text is not suitable for the social environment, step S31 is repeated until the generated text is suitable for the social environment and is output by the large language model.

[0022] The beneficial effects of the present invention are as follows: The present invention relates to a method for improving the performance of a large language model in the social field without fine-tuning the large language model. By learning from the speeches of other people, a high-quality social language knowledge base is constructed, and then the knowledge base is used to assist the large language model in text generation in the social field. The present invention can reduce the probability of a large language model generating text with low social quality in the absence of social ability. At the same time, the construction of the knowledge base of the mainstream social language continues with the continuous social activities, and the quality of the generated text output by the large language model becomes higher and higher by referring to the knowledge base. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0024] Figure 1 A flowchart of a method for improving the performance of large language models in the social domain without fine-tuning them;

[0025] Figure 2 A schematic diagram of an embodiment of a method for improving the performance of a large language model in a social domain without fine-tuning the large language model;

[0026] Figure 3 A flowchart of an embodiment of step S2 of a method for improving the performance of a large language model in a social domain without fine-tuning the large language model;

[0027] Figure 4 The figure is a flow chart of an embodiment of step S3 of a method for improving the performance of a large language model in a social domain without fine-tuning the large language model. DETAILED DESCRIPTION

[0028] In order to make the technical solutions and advantages of the embodiments of the present invention more clearly understood, the exemplary embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0029] refer to Figure 1-Figure 4 The present embodiment is described in detail, a method for improving the performance of a large language model in the social domain without fine-tuning the large language model, specifically comprising the following steps:

[0030] S1. Build a large language model and collect the comment corpus to be generated and its corresponding social domain corpus;

[0031] S2. Filter out the highest quality texts by analyzing social domain corpus, and build a knowledge base of mainstream social languages ​​by combining vector retrieval library;

[0032] S3. Improve the performance of the large language model through the knowledge base, input the current comment corpus to be generated into the large language model, and output the generated text suitable for the social environment.

[0033] Specifically, in the social field, there are many speakers, and the sentences generated by the large language model are often not the first sentence of a speech. Therefore, when entering a topic discussion, the large language model can first observe the speeches of other people. When the large language model is about to speak on a certain content, several speeches of other people are given to the input of the large language model at the same time. This can help the large language model understand the theme, form or style of the speech more quickly, and avoid the output of the large language model being incompatible with the social field;

[0034] For example, when browsing posts on Weibo, the commenter may not know what to comment on based on the content of posts posted by others. However, by clicking on the comment area to view other people's comments, it is easier to get the content of comments related to the same topic. Analogously to the processing process of the large language model, if only the content of the post is input into the large language model, then the large language model does not know what content should be generated for comment, or the content of the comment is far from the style and form of other people's comments, resulting in the comments generated by the large language model being identified as meaningless comments by robots. If we input the content of the post and the popular comments in the comment area into the large language model at the same time, then the large language model can generate more human-like content, which will greatly improve the generation quality of the large language model in the field of social media.

[0035] Step S1 can collect other people's social language, that is, social field corpus, to accumulate corpus for the subsequent step 2.

[0036] Furthermore, the step S2 specifically includes the following steps:

[0037] S21. Conduct statistics on social domain corpus, check data distribution, and determine quantiles;

[0038] S22. Formulate a screening strategy for the highest quality texts based on the quantiles to ensure that the set number of screenings is sufficient and the highest quality texts are selected;

[0039] S23. Using the topics of the review corpus to be generated and the highest quality text as keys and the text itself as values, a knowledge base based on a vector database is constructed;

[0040] In S22, before constructing the knowledge base, it is necessary to select high-quality parts from a large amount of social domain corpus. To this end, it is necessary to conduct statistics and analysis on the existing corpus. The screening strategy is as follows: the screening index is set as the evaluation between people on the social domain corpus. The higher the evaluation, the higher the quality of the social domain corpus. The evaluation range is set, and the texts in the social domain corpus that do not meet the evaluation range are deleted, and the top 20%-30% of the highest quality texts in the social domain corpus are screened out;

[0041] In S23, a vector database is used as a carrier of the knowledge base. According to the comment corpus to be generated and the highest quality text, the vector database can store vectors and corresponding meta information. The theme of the highest quality text is vectorized using an embedding model, and the corresponding comment corpus to be generated and the highest quality text are stored in the vector database as meta information, so that each key-value pair of the theme-text corresponds to a piece of data in the knowledge base, and a knowledge base based on the vector database is obtained;

[0042] Specifically, in step S1, the large language model not only participates in social activities, but also has a considerable amount of social domain corpus. Before building the knowledge base, the collected social domain corpus needs to be analyzed and processed to ensure that the knowledge base can contain high-quality corpus data. Generally speaking, through mutual evaluation among social participants, a small number of the most popular texts are selected as high-quality social languages, and these languages ​​are built into the knowledge base in the form of "topic-text" key-value pairs;

[0043] The process of determining the quantile is as follows: in the process of counting the corpus in the social field, for the Weibo platform of this embodiment, the likes of the posts will be counted. For example, there are 10,000 pieces of data and the number of likes for each piece of data. When counting the likes, it will be found that there are more data with low likes and fewer data with high likes. Since high-quality data is needed later, the data with high likes will be selected until about x% of the data is selected, where x is a percentage, and the corresponding number of likes is obtained. No matter what percentage is selected, it will stop at the post with a certain number of likes. For example, 20% of the data is selected, which happens to be the data with more than 50 likes, to obtain the statistical result, that is, the data with more than the number of likes corresponding to the required percentage data is selected to obtain the required percentage data;

[0044] The evaluation between people on comments, for example, posts on the Weibo platform have likes, and comments under the posts also have likes. Generally speaking, the more likes a post has, the higher the likes of the popular comments under the post, and the higher the quality of the comments. Analysis shows that there are many comments with likes less than 3 and their quality is very low, so this part of the text is deleted. There are fewer comments with likes greater than 50 and their quality is generally high, so this part of the text is completely retained. Comments with likes between 3-50 need to be more carefully identified, referring to the number of likes of the post. If the number of likes of the comment is greater than 1% of the number of likes of the post, then the comment is retained, otherwise it is discarded. The text filtered in this way is exactly about 25% of the text before filtering, that is, the highest quality social text in the corpus;

[0045] Vector retrieval database is a database that can store vectors and query similar vectors. It is different from traditional databases. The vectors are composed of numbers of many dimensions and are difficult to read directly. Vectors are generated by natural language through an embedding model. The embedding model is used to convert text into vectors, calculate the similarity between vectors, and finally obtain similar texts from the knowledge base. In other words, the embedding model can convert a natural language text into a vector. Traditional databases are stored in natural language and require precise matching when querying, while vector databases store vectors and return similar vectors when querying. Since the input and output of the storage and query of the vector retrieval database are both vectors, it is difficult for humans to directly read the results. Therefore, when converting text into vectors and storing them in the vector retrieval database, the corresponding meta information will be stored at the same time. The meta information is composed of natural language and the content can be customized when storing. Therefore, the natural language form of the text itself will be stored as meta information in the vector retrieval database when storing. For example, when building a high-quality social text database in the microblog scenario, the content of the comments and the content of the corresponding posts will be stored as meta information in the vector database;

[0046] Step S2 requires a certain amount of corpus in the social field for analysis. If there is not enough corpus, data can be collected continuously through step S1 during the process of building the knowledge base.

[0047] Furthermore, the step S3 specifically includes the following steps:

[0048] S31. Refer to other people’s speeches and knowledge base to generate text through a large language model;

[0049] S32. Self-evaluation of the quality of generated texts, and the large language model publishes generated texts suitable for social environments;

[0050] In the S31, the current comment corpus to be generated is converted into a vector through the embedding model, the vector is queried according to the knowledge base to obtain the similarity between the vectors, the social field corpus with the highest similarity is output from the knowledge base, the social field corpus with the highest similarity and the current comment corpus to be generated are input into the large language model, and the generated text is output;

[0051] In said S32, the generated text is evaluated by a preset standard to verify the quality of the generated text. If the generated text is not suitable for the social environment, step S31 is repeated until the generated text is suitable for the social environment and is output by the large language model;

[0052] Specifically, in this embodiment, the preset standards are as follows:

[0053] (1) If the comment is consistent with the topic of the post or can form an echo, 1 point will be awarded;

[0054] (2) If the review used friendly and positive language, 1 point was awarded;

[0055] (3) If the comment has a unique perspective or opinion relative to the post, 1 point will be awarded;

[0056] (4) If the comment is concise, semantically rich, and easy to understand, 1 point will be awarded;

[0057] (5) If the comment contains allusions or memes, 1 point will be awarded;

[0058] Then, for the texts with unqualified quality, step S31 is repeated to regenerate. If the score of the generated text after evaluation is above 3 points, it is considered to be a qualified review. If the score is less than 3, it is considered to be an unqualified review. The knowledge base is used for retrieval, and then the large language model is used to generate a new review based on the retrieval results.

[0059] The knowledge base can guarantee the quality of speech, while the reference speech will have more diversity. This method can explore the diversity of generation while ensuring the minimum generation quality;

[0060] The knowledge base composed of high-quality social language constructed based on the vector database in step S2 can support similarity query in step S3. When the large language model is ready to participate in social activities and speak on a certain content, it first uses the same embedding model as in step S2 to vectorize the content and obtain a vector representing the content. Then, the vector is used to query the knowledge base, and the knowledge base will return the most similar vectors. In the meta-information of these vectors, the social language corresponding to the topic represented by them can be found;

[0061] Retrieve the most popular social language in the knowledge base under the content similar to the current social content. Then, let the large language model generate texts based on the texts obtained from the knowledge base and the current content. This will produce texts with higher quality than step S1 and the retrieval results.

[0062] For example, when the large language model conducts social activities on the Weibo platform, every time it sees a post, it converts the post into a vector, and then inputs the vector into the knowledge base for query. The query results are some vectors. The meta-information of these vectors contains pre-stored comments and posts, which can be read. The posts to be evaluated by the large language model and the corresponding comments retrieved from the knowledge base are input into the large language model at the same time, and the large language model can generate higher quality comments.

[0063] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.

Claims

1. A method for improving the performance of a large language model in the social domain without fine-tuning it, characterized in that: The following steps are involved: S1. Build a large language model and collect the comment corpus to be generated and its corresponding social domain corpus; S2. Filter out the highest quality texts by analyzing social domain corpus, and build a knowledge base of mainstream social language by combining vector retrieval library; S3. Improve the performance of the large language model through the knowledge base, input the current comment corpus to be generated into the large language model, and output the generated text suitable for the social environment.

2. A method for improving the performance of a large language model in a social domain without fine-tuning the large language model according to claim 1, characterized in that: The S2 specifically includes the following steps: S21. Conduct statistics on social domain corpus, check data distribution, and determine quantiles; S22. Formulate a screening strategy for the highest quality texts based on the quantiles, select the highest quality texts while ensuring the set screening quantity; S23. Using the topics of the review corpus to be generated and the highest quality text as keys and the text itself as values, a knowledge base based on a vector database is constructed; In S22, the screening strategy is represented as follows: setting the screening index as the evaluation between people on the social field corpus, setting an evaluation range according to which the higher the evaluation, the higher the quality of the social field corpus, deleting the texts in the social field corpus that do not meet the evaluation range, and screening out the highest quality texts in the social field corpus; In S23, a vector database is used as a carrier of the knowledge base, and the subject of the highest quality text is vectorized using an embedding model according to the comment corpus to be generated and the highest quality text, and the corresponding comment corpus to be generated and the highest quality text are stored in the vector database as metadata, so that each subject-text key-value pair corresponds to a piece of data in the knowledge base, thereby obtaining a knowledge base based on the vector database.

3. A method for improving the performance of a large language model in a social domain without fine-tuning the large language model according to claim 2, characterized in that: The S3 specifically includes the following steps: S31. Referring to the knowledge base, the generated text is obtained through the large language model; S32. Self-evaluation of the quality of generated texts, and the large language model publishes generated texts suitable for social environments; In the S31, the current comment corpus to be generated is converted into a vector through the embedding model, the vector is queried according to the knowledge base to obtain the similarity between the vectors, the social field corpus with the highest similarity is output from the knowledge base, the social field corpus with the highest similarity and the current comment corpus to be generated are input into the large language model, and the generated text is output; In S32, the generated text is evaluated by a preset standard to verify the quality of the generated text. If the generated text is not suitable for the social environment, step S31 is repeated until the generated text is suitable for the social environment and is output by the large language model.

Citation Information

Patent Citations

  • Comment generation method and device, server and storage medium

    CN115221309A

  • Comment generation method and device, electronic equipment and medium

    CN117313677A

  • Question and answer system construction method fusing large language model and domain knowledge

    CN118113832A