Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs
Fuente:
arXiv
Enregistré dans:
| Auteurs principaux: | , , , , , |
|---|---|
| Format: | Preprint |
| Publié: |
2025
|
| Sujets: | |
| Accès en ligne: | |
| Tags: |
Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
|
| _version_ | 1866909647250653184 |
|---|---|
| author | Cruz, Rogelio Contreras, Jonatan Guerrero, Francisco Rodriguez, Ezequiel Valdez, Carlos Carrillo, Citlali |
| author_facet | Cruz, Rogelio Contreras, Jonatan Guerrero, Francisco Rodriguez, Ezequiel Valdez, Carlos Carrillo, Citlali |
| contents | In this paper, we propose a novel prompting approach aimed at enhancing the ability of Large Language Models (LLMs) to generate accurate Python code. Specifically, we introduce a prompt template designed to improve the quality and correctness of generated code snippets, enabling them to pass tests and produce reliable results. Through experiments conducted on two state-of-the-art LLMs using the HumanEval dataset, we demonstrate that our approach outperforms widely studied zero-shot and Chain-of-Thought (CoT) methods in terms of the Pass@k metric. Furthermore, our method achieves these improvements with significantly reduced token usage compared to the CoT approach, making it both effective and resource-efficient, thereby lowering the computational demands and improving the eco-footprint of LLM capabilities. These findings highlight the potential of tailored prompting strategies to optimize code generation performance, paving the way for broader applications in AI-driven programming tasks. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2506_10989 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs Cruz, Rogelio Contreras, Jonatan Guerrero, Francisco Rodriguez, Ezequiel Valdez, Carlos Carrillo, Citlali Software Engineering Artificial Intelligence In this paper, we propose a novel prompting approach aimed at enhancing the ability of Large Language Models (LLMs) to generate accurate Python code. Specifically, we introduce a prompt template designed to improve the quality and correctness of generated code snippets, enabling them to pass tests and produce reliable results. Through experiments conducted on two state-of-the-art LLMs using the HumanEval dataset, we demonstrate that our approach outperforms widely studied zero-shot and Chain-of-Thought (CoT) methods in terms of the Pass@k metric. Furthermore, our method achieves these improvements with significantly reduced token usage compared to the CoT approach, making it both effective and resource-efficient, thereby lowering the computational demands and improving the eco-footprint of LLM capabilities. These findings highlight the potential of tailored prompting strategies to optimize code generation performance, paving the way for broader applications in AI-driven programming tasks. |
| title | Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs |
| topic | Software Engineering Artificial Intelligence |
| url | https://arxiv.org/abs/2506.10989 |