Select Best Output Using Max Score
AI prompt chain for objective output selection using max-score assertion. Selects the best LLM response based on aggregated assertion scores.
Why it matters
Automate objective output selection by aggregating scores from multiple assertions. This ensures the most accurate and relevant results are chosen based on predefined criteria.
Outcomes
What it gets done
Define and apply multiple assertions to evaluate AI outputs.
Aggregate scores from individual assertions.
Select the output with the highest aggregated score.
Ensure consistent and objective output selection.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-max-score-selection | bash Overview
Max Score Selection
This prompt chain demonstrates the `max-score` assertion type for objective output selection. It aggregates scores from other assertions to automatically identify and select the LLM response with the highest overall score, ensuring a data-driven approach to choosing the best output. Utilize this prompt chain when you need to objectively compare and automatically select the best performing LLM output across multiple evaluation criteria. It is ideal for scenarios requiring automated, reproducible selection of optimal responses based on defined metrics.
What it does
This prompt chain demonstrates the max-score assertion type within promptfoo. It enables objective selection of the best LLM output by aggregating scores from multiple other assertions, effectively automating the process of identifying the highest-performing response.
When to use - and when NOT to
Use this prompt chain when you need to objectively compare multiple LLM outputs and automatically select the one that performs best across a defined set of criteria. It is ideal for scenarios where you have established evaluation metrics and want to automate the selection of the optimal response for a given prompt. Do not use this if your evaluation is purely subjective or if you do not have a defined set of assertions to score the outputs against.
Inputs and outputs
The primary input is a prompt that will be sent to one or more language models. The chain then applies a series of assertions to evaluate the outputs from these models. The output is the selected LLM response that achieved the highest aggregated score based on the max-score assertion configuration.
Integrations
This example is designed to be used with promptfoo, an open-source tool for testing and evaluating LLM outputs. promptfoo supports integration with various language models and APIs, allowing you to test outputs from different providers.
Who it's for
This prompt chain is for developers, prompt engineers, and AI researchers who are focused on optimizing LLM performance and require a systematic, data-driven approach to selecting the best model outputs. It differs from manual selection by providing an automated, objective, and reproducible method for identifying top-performing responses based on predefined metrics.
Source README
This example demonstrates the max-score assertion type for objective output selection based on aggregated scores from other assertions.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.