Large language model parameter tuning method, evaluation method and device
By acquiring training samples and user interest information, and adjusting the parameters of the large language model, the problems of low evaluation efficiency and low accuracy in existing technologies are solved, achieving efficient and personalized evaluation and recommendation effects, and adapting to rapid business iteration.
Patent Information
- Application Number
- CN202511012428.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-10-31
AI Technical Summary
Existing evaluation methods for large language models in generative tasks are inefficient and highly subjective, making it difficult to adapt to the needs of rapid business iteration. Open-source large models have low accuracy and benchmark datasets are difficult to update.
By acquiring training samples, including business results, annotation results, and user interest information, the first large language model is used for evaluation. Its parameters are adjusted to improve evaluation performance, and a high-quality training sample set and evaluation benchmark dataset are constructed. Combined with the spatiotemporal large language model, user interests are captured to generate personalized recommendation content.
It improves the evaluation effect of large language models, ensures that the evaluation results are consistent with user interests, adapts to business changes, reduces subjectivity and cost, and improves the accuracy and efficiency of evaluation.
Smart Images

Figure CN120873221A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on April 8, 2025, with application number 2025104365690, entitled "Method, Evaluation Method and Apparatus for Parameter Tuning of Large Language Models". Technical Field
[0002] The embodiments in this specification relate to the field of computer technology, specifically to a method and apparatus for optimizing parameters of a large language model, and a method and apparatus for evaluating a large language model. Background Technology
[0003] In the field of artificial intelligence, a large model typically refers to a machine learning model with a large number of parameters (such as tens or hundreds of billions of parameters) and a complex structure. Through training on massive amounts of data, these models can accomplish a variety of complex tasks. Currently, many businesses are developing by integrating large model technologies, especially Large Language Models (LLMs) and multimodal technologies, to meet various project requirements, such as generative tasks that generate corresponding business content based on the subject in a query image. Large models can also be used to evaluate whether various business processes are achieving the expected results.
[0004] However, the business results generated by such generative tasks are highly uncertain and complex, and the business updates and iterations are very rapid, making it difficult for the large models currently used for evaluation to effectively assess such businesses. Summary of the Invention
[0005] This specification provides implementation examples of large language model parameter tuning and large language model evaluation schemes, which can improve the evaluation performance of large language models through parameter tuning.
[0006] In a first aspect, embodiments of this specification provide a method for tuning parameters of a large language model, wherein a first large language model is used to evaluate the execution performance of a target service, and the target service is used to generate service results for subjects in a user's query image based on a second large language model; the method includes: acquiring training samples, the training samples including the service results, annotation results, and first information indicating the user's interest tendency, the annotation results being used to annotate the evaluation labels of the service results; evaluating the first large language model based on the service results to obtain evaluation results for the training samples, the evaluation results and the annotation results including the correlation between the service results and the first information; and adjusting the parameters of the first large language model based on the evaluation results and the annotation results.
[0007] In some embodiments, the training samples include query images.
[0008] In some embodiments, the evaluation results and the annotation results further include at least one of the following evaluation metrics: the relevance of the semantic subject in the business result to the subject in the query image; the correctness of the business result; the logicality of the business result; and the information content of the business result.
[0009] In some embodiments, adjusting the parameters of the first large language model based on the evaluation results and the annotation results includes: determining whether the training sample is an offset sample based on the difference between the evaluation results and the annotation results; if the training sample is determined to be an offset sample, upsampling the offset sample to obtain an amplified offset sample; and adjusting the parameters of the first large language model based on the amplified offset sample.
[0010] In some embodiments, the method further includes: determining whether the training sample is an offset sample based on the difference between the evaluation result and the annotation result; if the training sample is determined to be an offset sample, adjusting the prompt words of the first large language model based on the offset sample and the subjectivity of each evaluation indicator, and then evaluating again based on the business results to obtain a second evaluation result for the training sample; and adjusting the parameters of the first large language model based on the second evaluation result and the annotation result.
[0011] In some embodiments, determining whether the training sample is an offset sample based on the difference between the evaluation result and the annotation result includes: determining the training sample as an offset sample in response to the consistency between the evaluation metric in the evaluation result and the evaluation metric in the annotation result being lower than a preset threshold.
[0012] In some embodiments, obtaining training samples includes: obtaining a first service result and a first annotation result generated by the target service for a first candidate image, wherein the first service result includes location information of at least one subject identified based on the first candidate image, and the first annotation result is used to annotate the location labels of the at least one subject; filtering the first candidate image based on the location information in the first service result and the location labels in the first annotation result to determine a first image; and obtaining the service result and annotation result generated by the target service for the first image as training samples.
[0013] In some embodiments, obtaining training samples includes: obtaining the category of at least one subject in the second candidate image; filtering the second candidate image according to the first category requirements to determine the second image; and obtaining the business results and annotation results generated by the target business on the second image as training samples.
[0014] In some embodiments, the method further includes: acquiring actual business data during the operation of the target service, the actual business data including at least one of the following: query images, first information indicating the user's interest tendencies; determining sample offset data based on the difference between the actual business data and the training samples; and constructing new training samples based on the sample offset data.
[0015] Secondly, embodiments of this specification provide a large language model evaluation method, the method comprising: obtaining the execution result of a target service, the execution result being generated by the target service based on a second large language model of the subject in the user's query image; evaluating the execution result by a first large language model to obtain evaluation data for the execution result, wherein the first large language model is a large language model obtained after parameter tuning based on any of the large language model parameter tuning methods described in the first aspect.
[0016] In some embodiments, the method further includes: obtaining intermediate execution results and class annotation data of the target service, wherein the intermediate execution results are the main categories in the query image identified by the target service, and the class annotation data is used to annotate the class tags of the main body of the query image; and evaluating the intermediate execution results based on the class annotation data using a third language model to obtain the accuracy of the intermediate execution results.
[0017] In some embodiments, obtaining the intermediate execution results and class-specific annotation data of the target service includes: obtaining a benchmark dataset, which contains query images of multiple users and class-specific annotation data corresponding to the query images; and generating intermediate execution results from the target service on the main body in the query images in the benchmark dataset.
[0018] In some embodiments, obtaining the benchmark dataset includes: obtaining historical business data, which contains user query images; filtering the historical business data according to data filtering requirements to obtain target business data; and annotating the query images in the target business data to obtain class-specific annotation data.
[0019] In some embodiments, the step of filtering the historical business data according to data filtering requirements to obtain target business data includes: obtaining the main category of the query image in the historical business data; and filtering the query image in the historical business data according to the second category requirements to obtain target business data.
[0020] In some embodiments, obtaining the benchmark dataset includes: obtaining business data from a third-party platform, the business data containing query images in actual user scenarios; and labeling the query images in the business data to obtain class-specific annotation data.
[0021] In some embodiments, the method further includes: determining whether the query image corresponding to the intermediate execution result is an offset image based on the accuracy of the intermediate execution result; and if the query image is determined to be an offset image, constructing a new benchmark dataset based on the offset image.
[0022] Thirdly, embodiments of this specification provide a large language model parameter tuning device. A first large language model is used to evaluate the execution performance of a target service, which is used to generate service results based on the main body in a user's query image using a second large language model. The device includes: a data acquisition module configured to acquire training samples, the training samples including the service results, annotation results, and first information indicating the user's interest tendency, the annotation results being used to annotate the evaluation labels of the service results; a service evaluation module configured to have the first large language model evaluate the service results to obtain evaluation results for the training samples, the evaluation results and the annotation results including the correlation between the service results and the first information; and a parameter adjustment module configured to adjust the parameters of the first large language model based on the evaluation results and the annotation results.
[0023] Fourthly, embodiments of this specification provide a large language model evaluation device, the device comprising: a result acquisition module configured to acquire the execution result of a target service, the execution result being generated by the target service based on a second large language model of the subject in a user's query image; and a performance evaluation module configured to evaluate the execution result using a first large language model to obtain evaluation data for the execution result, wherein the first large language model is a large language model obtained after parameter tuning based on any of the large language model parameter tuning methods described in the first aspect.
[0024] Fifthly, embodiments of this specification provide a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method described in either the first or second aspect.
[0025] The solutions provided in the above embodiments of this specification can realize the evaluation of image-based content generation tasks. Evaluation results are obtained by evaluating the business results of training samples. Then, the parameters of the first language model are fine-tuned based on the evaluation results and annotation results to help the first language model adapt to different business changes. This allows for the testing of the generation performance of the second language model under different conditions, improving the evaluation effect of the first language model. Furthermore, the evaluation also considers the correlation between the business results and the first information used to indicate the user's interests, ensuring that the evaluation results are consistent with the user's subjective experience. Attached Figure Description
[0026] To more clearly illustrate the technical solutions of the various embodiments disclosed in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only a few embodiments disclosed in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of a large language model parameter tuning process in an embodiment of this specification;
[0028] Figure 2 This is a schematic diagram illustrating the implementation process of a target service in an embodiment of this specification;
[0029] Figure 3 This is the business result of a target service in one of the embodiments of this specification;
[0030] Figure 4 This is a flowchart of a method for optimizing large language model parameters in the embodiments of this specification;
[0031] Figure 5 This is a schematic diagram illustrating the degree of consistency in the embodiments of this specification;
[0032] Figure 6 This is a schematic diagram of the acquisition and processing path of an offset sample in one embodiment of this specification;
[0033] Figure 7 This is a flowchart illustrating a large language model evaluation method as described in the embodiments of this specification;
[0034] Figure 8 This is a schematic diagram illustrating the construction process of the benchmark dataset in the embodiments of this specification;
[0035] Figure 9 This is a schematic diagram of the structure of the large language model parameter tuning device in the embodiments of this specification;
[0036] Figure 10This is a schematic diagram of the structure of the large language model evaluation device in the embodiments of this specification. Detailed Implementation
[0037] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0038] As mentioned earlier, with the rapid development of large language model technology, its application in content generation across various industries has become widespread. To verify whether the content generated by large language models achieves the expected results, the generated content can be evaluated. However, the content generated by large language models often exhibits divergence and instability, especially when generating content based on the subject in an image. Due to the richness of visual information in images, the diversity of scenes, and the potential multimodal fusion of visual and textual information, evaluating the results of such applications requires comprehensive consideration of numerous uncertainties and complex factors. Currently, there are methods for evaluation through manual assessment and methods utilizing open-source large language models.
[0039] However, manual evaluation has the following problems: First, relying on manual evaluation is extremely inefficient and costly. Second, manual evaluation is highly subjective, as its results are easily influenced by personal experience, knowledge, emotions, and preferences. Utilizing open-source large language models for evaluation has the following problems: First, open-source large models have low accuracy, making it impossible to guarantee evaluation results, and further manual intervention is still required. Second, the rapid development of large model technology leads to a fast iteration speed for the target business itself, while open-source large models and their benchmark datasets are difficult to keep pace with the rapid iteration of the evaluation system in keeping with the business's model updates.
[0040] To address the aforementioned technical problems, this specification provides a method for optimizing large language model parameters and a method for evaluating large language models. Figure 1 A schematic diagram illustrating a large language model parameter tuning process according to an embodiment of this specification is shown. Figure 1As shown, in some embodiments, training samples can be obtained first. These training samples include: business results of the target service, annotation results, and first information indicating the user's interests. Then, based on the prompt words, a first language model evaluates the business results to obtain evaluation results for the training samples. The evaluation metrics in the evaluation results and annotation results include the relevance between the business results and the first information. Then, based on the evaluation results and annotation results, the parameters of the first language model are adjusted. In another embodiment, the training samples further include: a query image. The query image and the first information indicating the user's interests are input into the target service to obtain business results generated by the target service based on a second language model of the main subject in the user's query image. Annotating the business results yields annotation results.
[0041] The target business to be evaluated will be explained below.
[0042] In the embodiments described in this specification, the target service is used to generate service results based on the main subject in the user's query image using a second major language model, in order to satisfy the user's curiosity or inspire the user, and to provide personalized recommendations to the user. For example, when a user takes a picture of their surroundings and uploads the query image to the target service, the target service can identify at least one main subject in the query image and obtain first information indicating the user's interests. Then, based on the first information, it determines the target subject among the at least one main subject, and then generates service results for the user based on the target subject using the second major language model.
[0043] The business results can be recommended content that meets the user's query requirements for the subject. Specifically, the business results can be generated content in different modalities, such as one or more of text, image, video, and audio modalities. For example, when the query image is an image taken by the user of a desktop, the teacup, paper, pen, laptop, tea leaves in the teacup, and the user's exposed pants in the image can all be considered subjects. The generated business results can be text-based content, such as: "What kind of tea is suitable for this teacup?".
[0044] In practice, the first piece of information can be topics or services that users are interested in. Specifically, it can be topics or online services related to people's livelihood and government affairs, product information, cultural and technological fields, historical and geographical knowledge, and current affairs. For example, the first piece of information could be football matches that users care about, traditional culture that they are interested in, or housing provident fund withdrawal services. When multiple subjects are identified, the target subject can be determined from the user's interest tendencies indicated by the first piece of information. That is, the target subject is the subject that the user is interested in. For example, taking desktop objects as an example, if there are multiple subjects on the desktop, such as a teacup, paper, pen, laptop, tea leaves in the teacup, and the user's exposed pants, when the user's first piece of information indicates that the user is interested in traditional Chinese culture, the target subject can be the teacup and tea leaves because the teacup and tea leaves are not only daily necessities but also have a semantic connection with traditional Chinese culture, carrying rich cultural connotations and symbolic meanings.
[0045] Prompts, constructed based on the subject and the user, can be input into a second large language model to generate corresponding business results. These prompts contain information about the subject and may also include user-related information, enabling the second large language model to generate recommended content that the user might be interested in. This recommended content is semantically relevant to the subject and can be personalized text information, products, services, or other resources. For example, when querying an image where the subject is a computer host, the user-constructed prompt could be "Based on the subject, ask questions that the user might be interested in." The business results generated by the second large language model based on the prompt could be text information such as "How can brand A computer host improve work efficiency?" or "How should the cooling system of brand A computer host be designed?" When the user clicks on this text information, it can be input into the second large language model or other large language models to obtain more related text or image content generated by the large language models to answer related questions and satisfy the user's curiosity.
[0046] The embodiments in this specification do not limit the method of obtaining the user's first information. For example, the user's first information can be obtained by analyzing the user's historical behavior data, or by analyzing the attribute information uploaded by the user themselves. Taking the user's billing records as an example of historical behavior data, if items such as running shoes, knee braces, and sports drinks appear multiple times in the billing records, the user's first information can be analyzed to be topic words related to sports and fitness, indicating the user's interest in sports and fitness.
[0047] As one approach, to accurately obtain the user's primary information, one could first acquire the user's associated information, and then use a second language model to generate the user's primary information based on that associated information.
[0048] The user's associated information refers to personal information related to the user, such as the user's occupation, user demographics, and historical behavior. For example, the user's associated information may include at least one of the following: user attribute information, user historical behavior data, user location information, and user current time information.
[0049] Specifically, user attribute information is used to describe a user's basic information, interests, preferences, and behavioral habits, such as education level, social role, and exercise habits, to better model user profiles; user historical behavior data is used to describe a user's online behavior, such as billing records, mini-program usage records, search history, and history of accessing specific locations on the client at specific times, to obtain continuous user behavior in different spatiotemporal scenarios for better analysis of user behavior patterns; user location information can be the geographical location information of the image taken or uploaded by the user, or the shooting location information carried by the image itself, to better predict behavioral patterns through location information; user current time information can be the time when the user took the image or the time when the user uploaded the image to the client, to better predict user behavior patterns through time information.
[0050] The second major language model used here is a deep learning-based artificial intelligence model specifically designed to understand and generate natural language. It can be obtained by fine-tuning an open-source major language model or by training it to learn the deep connections between the user's related information and the primary information through supervised training.
[0051] In one embodiment, the second major language model used to meet the dynamic needs of users can be a Spatial Temporal-LLM (ST-LLM). It is obtained by training or fine-tuning the major language model with large-scale spatiotemporal data (association information). It has a certain spatiotemporal prediction capability and can capture the specific needs of users in different scenarios. The generated recommended content is more in line with the user's current needs.
[0052] In practice, prompts can be constructed based on related information. These prompts are then input into a spatiotemporal large language model to obtain the user's initial information output by the model. For example, the constructed prompts could be: based on the user's profile information {p} and recent purchase history {h}, combined with the current time {t} and location information {l}, predicting what service {f} the user needs, thus obtaining the service prediction {f} output by the model.
[0053] Next, combined Figure 2The implementation process of the target business will be explained in more detail.
[0054] like Figure 2 As shown, the target business can be a recommendation business based on a spatiotemporal large language model. The business mainly includes four modules: an input module, which is used to obtain the input data required during the execution of the target business, such as the user's historical behavior data, attribute information and other related information, as well as the user's query image; a spatiotemporal guidance module, which is used to fine-tune the spatiotemporal large language model; and a preference discovery module, which consists of steps 1, 2, 3 and 4. Here, the step numbers are only used to identify different steps and do not restrict the execution order of the steps.
[0055] In step 1, a scene graph is generated based on the query image. The scene graph contains at least one identified subject and the relationship between the subjects. The scene graph can be represented by a set of triples, where each triple represents the relationship between two subjects. For example, the subjects included in the scene graph are: teacup, paper, pen, laptop, tea leaves in the teacup, and pants. Arrows indicate the relationship between two subjects, such as tea leaves in the teacup and a pen on the paper.
[0056] Step 2: Generate a knowledge graph based on user attribute information and the scene graph. This knowledge graph can also be represented using a set of triples, where each triple represents the association between a subject and a word, and multiple triples form a multi-hop chain relationship. Specifically, it can be based on a pre-set corpus, retrieving association information and / or context information of at least one subject, and then using a large model to generate words that are associated with the subject based on the association information, at least one subject, and context information. The pre-set corpus can be various open knowledge bases or a private corpus. The words can be seen as knowledge augmentation based on the scene graph, to better utilize the large language model as a user agent to simulate user preferences and interests. Figure 2 Taking the knowledge graph in the example, the vocabulary in the blue module is expanded from the main body, and the vocabulary in the yellow module is expanded from related information.
[0057] Step 3: Generate the first information based on the user's attribute information and historical behavior data using a pre-trained spatiotemporal large language model. For example... Figure 2 As shown in step 3 of the preference discovery module, the associated information input into the spatiotemporal large language model can include user attribute information and user historical behavior data. After inputting the associated information into the spatiotemporal large language model, the model can model user interests and predict the first information indicating the user's interest tendency.
[0058] Step 4: Based on the first information, the knowledge graph is searched and sorted to determine the target subject and the words associated with the target subject. Specifically, based on the first information, the target subject and the words associated with the target subject are determined from at least one subject and the words associated with the subject. In practice, the semantic similarity between the first information and each subject-word pair (i.e., the subject and the words associated with that subject) can be calculated, and then the one or more subject-word pairs with the highest similarity can be determined as the target subject and the words associated with the target subject, in order to find the target subject and words that are closest to the user's interests. For example, in order to further construct a personalized knowledge graph, hop-by-hop semantic indexing can be performed on the knowledge graph to effectively retrieve relevant information and efficiently capture first-order neighbors with clear semantic relationships, thereby using this as a new basis for knowledge retrieval and enhancing the knowledge matching ability of user interests. For example, a pre-trained language model (e.g., a generative encoder) can be introduced to semantically encode the first information and the triples in the knowledge graph respectively to obtain the first semantic vector and the second semantic vector, thereby capturing their potential semantic information. In a knowledge graph, since the relationships between multiple subjects and words are connected by a chain of triples, the semantic similarity between the first semantic vector corresponding to the first piece of information and the second semantic vector corresponding to the triple can be calculated hop by hop.
[0059] During hop-by-hop computation, the similarity between the first semantic vector and the second semantic vector corresponding to the first hop can be calculated first. If the similarity is higher than a set threshold, the triple is considered highly relevant and retained. Otherwise, the process continues to propagate backward along the graph structure and recursively calculates the similarity of adjacent triples in the next hop to ensure the scalability of the retrieval range. For example, the similarity between the first semantic vector and the second semantic vector corresponding to the second hop can be calculated and it can be determined whether it is higher than a set threshold. This process is repeated until the entire knowledge graph is traversed.
[0060] Finally, after completing the hop-by-hop indexing, the retained relationships are filtered and sorted according to semantic similarity. For example, the top 5 relationships are selected, and the subjects and words associated with these relationships are used as target subjects and words related to the target subjects for subsequent personalized recommendations or knowledge enhancement tasks.
[0061] like Figure 2As shown in step 4 of the reordering process, by comparing the similarity between the first semantic vector and the second semantic vector corresponding to the association between tea and beverages, the similarity score for the association between tea and beverages is 0.9. Similarly, by comparing the similarity between the first semantic vector and the second semantic vector corresponding to the association between tea and cultural experience, the similarity score for the association between tea and cultural experience is 0.7. A higher similarity score indicates a greater semantic similarity between the two, demonstrating a high level of user interest in beverages. Generating questions based on this interest satisfies the user's needs. However, analyzing only the target image without considering user interests makes it difficult to elicit the concept of beverages. This method effectively extracts structured knowledge from complex visual content and generates personalized knowledge graphs based on user preferences, thereby improving the accuracy and relevance of information retrieval and recommendation.
[0062] The personalized recommendation module uses a spatiotemporal large language model to generate at least one recommended content (i.e., a business result) for a user based on the target subject and related words. In practice, a large language model can be constructed based on the target subject and related words to input prompt words. This model can then output corresponding recommended content. Prompt words can include user attribute information and historical behavior data to provide the large model with rich background information. They can also include the user's location and current time information to help the model capture the user's complex and dynamic needs that change over time and space based on actual time and geographical environment. Exemplary recommended content could include questions like "What kind of tea is suitable for this teacup?", "What are the types and materials of traditional Chinese teacups?", and "What are the types of tea in China?", thereby stimulating the user's interest.
[0063] like Figure 3 As shown, Figure 3 This document illustrates an exemplary business result of a target service provided in this specification, displayed on a user terminal's screen. This screen includes a text section and a view section. The text content in the text section is the business result generated by the second language model, and the view section contains an image of the subject from the query image. For example, the generation process of this business result could be as follows: A user takes an image of sausages drying on a balcony and uploads it to the target service for querying. After obtaining the query image, the target service identifies the subject "sausage" from the image, then constructs a prompt based on the sausage image, stating "Based on the sausage in the image, ask the user questions they might be interested in," and inputs this prompt into the second language model. The second language model then generates questions such as: "What are the different versions of sausages in the world?", "How are sausages made?", and "Why has sausage become a classic delicacy?".
[0064] In the process of gradually realizing the requirements of the target business, strong indicator data is needed to evaluate whether the target business has achieved the expected results. This specification's embodiment divides the evaluation of the target business's execution performance into two modules: the understanding module primarily ensures the business rationality of the business results, and the intent module primarily ensures the accuracy of the main category identification in the view panel. In the understanding module, the first major language model is used to evaluate the business results of the target business. The detailed process of parameter tuning for this first major language model is explained below.
[0065] Figure 4 A flowchart illustrating a method for tuning parameters of a large language model according to an embodiment of this disclosure is shown. This parameter tuning process can be performed by any device, platform, or cluster of devices with computing and processing capabilities, and includes steps S401-S403 as shown below.
[0066] like Figure 4 As shown, in step S401, training samples are obtained.
[0067] Each training sample includes a business result and a corresponding annotation result, as well as first information indicating the user's interest tendency in that training sample. The business result is the output of the aforementioned target business, and the annotation result is used to label the business result with evaluation tags. The annotation result can be the result of manual scoring and annotation of the business result according to evaluation criteria. It is understood that the evaluation criteria can also be used as the evaluation criteria for the first language model to evaluate the business result and obtain the evaluation result. The first information can be information generated during the implementation process of the target business described in the foregoing embodiments.
[0068] In this embodiment, the evaluation metrics for both the evaluation results and the annotation results can include the correlation between the business results and the first information, in order to assess whether the content of the target business output matches the user's personal intentions. By emphasizing this evaluation metric, it is possible to avoid situations where users are not interested in the business results.
[0069] Different evaluation criteria can be used in different embodiments. In one example, to avoid incorrect knowledge information and illegal guidance in the business results, three business-related evaluation indicators—relevance, correctness, and logicality—can be set in the evaluation criteria. In another example, a series of standards and criteria can be used to constrain the evaluation of the model to comprehensively consider various uncertainties and complex factors, reducing evaluation bias. Specifically, to evaluate the effectiveness of the target business in generating personalized recommendation content, the evaluation criteria need to not only capture the relevance of the recommended content to the visual query but also measure its alignment with user interests. The evaluation results and annotation results can also include at least one of the following evaluation indicators: the relevance of the semantic subject in the business result to the subject in the query image; the correctness of the business result; the logicality of the business result; the information content of the business result; and the relevance of the business result to the primary information. It is understood that the specific details of the evaluation indicators are related to the content of the business result.
[0070] For example, when the business result is text-based recommended content (such as a question), the relevance between the semantic subject in the business result and the subject in the query image can be considered as image-text relevance, used to evaluate whether the output recommended content is related to the subject of the visual query; the correctness of the business result is the correctness of the recommended content, used to evaluate whether the output recommended content contains misleading information that violates compliance; the logicality of the business result is the logicality of the question, used to evaluate whether the output question is logical and easy to understand; the information content of the business result can be considered as the attractiveness of the question, used to evaluate whether the output question provides new perspectives or involves content that is not well known to most people. Generally speaking, the greater the information content of the question, the stronger its attractiveness; the relevance of the business result to the primary information, i.e., the personalization of the question, used to evaluate whether the output question is highly related to the user's personal intent and interests.
[0071] In different embodiments, the scoring criteria for evaluation indicators can vary. In one embodiment, three levels—high, medium, and low (1 / 0 / -1)—can be set for manual evaluation, where a higher level or score indicates better performance of the target business. Furthermore, considering that subjective evaluations are easily influenced by personal experience, knowledge, emotions, and preferences, to reduce potential biases caused by subjectivity, objective data or the opinions of multiple evaluators can be combined for comprehensive analysis. For example, during the evaluation process, multiple groups of similarly educated annotators can be used to ensure the validity of the results. For instance, when the business outcome is a problem, the annotation result could be: "Problem perspective diversity: 1 point, problem logic: 1 point, problem personalization: -1 point, problem information content: 1 point, content accuracy: 1 point, image and text relevance: 1 point."
[0072] In practice, training samples can be obtained from a pre-prepared training sample set or from other designated locations.
[0073] In one embodiment, in order to improve the parameter tuning effect of the first language model and reduce the annotation cost, based on the idea of active learning, this embodiment also constructs a high-quality training sample set to assist the first language model in continuous fine-tuning and iteration. The most valuable data is selected in the training sample set to improve the model's performance and learning efficiency, and the amount of labeled data required is reduced. The following are examples of several ways to obtain training samples in the training sample set. It can be understood that the following examples of obtaining training samples can be used separately or in combination.
[0074] In one example, to ensure the validity of the training sample set, the data can be strictly filtered. When obtaining training samples, the first service result and the first annotation result generated by the target service for the first candidate image can be obtained. The first service result contains the location information of at least one subject identified based on the first candidate image, and the first annotation result is used to annotate the location labels of at least one subject. Based on the location information in the first service result and the location labels in the first annotation result, the first candidate image is filtered to determine the first image. The service result and annotation result generated by the target service for the first image are obtained as training samples.
[0075] Since the business results of the target service are generated based on the subject in the user's query image, if the subject detection in the query image is incorrect, the subject is unclear, or the user's query intent is ambiguous, it will affect the quality of the generated business results. Evaluating such business results cannot reflect the true execution performance of the target service, and these results can be considered invalid data. This example can filter out such invalid data by verifying the accuracy of the detected subject's location in the target service.
[0076] Specifically, the first candidate image can be a query image from the historical business data of the target business. When the target business identifies the subject in the first candidate image, it generates a first business result. The first business result contains the location information of at least one subject identified based on the first candidate image, such as the bounding box of the subject. By manually annotating the first candidate image, the first annotation result, i.e., the ground truth (GT), can be obtained. Then, the degree of overlap between the bounding box and the GT can be measured by IoU (Intersection over Union) or other filtering strategies. If the IoU value is greater than a certain threshold (e.g., 0.5), the detection is considered successful, and the first candidate image is retained and determined as the first image. Otherwise, it means that the target business has failed to detect the subject, and the first candidate image is filtered out to ensure that samples with unclear subjects or ambiguous intentions do not flow into the training samples.
[0077] In another example, to ensure the data diversity of the training sample set, when acquiring training samples, one could obtain the category of at least one subject in the second candidate image; filter the second candidate image according to the first category requirement to determine the second image; and obtain the business results and annotation results generated by the target business on the second image as training samples.
[0078] The second candidate image can be an image collected from historical business data, various online platforms, or manually captured images. Subject recognition is performed on the second candidate image to obtain the categories of different subjects within it. For example, in this embodiment, the subject category can refer to a second-level category. When the first-level category is electronic products, the second-level category could be categories such as mobile phones, televisions, headphones, and computers. In other embodiments, the subject category can also refer to other levels of categories. The first category requirement can be a requirement for the richness of various categories, such as a requirement for the proportion of different categories. The second candidate image that meets the first category requirement is determined as the second image, and the business results generated by the target business based on the second image are manually labeled to obtain the corresponding annotation results, thereby obtaining training samples. By sampling different subject categories, category richness is ensured, so that the training samples provide sufficient differentiated information, thereby ensuring the comprehensive evaluation performance of the first language model.
[0079] In another example, considering the rapid iteration speed of the target business, in order to enable the primary language model to be adjusted in a timely manner according to business changes, the actual business data during the target business operation can also be obtained. The actual business data includes at least one of the following: query images, which are the primary information indicating the user's interest tendencies; determining sample offset data based on the difference between the actual business data and the training samples; and constructing new training samples based on the sample offset data.
[0080] In practice, the actual business data generated by the target business during runtime includes query images collected by different users in different scenarios, as well as the first information of different users. Due to the rapid development of society, many new things are generated every day, which makes the categories of the main subjects in the query images and the interests of users constantly updated. By comparing the differences between the actual business data and the training samples in the training sample set, the sample offset data after the business changes can be determined. The sample offset data contains query images and / or first information that have not appeared in the training samples. New training samples are constructed through the sample offset data, so that the training sample set can be quickly updated with the business iteration of the target business, thereby improving the evaluation performance of the first language model for newly emerging business data.
[0081] Next, in step S402, the first language model performs an evaluation based on the business results to obtain the evaluation results for the training samples.
[0082] In practice, prompt words can be constructed and input into the primary language model to guide it in evaluating business results and obtaining evaluation results. Prompt words refer to the information input into the primary language model, which can include information of different modalities such as text and images. The purpose is to guide the primary language model to evaluate business results according to the evaluation criteria or requirements in the prompt words and generate corresponding evaluation results. The primary language model can be an open-source large model or a pre-trained large model. In different embodiments, the primary language model can be a large model of different specific types or with different neural network structures, and the prompt words can also be different specific prompt words; this specification does not impose any restrictions on this.
[0083] In different embodiments, the specific scoring criteria indicated by the prompt words may be different. In one embodiment, when the business result is a question generated for the subject in the query image, the evaluation index in the scoring criteria may be the logicality of the business result, and the prompt words may be "Please score the logicality of question q: 5 points: logically correct, accurate and fluent; 4 points: logically basically correct, accurate in expression; 3 points: logically basically correct; 2 points: logically flawed, part of the result is incorrect; 1 point: logically flawed, part of the content is misunderstood; 0 points: false content".
[0084] The evaluation metrics in the scoring criteria can also include the relevance of the semantic subject in the business result to the subject in the query image; the correctness of the business result; the logicality of the business result; the information content of the business result; and the relevance of the business result to the primary information. When the business result is a question generated for the subject in the query image, the prompt word A could be "The question content is: q,"
[0085] Please rate the two related items based solely on the semantic subject in the question (considering only the semantic subject) and the subject in the diagram, using a score range of [-1, 0, 1]. The specific meanings of each score range are as follows:
[0086] -1: The semantic subject of the problem (considering only the semantic subject) is irrelevant to the subject in the diagram.
[0087] 0: The subject of the question (considering only the semantic subject) is too broad.
[0088] 1. The subject of the question (considering only the semantic subject) is clearly defined and consistent with the subject in the diagram.
[0089] Please score according to the score tier rules. Note that you only need to output the score, and put it in the first element of the list;
[0090] Please rate the correctness of the question's content, using a score range of [-1, 0, 1]. The specific meanings of each score range are as follows:
[0091] -1: Cost of content errors or content containing misleading information.
[0092] 0: The question is normal, but the knowledge required is unclear.
[0093] 1. The question involves a certain amount of knowledge.
[0094] Please score according to the score tier rules. Note that you only need to output the score, and put it in the second element of the list;
[0095] Please rate the logical reasoning behind the question, with a score range of [-1, 1]. The specific meanings of each score range are as follows:
[0096] -1: The problem description lacks logic and is difficult to understand; or the problem contains nouns or terms.
[0097] 1. The problem logic is clear.
[0098] Please score according to the score tier rules. Note that you only need to output the score, and put it in the third element of the list;
[0099] Please rate the information content of the question, using a score range of [-1, 0, 1]. The specific meanings of each score range are as follows:
[0100] -1: The answer to the question is too simple (obvious to the naked eye, requiring almost no thought);
[0101] 0: The question is mediocre, and the answer is familiar to most people (common sense, but requires some thought);
[0102] 1. The question presents a new perspective or involves content that is not widely known.
[0103] Please score according to the score tier rules. Note that you only need to output the score, and put it in the fourth element of the list;
[0104] User's personal interest keyword (i.e., primary information): 'usr_interest'. Please rate the relevance between the question and any item in the user's interests, in score ranges [-1, 1]. The specific meanings of each score range are as follows:
[0105] -1: Not related to the user's personal interests;
[0106] 1. It is relevant to the user's personal interests and has a sense of novelty and a desire for exploration.
[0107] Please score according to the score tier rules. Note that you only need to output the score, and put it in the fifth element of the list;
[0108] Finally, output the result as a list. Note that only output the list format. If other problems occur, output [0, 0, 0, 0, 0].
[0109] In the above embodiments, the prompt words include business results and first information. In other embodiments, the prompt words may also include query images to assist the first language model in better evaluation. After inputting the prompt words into the first language model, the evaluation results obtained may include scores for various evaluation indicators.
[0110] It is understood that business results are not limited to questions, but can also be knowledge-based content, emotion-related content, etc. For other types of business results besides questions, prompt words can be generated in a similar way to the above example, which will not be elaborated on in this embodiment.
[0111] Next, in step S403, the parameters of the first language model are adjusted based on the evaluation results and annotation results.
[0112] In practice, discrepancies may arise between the evaluation results output by the first language model and the manually labeled results. For example, for a certain evaluation metric, the evaluation result might be low, while the labeled result might be high. By adjusting the parameters of the first language model, this discrepancy can be gradually reduced, making the evaluation results increasingly closer to the labeled results, thereby continuously improving the evaluation performance of the first language model. For instance, a loss function can be calculated based on the difference between the evaluation and labeled results, and then the parameters of the first language model can be adjusted with the goal of minimizing the loss value of the loss function. Parameter adjustments can be made by fine-tuning some parameters, adjusting all parameters, or optimizing prompt words using Prompt Tuning (P-Tuning).
[0113] In one embodiment, for the part where the evaluation results predicted by the first language model differ significantly from the manually labeled results, expert knowledge can be introduced for secondary calibration, and this can be used as a hard case to strengthen the training of the first language model.
[0114] In one example, one could first determine whether the training sample is an offset sample based on the difference between the evaluation results and the annotation results. Then, if the training sample is determined to be an offset sample, the offset sample is upsampled to obtain the amplified offset sample. Finally, the parameters of the first language model are adjusted based on the amplified offset sample.
[0115] In practice, the difference between the evaluation results and the annotation results can be measured first. Different methods can be used to measure this in different embodiments. For example, a loss function can be used to calculate the difference between the two. The larger the loss value of the loss function, the greater the difference. When the loss value exceeds a preset threshold A, the training sample is determined as an offset sample. Alternatively, the similarity between the two can be calculated. The lower the similarity, the greater the difference. When the similarity is lower than a preset threshold B, the training sample is determined as an offset sample.
[0116] One implementation approach is to identify training samples as offset samples when the consistency between the evaluation metrics in the evaluation results and the evaluation metrics in the annotation results is lower than a preset threshold. For example, the consistency between the evaluation results and the annotation results can be calculated using Pearson correlation coefficient, Spearman rank correlation coefficient, or Cohen's Kappa coefficient. Alternatively, exact match can be used to calculate the consistency, i.e., the matching degree of content and format between the evaluation results and the annotation results. If the consistency is lower than a preset threshold, it indicates a significant difference between the evaluation results and the annotation results, and these samples are identified as offset samples. For example, Figure 5The diagram illustrates the degree of consistency. For exact match, the closer the score is to 1, the higher the degree of consistency. For the Kappa coefficient, when the score is greater than 1, the two are considered to have a high degree of consistency.
[0117] After identifying the offset samples, expert experience can be used to determine the reasons for the large differences in the offset samples and take appropriate measures. For example, if it is due to errors in manual annotation, the offset samples can be re-annotated. If it is due to model prediction errors, the offset samples can be used as a hard case to recalibrate the model.
[0118] In this example, when the offset sample is a hard case, it can be upsampled to obtain an amplified offset sample. This embodiment does not limit the specific upsampling method. For example, it can use simple oversampling to duplicate the offset sample to increase its number in the training sample set, or it can use synthetic minority class oversampling to generate new samples by interpolation between training samples, thereby amplifying the offset sample and increasing its weight in the training sample set. Finally, steps S402 and S403 can be executed again based on the amplified offset sample to adjust the parameters of the first language model. The adjusted model can achieve better evaluation results when facing hard cases.
[0119] In another example, if the training samples are determined to be offset samples, the prompt words of the first language model can be adjusted based on the offset samples and the subjectivity of each evaluation metric. The evaluation can then be performed again based on the business results to obtain a second evaluation result for the training samples. Finally, the parameters of the first language model can be adjusted based on the second evaluation result and the annotation result.
[0120] In practice, the scores of various evaluation indicators in the annotation results are greatly influenced by the subjective opinions of the annotators, resulting in a large difference between the evaluation results predicted by the model and the annotation results. To address this issue, this embodiment considers adjusting the prompts for the input model based on the subjectivity of each evaluation indicator, making them closer to human subjective thinking, thereby narrowing the gap between the annotation results and the evaluation results and improving the model's evaluation performance.
[0121] For example, when annotators score different evaluation metrics, the order of subjectivity for each metric in their evaluation logic could be: attractiveness > logicality > content accuracy > subject relevance > interest relevance. For instance, the prompt could include "Please subjectively score the above evaluation metrics according to the subjective order of attractiveness > logicality > content accuracy > subject relevance > interest relevance." Alternatively, the scoring criteria for the prompt could be optimized to better reflect human subjective thinking. For example, prompt B, obtained by optimizing prompt A in the above example, could be "The problem content is: q. Regarding the relevance of the problem to the main image, please score according to the following steps, and finally only output the score."
[0122] 1. Identify the semantic subject from the problem text, that is, the main object that is emphasized or focused on.
[0123] 2. Observe and identify the main subject in the image, and clarify the main object displayed in the image.
[0124] 3. Compare the semantic subject in the problem with the subject in the image:
[0125] If they are irrelevant, please rate them -1.
[0126] If the semantic subject of the question is too broad and difficult to match, please give it a score of 0.
[0127] If the semantic subject is clear and is the same as the subject in the diagram, please score 1.
[0128] If there is uncertainty, simply give a score of 0 and output the scores as a list, with the score placed in the first element of the list.
[0129] To ensure the correctness of the questions, please analyze the following questions in detail, and only output the score:
[0130] 1. Ensure you fully understand the question.
[0131] 2. Determine if there are any factual errors in the content:
[0132] If there is an obvious error that may lead to an incorrect conclusion, -1 point will be awarded.
[0133] 3. Determine whether the question contains knowledge-based information:
[0134] If the question does not involve clear knowledge, give it 0 points.
[0135] If the question can stimulate knowledge discussion and exploration, give 1 point.
[0136] 4. If there is any uncertainty, simply give a score of 0 and output the scores in a list format, with the score placed in the second element of the list.
[0137] Please score the logical reasoning behind the questions. Please provide a detailed analysis of the following questions and only output the score:
[0138] 1. Ensure you fully understand the question.
[0139] 2. Determine if there are any factual errors in the content:
[0140] If there is an obvious error that may lead to an incorrect conclusion, -1 point will be awarded.
[0141] 3. Determine whether the question contains knowledge-based information:
[0142] If the question does not involve clear knowledge, give it 0 points.
[0143] If the question can stimulate knowledge discussion and exploration, give 1 point.
[0144] 4. If there is any uncertainty, simply give a score of 0. Based on the analysis, derive the final score, which should be placed in the third element of the list.
[0145] Please rate the attractiveness of the question, specify the rating criteria, and only output the rating:
[0146] -1 indicates that the answer to the question is obvious and can be obtained without thinking;
[0147] 0 indicates that the answer to the question is common sense, but requires a brief moment of thought;
[0148] 1 indicates that the problem introduces a new perspective or involves knowledge that is not widely known.
[0149] Problem Analysis: Is the problem simple? Is the answer obvious?
[0150] Common sense level: Is the question understood by most people?
[0151] Novelty: Does the question present a new perspective or uncommon knowledge?
[0152] Select a rating: Based on the analysis of the problem, select the appropriate rating. If you are unsure, simply give a rating of 0. The score should be placed in the fourth element of the list.
[0153] Based on the user's personal interests, only a rating needs to be output. Input:
[0154] User's personal interest keywords: 'usr_interest'
[0155] Questions to be rated: q
[0156] Output: Output the associated rating as the fifth element of the list.
[0157] Execution steps:
[0158] 1. Extract keywords related to users' personal interests.
[0159] 2. Obtain the text of the issue to be evaluated.
[0160] 3. Analyze the correlation between the problem and user interests:
[0161] Find the occurrence of keywords of interest in the question.
[0162] Determine whether the content of the question is likely to generate a sense of novelty or a desire for exploration in the user.
[0163] 4. Scoring will be based on the following criteria:
[0164] -1: The question is irrelevant to the user's interests.
[0165] 1. The question is related to the user's interests and may stimulate their desire to explore.
[0166] 5. If there is any uncertainty, simply assign a score of 0, store the scores as the fifth element of the list, and output them.
[0167] Note: The final output should be a list, and only output in list format. If other issues occur, output "[0, 0, 0, 0, 0]".
[0168] The adjusted prompts are closer to human evaluation logic, making the model's evaluation results more similar to human subjective feelings. Then, based on the adjusted prompts, steps S402 and S403 are executed again until the difference between the labeled results and the evaluation results reaches the preset requirements.
[0169] In other embodiments, the offset samples may also be determined from the evaluation of the first large language model on test samples other than the training samples, such as... Figure 6 As shown, Figure 6Another path for obtaining and processing offset samples is shown. For the manually labeled benchmark dataset, in the first stage of training, it can be sampled to obtain test sample set 1, and then filtered through IoU and other methods to obtain training sample set 1. The specific filtering method is described above and will not be repeated here. The training samples in training sample set 1 are used to fine-tune the parameters of the first language model to obtain version V1 of the first language model. This version V1 of the first language model can be used to evaluate the business results in the test samples in test sample set 1 to obtain the evaluation results corresponding to the test samples. These evaluation results are then compared with the labeled results, and the samples with large differences are identified as offset samples. In the second phase of training, the benchmark dataset can be sampled to obtain test sample set 2. A new training sample set 2 is constructed using the offset samples and training sample set 1. Similarly, the training samples in training sample set 2 are used to fine-tune the parameters of the first language model of version V1 to obtain the first language model of version V2. The first language model of version V2 can be used to evaluate the business results in the test samples in test sample set 2 to obtain the evaluation results corresponding to the test samples. These results are compared with the labeled results, and samples with large differences are identified as new offset samples. This process is repeated until the adjusted first language model meets the business requirements.
[0170] The large language model parameter tuning method provided in this specification has two advantages. First, it can automatically evaluate the business results generated by the target business using a first large language model. Compared to manual evaluation, this significantly improves the efficiency of business result evaluation, reduces labor and time costs, and enhances objectivity. Second, by adjusting the parameters of the first large language model using the evaluation and annotation results of training samples, it improves the accuracy and stability of the first large language model evaluation and allows it to adapt to different business changes. This enables the testing of the generation performance of the second large language model under different iterative versions. Furthermore, the evaluation also considers the correlation between the business results and the primary information used to indicate user interests, ensuring that the evaluation results are consistent with the user's subjective experience.
[0171] The following describes the evaluation process of the large language model after parameter tuning. Figure 7 A flowchart illustrating a large language model evaluation method according to an embodiment of this disclosure is shown. This method can be executed by any device, platform, or cluster of devices with computing and processing capabilities, and includes steps S701-S702 as shown below.
[0172] like Figure 7 As shown, in step S701, the execution result of the target service is obtained.
[0173] The execution result is generated by the target business based on the main subject in the user's query image using the second language model. For a more detailed explanation of the second language model, the target business, and its execution result, please refer to the previous explanations of the second language model, the target business, and its results; they will not be repeated here.
[0174] In step S702, the first language model evaluates the execution result to obtain evaluation data for the execution result.
[0175] The first large language model is the large language model obtained after parameter tuning using any of the methods described in the preceding embodiments. In practice, prompt words can be constructed based on the execution result, the first information, and the query image and incorporated into the first large language model to obtain the output evaluation data. The evaluation metrics in the evaluation data can include the relevance between the execution result and the first information, the relevance between the semantic subject in the execution result and the subject in the query image, the correctness of the execution result, the logicality of the execution result, and the information content of the execution result.
[0176] The solution provided in the above embodiments can realize the evaluation of image-based content generation tasks. The first language model used can be adapted to the changes in the execution results of the second language model when facing different business scenarios through parameter tuning, and the generation performance of the second language model under different conditions can be tested.
[0177] In one embodiment, this specification also provides a method for evaluating intent modules, capable of evaluating such... Figure 2 The accuracy of main category identification in the mid-view module is evaluated. Specifically, intermediate execution results and category annotation data of the target business can be obtained. The intermediate execution results are the main categories in the query image identified by the target business, and the category annotation data is used to label the category tags of the main body of the query image. Then, the third language model evaluates the intermediate execution results based on the category annotation data to obtain the accuracy of the intermediate execution results.
[0178] In practice, during the execution of the target business, before generating the execution result based on the first major language model, it is necessary to detect and identify the subject in the query image to obtain the location box of the subject and the subject category, which is the intermediate execution result. The accuracy of the intermediate execution result affects the actual performance of the target business.
[0179] The evaluation of the accuracy of the subject's location is relatively objective. It can be done by comparing the overlap between the manually annotated subject's bounding box and the location box in the intermediate business result using the Intersection over Union (IoU). If the IoU value is greater than a certain threshold (e.g., 0.8), the detection is considered accurate. The evaluation of the subject's category can be done using a third language model. For example, a prompt word can be constructed, such as "Please compare the category label in the category annotation data with the subject category in the intermediate execution result to see if they match, and output a score of 0-10." The higher the score, the higher the accuracy of the intermediate execution result.
[0180] Considering the numerous subject categories in real-world applications, and the varying difficulty of identifying different subject categories, one approach is to automate the evaluation and coverage process by progressively increasing the difficulty of the subject category attributes. For example, the following demonstrates four evaluation modes:
[0181] a. For categories involving urgent needs or subjective evaluation, manual evaluation can be used. For example, categories related to medical care and safety can be considered urgent need categories, while categories influenced by personal experience can be considered subjective categories, and manual evaluation can be used to ensure accuracy.
[0182] b. For categories with unambiguous objective evaluations, such as pharmaceuticals, where the names and categories of pharmaceuticals are very definite and unambiguous, pre-programmed code logic can be used for evaluation, followed by manual review to reduce the amount of human intervention.
[0183] c. For objective evaluation categories that are ambiguous, such as the category of wine, since there are many types of wine and their appearances are very similar, some biases may occur during evaluation. In this case, a third language model with single-modal input can be used for evaluation. For example, the evaluation can be carried out by constructing prompt words for the text content and inputting them into the third language model.
[0184] d. For ambiguous objective evaluation categories and subjective evaluation categories, subjective evaluation categories are those that are easily influenced by personal experience, such as categories with complicated aliases or colloquialisms like animals, plants, food ingredients, and cosmetics. In such cases, a third language model with multimodal input can be used for evaluation. When constructing prompts, multimodal prompts can be constructed based on the query image, the bounding box of the subject, the subject category, and the category tag to inquire about the degree of matching between the subject category and the category tag. This allows for more accurate evaluation by combining multimodal data.
[0185] Specifically, it can be to preset the evaluation mode for each category. During the evaluation process, depending on the complexity of the category attributes, a single or multiple evaluation methods can be used to output the recall indicators. In practice, by continuously optimizing the code script and the prompt words of the model, the overall evaluation accuracy can reach more than 95% after manual sampling verification.
[0186] In some embodiments, to better evaluate different versions of the target service, a benchmark dataset for that target service can be pre-constructed. This benchmark dataset contains query images from multiple users and corresponding class annotation data for those query images. When obtaining intermediate execution results and class annotation data for the target service, the benchmark dataset can be obtained first, and then the target service can generate intermediate execution results based on the main body in the query images within the benchmark dataset. For example, the query image and class annotation data for a test sample in the benchmark dataset can be obtained, and the target service can identify the main body category based on the query image. In this way, different versions of the target service can be evaluated based on a unified standard benchmark dataset, which can better determine the performance differences between the different versions of the target service.
[0187] The following is combined Figure 8 The process of constructing the benchmark dataset is explained. Figure 8 The full-map data can include historical business data, business data from third-party platforms, and backflow data from the target business. After obtaining the full-map data, it can be backflowed or appended to a table to store it in the database.
[0188] For example, the construction of the benchmark dataset can be divided into three stages:
[0189] Phase 1: Historical Data Reuse and Processing
[0190] In one embodiment, historical business data, which includes user query images, can be obtained first. Then, the historical business data can be filtered according to data filtering requirements to obtain target business data. Next, the query images in the target business data can be labeled to obtain class-specific annotation data.
[0191] In practice, historical business data can be historical data from other image-based query businesses similar to the target business. This historical business data is cleaned according to data filtering requirements to remove invalid data. Invalid data can be duplicate data, incomplete data, or erroneous data, etc. Different implementations can adopt different cleaning methods according to the data filtering requirements. For example, it can be as follows: Figure 8As shown, historical business data in the database can be directly cleaned using a large model. Then, the positions of the main objects in the query image can be manually labeled (i.e., pre-labeling to obtain bounding boxes), and the categories of the main objects in the query image can be manually labeled to obtain category annotation data for secondary categories. Random sampling of this category annotation data yields the benchmark dataset usable by the intent module. This benchmark dataset can contain the bounding boxes of the main objects and their secondary categories. The category annotation data can also include the necessary attributes of the main objects, such as brand, category, and primary category, to ensure that the category name of the main object is unambiguous. For example, the necessary attributes for "apple" could be "plant" or "fruit," to distinguish it from the necessary attributes of "phone" or "electronic product" (e.g., "Apple phone"). The necessary attributes can be automatically labeled by a pre-trained large model. To improve the accuracy of the labeling, [further steps are needed]. Figure 8 As shown, multiple large models (large model 1, large model 2, large model 3, and large model 4) can be used to annotate the main objects in the same query image. Then, the answers output by different large models are combined as a reference answer, and manual annotation is performed based on this reference answer to obtain richer category annotation data. Figure 8 The standard category detailed attributes are available in a dataset, which can serve as a richer benchmark dataset. Based on this richer benchmark dataset, the model will output correspondingly richer category evaluation data. All the datasets obtained above can be manually reviewed to ensure their accuracy.
[0192] One approach to data cleaning is to obtain the main category of the query images in historical business data, and then filter the query images in the historical business data according to the second category requirements to obtain the target business data.
[0193] The second category requirement can be a requirement for the richness of various categories, such as the percentage or number of different categories. By filtering different main categories, category richness is ensured so that the benchmark dataset can provide sufficient differentiated information, thereby enabling the comprehensive performance evaluation of the target business.
[0194] In this stage, historical data from other businesses were reused. This data was cleaned, labeled, and processed and then persistently stored. This stage can utilize existing data resources to quickly build the initial dataset even when data resources are insufficient.
[0195] In other embodiments, the historical data may also include historical service data of the target service.
[0196] Phase Two: Data Crawling and Collection
[0197] In one embodiment, business data from a third-party platform may be obtained, which includes query images from actual user scenarios. The query images in the business data are then labeled to obtain class-specific annotation data.
[0198] In practice, third-party platforms can be travel, social, video sharing, or other types of websites or applications. Data scraping can be used to obtain data closely related to actual user scenarios, ensuring the dataset better matches the usage patterns of the target business. Third-party platforms provide rich and diverse data samples, thereby improving the quality and representativeness of the dataset. The specific annotation process is detailed in the first stage and will not be repeated here.
[0199] Phase 3: Link Backflow and Targeted Reinforcement
[0200] In the third stage, data can be retrieved from the actual business data of the target business and then used for targeted reinforcement. Similar to the first stage, large-scale models can be used to clean the data based on randomly sampled category results and their proportions to ensure that the data meets the preset category requirements. The cleaned data is then returned to the benchmark dataset. This step helps to supplement and improve the dataset, ensuring that it covers a wider range of situations.
[0201] In one embodiment, the targeted reinforcement construction can be based on the Hard Case, i.e., the offset image, in the benchmark dataset. Specifically, it can be determined whether the query image corresponding to the intermediate execution result is an offset image based on the accuracy of the intermediate execution result. If the query image is determined to be an offset image, a new benchmark dataset can be constructed based on the offset image.
[0202] For example, if the accuracy of the intermediate execution result is lower than a preset threshold, it indicates that there is a significant difference between the subject category and the category annotation data in the query image obtained by the target business identification. The evaluation performance of the model on the subject category needs to be strengthened. The query image corresponding to the intermediate execution result can be identified as an offset image, and then the offset image can be strengthened by targeted enhancement. For example, the offset image can be upsampled to obtain an expanded offset image and added to the evaluation benchmark dataset. Alternatively, data samples under specific scenarios can be generated based on the scene in the offset image to enhance the diversity and complexity of the dataset, thereby improving the model's understanding and generalization ability.
[0203] In addition, for the understanding module, the same process can be used to construct the corresponding benchmark dataset to evaluate the execution performance of different versions of the target business based on a unified standard benchmark dataset. The difference lies in the annotation part of the query image. For example, after determining the query image of the benchmark dataset, the target business can generate business results based on the query image and the first information. Then, the various evaluation indicators of the business results are manually annotated to obtain evaluation labels. Finally, the benchmark dataset is constructed based on the business results, annotation results, query image and the first information.
[0204] Figure 9 This is a schematic diagram of the large language model parameter tuning device in the embodiments of this specification. This device can be applied to any device, platform, or device cluster with computing and processing capabilities. The first large language model is used to evaluate the execution performance of the target service, and the target service is used to generate service results based on the main body in the user's query image using the second large language model. The device includes:
[0205] The data acquisition module 901 is configured to acquire training samples, which include business results, annotation results, and primary information used to indicate user interest tendencies. The annotation results are used to label the evaluation tags of the business results.
[0206] The business evaluation module 902 is configured to evaluate the first language model based on the business results, and obtain the evaluation results for the training samples. The evaluation results and annotation results include the correlation between the business results and the first information.
[0207] The parameter adjustment module 903 is configured to adjust the parameters of the first language model based on the evaluation results and annotation results.
[0208] In one implementation, the training samples include the query image.
[0209] In one implementation, the evaluation results and annotation results also include at least one of the following evaluation metrics: the relevance of the semantic subject in the business result to the subject in the query image; the correctness of the business result; the logicality of the business result; and the information content of the business result.
[0210] In one implementation, the business evaluation module 902 is specifically configured to determine whether the training sample is an offset sample based on the difference between the evaluation result and the annotation result; if the training sample is determined to be an offset sample, the offset sample is upsampled to obtain an amplified offset sample; and the parameters of the first language model are adjusted based on the amplified offset sample.
[0211] In one embodiment, the apparatus further includes: a prompt word optimization module (not shown in the figure), configured to determine whether a training sample is an offset sample based on the difference between the evaluation result and the annotation result; if the training sample is determined to be an offset sample, based on the offset sample and the subjectivity of each evaluation indicator, by adjusting the prompt words of the first language model, and then evaluating again based on the business results to obtain a second evaluation result for the training sample; and adjusting the parameters of the first language model based on the second evaluation result and the annotation result.
[0212] In one implementation, the business evaluation module 902 or the prompt word optimization module, when determining whether a training sample is an offset sample based on the difference between the evaluation results and the annotation results, is specifically configured to determine the training sample as an offset sample in response to the consistency between the evaluation indicators in the evaluation results and the evaluation indicators in the annotation results being lower than a preset threshold.
[0213] In one implementation, the data acquisition module 901 is specifically configured to: acquire a first service result and a first annotation result generated by the target service for the first candidate image, wherein the first service result includes location information of at least one subject identified based on the first candidate image, and the first annotation result is used to annotate the location labels of at least one subject; filter the first candidate image based on the location information in the first service result and the location labels in the first annotation result to determine the first image; and acquire the service result and annotation result generated by the target service for the first image as training samples.
[0214] In one implementation, the data acquisition module 901 is specifically configured to: acquire the category of at least one subject in the second candidate image; filter the second candidate image according to the first category requirements to determine the second image; and acquire the business results and annotation results generated by the target business on the second image as training samples.
[0215] In one implementation, the data acquisition module 901 is further configured to: acquire actual business data during the operation of the target business, the actual business data including at least one of the following: query images, first information used to indicate the user's interest tendency; determine sample offset data based on the difference between the actual business data and the training samples; and construct new training samples based on the sample offset data.
[0216] Figure 10 This is a schematic diagram of the large language model evaluation device in the embodiments of this specification. This device can be applied to any device, platform, or device cluster with computing and processing capabilities. The device includes:
[0217] The result acquisition module 101 is configured to acquire the execution result of the target business, which is generated by the target business based on the main body in the user's query image using the second largest language model;
[0218] The performance evaluation module 102 is configured to evaluate the execution results using the first large language model to obtain evaluation data for the execution results. The first large language model is a large language model obtained after parameter tuning using any large language model parameter tuning method.
[0219] In one embodiment, the device further includes a category evaluation module (not shown in the figure), configured to acquire intermediate execution results and category annotation data of the target service. The intermediate execution results are the main categories in the query image identified by the target service, and the category annotation data is used to annotate the category tags of the main body of the query image. The intermediate execution results are evaluated by a third language model based on the category annotation data to obtain the accuracy of the intermediate execution results.
[0220] In one implementation, when the category evaluation module obtains the intermediate execution results and category annotation data of the target business, it is specifically configured to obtain an evaluation benchmark dataset, which contains query images of multiple users and category annotation data corresponding to the query images; the target business generates intermediate execution results for the main body in the query images in the evaluation benchmark dataset.
[0221] In one implementation, the category evaluation module is specifically configured to acquire historical business data, which includes user query images, in order to obtain target business data by acquiring the evaluation benchmark dataset; and to annotate the query images in the target business data to obtain category annotation data.
[0222] In one implementation, the category evaluation module filters historical business data according to data filtering requirements to obtain target business data. Specifically, it is configured to obtain the main category of the query image in the historical business data; and filter the query image in the historical business data according to the second category requirements to obtain the target business data.
[0223] In one implementation, the category evaluation module acquires the evaluation benchmark dataset, specifically by acquiring business data from a third-party platform, which includes query images from actual user scenarios; the query images in the business data are then labeled to obtain category annotation data.
[0224] In one implementation, the category evaluation module is further configured to determine whether the query image corresponding to the intermediate execution result is an offset image based on the accuracy of the intermediate execution result; if the query image is determined to be an offset image, a new evaluation benchmark dataset is constructed based on the offset image.
[0225] This specification also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed in a computer, it causes the computer to perform actions such as... Figure 4 and Figure 7 The method described.
[0226] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements, as shown in the embodiment. Figure 4 and Figure 7 The method described.
[0227] This specification also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements... Figure 4 and Figure 7 The steps of the described method.
[0228] Those skilled in the art will recognize that the functions described in the various embodiments disclosed in this specification in one or more of the examples above can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0229] In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0230] The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of the multiple embodiments disclosed in this specification. It should be understood that the above descriptions are merely specific implementations of the multiple embodiments disclosed in this specification and are not intended to limit the protection scope of the multiple embodiments disclosed in this specification. Any modifications, equivalent substitutions, improvements, etc., made based on the technical solutions of the multiple embodiments disclosed in this specification should be included within the protection scope of the multiple embodiments disclosed in this specification.
Claims
1. A method for tuning parameters of a large language model, wherein, The first language model is used to evaluate the execution performance of the target service, which is used to generate service results based on the main subject in the user's query image using the second language model; the method includes: Obtain training samples, which include the business results, annotation results, and first information for indicating user interest tendencies, wherein the annotation results are used to annotate the evaluation labels of the business results; The first large language model performs an evaluation based on the business results to obtain an evaluation result for the training samples. The evaluation results and the evaluation metrics in the annotation results include the correlation between the business results and the first information. Based on the evaluation results and the annotation results, the parameters of the first large language model are adjusted.
2. The method according to claim 1, wherein, The training samples also include the query image.
3. The method according to claim 1, wherein, The evaluation results and the annotation results also include at least one of the following evaluation metrics: the relevance between the semantic subject in the business results and the subject in the query image; The correctness of the business results; the logicality of the business results; the information content of the business results.
4. The method according to claim 1, wherein, The adjustment of the parameters of the first large language model based on the evaluation results and the annotation results includes: Based on the difference between the evaluation results and the annotation results, it is determined whether the training sample is an offset sample; If the training sample is determined to be an offset sample, the offset sample is upsampled to obtain the amplified offset sample; Based on the amplified offset samples, the parameters of the first large language model are adjusted.
5. The method according to claim 1, wherein, The method further includes: Based on the difference between the evaluation results and the annotation results, it is determined whether the training sample is an offset sample; If the training sample is determined to be an offset sample, based on the subjectivity of the offset sample and the evaluation metric, the prompt words of the first large language model are adjusted, and the evaluation is performed again based on the business results to obtain a second evaluation result for the training sample. Based on the second evaluation results and the annotation results, the parameters of the first large language model are adjusted.
6. The method according to claim 4 or 5, wherein, Determining whether the training sample is an offset sample based on the difference between the evaluation result and the annotation result includes: If the consistency between the evaluation metrics in the evaluation results and the evaluation metrics in the annotation results is lower than a preset threshold, the training sample is determined as an offset sample.
7. The method according to claim 1, wherein, The acquisition of training samples includes: The target service generates a first service result and a first annotation result for the first candidate image. The first service result includes the location information of at least one subject identified based on the first candidate image. The first annotation result is used to annotate the location labels of the at least one subject. Based on the location information in the first business result and the location label in the first annotation result, the first candidate image is filtered to determine the first image; The service results and annotation results generated by the target service on the first image are obtained as training samples.
8. The method according to claim 1, wherein, The acquisition of training samples includes: Obtain the category of at least one subject in the second candidate image; Based on the requirements of the first category and the category of at least one subject in the second candidate images, the second candidate images are filtered to determine the second image; The service results and annotation results generated by the target service on the second image are obtained as training samples.
9. The method according to claim 1, wherein, The method further includes: Obtain the actual business data during the operation of the target business, wherein the actual business data includes at least one of the following: query images, which are primary information used to indicate the user's interest tendencies; Based on the difference between the actual business data and the training samples, the sample offset data is determined; Based on the sample offset data, new training samples are constructed.
10. A method for evaluating large language models, the method comprising: Obtain the execution result of the target service, which is generated by the target service based on the main body in the user's query image using the second largest language model; The execution result is evaluated by the first large language model to obtain evaluation data for the execution result. The first large language model is a large language model obtained by parameter tuning based on the method described in any one of claims 1-9.
11. The method according to claim 10, wherein, The method further includes: Obtain the intermediate execution results and class annotation data of the target business. The intermediate execution results are the main categories in the query image identified by the target business, and the class annotation data is used to annotate the class tags of the main body of the query image. The intermediate execution results are evaluated using the third language model based on the class annotation data to determine the accuracy of the intermediate execution results.
12. The method according to claim 11, wherein, The step of obtaining the intermediate execution results and class target annotation data of the target business includes: Obtain the benchmark dataset, which contains query images from multiple users and the corresponding class annotation data for the query images; Based on the target service, intermediate execution results are generated for the main body in the query image in the benchmark dataset.
13. The method according to claim 12, wherein, The acquisition of the benchmark dataset includes: Acquire historical business data, which includes user query images; Based on the data filtering requirements, the historical business data is filtered to obtain the target business data; The queried images in the target business data are labeled to obtain class-specific labeled data.
14. The method according to claim 13, wherein, The step of filtering the historical business data according to the data filtering requirements to obtain the target business data includes: Obtain the main category of the queried image from the historical business data; Based on the requirements of the second category and the main category of the query images in the historical business data, the query images in the historical business data are filtered to obtain the target business data.
15. The method according to claim 12, wherein, The acquisition of the benchmark dataset includes: Acquire business data from a third-party platform, the business data including query images in actual user usage scenarios; The queried images in the business data are labeled to obtain class-specific annotation data.
16. The method according to claim 12, wherein, The method further includes: Based on the accuracy of the intermediate execution results, determine whether the query image corresponding to the intermediate execution results is an offset image; If the query image is determined to be an offset image, a new benchmark dataset is constructed based on the offset image.
17. A parameter tuning device for a large language model, wherein, The first language model is used to evaluate the execution performance of the target service, which is used to generate service results based on the main subject in the user's query image using the second language model; the device includes: The data acquisition module is configured to acquire training samples, the training samples including the business results, annotation results and first information for indicating the user's interest tendency, the annotation results being used to annotate the evaluation labels of the business results; The business evaluation module is configured to evaluate the business results based on the first large language model to obtain evaluation results for the training samples. The evaluation results and the evaluation indicators in the annotation results include the correlation between the business results and the first information. The parameter adjustment module is configured to adjust the parameters of the first large language model based on the evaluation results and the annotation results.
18. A large language model evaluation device, the device comprising: The result acquisition module is configured to acquire the execution result of the target business, which is generated by the target business based on the main body in the user's query image using the second major language model; The performance evaluation module is configured to evaluate the execution result using a first large language model to obtain evaluation data for the execution result. The first large language model is a large language model obtained by parameter tuning based on the method described in any one of claims 1-9.
19. A computing device comprising a memory and a processor, wherein, The memory stores executable code, and when the processor executes the executable code, it implements the method of any one of claims 1-16.