paper-with-me

Papers

Optimizing LLM Prompt Engineering with DSPy Based Declarative Learning

2026-04-06 · Shiek Ruksana, Sailesh Kiran Kurra, Thipparthi Sanjay Baradwaj arxiv

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 module rewriting to reduce hallucinations, improve factual grounding, and avoid unnecessary prompt complexity. Experimental evaluations conducted on reasoning tasks, retrieval-augmented generation, and multi-step chain-of-thought benchmarks demonstrate consistent gains in output reliability, efficiency, and generalization across models. The results show improvements of up to 30 to 45% in factual accuracy and a reduction of approximately 25% in hallucination rates. Finally, we outline key limitations and discuss future research directions for declarative prompt optimization frameworks.

📄 PDF Abstract BibTeX arXiv:2604.04869

Code (0)

등록된 구현이 없습니다.

Tasks

Prompt Engineering

Similar Papers 제목 키워드 기반

DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines

2023-10-05 · Omar Khattab, Arnav Singhvi, Paridhi Maheshwari, Zhiyuan Zhang 외

The ML community is rapidly exploring techniques for prompting language models (LMs) and for stacking them into pipelines that solve complex tasks. Unfortunately, existing LM pipelines are typically implemented using har…

Language ModelingLanguage ModellingMathQuestion Answering

A Comparative Study of DSPy Teleprompter Algorithms for Aligning Large Language Models Evaluation Metrics to Human Evaluation

2024-12-19 · Bhaskarjit Sarmah, Kriti Dutta, Anna Grigoryan, Sachin Tiwari 외

We argue that the Declarative Self-improving Python (DSPy) optimizers are a way to align the large language model (LLM) prompts and their evaluations to the human annotations. We present a comparative analysis of five te…

HallucinationLanguage ModelingLanguage ModellingLarge Language Model

The Meta-Prompting Protocol: Orchestrating LLMs via Adversarial Feedback Loops

2025-12-17 · Fanzhe Fu arxiv

The transition of Large Language Models (LLMs) from stochastic chat interfaces to reliable software components necessitates a fundamental re-engineering of interaction paradigms. Current methodologies, predominantly heur…

Prompt Engineering

Is It Time To Treat Prompts As Code? A Multi-Use Case Study For Prompt Optimization Using DSPy

2025-07-04 · Francisca Lemos, Victor Alves, Filipa Ferraz arxiv

Although prompt engineering is central to unlocking the full potential of Large Language Models (LLMs), crafting effective prompts remains a time-consuming trial-and-error process that relies on human intuition. This stu…

Prompt EngineeringCode Generation

In-Context Learning for Extreme Multi-Label Classification

2024-01-22 · Karel D'Oosterlinck, Omar Khattab, François Remy, Thomas Demeester 외

Multi-label classification problems with thousands of classes are hard to solve with in-context learning alone, as language models (LMs) might lack prior knowledge about the precise classes or how to assign them, and it …

ClassificationExtreme Multi-Label ClassificationIn-Context LearningMulti-Label Classification+2