paper-with-me

Papers

DSPy Assertions: Computational Constraints for Self-Refining Language Model Pipelines

2023-12-20 · Arnav Singhvi, Manish Shetty, Shangyin Tan, Christopher Potts, Koushik Sen, Matei Zaharia, Omar Khattab

Chaining language model (LM) calls as composable modules is fueling a new way of programming, but ensuring LMs adhere to important constraints requires heuristic "prompt engineering". We introduce LM Assertions, a programming construct for expressing computational constraints that LMs should satisfy. We integrate our constructs into the recent DSPy programming model for LMs, and present new strategies that allow DSPy to compile programs with LM Assertions into more reliable and accurate systems. We also propose strategies to use assertions at inference time for automatic self-refinement with LMs. We report on four diverse case studies for text generation and find that LM Assertions improve not only compliance with imposed rules but also downstream task performance, passing constraints up to 164% more often and generating up to 37% more higher-quality responses. Our reference implementation of LM Assertions is integrated into DSPy at https://github.com/stanfordnlp/dspy

📄 PDF Abstract BibTeX arXiv:2312.13382

Code (1)

stanfordnlp/dspy 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingPrompt EngineeringQuestion AnsweringText Generation

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

Repairing Language Model Pipelines by Meta Self-Refining Competing Constraints at Runtime

2025-07-11 · Mojtaba Eshghie

Language Model (LM) pipelines can dynamically refine their outputs against programmatic constraints. However, their effectiveness collapses when faced with competing soft constraints, leading to inefficient backtracking …

Language ModelingLanguage Modelling

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

Advanced Semantics for Commonsense Knowledge Extraction

2020-11-02 · Tuan-Phong Nguyen, Simon Razniewski, Gerhard Weikum

Commonsense knowledge (CSK) about concepts and their properties is useful for AI applications such as robust chatbots. Prior works like ConceptNet, TupleKB and others compiled large CSK collections, but are restricted in…

Commonsense Knowledge Base Construction

Refined Commonsense Knowledge from Large-Scale Web Contents

2021-11-30 · Tuan-Phong Nguyen, Simon Razniewski, Julien Romero, Gerhard Weikum

Commonsense knowledge (CSK) about concepts and their properties is helpful for AI applications. Prior works, such as ConceptNet, have compiled large CSK collections. However, they are restricted in their expressiveness t…

Open Information Extraction