Optimizing LLMs Prompts via Semantically-Guided Evolutionary Algorithms using SLMs

Main Article Content

Pratyush Kumar Jha

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in natural language understanding, reasoning, generation, and task automation; however, their performance is highly dependent on the quality and structure of the prompts provided to them. Manual prompt engineering is often time-consuming, subjective, and difficult to scale across different tasks and models. This study proposes a Semantically-Guided Evolutionary Prompt Optimization framework using Small Language Models (SLMs) to automatically generate and refine effective prompts for LLM-based applications. The proposed approach integrates semantic similarity analysis with evolutionary optimization operations, including prompt generation, selection, mutation, crossover, and fitness evaluation. SLMs are employed as lightweight semantic evaluators to assess the relevance, clarity, consistency, and task alignment of candidate prompts without requiring repeated dependence on computationally expensive LLM evaluations. Candidate prompts are iteratively evolved based on their semantic fitness and task-specific performance, enabling the framework to search efficiently through a large prompt space. The methodology aims to preserve the original task intent while improving prompt quality and reducing unnecessary computational and inference costs. The optimized prompts are evaluated against manually designed and conventional prompt-optimization approaches using task performance, semantic similarity, robustness, computational efficiency, and response quality. The proposed framework provides a scalable strategy for automated prompt engineering and demonstrates the potential of combining LLMs, SLMs, semantic guidance, and evolutionary algorithms for efficient prompt optimization. The approach can be applied to question answering, text classification, summarization, reasoning, information extraction, and other LLM-based natural language processing tasks.

Article Details

How to Cite
Pratyush Kumar Jha. (2026). Optimizing LLMs Prompts via Semantically-Guided Evolutionary Algorithms using SLMs. International Journal of Advanced Research and Multidisciplinary Trends (IJARMT), 3(3), 1197–1209. Retrieved from https://www.ijarmt.com/index.php/j/article/view/1323
Section
Articles

References

A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention Is All You Need,” Advances in Neural Information Processing Systems (NeurIPS), vol. 30, 2017.

J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” Proceedings of NAACL-HLT, pp. 4171–4186, 2019.

T. B. Brown et al., “Language Models are Few-Shot Learners,” Advances in Neural Information Processing Systems (NeurIPS), vol. 33, pp. 1877–1901, 2020.

E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, and W. Chen, “LoRA: Low-Rank Adaptation of Large Language Models,” arXiv preprint arXiv:2106.09685, 2021.

L. Ouyang et al., “Training Language Models to Follow Instructions with Human Feedback,” Advances in Neural Information Processing Systems (NeurIPS), vol. 35, 2022.

J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, E. Chi, Q. V. Le, and D. Zhou, “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models,” Advances in Neural Information Processing Systems (NeurIPS), vol. 35, 2022.

Y. Zhou, A. I. Muresanu, Z. Han, K. Paster, S. Pitis, H. Chan, and J. Ba, “Large Language Models Are Human-Level Prompt Engineers,” International Conference on Learning Representations (ICLR), 2023.

Q. Guo, R. Wang, J. Guo, B. Li, K. Song, X. Tan, G. Liu, J. Bian, and Y. Yang, “Connecting Large Language Models with Evolutionary Algorithms Yields Powerful Prompt Optimizers,” International Conference on Learning Representations (ICLR), 2024.

R. Pryzant, D. Iter, J. Li, Y. Lee, C. Zhu, and M. Zeng, “Automatic Prompt Optimization with ‘Gradient Descent’ and Beam Search,” Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2023.

C. Fernando, D. S. Banarse, H. Michalewski, S. Osindero, and T. Rocktäschel, “Promptbreeder: Self-Referential Self-Improvement via Prompt Evolution,” Proceedings of the 41st International Conference on Machine Learning (ICML), vol. 235, pp. 13481–13544, 2024.

O. Khattab et al., “DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines,” International Conference on Learning Representations (ICLR), 2024.

M. Yüksekgönül, F. Bianchi, J. Boen, S. Liu, Z. Huang, C. Guestrin, and J. Zou, “TextGrad: Automatic ‘Differentiation’ via Text,” arXiv preprint arXiv:2406.07496, 2024.

K. Opsahl-Ong, M. J. Ryan, J. Purtell, D. Broman, C. Potts, M. Zaharia, and O. Khattab, “Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs,” Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9340–9366, 2024.

J. Xian, S. Samuel, F. Khoubsirat, R. Pradeep, M. A. Sultan, R. Florian, S. Roukos, A. Sil, C. Potts, and O. Khattab, “Prompts as Auto-Optimized Training Hyperparameters: Training Best-in-Class IR Models from Scratch with 10 Gold Labels,” arXiv preprint arXiv:2406.11706, 2024.

P. Zhang, G. Zeng, T. Wang, and W. Lu, “TinyLlama: An Open-Source Small Language Model,” arXiv preprint arXiv:2401.02385, 2024.

M. Abdin et al., “Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone,” arXiv preprint arXiv:2404.14219, 2024.

L. A. Agrawal et al., “GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning,” arXiv preprint arXiv:2507.19457, 2025.

A. Zou, Z. Wang, N. Carlini, M. Nasr, J. Z. Kolter, and M. Fredrikson, “Universal and Transferable Adversarial Attacks on Aligned Language Models,” arXiv preprint arXiv:2307.15043, 2023.

Similar Articles

<< < 19 20 21 22 23 24 25 26 27 28 > >> 

You may also start an advanced similarity search for this article.