Optimizing LLM Prompt Engineering with DSPy Based Declarative Learning
Shiek Ruksana, Sailesh Kiran Kurra, Thipparthi Sanjay Baradwaj

TL;DR
This paper introduces DSPy, a declarative framework that automates and optimizes prompt engineering for LLMs, significantly enhancing accuracy, reliability, and efficiency across various NLP tasks.
Contribution
It presents a novel DSPy-based architecture combining symbolic planning and gradient-free optimization for automated prompt synthesis and correction.
Findings
Up to 45% improvement in factual accuracy.
Approximately 25% reduction in hallucination rates.
Consistent gains in output reliability and generalization.
Abstract
Large Language Models (LLMs) have shown strong performance across a wide range of natural language processing tasks; however, their effectiveness is highly dependent on prompt design, structure, and embedded reasoning signals. Conventional prompt engineering methods largely rely on heuristic trial-and-error processes, which limits scalability, reproducibility, and generalization across tasks. DSPy, a declarative framework for optimizing text-processing pipelines, offers an alternative approach by enabling automated, modular, and learnable prompt construction for LLM-based systems.This paper presents a systematic study of DSPy-based declarative learning for prompt optimization, with emphasis on prompt synthesis, correction, calibration, and adaptive reasoning control. We introduce a unified DSPy LLM architecture that combines symbolic planning, gradient free optimization, and automated…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
