Sahler, Kerstin and Jentzsch, Sophie Freya and Retkowitz, Daniel (2024) Prompt Engineering for Steering Emotions in Large Language Model (LLM) Responses. Master's, Hochschule Niederrhein.
|
PDF
- Only accessible within DLR
11MB |
Abstract
Emotion-awareness in conversational agents has been shown to be beneficial and can be exploited in high-stress scenarios, such as soothing flight controllers' emotions in aerospace. Despite advances in Large Language Models, steering responses to specific emotions remains challenging, but crucial for emotion-aware and neutral communication needs. Recently, new methods for steering model responses have emerged. Following these developments, this thesis investigates the potential of steering emotions in model responses through one new method called Prompt Engineering. The aim is to comprehensively evaluate the effectiveness of Prompt Engineering for steering emotions and compare its effectiveness to Fine-Tuning. This work employs the ChatGPT base model, GPT-3.5-turbo, from OpenAI over the OpenAI interface. The experiments are conducted iteratively, with each prompting technique representing one cycle, i.e., Zero-Shot, Zero-Shot Chain-of-Thought, Few-Shot, and Chain-of-Thought Prompting. The most effective prompt from each cycle serves as the basis for the next. The different prompts are designed based on three prompting guides and relevant scientific findings. Additionally, the same model is fine-tuned on a novel dataset of 120 human-written examples, each expressing one of six Ekman basic emotions. Both quantitative and qualitative methods are used to evaluate the results. The quantitative evaluation includes an Emotion Score based on the F1 Score of a selftrained emotion classifier and textual quality metrics such as BERTScore, Flesch Reading Ease Score, Distinct-1, Distinct-2, and Accuracy. Qualitative evaluation involves categorising outstanding features in the responses. The findings indicate that Prompt Engineering is a valuable tool for steering emotions in model responses. The most effective approach was a Few-Shot Prompt with six examples written by the same author, each representing one of the six Ekman emotions. Even the simplest Zero-Shot Prompts yielded good results. However, including examples mitigated unwanted model behaviour. In comparison, ZeroShot Chain-of-Thought and Chain-of-Thought Prompts were less effective. Overall, Prompt Engineering outperformed Fine-Tuning in terms of Emotion Score and textual quality, suggesting the need for a more diverse dataset and higher temperature settings for effective Fine-Tuning. Future research can focus on collecting more diverse data and exploring different languages and cultures. Additionally, it would be valuable to use human raters for evaluation, examine various models, such as open-source models, and compare other methods to Prompt Engineering.
| Item URL in elib: | https://elib.dlr.de/205518/ | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Document Type: | Thesis (Master's) | ||||||||||||||||
| Title: | Prompt Engineering for Steering Emotions in Large Language Model (LLM) Responses | ||||||||||||||||
| Authors: |
| ||||||||||||||||
| Date: | 2024 | ||||||||||||||||
| Open Access: | No | ||||||||||||||||
| Number of Pages: | 132 | ||||||||||||||||
| Status: | Published | ||||||||||||||||
| Keywords: | Large Language Models Machine Learning Artificial Intelligence Human Computer Interaction Sentiment Analysis Prompt Engineering | ||||||||||||||||
| Institution: | Hochschule Niederrhein | ||||||||||||||||
| HGF - Research field: | Aeronautics, Space and Transport | ||||||||||||||||
| HGF - Program: | Space | ||||||||||||||||
| HGF - Program Themes: | Space System Technology | ||||||||||||||||
| DLR - Research area: | Raumfahrt | ||||||||||||||||
| DLR - Program: | R SY - Space System Technology | ||||||||||||||||
| DLR - Research theme (Project): | R - Collaboration of aviation operators and AI systems, R - Tasks SISTEC | ||||||||||||||||
| Location: | Köln-Porz | ||||||||||||||||
| Institutes and Institutions: | Institute of Software Technology Institute of Software Technology > Intelligent and Distributed Systems | ||||||||||||||||
| Deposited By: | Jentzsch, Sophie Freya | ||||||||||||||||
| Deposited On: | 02 Aug 2024 10:24 | ||||||||||||||||
| Last Modified: | 02 Aug 2024 11:41 |
Repository Staff Only: item control page