A Large Language Model Based on EEG Signals for Emotion Recognition and Dialogue Generation

CN122572518APending Publication Date: 2026-08-14SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0003]本发明针对现有技术无法利用脑电信号调控大语言模型的情感对话生成,不能解决在无显式情绪标签参与推理时,利用脑电信号实现情绪感知对话生成的问题以及在缺少显式情感标签场景下难以根据用户真实情绪生成适配回复的不足,提出一种基于脑电信号的大语言模型情绪感知对话生成方法,将脑电中与情感相关的隐式信息转化为大语言模型可消费的连续软提示(soft prompt),再用该软提示调节回复的语气、措辞和支持策略,使模型在没有显式情感标签的推理阶段仍能利用脑电实现情感自适应回复,同时解决了现有技术中数据不同步、跨被试泛化、离散标签信息损失和生成控制稳定性四类问题

Benefits of technology

[0007]本发明通过在推理阶段直接使用脑电信号作为隐式情感控制源,在文本未充分表达情绪时仍提供补充信息并将EEG情感表征映射为用于大语言模型生成控制的连续嵌入。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122572518A_ABST
    Figure CN122572518A_ABST
Patent Text Reader

Abstract

A large language model-based emotion-aware dialogue generation method based on EEG signals is proposed. In the offline stage, a spatiotemporal convolutional network is used to learn a cross-subject EEG emotion encoder. After obtaining EEG emotion representations, a lightweight projector of the spatiotemporal convolutional network is trained separately to align the EEG representations to the embedding sequences corresponding to emotion control words. The projected EEG vectors are then injected as soft cues into the dialogue generation model. Through initial supervised training and pairwise refinement training, the model learns to adjust responses based on EEG conditions. In the online inference and deployment stages, based on the original EEG signals corresponding to the user's real-time dialogue turn and the current dialogue context, the encoder and projector trained in the offline stage generate EEG soft cues, which are inserted between the large language model input prefix and the dialogue context to generate and output responses that better match the user's current emotional state. This invention can achieve emotion-adaptive responses using EEG even in the inference stage without explicit emotion labels, while solving the problems of data asynchrony, cross-subject generalization, loss of discrete label information, and generation control stability in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a technology in the field of large language models, specifically a method for generating emotion-aware dialogues based on a large language model (LLM) using electroencephalogram (EEG) signals. Background Technology

[0002] Existing large language models based on explicit emotion labeling are prone to losing stable control sources when labels are lacking in real-world scenarios. Text-based emotion inference techniques are susceptible to structural biases where the text content is insufficient to represent genuine emotions. Furthermore, current EEG emotion recognition technologies typically output classification labels rather than continuous control vectors aligned with the large language model's embedding space, thus interrupting the technological chain after "recognition" and failing to naturally transition to "generation." Existing multimodal bridging techniques usually assume the existence of a large amount of strictly synchronized, sample-by-sample paired cross-modal training data; however, EEG and dialogue data are often collected separately, from heterogeneous sources, and with inconsistent granularity in reality, making conventional end-to-end bridging paths difficult to establish. In summary, there is currently no suitable technology capable of stably integrating cross-subject EEG emotion information into a large language model and driving dialogue generation without relying on explicit emotion labels. Summary of the Invention

[0003] This invention addresses the shortcomings of existing technologies, such as the inability to utilize EEG signals to regulate the generation of emotional dialogue in large language models, the inability to achieve emotion-aware dialogue generation using EEG signals when there are no explicit emotion labels involved in reasoning, and the difficulty in generating adaptive responses based on the user's true emotions in scenarios lacking explicit emotion labels. It proposes a method for generating emotion-aware dialogue based on large language models using EEG signals. This method transforms implicit emotion-related information from EEG into continuous soft prompts that the large language model can consume. These soft prompts are then used to adjust the tone, wording, and support strategies of responses, enabling the model to achieve emotion-adaptive responses using EEG signals even during the reasoning stage without explicit emotion labels. Simultaneously, it solves four types of problems in existing technologies: data asynchrony, cross-subject generalization, loss of discrete label information, and generation control stability.

[0004] This invention is achieved through the following technical solution:

