A Prompt Example Construction Method Based on Clustering and Semantic Similarity

With the launch of OpenAI’s ChatGPT, large language models have garnered significant attention, and applications based on these models have proliferated. A critical challenge has emerged: how to rapidly enhance the capabilities of general LLMs in specialized domains. Compared to fine-tuning and other methods, prompt engineering has proven to be a cost-effective approach for improving the performance of LLMs on specific tasks, yielding remarkable results. However, current prompt example construction methods are numerous and lack a universally applicable approach that spans different models and tasks. Furthermore, existing research is predominantly tested and evaluated on a limited range of specific datasets, failing to explore the broader impact of these methods on a wider array of tasks. This paper proposes a prompt example construction method based on clustering and semantic similarity, which combines clustering algorithms with semantic similarity techniques to significantly improve the quality of prompt examples. In comparative tests conducted on six LLMs and seven datasets, the overall accuracy and stability of the proposed method significantly outperforms five other common methods, demonstrating broad applicability and the potential to enhance the output performance of all LLMs. Through comparative experiments, this paper also identifies that as the parameter scale of LLMs increases, the improvement effect of the prompt example construction method on LLM output performance tends to diminish. Additionally, diversified prompt example sets provide a more pronounced enhancement in LLM output performance.

Authors

Institutions

Publication Details

Journal
Systems
Published
2024-10-03
DOI
https://doi.org/10.3390/systems12100410
Citations
3
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
1.04
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Prompt Example Construction Method Based on Clustering and Semantic Similarity

Ding Chen, Jun Wang
3 citations
Systems
Sentiment Analysis and Opinion Mining
1.04
article

A Prompt Example Construction Method Based on Clustering and Semantic Similarity

Ding Chen, Jun Wang
article en
3 citations

Abstract

With the launch of OpenAI’s ChatGPT, large language models have garnered significant attention, and applications based on these models have proliferated. A critical challenge has emerged: how to rapidly enhance the capabilities of general LLMs in specialized domains. Compared to fine-tuning and other methods, prompt engineering has proven to be a cost-effective approach for improving the performance of LLMs on specific tasks, yielding remarkable results. However, current prompt example construction methods are numerous and lack a universally applicable approach that spans different models and tasks. Furthermore, existing research is predominantly tested and evaluated on a limited range of specific datasets, failing to explore the broader impact of these methods on a wider array of tasks. This paper proposes a prompt example construction method based on clustering and semantic similarity, which combines clustering algorithms with semantic similarity techniques to significantly improve the quality of prompt examples. In comparative tests conducted on six LLMs and seven datasets, the overall accuracy and stability of the proposed method significantly outperforms five other common methods, demonstrating broad applicability and the potential to enhance the output performance of all LLMs. Through comparative experiments, this paper also identifies that as the parameter scale of LLMs increases, the improvement effect of the prompt example construction method on LLM output performance tends to diminish. Additionally, diversified prompt example sets provide a more pronounced enhancement in LLM output performance.

SystemsVol. 12(10)
Beihang University (CN)
Openalex Percentile: Top 19%
Sentiment Analysis and Opinion Mining
1.04
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A Prompt Example Construction Method Based on Clustering and Semantic Similarity — Ding Chen, Jun Wang · Systems (2024) | TGRS Research Map | TGRS