Optimizing Large Language Models: A Deep Dive into Effective Prompt Engineering Techniques

被引:0
|
作者
Son, Minjun [1 ]
Won, Yun-Jae [2 ]
Lee, Sungjin [3 ]
机构
[1] Sungkyunkwan Univ, Dept MetabioHlth, Suwon 16419, South Korea
[2] Korea Elect Technol Inst, Seongnam 13488, South Korea
[3] Soonchunhyang Univ, Dept Smart Automot, Asan 31538, South Korea
来源
APPLIED SCIENCES-BASEL | 2025年 / 15卷 / 03期
关键词
large language model; prompt engineering; in-context learning; chain of thought; retrieval-augmented generation; step-by-step reasoning; tree of thought;
D O I
10.3390/app15031430
中图分类号
O6 [化学];
学科分类号
0703 ;
摘要
Recent advancements in Natural Language Processing (NLP) technologies have been driven at an unprecedented pace by the development of Large Language Models (LLMs). However, challenges remain, such as generating responses that are misaligned with the intent of the question or producing incorrect answers. This paper analyzes various Prompt Engineering techniques for large-scale language models and identifies methods that can optimize response performance across different datasets without the need for extensive retraining or fine-tuning. In particular, we examine prominent Prompt Engineering techniques including In-Context Learning (ICL), Chain of Thought (CoT), Retrieval-Augmented Generation (RAG), Step-by-Step Reasoning (SSR), and Tree of Thought (ToT), and we apply these techniques to leading LLMs such as Gemma2, LlaMA3, and Mistral. The performance of these models was evaluated using the AI2 Reasoning Challenge (ARC), HellaSwag, Massive Multitask Language Understanding (MMLU), TruthfulQA, Winogrande, and Grade School Math (GSM8k) datasets across metrics such as BLEU, ROUGE, METEOR, BLEURT, and BERTScore. The experimental results indicate that the most suitable Prompt Engineering technique can vary depending on the characteristics of each dataset. Specifically, for datasets emphasizing mathematical and logical reasoning, Prompt Engineering strategies centered around CoT, SSR, and ToT were found to be advantageous. For datasets focusing on natural language understanding, ICL-centric strategies were more effective, while RAG-based strategies were beneficial for datasets where factual accuracy is crucial. However, it was also observed that the optimal combination of Prompt Engineering techniques could differ depending on the specific LLM, indicating that fine-tuning the Prompt Engineering approach to the model and dataset is essential for achieving the best performance. The findings indicate that as LLMs become more advanced, their reliance on Prompt Engineering (PE) techniques diminishes, yet the magnitude of their performance improvement when PE strategies are applied increases. Furthermore, these advanced models tend to depend less on ICL techniques while exhibiting a greater reliance on RAG strategies. It is also evident that implementing RAG with PE-based preprocessing yields superior performance enhancements compared to the mere application of RAG on raw data.
引用
收藏
页数:32
相关论文
共 50 条
  • [21] Implications of Large Language Models for OSINT: Assessing the Impact on Information Acquisition and Analyst Expertise in Prompt Engineering
    Cerny, Jan
    PROCEEDINGS OF THE 23RD EUROPEAN CONFERENCE ON CYBER WARFARE AND SECURITY, ECCWS 2024, 2024, 23 : 116 - 124
  • [22] <monospace>BadCodePrompt</monospace>: backdoor attacks against prompt engineering of large language models for code generation
    Qu, Yubin
    Huang, Song
    Li, Yanzhou
    Bai, Tongtong
    Chen, Xiang
    Wang, Xingya
    Li, Long
    Yao, Yongming
    AUTOMATED SOFTWARE ENGINEERING, 2025, 32 (01)
  • [23] Fine-tuning and prompt engineering for large language models-based code review automation
    Pornprasit, Chanathip
    Tantithamthavorn, Chakkrit
    INFORMATION AND SOFTWARE TECHNOLOGY, 2024, 175
  • [24] Optimized interaction with Large Language Models: A practical guide to Prompt Engineering and Retrieval-Augmented Generation
    Fink, Anna
    Rau, Alexander
    Kotter, Elmar
    Bamberg, Fabian
    Russe, Maximilian Frederik
    RADIOLOGIE, 2025,
  • [25] To prompt or not to prompt: Navigating the use of Large Language Models for integrating and modeling heterogeneous data
    Remadi, Adel
    El Hage, Karim
    Hobeika, Yasmina
    Bugiotti, Francesca
    DATA & KNOWLEDGE ENGINEERING, 2024, 152
  • [26] Ontology engineering with Large Language Models
    Mateiu, Patricia
    Groza, Adrian
    2023 25TH INTERNATIONAL SYMPOSIUM ON SYMBOLIC AND NUMERIC ALGORITHMS FOR SCIENTIFIC COMPUTING, SYNASC 2023, 2023, : 226 - 229
  • [27] PromptMaker: Prompt-based Prototyping with Large Language Models
    Jiang, Ellen
    Olson, Kristen
    Toh, Edwin
    Molina, Alejandra
    Donsbach, Aaron
    Terry, Michael
    Cai, Carrie J.
    EXTENDED ABSTRACTS OF THE 2022 CHI CONFERENCE ON HUMAN FACTORS IN COMPUTING SYSTEMS, CHI 2022, 2022,
  • [28] Balancing Privacy and Robustness in Prompt Learning for Large Language Models
    Shi, Chiyu
    Su, Junyu
    Chu, Chiawei
    Wang, Baoping
    Feng, Duanyang
    MATHEMATICS, 2024, 12 (21)
  • [29] Response Generated by Large Language Models Depends on the Structure of the Prompt
    Sarangi, Pradosh Kumar
    Mondal, Himel
    INDIAN JOURNAL OF RADIOLOGY AND IMAGING, 2024, 34 (03): : 574 - 575
  • [30] Multimodal Emotion Captioning Using Large Language Model with Prompt Engineering
    Xu, Yaoxun
    Zhou, Yixuan
    Cai, Yunrui
    Xie, Jingran
    Ye, Runchuan
    Wu, Zhiyong
    PROCEEDINGS OF THE 2ND INTERNATIONAL WORKSHOP ON MULTIMODAL AND RESPONSIBLE AFFECTIVE COMPUTING, MRAC 2024, 2024, : 104 - 109