Pairwise Comparison Tools for Large Language Model-Based Writing Evaluation
Overview
Provides a unified framework for generating, submitting, and analyzing pairwise comparisons of writing quality using large language models (LLMs). The package supports live and/or batch evaluation workflows across multiple providers ('OpenAI', 'Anthropic', 'Google Gemini', 'Together AI', and locally-hosted 'Ollama' models), includes bias-tested prompt templates and a flexible template registry, and offers tools for constructing forward and reversed comparison sets to analyze consistency and positional bias. The package additionally supports adaptive pairing workflows that iteratively select comparisons based on model uncertainty to improve ranking efficiency. Results can be modeled using frequentist or Bayesian Bradley–Terry–Luce models (Bradley & Terry, 1952 doi:10.2307/2334029; see also Caron & Doucet, 2012 doi:10.1080/10618600.2012.638220) or Elo rating methods (see Clark et al., 2018 doi:10.1371/journal.pone.0190393) to derive writing quality scores. For information on pairwise comparisons and comparative judgement, see Thurstone (1927) doi:10.1037/h0070288 and Heldsinger & Humphry (2010) doi:10.1007/BF03216919.
New Features
Adaptive linking
- Added cross-set adaptive linking through
adaptive_rank(), with one-spoke and multi-spoke hub-and-spoke run modes for placing separately ranked sets on a shared scale. - Phase A can run canonical within-set ranking, import saved Phase A artifacts, or combine imported and newly run sets. Phase B uses anchored-joint estimation with hard-locked hub parameters, globally shared judge parameters, and concurrent spoke processing.
- Added D-optimal cross-set candidate selection, spoke-aware comparison budgets, and fixed per-refit held-out probes with explicit coverage, calibration, and stopping gates.
Show all changes in 1.3.1Hide the rest of the changes in 1.3.1
- Added persistent Phase A manifests and linking sessions, resume support,
link_stage_log, and explicit blocker and invalid-judgment reporting for auditable long-running workflows.
Model support & live API improvements
- Added a separate Vertex AI Gemini live backend via
backend = "vertex"withVERTEX_API_KEY. - Vertex remains live-only in this series; generic batch wrappers reject
backend = "vertex"explicitly rather than routing it through Gemini batch helpers. - Clarified provider-specific
service_tierbehavior for Gemini Developer API and Vertex AI Gemini API in the package docs, README, and vignettes. - Added request-shape handling for the OpenAI GPT-5.x and GPT-5.6 model families.
Bayesian BTL usability
- Added exported
build_btl_results_data()to convert conventionalID1/ID2/better_idoutcomes into the canonical input required byfit_bayes_btl_mcmc(). - Standalone Bayesian BTL fits now report reliability and sampler diagnostics through the same result and log surfaces used by adaptive workflows.
Improvements
- Reduced adaptive-linking refit, candidate-generation, logging, and checkpoint overhead for large runs, including bounded candidate construction and analytic anchored-joint derivatives.
- Hardened adaptive-linking resume behavior, Phase A stopping scope, spoke routing, probe scheduling, and Phase B pair accounting.
Documentation
- Updated the backend support matrix to distinguish Gemini Developer API from Vertex AI Gemini API and to document the live-only Vertex scope.
- Replaced the undated supported-model list with a dated, machine-readable compatibility registry that separates backend implementation, live/batch testing, and current provider availability.
- Corrected stale provider identifiers, API-key and CmdStan setup guidance, OpenAI Flex wording, cost-estimator summaries, and broken public examples.
Bug fixes
- Fixed Anthropic extended-thinking live requests when users explicitly set the required
temperature = 1. - OpenAI Responses live requests now forward and enforce an explicitly supplied
max_output_tokenslimit. - Changed omitted
temperatureandtop_pcontrols to use model/provider defaults instead of injecting deterministic sampling values. Provider-required reasoning constraints are still enforced. - Provider smoke runs now exit unsuccessfully when a selected API key is absent, unless missing-key skips were explicitly allowed.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-08
- ERROR12 OK, 1 ERROR2026-06-07
- OK14 OK2026-03-30
Show 2 earlier changesHide 2 earlier changes
- ERROR13 OK, 1 ERROR2026-03-28
- OK14 OK2026-03-10
Documentation
- Help pages
- 95 (5 internal)includes a package overview page
- Examples that run
- 59%53 run in a plain check · 37 never run
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 1%
- Advanced: Submitting and Polling Multiple Batches HTML
- Backends and Tested Model Configurations HTML
- Data Schemas and Prompt Management HTML
- Design: Adaptive Linking HTML
- Design: Adaptive Pairing HTML
- Getting Started with pairwiseLLM HTML
- Guide: Adaptive Linking HTML
- Guide: Adaptive Pairing HTML
- Prompt Template Positional Bias Testing
- Provider Controls and Recovery HTML
Show 1 moreHide 1 vignette
Downloads
Repository
- PRs merged (all time)
- 97%
- Median days to close, 50 most recently updated closed issues
- 0
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Issues over time
PRs over time
Commits over time
14 development-tooling and community-health practices detected across 8 families in the upstream repository
Checks run against github.com/shmercer/pairwisellm on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows
GitHub Pages site last deployed 2026-10-19 · The repository has a site deploy workflow
pkgdown site last built 2026-10-19
Show all practicesHide 4 practices
This repository shows signs of AI coding tools.
- Codexfirst seen 2025-12-02Named in .Rbuildignore: .codexNamed in .gitignore: .codexPull request it wrote: opened by a project member
- Claude Codefirst seen 2026-09-09Named in .Rbuildignore: .claude
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.3.1Latest2026-09-07 · current release · diff ↗ ·
added 23 exports
adaptive_get_logs, adaptive_item_log, adaptive_rank, adaptive_rank_resume, adaptive_rank_run_live, adaptive_rank_start, adaptive_results_history, adaptive_round_log, adaptive_step_log, build_btl_results_data, estimate_llm_pairs_cost, fit_bayes_btl_mcmc, llm_resume_multi_batches, llm_submit_pairs_multi_batch, load_adaptive_session, make_adaptive_judge_llm, save_adaptive_session, submit_vertex_pairs_live, summarize_adaptive, summarize_items, summarize_refits, validate_session_dir, vertex_compare_pair_live - RR 4.6.0 released · 2026-04-24
- 1.1.02025-12-22
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-12-22
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Additional repositories
- stan-dev.r-universe.dev
- Minimum R
- ≥ 4.1
- Bundled data
- 176 KB / 5 files
- Download size
- 1.5 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("pairwiseLLM")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.32614/cran.package.pairwisellm.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.