PROMPTEVALS: A Dataset of Assertions and Guardrails for Custom Production Large Language Model Pipelines

Reya Vir, Shreya Shankar, Harrison Chase, Will Fu-Hinthorn, Aditya G. Parameswaran

Introduction

As Large Language Models (LLMs) transition from experimental prototypes to production-grade pipelines in critical sectors like finance and healthcare, reliability has emerged as a primary bottleneck. Developers frequently encounter failures where models ignore specific instructions or deviate from a desired tone. While programmatic "assertions"—checks that validate output against specific rules—offer a solution, identifying which assertions are necessary for a complex prompt remains a significant challenge.

Researchers from UC Berkeley and LangChain have introduced PROMPTEVALS, a comprehensive dataset designed to automate the generation of these guardrails. By fine-tuning smaller, open-source models on this data, the team achieved substantial performance gains over state-of-the-art models like GPT-4o, while simultaneously reducing latency and operational costs.

The PROMPTEVALS Dataset

The core contribution of this work is the PROMPTEVALS dataset, which is five times larger than previous collections of LLM instructions and constraints. It consists of 2,087 prompt templates and 12,623 corresponding assertion criteria. The data is sourced from real-world applications in the LangChain Prompt Hub, spanning diverse domains such as medical question-answering and horse racing analytics.

Methodology: Generating and Refining Assertions

The researchers developed a three-step pipeline to establish high-quality "ground truth" criteria:

  1. Initial Generation: Using GPT-4o to generate criteria based on a taxonomy of constraints (e.g., length, style, and hallucination prevention).
  2. Verification: Identifying constraints explicitly mentioned in the prompt that were missed in the first pass.
  3. Refinement: Removing redundant or vague assertions that are difficult to validate.

To measure success, the study utilizes Semantic F1, a metric that uses vector embeddings to evaluate how well predicted assertions capture the meaning of ground-truth criteria, moving beyond simple keyword matching.

Figure 1: Semantic similarity scores across different model configurations, demonstrating the impact of fine-tuning on instruction adherence.

Key Results: Performance and Latency

The study's most significant finding is that fine-tuned 7B and 8B parameter models (Mistral and Llama 3) outperformed GPT-4o by an average of 20.93% in identifying relevant assertions. This suggests that for specialized tasks like guardrail generation, high-quality targeted data is more impactful than raw model scale.

Furthermore, the fine-tuned models offer a dramatic improvement in efficiency. While GPT-4o requires a complex multi-step process to produce high-quality assertions, the fine-tuned open-source models achieve superior results in a single step.

Figure 5: Comparison of inference latency (seconds) between fine-tuned models and GPT-4o, highlighting the 3x speedup achieved by Mistral (FT).

As shown in the latency data, the fine-tuned Mistral model achieved a mean runtime of 2.59 seconds, compared to 8.70 seconds for GPT-4o. This 3x speedup is critical for developers iterating rapidly on production prompts. Additionally, fine-tuning effectively curtailed the "over-generation" seen in base models, which often hallucinated dozens of redundant assertions per prompt.

Limitations and Future Directions

Despite these advances, the current benchmark relies on proprietary embedding models for scoring, which may lead to consistency issues if those models are updated. Additionally, the dataset is currently limited to text-only prompts. Future work aims to expand the taxonomy to multimodal pipelines and explore the use of these generated criteria to automatically configure "LLM-as-a-judge" validators.

By providing both the dataset and fine-tuned models on HuggingFace, the researchers have lowered the barrier for developers to implement robust, task-specific evaluation criteria in their LLM applications.

Summary updated

BibTeX
@inproceedings{vir2025promptevals,
  author = {Reya Vir and Shreya Shankar and Harrison Chase and Will Fu-Hinthorn and Aditya G. Parameswaran},
  title = {{PROMPTEVALS: A Dataset of Assertions and Guardrails for Custom Production Large Language Model Pipelines}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.213},
}
Figure