Best-Worst Scaling
Run Best-Worst Scaling in Potato: annotators pick the best and worst item in each tuple, and counting, Bradley-Terry or Plackett-Luce turns that into scores.
New in v2.3.0
Best-Worst Scaling (BWS), also known as MaxDiff, shows an annotator a tuple of items, usually four, and asks for the best and the worst by some criterion. Two clicks per tuple produce more information than a rating would, and because the judgment is comparative it sidesteps the problem that one annotator's 7 is another's 5.
BWS is worth the setup when:
- Direct numerical ratings suffer from scale-usage differences between annotators
- You need a reliable ranking over hundreds or thousands of items
- The quality dimension is inherently relative, such as which translation reads most fluently
Best-worst scaling interface for comparative annotation in Potato
Configuration
A BWS task has two parts. The scheme says what the annotator is asked, and the top-level bws_config block says how tuples are built and scored.
bws_config:
tuple_size: 4 # items shown at once
min_item_appearances: 8 # how often each item must appear across tuples
seed: 42
scoring:
method: counting # counting | bradley_terry | plackett_luce
annotation_schemes:
- annotation_type: bws
name: fluency
description: "Select the BEST and WORST translation by fluency"
tuple_size: 4
best_description: "Most Fluent"
worst_description: "Least Fluent"
sequential_key_binding: true
label_requirement:
required: trueBesides the keys every scheme shares, the scheme takes tuple_size, best_description, worst_description, sequential_key_binding, label_requirement, options_field, and option_type. Anything about generating or scoring tuples belongs in bws_config.
A bws scheme takes tuples from bws_config, or from each item's own options when the scheme sets options_field (see Options given on each item). Potato stops at startup with an error when a bws scheme has neither.
bws_config Options
| Option | Description |
|---|---|
tuple_size | How many items appear in one tuple |
num_tuples | How many tuples to generate in total |
min_item_appearances | The minimum number of tuples each item appears in |
seed | Fixes the sampling, so a run can be reproduced |
scoring.method | counting, bradley_terry, or plackett_luce |
Raising min_item_appearances tightens every item's score at the cost of more comparisons. It is the dial to turn when the scores come out noisy.
Data Format
Each row of the data file is one item, and Potato samples tuples from the pool.
{"id": "sys_a", "text": "Le chat s'est assis sur le tapis."}
{"id": "sys_b", "text": "Le chat a assis sur le tapis."}
{"id": "sys_c", "text": "Le chat etait assis sur le mat."}
{"id": "sys_d", "text": "Le chat se tenait sur le tapis."}Tuple generation balances how often each item appears and nothing more. Potato walks reshuffled copies of the pool and cuts tuples off the front, so every item appears about equally often. Without num_tuples, Potato makes pool size × min_item_appearances / tuple_size tuples, rounded up. Which items share a tuple is random, and seed fixes the draw so that a run can be reproduced.
Options given on each item
New in v2.15.0
Some designs fix the set to compare, such as the translations of one paragraph or the outputs of several models for one prompt. Tuples drawn at random from a pool would split the set, so a bws scheme can instead read each item's own options from the field that options_field names. The item stays on the page with all the item's fields, and the annotator picks the best and the worst of the item's options:
annotation_schemes:
- annotation_type: bws
name: quality
description: "Translations of the paragraph above"
best_description: "Which translation is best?"
worst_description: "Which translation is worst?"
options_field: translations
tuple_size: 6Each item lists between two and tuple_size options, so tuple_size here is the most options any item has, up to 26:
{"id": "p1", "text": "Der Abend war still.",
"translations": [
{"id": "sysA", "text": "The evening was quiet."},
{"id": "sysB", "text": "It was a still evening."},
{"id": "human", "text": "The evening lay silent."}]}An option is a string or an object with any of id, text, and image. Scoring counts options that share an id as one option across items. sysA therefore gets one score from every paragraph sysA translated, and a translation study gets one score per system. An option without an id is scored separately. The page shows a best and a worst button for each option the item has. An item with fewer than two options, more than tuple_size options, or two options with the same id gets no options, and the server log names the item when the data loads. The server refuses with a 400 any save whose best or worst answer names no option of the item, or names one option as both.
For images, add option_type: image and give each option as an image URL, or as an object with an image key and an optional text caption. An image URL can be an http or https URL, a data:image/ URL, a path rooted at /, or a file name under media_directory.
options_field takes the place of bws_config. Potato stops at startup with an error when a config has both, or has a second bws scheme beside the one that sets options_field. The scoring endpoint below and the training export read the item's options, and each answer stores the position letter of the chosen option, in the order the item lists the options.
Scoring
Scores come from the admin endpoint POST /admin/api/bws_scoring/generate, while the server is running. The endpoint needs admin access, for example the X-API-Key header described in the admin API, and takes the method as a query parameter:
curl -X POST -H "X-API-Key: $KEY" \
"http://localhost:8000/admin/api/bws_scoring/generate?method=counting"The method parameter accepts counting, bradley_terry, and plackett_luce, and defaults to counting whatever bws_config.scoring.method says. The server scores every saved tuple that has both a best and a worst answer, from the annotations in server memory. The JSON response lists the items by rank, and the server also writes the scores to bws_scores.tsv in output_annotation_dir, with the columns item_id, text, score, best_count, worst_count, appearances, and rank. Scoring covers only the first bws scheme in the config.
The command-line scorer gives the same scores without a running server (New in v2.15.0). Like potato export, the scorer reads each annotator's saved state, resolves paths against the config's folder, rebuilds the bws_config tuples from the same seed, and scores options_field schemes too:
python -m potato.bws_scoring --config config.yaml --method bradley_terry
python -m potato.bws_scoring --config config.yaml --method counting --output scores.tsv--method takes the same three names as the endpoint, and --output defaults to bws_scores.tsv in output_annotation_dir. The command-line scorer, like the endpoint, scores only the first bws scheme in the config. Before 2.15.0, the command read JSONL files in a layout Potato does not write, so a run on a real study printed "No BWS annotations found" and exited with an error. Use the endpoint on older releases.
Counting
The default, and the transparent one. An item's score is the share of times it was picked best minus the share of times it was picked worst, so scores run from -1.0 to +1.0. It needs no extra dependencies and it is the method to report when you want a reader to be able to recompute it by hand.
Bradley-Terry
Fits a model over the pairwise comparisons each tuple implies: the best item beats every other item in its tuple, and every other item beats the worst. It handles sparse data better than counting.
curl -X POST -H "X-API-Key: $KEY" \
"http://localhost:8000/admin/api/bws_scoring/generate?method=bradley_terry"Plackett-Luce
Treats each judgment as two choices, the best from the whole tuple and then the worst from the items left, which is the MaxDiff model of how best-worst judgments are made. It fits a utility per item by maximum likelihood. Before 2.10.2 it fitted the same pairs as Bradley-Terry and returned identical scores, so rescore with 2.10.2 or later if you reported it.
curl -X POST -H "X-API-Key: $KEY" \
"http://localhost:8000/admin/api/bws_scoring/generate?method=plackett_luce"Choosing a Method
| Method | Speed | Information used | Best for |
|---|---|---|---|
counting | Fast | Best and worst counts | Exploratory analysis, and results you want to be easy to check |
bradley_terry | Medium | Implied pairwise comparisons | The usual default |
plackett_luce | Slower | Each best and worst choice, in the order they are made | A likelihood model of the judgment itself |
bradley_terry needs pip install choix. plackett_luce uses scipy, which Potato already installs.
Several Dimensions at Once
Two BWS schemes over the same items collect two judgments per tuple, which costs one extra pair of clicks rather than a second pass over the corpus:
annotation_schemes:
- annotation_type: bws
name: fluency
description: "Select the BEST and WORST by fluency"
tuple_size: 4
best_description: "Most Fluent"
worst_description: "Least Fluent"
- annotation_type: bws
name: adequacy
description: "Select the BEST and WORST by meaning preservation"
tuple_size: 4
best_description: "Most Accurate"
worst_description: "Least Accurate"The scoring endpoint in Potato 2.15.0 scores only the first bws scheme, here fluency. Potato saves the adequacy answers but has no scorer for the adequacy scheme.
What the Output Contains
Potato stores each tuple as its own item, with an ID such as bws_tuple_0008, and each scheme records the position letter of the tile chosen best and of the tile chosen worst, from "A" to "D" in a tuple of four. A line of the JSONL export from a study with a scheme named sentiment_bws looks like this:
{"instance_id": "bws_tuple_0008", "labels": {"sentiment_bws": {"best": "A", "worst": "C"}}}The export carries neither the item IDs nor the item each letter stood for, so the letters cannot be resolved from the export alone. The scoring endpoint resolves the letters from the tuples the server holds in memory. The scores are not in the export either, and calling the endpoint again with a different method rescores a finished study without recollecting anything.
Monitoring
The admin dashboard carries a BWS tab showing annotation progress and the current item scores, so you can watch whether the ranking has settled before deciding to stop collecting.
Full Example
annotation_task_name: "MT System Ranking (BWS)"
task_dir: "."
data_files:
- "data/mt_systems.jsonl"
item_properties:
id_key: id
text_key: text
bws_config:
tuple_size: 4
min_item_appearances: 8
seed: 42
scoring:
method: bradley_terry
annotation_schemes:
- annotation_type: bws
name: overall_quality
description: "Select the BEST and the WORST translation"
tuple_size: 4
best_description: "Best Translation"
worst_description: "Worst Translation"
sequential_key_binding: true
label_requirement:
required: true
output_annotation_dir: "annotation_output/"
export_annotation_format: jsonl
user_config:
allow_all_users: trueStart the server, collect the annotations, and score them from a second terminal while the server runs:
potato start config.yaml -p 8000
curl -X POST -H "X-API-Key: $KEY" \
"http://localhost:8000/admin/api/bws_scoring/generate?method=bradley_terry"Iterative best-worst scaling
Iterative best-worst scaling (IBWS) runs best-worst scaling in rounds. After each round, Potato scores the items, splits the items into thirds by score, and builds the next round's tuples inside each third. Later rounds therefore compare an item only with items that scored close to the item in the round before. The method comes from Han et al. (2024), who found that IBWS produced reliable rankings of crowdsourced scalar annotations and used those rankings as the benchmark for cheaper rating scales.
Configuring IBWS
An IBWS study uses the same bws scheme and replaces bws_config with a top-level ibws_config block. The partial config below takes the place of bws_config and the scheme in the full example above:
ibws_config:
tuple_size: 4
max_rounds: null
seed: 42
scoring_method: counting
tuples_per_item_per_round: 2
annotation_schemes:
- annotation_type: bws
name: sentiment
description: "Select the MOST and the LEAST positive sentence"
tuple_size: 4
best_description: "Most positive"
worst_description: "Least positive"
sequential_key_binding: true| Option | Default | Description |
|---|---|---|
tuple_size | 4 | Items per tuple. Validation rejects a value below 2. |
max_rounds | null | The most rounds Potato runs. null runs until every bucket is too small to split. |
seed | 42 | The base seed for tuple generation. Each bucket in each round derives its own seed from the base seed, the round, and the bucket. |
scoring_method | counting | counting, bradley_terry, or plackett_luce, used to score each bucket between rounds |
tuples_per_item_per_round | 2 | How many tuples each item appears in during one round |
ibws_config names the scoring method in a flat scoring_method key, where bws_config nests the method under scoring.method. A config with both ibws_config and bws_config fails validation, and so does an ibws_config with no bws scheme. When the config has several bws schemes, the first one drives the rounds. Potato sets no annotation limit per annotator under IBWS and keeps assigning tuples until the last round ends, whatever max_annotations_per_user says. In Potato 2.14.0, IBWS never starts in a config that loads its items through data_sources, so an IBWS study lists its items under data_files.
The round procedure
Each round follows the same steps:
- Tuples. Round 1 treats the whole pool as one bucket. Potato builds tuples inside every bucket that still splits. A bucket of n items gets n ×
tuples_per_item_per_round/tuple_sizetuples, rounded up, and every item in the bucket appears once before any item appears again. The one exception is a tuple that straddles two passes over the bucket, which can take an item from the next pass early. - End of a round. A round ends as soon as every tuple in the round has at least one saved answer. A tuple with only a "best" answer saved counts toward closing the round, and scoring then skips that tuple, because scoring needs both a best and a worst answer. Potato scores each bucket from the round's judgments with
scoring_methodand sorts the bucket by score. - Split. Potato cuts each sorted bucket into an upper and a lower third of equal size, with any remainder in the middle third. A bucket with fewer items than
tuple_sizestops splitting, and the items in that bucket are not compared again. - Stop. The study ends when every bucket has stopped splitting or
max_roundsis reached. The last round is scored and split before the study stops.
Because a round advances on one judgment per tuple, raising tuples_per_item_per_round is the way to collect more judgments per item in each round. Round state lives in server memory. After a restart, Potato replays the completed rounds from the stored answers and the seed, and the study continues from the round the study had reached.
The IBWS ranking
The ranking comes from the admin endpoint GET /admin/api/ibws_ranking. The endpoint needs admin access, for example the X-API-Key header described in the admin API:
curl -H "X-API-Key: $KEY" http://localhost:8000/admin/api/ibws_rankingThe response gives completed, current_round, and a ranking list with item_id, rank, bucket_position, and text for every item. Buckets keep their rank position as they split, and the ranking lists the buckets in that order. Inside a bucket, items follow the latest score each item received. Items in a bucket that stopped splitting keep the order of the last round that scored those items, and no later judgment separates neighboring ranks inside such a bucket. Potato writes the ranking to no file. Save the endpoint's response once completed is true. GET /admin/api/ibws_status reports progress with current_round, max_rounds, total_tuples_this_round, active_buckets, terminal_buckets, total_items, terminal_items, and completed.
IBWS compared with plain BWS and the calculator
Plain BWS with bws_config generates every tuple before annotation starts and scores the judgments on request through /admin/api/bws_scoring/generate. IBWS generates the tuples round by round from the scores so far, and the ranking builds up while the study runs. The annotator sees the same bws interface in both cases.
The best-worst scaling calculator scores one set of judgments pasted as rows, with counting scores, a Bradley-Terry fit, and split-half reliability, and suits a plain BWS study. The calculator has no input for buckets, and IBWS rounds after the first compare items only inside a bucket. Pooled scores from the calculator therefore do not reproduce the IBWS ranking. Round 1 tuples come from the whole pool, so the calculator can still check the first round of an IBWS study. Take the final order from /admin/api/ibws_ranking.
Potato's repository carries a sentiment-intensity example in examples/classification/iterative-bws/. From a checkout of the repository, potato start examples/classification/iterative-bws/config.yaml -p 8000 runs the example.
Further Reading
- Pairwise Comparison - the two-item case
- Likert Scales - direct rating instead of comparison
- Export Formats - getting the annotations out
For implementation details, see the source documentation.