[0005] This invention relates to a large language model-based emotion-aware dialogue generation method based on EEG signals. In the offline stage, a spatiotemporal convolutional network is used to learn a cross-subject EEG emotion encoder. After obtaining EEG emotion representations, a lightweight projector of the spatiotemporal convolutional network is trained separately to align the EEG representations to the embedding sequences corresponding to emotion control words. The projected EEG vectors are then injected as soft cues into the dialogue generation model. Through initial supervised training and pairwise refinement training, the model learns to adjust its responses based on EEG conditions. In the online inference and deployment stage, based on the original EEG signals corresponding to the user's real-time dialogue turn and the current dialogue context, the encoder and projector trained in the offline stage generate EEG soft cues, which are inserted between the large language model input prefix and the dialogue context to generate and output responses that better match the user's current emotional state.

[0006] Technical effect

[0007] This invention uses EEG signals directly as an implicit source of emotion control during the reasoning stage, providing supplementary information even when the text does not fully express emotion, and mapping EEG emotional representations into continuous embeddings for the generation control of large language models. Attached Figure Description

[0008] Figure 1 This is a flowchart of the present invention;

[0009] Figure 2 This is a deployment diagram for an example;

[0010] Figure 3 This example illustrates online user ratings and scores.

[0011] Figure 4 This is a schematic diagram illustrating the effect of an example. Detailed Implementation

[0012] This embodiment relates to a method for generating emotion-aware dialogues based on a large language model using electroencephalogram (EEG) signals, including: Figure 1 The offline phase shown and as Figure 2 The online inference and deployment phases are shown.

[0013] The offline phase includes:

[0014] Step A: Use the spatiotemporal convolutional network EEGNet to learn the emotional EEG signal representation across subjects. Specifically, this involves: processing the EEG samples... The input spatiotemporal convolutional network undergoes temporal convolution, spatial convolution, and feature pooling to obtain a representation h, which is then trained using a linear classifier to predict positive / negative sentiment. Finally, the classifier is discarded, and only the encoder is retained as the frozen EEG backbone network for subsequent stages. For the number of channels, This refers to a point in time.

[0015] The spatiotemporal convolutional network includes: a temporal feature extraction unit, a spatial feature extraction unit, a feature aggregation unit, and an output mapping unit. Specifically: the temporal feature extraction unit performs temporal convolution processing based on the time-series information of the original EEG to obtain temporal feature results representing the temporal changes in EEG; the spatial feature extraction unit performs spatial convolution processing based on the temporal features obtained by the temporal extraction unit and the EEG channel distribution information to obtain spatial feature results representing the correlation between different EEG channels; the feature aggregation unit performs pooling and compact representation learning processing based on the spatiotemporal feature information obtained in the previous step to obtain high-level EEG features related to emotion; and the output mapping unit performs mapping processing based on the high-level EEG features to obtain the EEG representation results for subsequent emotion control or emotion recognition.

[0016] Step B: Map the cross-subject emotion EEG signal representation h learned by the spatiotemporal convolutional network EEGNet to the embedding space of the large language model. Specifically, freeze the encoder in the spatiotemporal convolutional network and the network parameters of the input embedding layer of the large language model, and train only the lightweight projector. Then, the representation h obtained in step A is input into a lightweight projector to obtain a soft cue embedding sequence of length M. As the projection result, the input embedding of the emotion control string in the large language model is used as the target prototype to optimize the projection result, so as to obtain an EEG representation that can represent EEG emotion and is suitable as a soft cue input for the large language model.

[0017] The optimization process specifically includes:

[0018] a) Token-level alignment, making each soft cue position close to the embedding of the corresponding emotion control token;

[0019] b) Token orientation consistency constraint, ensuring that the projection vector and the target embedding are consistent in the cosine direction;

[0020] c) Category prototype constraints make the projected pooled representation closer to the correct sentiment category prototype and further away from the opposite category prototype;

[0021] d) Spacing constraints ensure that there is a sufficient separation boundary between the correct and incorrect categories.

[0022] Step C0: Initial supervised training under single EEG conditions, i.e., freezing the network parameters of the encoder in the spatiotemporal convolutional network and training only the low-rank adaptation parameters of the lightweight projector and the large language model.

[0023] The initial supervised training uses text input sequences as training samples. ,in: For prefix template, For the context of the dialogue, The target response is Ê, which is the EEG soft cue obtained after steps A and B.

[0024] The initial supervised training only calculates the autoregressive language modeling loss for the target response; prefixes, EEG soft prompts, and context are not included in the loss calculation.

