Find the settings of a sweep that changed nothing that was sent
Source:R/core-bench-sweep.R
hr_sweep_check.RdA setting a reader does not use (top_k under a reader that sends every
chunk, mmr with top_k at or above the number of chunks) leaves the
requests as they were, and a sweep over it compares an arm with itself.
hr_sweep_check() finds such pairs in a benchmark: two arms that sent
byte-identical requests (the same model, prompts and request settings, in
the same order) on every item and run they share.
Arguments
- bench
An
hr_benchfromhr_benchmark().
Value
A data frame with one row per arm whose requests were identical
to an earlier arm's: arm and same_as (the first earlier arm, in the
benchmark's order, that sent the same requests), runs (the item and run pairs compared),
requests (the requests arm sent over them), and settings, the
recorded settings (param.* columns) that differ between the two, as
"top_k: 2 vs 8", which are the settings that changed nothing. No
rows when every pair of arms sent different requests.
Details
An arm is reported once, against the first arm before it with the same requests, so three arms that sent the same requests give two rows. Pairs in which neither arm sent a request are left out, since requests cannot tell them apart. A request answered from a cache counts as sent: its prompt is recorded as it would have gone out.
See also
Other harness:
gr_arm(),
gr_condensation_check(),
gr_qa_reference(),
gr_reverse_text(),
gr_scorer_answer(),
hr_arm(),
hr_benchmark(),
hr_chain(),
hr_contrast(),
hr_drift_check(),
hr_effort_check(),
hr_effort_escalate(),
hr_effort_event(),
hr_effort_log(),
hr_mdd(),
hr_modules(),
hr_reference(),
hr_register(),
hr_report(),
hr_scorer(),
hr_set(),
hr_settings(),
hr_skill(),
hr_step(),
hr_step_command(),
hr_sweep()
Examples
cl <- hr_mock_client(function(m, p) "Revenue was 45.2 million dollars.")
ref <- gr_qa_reference(
questions = c(revenue = "What was revenue in 2024?"),
documents = gr_example(), answers = list("45.2 million"), split = "test")
old <- hr_options(verbose = FALSE)
# `stuff` sends the whole document, so top_k changes nothing.
arms <- hr_sweep(gr_arm("fast"), list(top_k = c(2, 8)))
bench <- hr_benchmark(arms, ref, runs = 5, client = cl,
scorer = gr_scorer_answer())
hr_sweep_check(bench)
#> arm same_as runs requests settings
#> 1 fast:top_k=8 fast:top_k=2 5 5 top_k: 2 vs 8
hr_options(old)