SuperAPI AI Directory

llm-comparator

LLM Comparator is an interactive data visualization tool for evaluating and analyzing LLM responses side-by-side, developed.

Open website

About this tool

LLM Comparator is an interactive visualization tool developed by the PAIR team, accompanied by a Python library, for analyzing side-by-side evaluation results of two large language models (Model A and Model B), helping users qualitatively understand the differences between the two models' responses at the example level and slice level.

Main capabilities: The Score Distribution and Metrics by Prompt Category panels display the win rate and quality distribution of Model A relative to B; the Rationale Summary panel summarizes the scoring rationales given by the LLM judge; the Custom Functions panel can discover specific differences, such as one model more often using bulleted lists, less often starting with "Sure," etc. The tool supports displaying details of multiple repeated evaluations to address position bias and non-deterministic sampling.

Usage: You can directly visit https://pair-code.github.io/llm-comparator/ to try it online, select an example file, or upload a JSON file that conforms to the format. The example link comparing Gemma 1.1 and 1.0 is https://pair-code.github.io/llm-comparator/?results_path=https://pair-code.github.io/llm-comparator/data/example_arena.json . You can also use the llm-comparator package on PyPI to generate JSON files; refer to basic_demo.ipynb and the Python library README.

Data format: The JSON file must contain each prompt, the two models' responses, and the numerical score of the side-by-side evaluation (a positive score indicates A is better, a negative score indicates B is better, 0 indicates a tie, ranging approximately from 1.5 to -1.5). Optional additional fields support types such as number, category, text, string, image_path, image_byte, as well as per-model types such as per_model_boolean, per_model_number, per_model_category; multiple evaluation results can be embedded in the individual_rater_scores attribute.

Use cases: Model version comparison, prompt category slice analysis, and visual exploratory analysis of LLM-as-a-judge evaluation results.

Limitations: This project is a research project, actively developed by a small team, and may have bugs; it is not an official Google product. When citing, please refer to the IEEE VIS 2024 paper (published in IEEE TVCG); an earlier version appears in ACM CHI 2024 Late-Breaking Work and arXiv:2402.10524.