[0025] Step C1: Based on the lightweight projector and large language model obtained in step C0, continue pairwise refinement training: for the same dialogue context At the same time, construct positive style responses Replies with negative style For each emotional branch Instead of using a single EEG sample, it selects K label-matched EEG samples from the corresponding emotion category, processes them through an encoder and projector to obtain K soft cues, and then calculates the group average. Then, negative average soft cues and positive average soft cues were injected into the same context, respectively, and the model was trained to produce responses with consistent direction but different sentiment styles under the same semantic input, wherein: It consists of paired sentiment-monitored text data. It is the EEG encoder obtained in step A. For the lightweight projector obtained in step B, K represents the number of EEG samples matched to the selected labels in each emotion branch. For the k EEG signals corresponding to the r-th branch, For the i-th sample, under the r-th - or + sentiment branch, the average soft cue is obtained by averaging the soft cues corresponding to the K label-matched EEG samples.

[0026] The online inference and deployment phases include:

[0027] Step D: Collect the raw EEG signal corresponding to the user's current dialogue turn and the current dialogue context.

[0028] The data acquisition is achieved using, but is not limited to, head-mounted acquisition devices or experimental acquisition systems;

[0029] The dialogue context includes the current user input and the previous rounds.

[0030] Step E: Perform preprocessing on the raw EEG signals;

[0031] The preprocessing includes, but is not limited to, windowing, noise reduction, bandpass filtering, baseline correction, bad lead repair, rereference or artifact removal; if the EEG quality is detected to be below the threshold, re-acquisition or downgrade to text fallback mode is triggered.

[0032] Step F: Input the preprocessed EEG signal from step E and the current dialogue context obtained in step D into the encoder and projector trained in the offline stage to generate EEG soft cues. Insert these cues between the input prefix of the large language model and the dialogue context to generate a response that better matches the user's current emotional state and output it.

[0033] Preferably, user feedback, ratings, or interaction logs are further recorded for subsequent offline incremental optimization.

[0034] Through practical application scenario experiments, the offline device used was Linux + Python 3.10 + Nvidia 4090 graphics card. The test set data was used to run the emotion perception dialogue generation method based on the large language model of EEG signals of this invention.

[0035] As shown in Table 1, in the offline blind evaluation main experiment, this invention significantly improves the emotion matching ability and overall generation quality of responses. Table 1 also shows that blind GPT-5.4 evaluation was conducted on 1,598 test samples, comparing this invention with a baseline model without emotion control, a baseline model trained solely on text but without emotion input during inference, and a reference upper bound model using real emotion labels. The results show that the EEG-Conditioned LLM of this invention achieves a win rate of 31.93% and an average ranking of 2.23, significantly better than Unconditioned LLM's 11.67% / 3.17 and Text-OnlyBaseline's 22.44% / 2.45; its emotion matching index reaches 7.49, also higher than Text-OnlyBaseline's 6.93 and Unconditioned LLM's 5.81. The results demonstrate that by mapping EEG emotion representations to soft cue signals that can be utilized by large models, this invention can substantially improve the ability of generated responses to perceive and adapt to the user's emotional state in the absence of explicit emotion labels, and simultaneously benefit in terms of overall quality, anthropomorphism, and naturalness.

[0036] Table 1 Results of LLM blind review

[0037] As shown in Table 2, in comparative experiments with open-source large language models of similar scale, the present invention demonstrates superior performance compared to simply replacing the backbone network of the language model, proving that the performance improvement originates from the EEG conditional control mechanism itself, rather than solely from differences in model size or base model. Furthermore, the present invention was uniformly evaluated against models of similar scale, including Qwen2.5-7B, Llama3-8B, Qwen3-8B, Gemma-2-9B-it, and Ministry-3-8B-Instruct-2512. The results show that the model of the present invention achieved a win rate of 32.98% and an average ranking of 2.86, outperforming all the compared models; it also ranked first in emotion matching, anthropomorphism, naturalness, and overall score. This experiment illustrates that the key effect of the present invention is not achieved by simply using a stronger language model, but rather stems from the technical chain of "cross-subject EEG emotion encoding—embedded spatial mapping—soft cue generation control," enabling the system to effectively modulate the generation behavior using neurophysiological information beyond the text.

[0038] Table 2 Comparison results with LLMs of similar size

[0039] As shown in Table 3, in human questionnaire evaluation, the present invention achieved results consistent with offline blind evaluation, indicating that the effect of the present invention is not solely due to the bias of the automated evaluator, but has perceptible effects on real users. Human questionnaire evaluation was conducted on the top 500 samples in the same test set, with human reviewers scoring and ranking the anonymous responses. The results show that the model of the present invention has an average score of 7.05 and an average ranking of 2.45, which is better than Unconditioned LLM (6.76 / 2.53) and Text-Only Baseline (6.56 / 2.71), second only to the reference upper bound model using real emotion labels. This result indicates that the technical effect of the present invention can be reflected not only in the blind machine evaluation system but also in human subjective evaluation, demonstrating that EEG conditioned control does indeed improve the consistency and acceptability between responses and user emotional states.

