Skip to main content
When scoring models in a Weave evaluation, absolute value metrics (e.g. 9/10 for Model A and 8/10 for Model B) are typically harder to assign than relative ones (e.g. Model A performs better than Model B). Pairwise evaluation allows you to compare the outputs of two models by ranking them relative to each other. This approach is particularly useful when you want to determine which model performs better for subjective tasks such as text generation, summarization, or question answering. With pairwise evaluation, you can obtain a relative preference ranking that reveals which model is best for specific inputs.
This approach is a workaround and may change in future releases. We are actively working on a more robust API to support pairwise evaluations. Stay tuned for updates!
The following code sample demonstrates how to implement a pairwise evaluation in Weave by creating a class-based scorer called PreferenceScorer. The PreferenceScorer compares two models, ModelA and ModelB, and returns a relative score of the model outputs based on explicit hints in the input text.

Evaluation