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 条
  • [1] Prompt Engineering: Guiding the Way to Effective Large Language Models
    Aljanabi M.
    Yaseen M.G.
    Ali A.H.
    Mohammed M.A.
    Iraqi Journal for Computer Science and Mathematics, 2023, 4 (04): : 151 - 155
  • [2] WORDFLOW: Social Prompt Engineering for Large Language Models
    Wang, Zijie J.
    Chakravarthy, Aishwarya
    Munechika, David
    Chau, Duen Horng
    PROCEEDINGS OF THE 62ND ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, VOL 3: SYSTEM DEMONSTRATIONS, 2024, : 42 - 50
  • [3] Empowerment of Large Language Models in Psychological Counseling through Prompt Engineering
    Huang, Shanshan
    Fu, Fuxiang
    Yang, Ke
    Zhang, Ke
    Yang, Fan
    2024 IEEE 4TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING AND ARTIFICIAL INTELLIGENCE, SEAI 2024, 2024, : 220 - 225
  • [4] Integrating chemistry knowledge in large language models via prompt engineering
    Liu, Hongxuan
    Yin, Haoyu
    Luo, Zhiyao
    Wang, Xiaonan
    SYNTHETIC AND SYSTEMS BIOTECHNOLOGY, 2025, 10 (01) : 23 - 38
  • [5] Prompt Optimization in Large Language Models
    Sabbatella, Antonio
    Ponti, Andrea
    Giordani, Ilaria
    Candelieri, Antonio
    Archetti, Francesco
    MATHEMATICS, 2024, 12 (06)
  • [6] Prompt engineering on leveraging large language models in generating response to InBasket messages
    Yan, Sherry
    Knapp, Wendi
    Leong, Andrew
    Kadkhodazadeh, Sarira
    Das, Souvik
    Jones, Veena G.
    Clark, Robert
    Grattendick, David
    Chen, Kevin
    Hladik, Lisa
    Fagan, Lawrence
    Chan, Albert
    JOURNAL OF THE AMERICAN MEDICAL INFORMATICS ASSOCIATION, 2024, 31 (10) : 2263 - 2270
  • [7] Prompt Engineering: Unleashing the Power of Large Language Models to Defend Against Social Engineering Attacks
    Nezer, Ahmed I.
    Nema, Bashar M.
    Salim, Wisam Makki
    Iraqi Journal for Computer Science and Mathematics, 2024, 5 (03): : 404 - 416
  • [8] Deep Dive into Machine Learning Models for Protein Engineering
    Xu, Yuting
    Verma, Deeptak
    Sheridan, Robert P.
    Liaw, Andy
    Ma, Junshui
    Marshall, Nicholas M.
    McIntosh, John
    Sherer, Edward C.
    Svetnik, Vladimir
    Johnston, Jennifer M.
    JOURNAL OF CHEMICAL INFORMATION AND MODELING, 2020, 60 (06) : 2773 - 2790
  • [9] MetaPredictor: in silico prediction of drug metabolites based on deep language models with prompt engineering
    Zhu, Keyun
    Huang, Mengting
    Wang, Yimeng
    Gu, Yaxin
    Li, Weihua
    Liu, Guixia
    Tang, Yun
    BRIEFINGS IN BIOINFORMATICS, 2024, 25 (05)
  • [10] Knowledge graph construction for heart failure using large language models with prompt engineering
    Xu, Tianhan
    Gu, Yixun
    Xue, Mantian
    Gu, Renjie
    Li, Bin
    Gu, Xiang
    FRONTIERS IN COMPUTATIONAL NEUROSCIENCE, 2024, 18