[0040] Table 3. Results of the Human Questionnaire Assessment

[0041] As shown in Table 4 and Figure 3As shown, in online real-time user experiments, this invention remains effective in real-world interactive scenarios, demonstrating its applicability not only to offline datasets but also to open-ended dialogue generation driven by real-time EEG input. Through an online real-time EEG user study, participants input free text after watching emotion-evoked videos, and the system generates responses based on real-time collected EEG signals. Participants then rate the matching degree between each model's response and their current emotion. Results show that the average emotion matching score of this invention's model is 3.44 / 5, and the average ranking is 1.74, superior to Text-Only Baseline's 3.22 / 1.91 and Unconditioned LLM's 2.56 / 2.35. Further analysis indicates that compared to Unconditioned LLM, this invention improves the average emotion matching score by 0.88 points and the average ranking by 0.61 points, with statistically significant differences. This experiment demonstrates that this invention is not only effective in offline paired samples but also achieves superior emotion matching results under actual interactive conditions involving real users, real-time EEG, and open input, demonstrating clear application value.

[0042] Table 4 Online User Evaluation Results

[0043] As shown in Table 5, the pairwise refinement stage (step C1) significantly improves performance further than the initial supervised training stage (step C0), indicating that the training mechanism of "pairwise constraints of positive and negative emotions under the same semantic input" in this invention can enhance the consistency and usability of emotion control signals. Ablation experiments show that, while maintaining the consistency of the encoder in step A, the projector in step B, and the language model backbone, after adding pairwise refinement in step C1, the model's win rate increased from 30.8% to 69.2%, the average ranking improved from 1.69 to 1.31; emotion matching improved from 6.43 to 7.78, anthropomorphism from 6.50 to 7.78, helpfulness from 5.38 to 6.75, naturalness from 7.54 to 8.00, and overall quality improved from 6.36 to 7.72. These results demonstrate that by introducing pairwise supervision of positive and negative emotions under the same dialogue semantic conditions, this invention can significantly enhance the model's ability to utilize the directionality of EEG emotion signals, thereby simultaneously improving emotion matching and response quality.

[0044] As shown in Table 5, using a projector to map continuous EEG representations into language model embedded control signals is superior to the scheme that first classifies EEG into discrete labels before control, indicating that the present invention can retain more fine-grained emotional information. A comparison was made between the present invention's "projector-based continuous control" and the scheme of "first identifying as POS / NEG labels, then controlling generation with discrete labels." The results show that the projector-based control scheme has a win rate of 56.4% and an average ranking of 1.44, higher than the discrete label control scheme's 43.6% and 1.56, respectively. Simultaneously, the five indicators of emotion matching, anthropomorphism, helpfulness, naturalness, and overall quality are all improved. These results demonstrate that the present invention does not simply convert EEG signals into binary classification results, but rather retains a richer emotional representation structure through continuous embedding mapping, thus providing a more refined and effective generation and modulation capability than discrete labels.

[0045] As shown in Table 5, multi-sample aggregation and refinement outperforms single-sample refinement, indicating that the multi-sample averaging mechanism in this invention can enhance the stability of the control signal and reduce the impact of noise from a single EEG sample on the generated results. The performance difference between single-sample refinement (K=1) and multi-sample refinement (K=3) is compared. The results show that the multi-sample scheme has a win rate of 52.6% and an average ranking of 1.47, which is better than the single-sample scheme's 47.4% and 1.53. Improvements are also seen in emotion matching, anthropomorphism, helpfulness, and overall quality. The paper also points out that when K increases from 1 to 2, 3, and 5, the main benefit comes from the transition from single-sample to multi-sample, rather than depending on a specific K value. This result demonstrates that this invention, by aggregating and averaging multiple similar EEG samples, can improve the robustness and stability of EEG conditional signals without changing the main reasoning framework.

[0046] Table 5 Ablation Experiment Results

