Method, device, equipment and computer-readable medium for constructing large language model
Through cross-fusion of features of multi-modal data and enhanced training of knowledge graphs for large language models, the problem of insufficient understanding of multi-modal data by large models is solved, and stronger multi-modal understanding and analysis capabilities and modalities are achieved. compatibility.
Patent Information
- Application Number
- CN202410616719.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-17
AI Technical Summary
Large language models lack comprehensive mechanisms for multimodal understanding and cannot directly process visual data and other non-textual data.
By acquiring visual data, audio data, text data, brain wave data and eye movement data, we perform feature extraction and integration, use the global model knowledge graph for data enhancement, and use these data as multi-modal training data to perform the initial large language model Train until the model converges to form the target large language model.
It improves the ability of large language models to understand and analyze multi-modal content, solves the problem of large models lacking comprehensive mechanisms for multi-modal understanding, achieves wider modal compatibility and flexibility, and reduces algorithm complexity and deployment cost.
Smart Images

Figure CN118194923B
Abstract
Description
Technical Field
[0001] The present application relates to the field of large model technology, and in particular to a method, device, equipment and computer-readable medium for constructing a large language model. Background Art
[0002] Large language models have made remarkable progress in recent years. By expanding the data scale and model size, large language models have improved amazing emerging capabilities. These often include contextual learning, instruction following, and thought chaining. Although large language models have shown amazing zero-shot and few-shot reasoning capabilities in most natural language processing tasks, their operating framework is limited to processing and understanding textual information. This inherent limitation in design excludes the possibility of directly processing visual data, so additional comprehensive mechanisms are needed to achieve comprehensive multimodal understanding.
[0003] There is currently no effective solution to the problem that large models lack a comprehensive mechanism for multimodal understanding. Summary of the invention
[0004] The present application provides a method, apparatus, device and computer-readable medium for constructing a large language model to solve the technical problem that large models lack a comprehensive mechanism for multimodal understanding.
[0005] According to one aspect of an embodiment of the present application, the present application provides a method for constructing a large language model, including: obtaining visual data, audio data, text data that describe the same content, and brain wave data and eye movement data generated by a user when receiving at least one of the visual data, the audio data, and the text data; performing feature extraction and integration on the visual data and the audio data to obtain cross-features of the visual data and the audio data; performing data enhancement on the cross-features using a global model knowledge graph to obtain graph-enhanced data of the cross-features; using the graph-enhanced data, the text data, the brain wave data, and the eye movement data as multimodal training data to train an initial large language model until the model converges to obtain a target large language model.
[0006] Optionally, performing feature extraction and integration on the visual data and the audio data to obtain cross-features of the visual data and the audio data includes: inputting the visual data into a visual encoder to obtain visual features output by the visual encoder for encoding the visual data; inputting the audio data into an audio encoder to obtain audio features output by the audio encoder for encoding the audio data; aligning the visual features and the audio features in a time series to obtain aligned features; and inputting the aligned features into a cross-Transformer module to utilize the cross-Transformer module to perform feature cross-understanding on the visual features and the audio features to obtain the cross-features.
[0007] Optionally, the cross-features are data enhanced using the global model knowledge graph to obtain the graph-enhanced data of the cross-features, including: searching for a basic entity representing the cross-features in the global model knowledge graph; searching for associated entities whose association is greater than or equal to a preset threshold for each basic entity based on the association between the basic entity and other entities; and obtaining entity information and attribute information of the basic entity and the associated entity as the graph-enhanced data.
[0008] Optionally, using the graph enhancement data, the text data, the brain wave data and the eye movement data as multimodal training data to train the initial large language model includes: assigning weights to the graph enhancement data, the text data, the brain wave data and the eye movement data respectively; constructing an optimization function using the weighted sum of the graph enhancement data, the text data, the brain wave data and the eye movement data; inputting the graph enhancement data, the text data, the brain wave data and the eye movement data into the initial large language model, and using the optimization function to optimize the training results of the initial large language model until the model converges to obtain the target large language model.
[0009] Optionally, the training results of the initial large language model are optimized using the optimization function until the model converges, and obtaining the target large language model includes: determining the understanding deviation of the initial large language model for the multimodal training data based on the labeled data of the multimodal training data and the training results; adjusting the weights of the atlas enhancement data, the text data, the brain wave data, and the eye movement data in the optimization function according to the understanding deviation, and continuing iterative training; when the optimization function makes the understanding deviation of the initial large language model for the multimodal training data less than a target threshold, determining that the model converges and obtaining the target large language model.
[0010] Optionally, after obtaining the target large language model, the method further includes: acquiring retrieval data input by the user; inputting the retrieval data into the target large language model so as to identify the modality contained in the retrieval data through the target large language model, and calling an encoder of the corresponding modality to perform entity extraction and content understanding on the retrieval data, and generate answer data based on the extracted entity information and understood content information; and returning the answer data to the user.
[0011] Optionally, the modalities contained in the retrieved data include at least one of visual data, audio data, text data, brain wave data and eye movement data.
[0012] According to another aspect of an embodiment of the present application, the present application provides a device for constructing a large language model, including: a multimodal data acquisition module, used to acquire visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data and the text data; a feature intersection module, used to extract and integrate features of the visual data and the audio data to obtain cross-features of the visual data and the audio data; a knowledge graph enhancement module, used to perform data enhancement on the cross-features using a global model knowledge graph to obtain graph-enhanced data of the cross-features; a multimodal training module, used to train the initial large language model using the graph-enhanced data, the text data, the brain wave data and the eye movement data as multimodal training data until the model converges to obtain a target large language model.
[0013] According to another aspect of an embodiment of the present application, the present application provides an electronic device, including a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, the memory and the processor communicate through the communication bus and the communication interface, and the steps of the above method are implemented when the processor executes the computer program.
[0014] According to another aspect of an embodiment of the present application, the present application also provides a computer-readable medium having a non-volatile program code executable by a processor, and the program code enables the processor to execute the above method.
[0015] The above technical solution provided by the embodiment of the present application has the following advantages compared with the related art:
[0016] The present application can be applied to computer vision implementation in deep learning technology. The present application provides a method for constructing a large language model, including: obtaining visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data, and the text data; extracting and integrating features of the visual data and the audio data to obtain cross-features of the visual data and the audio data; using the global model knowledge graph to perform data enhancement on the cross-features to obtain graph-enhanced data of the cross-features; using the graph-enhanced data, the text data, the brain wave data, and the eye movement data as multimodal training data to train the initial large language model until the model converges to obtain the target large language model. The present application comprehensively and effectively improves the large language model's ability to understand and analyze multimodal content by cross-fusion of multimodal data features and introducing knowledge graphs, brain wave data, and eye movement data in the multimodal training of the large language model, solving the technical problem that the large model lacks a comprehensive mechanism for multimodal understanding. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 A schematic diagram of a flow chart of an optional method for constructing a large language model according to an embodiment of the present application;
[0020] Figure 2 A block diagram of an optional large language model construction device provided according to an embodiment of the present application;
[0021] Figure 3 A schematic diagram of an optional electronic device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0023] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.
[0024] In order to solve the problem mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a method is provided, such as Figure 1 As shown, the method may include the following steps:
[0025] Step S102, acquiring visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data, and the text data;
[0026] Step S104, extracting and integrating features of the visual data and the audio data to obtain cross-features of the visual data and the audio data;
[0027] Step S106, using the global model knowledge graph to perform data enhancement on the cross-features to obtain graph-enhanced data of the cross-features;
[0028] Step S108, using the atlas enhancement data, the text data, the brain wave data and the eye movement data as multimodal training data to train the initial large language model until the model converges to obtain a target large language model.
[0029] Through the above steps S102 to S108, the present application comprehensively and effectively improves the understanding and analysis capabilities of the large language model for multimodal content by cross-fusion of multimodal data features and introduction of knowledge graphs, brain waves and eye movement data in the multimodal training of the large language model, and solves the technical problem that the large model lacks a comprehensive mechanism for multimodal understanding.
[0030] The large language model construction method proposed in this application can be compatible with more modalities, including: vision, speech, text, knowledge base, EEG signals, etc.; multiple modalities can be "plug and play", flexible and changeable, and the advantages of using flexible modalities include the following aspects: first, for the data at the input source, it is not necessary for each data to have all the modal attributes. The multimodal large model trained by the large language model construction method proposed in this application can be flexibly adapted to the modalities possessed by the data, and can adapt to a wider range of application scenarios; second, for the large language model of the base, since multimodal training is integrated in the training stage, there is no need to replace the large language model for different modalities, which can save the cost of deployment and reasoning; third, there is no coupling between modalities, and a certain modality does not need to be bound to other modalities, which reduces the complexity of the algorithm and can improve the computing efficiency. The large language model construction method proposed in this application is described in detail below.
[0031] In step S102, firstly, the multimodal data required for training the large language model is obtained, including visual data, audio data, text data, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, audio data, and text data, wherein the visual data, audio data, and text data can be different modal data describing the same content, such as video shooting, photo collection, audio collection, text creation, etc. of the same natural scenery to obtain visual data, audio data, and text data describing the same content. The brain wave data and eye movement data used for training can be the brain wave change data and eye movement data when the user is watching the natural scenery, listening to the sound collected from the natural scenery, and reading the literary creation of the natural scenery.
[0032] This application combines eye movement data and brain waves into the training of a large language model. In fact, it uses eye movement data and brain waves as standard references for the human brain to understand and analyze things, and supervises the training of the large language model, which can improve the understanding and analysis capabilities of the large language model.
[0033] In step S104, in order to capture the correlation and complementarity between different modal data, thereby improving the accuracy and performance of subsequent analysis or model prediction, feature extraction and cross-integration of multimodal data may be performed.
[0034] In an optional embodiment, extracting and integrating features of the visual data and the audio data to obtain cross-features of the visual data and the audio data includes:
[0035] Step 1: input the visual data into a visual encoder to obtain visual features output by the visual encoder after encoding the visual data.
[0036] In the embodiment of the present application, the input video V is decomposed into a series of frames and preprocessed by a masked autoencoder Ev to extract key visual features Fi=Ev(V).
[0037] In addition, you can also use pre-trained convolutional neural networks (CNNs) for feature extraction. After being trained on a large amount of image data, convolutional neural networks can learn hierarchical features in images, from edges and textures to high-level semantic concepts. By inputting visual data into CNN, fixed-size feature vectors can be extracted, which represent the main content or attributes of the image.
[0038] Step 2: input the audio data into an audio encoder to obtain audio features output by the audio encoder after encoding the audio data.
[0039] In an embodiment of the present application, the audio data A can be input into an audio encoder Ea designed specifically for audio, such as a BlockFormer module, for processing to obtain audio features Si=Ea(A).
[0040] Alternatively, you can use audio processing algorithms or pre-trained audio neural networks for feature extraction. Audio features may include Mel-frequency cepstral coefficients (MFCC), short-time energy, zero-crossing rate, etc. These features can describe audio properties such as pitch, loudness, and rhythm. When using neural networks for audio feature extraction, you can choose a model that is suitable for audio tasks, such as recurrent neural networks (RNNs) or convolutional neural networks (CNN) variants.
[0041] Step 3: align the visual features and the audio features in time series to obtain aligned features.
[0042] In the embodiment of the present application, for audio signals and video frames, their respective timestamps need to be extracted first. Audio signals usually have a sampling rate, and each sampling point corresponds to a time point. Video frames usually have a frame rate, and each frame also corresponds to a time point. Ensure that the timestamps of audio and video are based on the same clock or time reference for subsequent alignment operations. Ideally, audio signals and video frames should be recorded synchronously, that is, their timestamps should correspond one to one. However, in practical applications, there may be a certain time deviation due to recording equipment, transmission delay or other factors. To solve this problem, a time synchronization algorithm can be used to calibrate the timestamps of audio and video. These algorithms usually estimate and correct time deviations based on specific synchronization points (such as key frames in video or specific sound events in audio). Once the timestamps of audio and video are synchronized, a mapping relationship between them can be established. This usually means assigning a corresponding audio segment to each video frame (or vice versa). The mapping relationship can be based on simple linear interpolation or search based on the timestamp, or a more complex algorithm can be used to take into account the dynamic changes of audio and video content. After the mapping relationship is established, it is necessary to verify whether the audio and video are truly aligned. This can be done through observation or auditory inspection, or by calculating a quantitative indicator of the alignment error. If the alignment is found to be inaccurate, the mapping relationship can be adjusted or the time synchronization can be re-performed. This can be done through repeated iterations and optimizations until a satisfactory alignment is achieved. Aligning audio and video in time series allows for subsequent multimodal processing or analysis. For example, features of audio and video can be extracted and fused together for tasks such as event detection, sentiment analysis, or content understanding.
[0043] Step 4: Input the aligned features into a cross Transformer module to use the cross Transformer module to perform feature cross-understanding on the visual features and the audio features to obtain the cross features Xf,Xs=C(Fi,Si), where C is a cross Transformer module, and Xf and Xs represent the outputs corresponding to Fi and Si, respectively.
[0044] In an embodiment of the present application, the aligned visual features and audio features are simultaneously input into the cross Transformer module. The two feature vectors can be spliced together, or they can be passed to the cross Transformer module as different input channels. The cross Transformer module is designed with a special mechanism to process data from different modalities and realize their interaction and fusion at different levels. Inside the cross Transformer module, visual features and audio features interact through self-attention mechanisms and cross-modal attention mechanisms. The self-attention mechanism allows the model to capture the dependencies within each modality, while the cross-modal attention mechanism promotes information exchange and complementarity between different modalities. Through multi-layer stacking and nonlinear transformations, the model is able to learn and capture complex and sophisticated association patterns between visual and audio data. After being processed by the cross Transformer module, visual features and audio features are no longer isolated, but are understood and fused by the model in a cross and collaborative way. This means that the model is able to consider visual and audio information at the same time and utilize their complementarity and correlation when generating cross features.
[0045] The cross-Transformer module can be a Cross-Former module, which is a Transformer architecture specially designed for processing multimodal data. It aims to enhance the representation ability of the model by fusing information from different modalities (such as vision, text, audio, etc.) and achieve better performance in multimodal tasks. In the Cross-Former module, data of different modalities are first processed by their respective feature extractors to obtain corresponding feature representations. Then, these feature representations are input into the Cross-Former module, and through a series of multimodal interactions and fusion operations, fused multimodal features are generated. The core of the Cross-Former module lies in its cross-modal interaction mechanism. It uses the self-attention mechanism and cross-modal attention mechanism of the Transformer to enable data of different modalities to interact and fuse in the feature space. In this way, the Cross-Former module can learn the correlation and complementarity between different modalities, thereby generating more expressive and discriminative multimodal features.
[0046] In step S106, the global model knowledge graph can be used for processing, and the context of the input data can be enhanced and enriched by the knowledge graph, thereby improving the accuracy of decision-making or understanding. The global model knowledge graph contains a wide range of cross-domain knowledge information. It can provide the model with deeper background knowledge, so that the model's decision is not only based on the directly input data, but also includes this wide range of knowledge. The global model knowledge graph is a structured semantic knowledge base used to describe concepts and their relationships in the physical world in symbolic form. It is based on the data structure of the graph, consisting of nodes, edges and attribute values. Each node represents an "entity", and the entities are connected to each other through relationships to form a network of knowledge structures. The essence of the global model knowledge graph lies in its semantic network based on the graph, which aims to describe the concept entity events of the objective world and the relationships between them, and to perform semantic modeling. The construction of the global model knowledge graph usually includes multiple aspects such as data acquisition, entity recognition and relationship extraction, data storage, and graph application. In addition, according to the needs of a specific field, a knowledge graph in a vertical field can be constructed, such as medical, engineering machinery, financial risk control, etc., to better serve the practical application in this field.
[0047] In the embodiment of the present application, the global model knowledge graph and the large language model can be used in combination to give full play to the advantages of both and improve the performance and intelligence level of the artificial intelligence system. For example, the large language model has a strong text generation and understanding ability, and the global model knowledge graph provides rich structured knowledge. By integrating the entities, relationships and attributes in the knowledge graph into the large language model, the model's understanding and reasoning ability of semantics can be enhanced. This enables the model to more accurately grasp the context and meaning of the problem when answering complex questions, thereby giving more accurate and in-depth answers. For another example, the entities and relationships in the global model knowledge graph can provide entity linking and knowledge completion functions for the large language model. When the large language model processes the text, it can automatically link the entities in the text with the entities in the knowledge graph to obtain more background knowledge and related information. This can not only enrich the output content of the model, but also improve the accuracy and credibility of the model. For another example, in a dialogue system, the combination of the global model knowledge graph and the large language model can achieve more intelligent question-answering and dialogue. By utilizing the structured knowledge in the knowledge graph, the model can better understand the user's intentions and needs, and give more accurate and targeted answers. At the same time, the generation capability of the large language model can also make the conversation more natural and smooth. For specific vertical fields, such as medical, finance, education, etc., corresponding global model knowledge graphs can be built. By combining the knowledge graphs in these fields with large language models, more professional and efficient intelligent applications can be developed. For example, in the medical field, the medical knowledge in the knowledge graph and the natural language processing capabilities of the large language model can be used to build an intelligent diagnosis assistance system or a health consultation system.
[0048] In an optional embodiment, the cross-features are data enhanced by using the global model knowledge graph to obtain the graph-enhanced data of the cross-features, including:
[0049] Step 1: Search the global model knowledge graph for a basic entity representing the cross-feature.
[0050] In an embodiment of the present application, the cross-features are input into the query system of the global model knowledge graph. Through text matching, semantic similarity calculation, etc., the entities that best match the cross-features are found in the knowledge graph, and these entities are called basic entities. The selection of basic entities is based on their semantic similarity and representativeness with the cross-features. If the knowledge graph supports vector representation or embedding, these techniques can also be used to more accurately find entities similar to the cross-features.
[0051] Step 2: searching, for each of the basic entities, for related entities whose degree of association is greater than or equal to a preset threshold, according to the degree of association between the basic entity and other entities.
[0052] In the embodiment of the present application, for each basic entity, its relationship chain in the knowledge graph is traversed to find the entities associated with it. The relevance of each associated entity to the basic entity is calculated, which can be measured by relationship weight, co-occurrence frequency, path length, etc. The associated entities whose relevance is greater than or equal to the preset threshold are screened out.
[0053] Step 3: Obtain entity information and attribute information of the basic entity and the associated entity as the graph enhancement data.
[0054] In the embodiment of the present application, for each basic entity and the selected associated entity, their entity information (such as name, type, etc.) and attribute information (such as attribute value, attribute type, etc.) are extracted from the knowledge graph. This information is integrated into the cross-features to form graph-enhanced data.
[0055] This application integrates rich information from external knowledge bases into the model, which can effectively improve the semantic understanding and generalization capabilities of the model.
[0056] In step S108, the above-mentioned graph enhancement data G(Xf, Xs) is combined with the electroencephalogram data EEG, the eye movement data EM and the text data T for training to enhance the model's ability to understand and analyze the content.
[0057] In an optional embodiment, using the atlas enhancement data, the text data, the brain wave data, and the eye movement data as multimodal training data to train the initial large language model includes:
[0058] Step 1, assigning weights to the atlas enhancement data, the text data, the brain wave data and the eye movement data respectively.
[0059] In the embodiment of the present application, the importance of each data type to the task is analyzed. For example, text data may be crucial for language understanding, while brain wave and eye movement data may provide more information about user cognition and attention. The weight of each data type is determined based on the importance of the data and the task requirements. The weights determined at this stage are initial weights, and although they are determined based on expert experience, they can still be fine-tuned to further enhance the model capabilities.
[0060] Step 2, constructing an optimization function using the weighted sum of the atlas enhancement data, the text data, the brain wave data, and the eye movement data.
[0061] In the embodiment of the present application, for the task goal (such as classification, generation, etc.), a suitable loss function is selected to measure the gap between the model's predicted results and the actual results. The weighted atlas enhancement data, text data, EEG data and eye movement data are integrated into the loss function. In order to prevent the model from overfitting, a regularization term such as L1 or L2 regularization can be added to the optimization function. Preferably, the optimization function can be expressed as:
[0062]
[0063] Among them, ω represents the weights of different input signals, and G represents the global model knowledge graph. The ultimate goal of the optimization function is to improve the model's ability to understand multimodal data (visual V, audio A, and text T) and be able to output useful information and analysis.
[0064] Step 3, inputting the atlas enhancement data, the text data, the brain wave data and the eye movement data into the initial large language model, and using the optimization function to optimize the training result of the initial large language model until the model converges to obtain the target large language model.
[0065] Training and optimizing the model consists of the following steps:
[0066] Initialize model parameters: Set the parameters of the initial large language model. These parameters can be randomly initialized or based on a pre-trained model.
[0067] Forward propagation: Input the weighted multimodal data into the initial large language model and calculate the output of the model through forward propagation.
[0068] Calculate loss: Use the constructed optimization function to calculate the loss between the model output and the true result.
[0069] Backpropagation and optimization: The gradient of the loss function with respect to the model parameters is calculated through the backpropagation algorithm, and the model parameters are updated using an optimization algorithm (such as Adam, SGD, etc.) to minimize the loss.
[0070] Iterative training: Repeat the process of forward propagation, loss calculation, backpropagation, and optimization until the model converges or reaches the preset number of training rounds.
[0071] In an optional embodiment, the optimization function is used to optimize the training result of the initial large language model until the model converges, and obtaining the target large language model includes:
[0072] Step 1: determining the understanding deviation of the initial large language model on the multimodal training data based on the labeled data of the multimodal training data and the training result.
[0073] In the embodiment of the present application, for the multimodal training data, corresponding annotated data is required, and these annotated data can be labels, classification results or other forms of supervision information. The prediction results of the initial large language model for the multimodal training data are compared with the annotated data, and the difference or deviation between the two is calculated. This deviation can be accuracy, recall rate, F1 score or other evaluation indicators.
[0074] Step 2: adjust the weights of the atlas enhancement data, the text data, the brain wave data, and the eye movement data in the optimization function according to the understanding deviation, and continue iterative training.
[0075] In the embodiment of the present application, according to the understanding deviation calculated in step 1, analyze which data types have larger deviations and which data types have smaller contributions, and adjust the weights of the atlas enhancement data, text data, brain wave data, and eye movement data in the optimization function based on the analysis results of the understanding deviation. For data types with larger deviations, their weights can be appropriately increased to make them have a greater impact during the training process, and the adjusted weights and optimization functions are used to continue iterative training of the initial large language model to reduce the understanding deviation.
[0076] Step 3: When the optimization function makes the understanding deviation of the initial large language model for the multimodal training data smaller than the target threshold, it is determined that the model has converged to obtain the target large language model.
[0077] In an embodiment of the present application, after each iterative training, the understanding deviation of the initial large language model on the multimodal training data is recalculated. When the understanding deviation is less than the preset target threshold, the model is considered to have converged, that is, the model's ability to understand multimodal data has reached a relatively stable and good level. When the model converges, training is stopped and the model at this time is used as the target large language model. In addition to the understanding deviation, other indicators (such as training loss, verification loss, etc.) can also be considered to comprehensively evaluate the convergence state of the model.
[0078] In an optional embodiment, after obtaining the target large language model, the method further includes:
[0079] Step 1, obtaining the search data input by the user;
[0080] Step 2: input the search data into the target large language model to identify the modality contained in the search data through the target large language model, call the encoder of the corresponding modality to perform entity extraction and content understanding on the search data, and generate answer data based on the extracted entity information and understood content information;
[0081] Step 3: Return the answer data to the user.
[0082] In an embodiment of the present application, the target large language model can be used to answer user questions, understand and analyze the information input by the user, and make predictions and evaluations. For example, after the user inputs a video, the model can comprehensively identify and classify entities in images, audio, and text, such as brands, products, relationships, and emotions through multimodal input. At the same time, the specific features of each entity, such as makeup, clothing, packaging, and color tones, are explored in depth. Further, the model uses technologies such as facial recognition, optical character recognition (OCR), automatic speech recognition (ASR), and scene understanding to analyze video content. Together, this information builds a comprehensive understanding of the system's content. On this basis, the system conducts a comprehensive analysis, makes predictions and evaluations, such as predicting the emotional response that the video content may trigger, or evaluating the consistency and quality of the content, to generate comprehensive feedback on the input data, thereby providing a creative evaluation of the video, as well as a detailed explanation of specific parts, to ensure the attractiveness of the content and the attention of customers.
[0083] The modalities contained in the retrieval data include at least one of visual data, audio data, text data, brain wave data, and eye movement data.
[0084] The present application can process multiple modalities including vision, speech, text, knowledge base, EEG signals, etc., and has a high degree of multimodal data compatibility. The algorithm supports plug-and-play modal processing, allowing flexible adaptation according to the modal characteristics of the input data, without the need for each data to have all modal attributes. Since there is no need to replace large language models for different modalities, the present invention can save significant costs in deployment and reasoning. The non-coupling design between modalities reduces the complexity of the algorithm and improves computing efficiency. The present application is applicable to a wider range of application scenarios and has significant practicality and applicability.
[0085] According to another aspect of the embodiment of the present application, Figure 2 As shown, a device for constructing a large language model is provided, comprising:
[0086] A multimodal data acquisition module 201, used to acquire visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data and the text data;
[0087] A feature cross module 203 is used to extract and integrate features of the visual data and the audio data to obtain cross features of the visual data and the audio data;
[0088] The knowledge graph enhancement module 205 is used to perform data enhancement on the cross-features using the global model knowledge graph to obtain graph-enhanced data of the cross-features;
[0089] The multimodal training module 207 is used to train the initial large language model using the atlas enhancement data, the text data, the brain wave data and the eye movement data as multimodal training data until the model converges to obtain a target large language model.
[0090] It should be noted that the multimodal data acquisition module 201 in this embodiment can be used to execute step S102 in the embodiment of the present application, the feature intersection module 203 in this embodiment can be used to execute step S104 in the embodiment of the present application, the knowledge graph enhancement module 205 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the multimodal training module 207 in this embodiment can be used to execute step S108 in the embodiment of the present application.
[0091] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be implemented by software or hardware.
[0092] Optionally, the feature cross-module is specifically used to: input the visual data into a visual encoder to obtain visual features output by the visual encoder for encoding the visual data; input the audio data into an audio encoder to obtain audio features output by the audio encoder for encoding the audio data; align the visual features and the audio features in a time series to obtain aligned features; input the aligned features into a cross-Transformer module to use the cross-Transformer module to perform feature cross-understanding on the visual features and the audio features to obtain the cross-features.
[0093] Optionally, the knowledge graph enhancement module is specifically used to: search for a basic entity representing the cross-feature in the global model knowledge graph; search for an associated entity whose association is greater than or equal to a preset threshold for each basic entity based on the association between the basic entity and other entities; and obtain entity information and attribute information of the basic entity and the associated entity as the graph enhancement data.
[0094] Optionally, the multimodal training module is specifically used to: assign weights to the graph-enhanced data, the text data, the brain wave data and the eye movement data respectively; construct an optimization function using the weighted sum of the graph-enhanced data, the text data, the brain wave data and the eye movement data; input the graph-enhanced data, the text data, the brain wave data and the eye movement data into the initial large language model, and use the optimization function to optimize the training results of the initial large language model until the model converges to obtain the target large language model.
[0095] Optionally, the multimodal training module is further used to: determine the understanding deviation of the initial large language model on the multimodal training data based on the labeled data of the multimodal training data and the training results; adjust the weights of the atlas enhancement data, the text data, the brain wave data and the eye movement data in the optimization function according to the understanding deviation, and continue iterative training; when the optimization function makes the understanding deviation of the initial large language model on the multimodal training data less than a target threshold, determine that the model converges and obtain the target large language model.
[0096] Optionally, the large language model construction device also includes an answer module, which is used to: obtain retrieval data input by the user; input the retrieval data into the target large language model to identify the modality contained in the retrieval data through the target large language model, and call the encoder of the corresponding modality to perform entity extraction and content understanding on the retrieval data, and generate answer data based on the extracted entity information and understood content information; and return the answer data to the user.
[0097] Optionally, the modalities contained in the retrieved data include at least one of visual data, audio data, text data, brain wave data and eye movement data.
[0098] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 3 As shown, it includes a memory 301, a processor 303, a communication interface 305 and a communication bus 307. The memory 301 stores a computer program that can be run on the processor 303. The memory 301 and the processor 303 communicate through the communication interface 305 and the communication bus 307. When the processor 303 executes the computer program, the steps of the above method are implemented.
[0099] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0100] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0101] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0102] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any of the above embodiments.
[0103] Optionally, in an embodiment of the present application, the computer-readable medium is configured to store program codes for the processor to perform the following steps:
[0104] Acquire visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data, and the text data;
[0105] Extracting and integrating features of the visual data and the audio data to obtain cross-features of the visual data and the audio data;
[0106] Performing data enhancement on the cross-features using a global model knowledge graph to obtain graph-enhanced data of the cross-features;
[0107] The atlas enhancement data, the text data, the brain wave data and the eye movement data are used as multimodal training data to train the initial large language model until the model converges to obtain a target large language model.
[0108] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.
[0109] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.
[0110] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0111] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0112] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0114] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0116] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0117] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk. It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.
[0118] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for constructing a large language model, characterized in that: include: Acquire visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data, and the text data; Extracting and integrating features of the visual data and the audio data to obtain cross-features of the visual data and the audio data; Performing data enhancement on the cross-features using a global model knowledge graph to obtain graph-enhanced data of the cross-features; Using the atlas enhancement data, the text data, the brain wave data, and the eye movement data as multimodal training data to train an initial large language model until the model converges, thereby obtaining a target large language model; The method of performing data enhancement on the cross-features by using the global model knowledge graph to obtain the graph-enhanced data of the cross-features includes: searching for a basic entity representing the cross-features in the global model knowledge graph; searching for an associated entity whose association degree is greater than or equal to a preset threshold for each basic entity according to the association degree between the basic entity and other entities; and obtaining entity information and attribute information of the basic entity and the associated entity as the graph-enhanced data; The training of the initial large language model using the graph enhancement data, the text data, the brain wave data and the eye movement data as multimodal training data comprises: assigning weights to the graph enhancement data, the text data, the brain wave data and the eye movement data respectively; constructing an optimization function using the weighted sum of the graph enhancement data, the text data, the brain wave data and the eye movement data; inputting the graph enhancement data, the text data, the brain wave data and the eye movement data into the initial large language model, and optimizing the training result of the initial large language model using the optimization function until the model converges to obtain the target large language model; The step of optimizing the training result of the initial large language model using the optimization function until the model converges to obtain the target large language model includes: determining the understanding deviation of the initial large language model for the multimodal training data based on the labeled data of the multimodal training data and the training result; adjusting the weights of the atlas enhancement data, the text data, the brain wave data, and the eye movement data in the optimization function according to the understanding deviation, and continuing iterative training; when the optimization function makes the understanding deviation of the initial large language model for the multimodal training data less than a target threshold, determining that the model converges to obtain the target large language model.
2. The method according to claim 1, characterized in that The extracting and integrating the features of the visual data and the audio data to obtain the cross features of the visual data and the audio data comprises: Inputting the visual data into a visual encoder to obtain visual features output by the visual encoder encoding the visual data; Inputting the audio data into an audio encoder to obtain audio features output by the audio encoder after encoding the audio data; Aligning the visual features and the audio features in time series to obtain aligned features; The aligned features are input into a cross Transformer module, so as to utilize the cross Transformer module to perform feature cross understanding on the visual features and the audio features to obtain the cross features.
3. The method according to any one of claims 1 to 2, characterized in that: After obtaining the target large language model, the method further includes: Get the search data entered by the user; Inputting the search data into the target large language model, so as to identify the modality contained in the search data through the target large language model, and calling the encoder of the corresponding modality to perform entity extraction and content understanding on the search data, and generating answer data based on the extracted entity information and the understood content information; The answer data is returned to the user.
4. The method according to claim 3, characterized in that The modalities contained in the retrieved data include at least one of visual data, audio data, text data, brain wave data and eye movement data.
5. A device for constructing a large language model, characterized in that: include: A multimodal data acquisition module, used to acquire visual data, audio data, text data describing the same content, and brain wave data and eye movement data generated by the user when receiving at least one of the visual data, the audio data and the text data; A feature cross module, used for extracting and integrating features of the visual data and the audio data to obtain cross features of the visual data and the audio data; A knowledge graph enhancement module, used to perform data enhancement on the cross-features using the global model knowledge graph to obtain graph-enhanced data of the cross-features; A multimodal training module, used to train an initial large language model using the atlas enhancement data, the text data, the brain wave data, and the eye movement data as multimodal training data until the model converges to obtain a target large language model; The knowledge graph enhancement module is specifically used to: search for a basic entity representing the cross feature in the global model knowledge graph; search for an associated entity with an association degree greater than or equal to a preset threshold for each basic entity according to the association degree between the basic entity and other entities; obtain entity information and attribute information of the basic entity and the associated entity as the graph enhancement data; The multimodal training module is specifically used to: assign weights to the atlas enhancement data, the text data, the brain wave data, and the eye movement data respectively; and construct an optimization function using the weighted sum of the atlas enhancement data, the text data, the brain wave data, and the eye movement data; Inputting the atlas enhancement data, the text data, the brain wave data and the eye movement data into the initial large language model, and optimizing the training result of the initial large language model using the optimization function until the model converges, thereby obtaining the target large language model; The multimodal training module is also used to: determine the understanding deviation of the initial large language model on the multimodal training data based on the labeled data of the multimodal training data and the training results; adjust the weights of the atlas enhancement data, the text data, the brain wave data and the eye movement data in the optimization function according to the understanding deviation, and continue iterative training; when the optimization function makes the understanding deviation of the initial large language model on the multimodal training data less than a target threshold, determine that the model converges and obtain the target large language model.
6. An electronic device, comprising a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, and the memory and the processor communicate through the communication bus and the communication interface, characterized in that: When the processor executes the computer program, the method for constructing a large language model as described in any one of claims 1 to 4 is implemented.
7. A computer-readable medium having a non-volatile program code executable by a processor, characterized in that: The program code enables the processor to execute the method for constructing a large language model as described in any one of claims 1 to 4.
