Method for generating psychological consultant style answer based on runtime fine tuning
By obtaining and storing psychological counseling data, building context data as input, and using runtime fine-tuning to generate psychological counselor-style answers, it solves the problem that large language models are difficult to evaluate the learned content in runtime fine-tuning, and achieves an efficient and professional psychology Consultation answers are generated, reducing labor costs and adapting to the needs of different scenarios.
Patent Information
- Application Number
- CN202410727201.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-11-08
AI Technical Summary
It is difficult to directly evaluate the learned content in runtime fine-tuning, and the effectiveness and professionalism of generating psychological counselor-style answers are difficult to guarantee, and different prompts are required to try multiple times to trigger the required behavior.
By acquiring and storing psychological counseling data and corresponding style answers, context data is constructed as input to a large-scale pre-trained language model, and fine-tuning is used to generate psychological counselor-style answers that meet expectations to ensure the effectiveness and professionalism of the consultation.
The model has realized that through a large number of dialogues and prompt information learning, it generates psychological counselor-style answers that meet expectations, reduces labor costs, improves efficiency, and can expand and adjust according to needs, maintaining the accuracy and professionalism of the answers.
Smart Images

Figure CN118917408A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and specifically designs a method for generating psychological counselor-style answers based on runtime fine-tuning. Background Art
[0002] As model size and corpus size scale, large language models demonstrate runtime fine-tuning capabilities, i.e., learning from a few examples in context. Many studies have shown that large language models can perform a range of complex tasks through runtime fine-tuning capabilities. This capability has been widely validated as an emerging capability of large language models. First, runtime fine-tuning requires some examples to form context. These examples are usually written in natural language templates. Then, runtime fine-tuning concatenates the question and context to form a prompt, which is input into the language model for prediction. Unlike supervised learning, which requires updating model parameters, runtime fine-tuning does not update parameters, but directly uses the pre-trained language model for prediction.
[0003] One implementation of the question-answering style is to fine-tune the large language model. The pre-trained language model has achieved good results in processing downstream tasks through fine-tuning. It is still necessary to try various prompts to trigger the required behavior, because the key point of prompt learning is to find the most appropriate prompt, and it is impossible to directly evaluate what the model has learned during fine-tuning. Summary of the invention
[0004] In view of the above problems, an embodiment of the present invention is proposed to provide a method for generating psychological counselor-style answers based on runtime fine-tuning to overcome the above problems.
[0005] S1. Obtain psychological counseling data and corresponding counselor-style answers and store them in a database;
[0006] S2. Construct a context based on the psychological counseling data and the corresponding counselor-style answers, obtain the corresponding data and use it as input data for a large-scale pre-trained language model;
[0007] S3. Large-scale pre-trained language models give counselor-style answers based on input data.
[0008] Furthermore, the storage format of the psychological counseling data and the corresponding psychological counselor style answers in step S1 is
[0009] Further, the specific method of step S2 is: sequentially arranging the psychological counseling data and the corresponding psychological counselor style answers and the psychological counselor style answers to be generated Get the corresponding data.
[0010] The beneficial effects of the present invention are:
[0011] 1. This method enables the model to learn a large number of psychological counseling dialogues and prompt information, and the model can generate answers in the style of psychological counselors that meet expectations, ensuring the effectiveness and professionalism of counseling. Automatically generating answers in the style of psychological counselors reduces labor costs and improves overall efficiency.
[0012] 2. This method can be expanded and adjusted according to needs to adapt to different types of psychological counseling scenarios. The model can maintain the accuracy and professionalism of the answers by continuously learning new data and feedback. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The specific implementation modes of the present invention will be further described in detail below with reference to the accompanying drawings.
[0014] Figure 1 A flow chart of the overall method is shown. DETAILED DESCRIPTION
[0015] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0016] Figure 1 A flowchart of a method for generating a psychological counselor style answer based on runtime fine-tuning according to an embodiment of the present invention is shown. Figure 1 As shown, the method comprises the following steps:
[0017] S1. Obtain psychological counseling data and corresponding counselor-style answers and store them in a database;
[0018] Furthermore, the storage format of the psychological counseling data and the corresponding psychological counselor style answers in step S1 is
[0019] Specifically, D is the delimiter for different context hints, I is the psychological counseling input, O is the psychological counselor's style answer output, H is the analysis of psychological problems in psychological counseling and the psychological counselor's tone description, C combines I, O, and H, and adds role prefixes to construct the final template Template (Input, Output, Hint). Specifically:
[0020]
[0021]
[0022] S2. Construct a context based on the psychological counseling data and the corresponding counselor-style answers, obtain the corresponding data and use it as input data for a large-scale pre-trained language model;
[0023] Furthermore, the specific method of step S2 is: sequentially arranging the psychological counseling data having the psychological counseling data and the corresponding psychological counselor style answers and the psychological counselor style answers to be generated at present Get the corresponding data. Specifically, S is the specific psychological counseling scenario setting ScenarioSetting, T is the Template in S1, and I′ is the psychological counseling data of the psychological counselor style answer to be generated, which are combined into the final input prompt Prompt. Specifically:
[0024]
[0025]
[0026] S3. The large-scale pre-trained language model gives a counselor-style answer based on the input data. Furthermore, the large-scale pre-trained language model obtains learning rules and correlations from the input data, extracts key information from the counselor-style answer data in the new scenario to be generated, and constructs the corresponding counselor-style answer based on the learning rules and correlations.
Claims
1. A method for generating psychological counselor-style answers based on runtime fine-tuning, characterized by: The following steps are involved: S1. Obtain psychological counseling data and corresponding counselor-style answers and store them in a database; the storage format of psychological counseling data and corresponding counselor-style answers is D is the delimiter of different context hints, I is the psychological consultation input, O is the psychological counselor's style answer output, H is the analysis of psychological problems in psychological consultation and the psychological counselor's tone description, C combines I, O, and H, and adds role prefixes to construct the final template Template (Input, Output, Hint); S2. Construct a context based on the psychological counseling data and the corresponding counselor-style answers, obtain the corresponding data and use it as input data for a large-scale pre-trained language model; Arrange the psychological counseling data and the corresponding psychological counselor style answers and the psychological counselor style answers to be generated in order Get the corresponding data; S is the specific psychological counseling scenario setting Scenario Setting, T is the template Template in S, and different subscripts represent different templates Template; I′ is the psychological counseling data of the psychological counselor style answer to be generated, which is combined into the final input prompt Prompt; S3. Large-scale pre-trained language models give counselor-style answers based on input data.