[0047] Comparative verification shows that this invention does indeed utilize EEG signals for emotion regulation, rather than outputting essentially identical templated responses under different EEG inputs. By performing counterfactual checks while maintaining the dialogue context and only changing the EEG conditions, the results show that the model generates completely identical responses under two different EEG conditions in only 7.2% of cases, and the proportion of high lexical overlap (Jaccard similarity greater than 0.9) is only 8.4%, with an average Jaccard similarity of 0.305 and a median of 0.205. These results demonstrate that the EEG control pathways in this invention can genuinely alter generative behavior, enabling the model to output responses with different styles and support strategies based on different EEG emotional states under the same semantic input. This proves that this invention possesses substantial EEG-driven emotion regulation capabilities, rather than merely performing fixed generation unrelated to EEG.

[0048] In the online inference and deployment phase, three devices were used for deployment and operation: Device A was a Windows 7 system with a NeuroScan EEG acquisition device, Device B was a Windows 10 system, and Device C was a Linux system with Python 3.10 and an Nvidia 4090 graphics card. EEG signals were acquired on Device A and transmitted in real-time to Device C via the network. Participants sat in front of Device B, watched a video played on Device B to evoke emotions, and input their desired message to the large language model on Device B. This text content was transmitted in real-time to Device C via the network. Device C received the EEG signals from Device A and the text content from Device B. Device C then integrated a pre-trained EEG spatiotemporal network, a projector, and the large language model in its background, processed the EEG and text, input them into the large language model, and obtained the model's response under the given emotional EEG condition. This response was transmitted back to Device B via the network, allowing participants to see it and assign an emotional fit score based on the response. Figure 2 As shown.

[0049] In online real-time user experiments, this invention remained effective in real-world interactive scenarios, demonstrating its applicability not only to offline datasets but also to open-ended dialogue generation driven by real-time EEG input. We designed an online real-time EEG user study where participants input free text after watching emotion-evoked videos. The system then generated responses based on real-time collected EEG signals, and participants scored the matching degree between each model's response and their current emotion. Results showed that the average emotion matching score of this invention's model was 3.44 / 5, and the average ranking was 1.74, superior to Text-OnlyBaseline's 3.22 / 1.91 and Unconditioned LLM's 2.56 / 2.35. Further analysis showed that compared to Unconditioned LLM, this invention improved the average emotion matching score by 0.88 points and the average ranking by 0.61 points, with statistically significant differences. This experiment demonstrates that this invention is not only effective in offline paired samples but also achieves superior emotion adaptation under real-world interactive conditions with real users, real-time EEG, and open input, demonstrating clear application value.

[0050] Compared with existing technologies, this invention uses emotional information from EEG as implicit control signals that do not require explicit labels during the reasoning stage for emotion-adaptive dialogue generation in large language models; it proposes a phased training framework of "cross-subject EEG emotion encoding + EEG projection to emotion embedding space + dialogue generation + pairwise refinement"; and it proposes a continuous soft cue mechanism that projects EEG onto the embedding space corresponding to the emotion control token, instead of only outputting discrete emotion labels.

[0051] The above-described specific implementations can be partially adjusted by those skilled in the art in different ways without departing from the principles and purpose of the present invention. The scope of protection of the present invention is defined by the claims and is not limited to the above-described specific implementations. All implementation schemes within the scope of the claims are bound by the present invention.

Claims

1. A method for generating emotion-perceived dialogues based on a large language model using electroencephalogram (EEG) signals, characterized in that, In the offline phase, a spatiotemporal convolutional network was used to learn the cross-subject EEG emotion encoder. After obtaining the EEG emotion representation, a lightweight projector of the spatiotemporal convolutional network was trained separately to align the EEG representation to the embedding sequence corresponding to the emotion control words. Then, the projected EEG vector was injected as a soft cue in the dialogue generation model. Through initial supervised training and pairwise refinement training, the model learned to adjust its response according to the EEG conditions. During the online inference and deployment phases, based on the raw EEG signals corresponding to the user's real-time dialogue rounds and the current dialogue context, the encoder and projector trained in the offline phase generate EEG soft cues, which are then inserted between the large language model input prefix and the dialogue context to generate and output a response that better matches the user's current emotional state.

