Prompt engineering designs input instructions that steer Large Language Models (LLMs) without modifying model parameters. This paper presents a lightweight, fully open-source pipeline that optimizes prompts online using a Linear Upper Confidence Bound (LinUCB) contextual bandit, coupled with the Qwen2.5-1.5B-Instruct generator and a Sentence-transformer-based evaluation module. The system combines automatic metrics (BLEU, ROUGE-L, coherence, hallucination) with optional human ratings collected via a Gradio interface, enabling selection of high-utility prompts using both automated and human feedback across general, medical, and legal domains. Unlike API-dependent approaches, the implementation runs end-to-end on commodity hardware and requires no proprietary services. On a diverse query set, the prototype achieves BLEU 0.682, ROUGE-L 0.715, normalized perplexity 0.320, coherence 0.825, and hallucination 0.280, yielding a composite reward of 0.742. These results show consistent gains over direct and template-only prompting baselines and reflect the literature’s finding that combining automated and human signals improves alignment, while our bandit-based design delivers this benefit with low computational overhead. The pipeline offers a practical foundation for accessible NLP applications in education, customer support, and professional services.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Prompt to Perfection: Re-framing AI Interaction with RL-Optimized NLP

  • Vaishnavi Bhat,
  • Ganesh Naik,
  • Shivyogi Bendigerimath,
  • Tejaswini Mullalli,
  • Sharada Shiragudikar

摘要

Prompt engineering designs input instructions that steer Large Language Models (LLMs) without modifying model parameters. This paper presents a lightweight, fully open-source pipeline that optimizes prompts online using a Linear Upper Confidence Bound (LinUCB) contextual bandit, coupled with the Qwen2.5-1.5B-Instruct generator and a Sentence-transformer-based evaluation module. The system combines automatic metrics (BLEU, ROUGE-L, coherence, hallucination) with optional human ratings collected via a Gradio interface, enabling selection of high-utility prompts using both automated and human feedback across general, medical, and legal domains. Unlike API-dependent approaches, the implementation runs end-to-end on commodity hardware and requires no proprietary services. On a diverse query set, the prototype achieves BLEU 0.682, ROUGE-L 0.715, normalized perplexity 0.320, coherence 0.825, and hallucination 0.280, yielding a composite reward of 0.742. These results show consistent gains over direct and template-only prompting baselines and reflect the literature’s finding that combining automated and human signals improves alignment, while our bandit-based design delivers this benefit with low computational overhead. The pipeline offers a practical foundation for accessible NLP applications in education, customer support, and professional services.