9/10 for Model A and 8/10 for Model B) are typically harder to assign than relative ones (for example, Model A performs better than Model B). Pairwise evaluation lets you compare the outputs of two models by ranking them relative to each other. This approach is 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 get a relative preference ranking that shows which model is best for specific inputs.
The following code sample shows 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.
ModelA and ModelB based on the PreferenceScorer results.
Evaluation