2. The method for generating emotion-perceived dialogue based on a large language model using EEG signals according to claim 1, characterized in that, The offline phase includes: Step A: Use the spatiotemporal convolutional network EEGNet to learn the emotional EEG signal representation across subjects. Specifically, this involves: processing the EEG samples... The input spatiotemporal convolutional network undergoes temporal convolution, spatial convolution, and feature pooling to obtain a representation h, which is then trained using a linear classifier to predict positive / negative sentiment. Finally, the classifier is discarded, and only the encoder is retained as the frozen EEG backbone network for subsequent stages. For the number of channels, This refers to a point in time. Step B: Map the cross-subject emotion EEG signal representation h learned by the spatiotemporal convolutional network EEGNet to the embedding space of the large language model. Specifically, freeze the encoder in the spatiotemporal convolutional network and the network parameters of the input embedding layer of the large language model, and train only the lightweight projector. Then, the representation h obtained in step A is input into a lightweight projector to obtain a soft cue embedding sequence of length M. As the projection result, the input embedding of the emotion control string in the large language model is used as the target prototype to optimize the projection result, so as to obtain an EEG representation that can represent EEG emotion and is suitable as a soft cue input for the large language model. Step C0: Initial supervised training under single EEG conditions, i.e., freezing the network parameters of the encoder in the spatiotemporal convolutional network and training only the low-rank adaptation parameters of the lightweight projector and the large language model. Step C1: Based on the lightweight projector and large language model obtained in step C0, continue pairwise refinement training: for the same dialogue context At the same time, construct positive style responses Replies with negative style For each emotional branch Instead of using a single EEG sample, it selects K label-matched EEG samples from the corresponding emotion category, processes them through an encoder and projector to obtain K soft cues, and then calculates the group average. Then, negative average soft cues and positive average soft cues were injected into the same context, respectively, and the model was trained to produce responses with consistent direction but different sentiment styles under the same semantic input, wherein: It consists of paired sentiment-monitored text data. It is the EEG encoder obtained in step A. For the lightweight projector obtained in step B, K represents the number of EEG samples matched to the selected labels in each emotion branch. For the k EEG signals corresponding to the r-th branch, For the i-th sample, under the r-th - or + sentiment branch, the average soft cue is obtained by averaging the soft cues corresponding to the K label-matched EEG samples.

3. The method for generating emotion-aware dialogues based on a large language model using EEG signals according to claim 1 or 2, characterized in that, The spatiotemporal convolutional network includes: a temporal feature extraction unit, a spatial feature extraction unit, a feature aggregation unit, and an output mapping unit. Specifically: the temporal feature extraction unit performs temporal convolution processing based on the time-series information of the original EEG to obtain temporal feature results representing the temporal changes in EEG; the spatial feature extraction unit performs spatial convolution processing based on the temporal features obtained by the temporal extraction unit and the EEG channel distribution information to obtain spatial feature results representing the correlation between different EEG channels; the feature aggregation unit performs pooling and compact representation learning processing based on the spatiotemporal feature information obtained in the previous step to obtain high-level EEG features related to emotion; and the output mapping unit performs mapping processing based on the high-level EEG features to obtain the EEG representation results for subsequent emotion control or emotion recognition.

4. The method for generating emotion-perceived dialogue based on a large language model using EEG signals according to claim 2, characterized in that, The optimization process specifically includes: a) Token-level alignment, making each soft cue position close to the embedding of the corresponding emotion control token; b) Token orientation consistency constraint, ensuring that the projection vector and the target embedding are consistent in the cosine direction; c) Category prototype constraints make the projected pooled representation closer to the correct sentiment category prototype and further away from the opposite category prototype; d) Spacing constraints ensure that there is a sufficient separation boundary between the correct and incorrect categories.

5. The method for generating emotion-aware dialogues based on a large language model using EEG signals according to claim 1 or 2, characterized in that, The initial supervised training only calculates the autoregressive language modeling loss for the target response; prefixes, EEG soft prompts, and context are not included in the loss calculation. The initial supervised training uses text input sequences as training samples. ,in: For prefix template, For the context of the dialogue, Reply to the target. The EEG soft cue obtained through steps A and B.

6. The method for generating emotion-perceived dialogue based on a large language model using EEG signals according to claim 1, characterized in that, The online inference and deployment phases include: Step D: Collect the raw EEG signal corresponding to the user's current dialogue turn and the current dialogue context. The dialogue context includes the current user input and the previous rounds. Step E: Perform preprocessing on the raw EEG signals; Step F: Input the preprocessed EEG signal from step E and the current dialogue context obtained in step D into the encoder and projector trained in the offline stage to generate EEG soft cues. Insert these cues between the input prefix of the large language model and the dialogue context to generate a response that better matches the user's current emotional state and output it.

7. The method for generating emotion-perceived dialogue based on a large language model using EEG signals according to claim 6, characterized in that, Further record user feedback, ratings, or interaction logs for subsequent offline incremental optimization.