Benchmark
aisteer360.evaluation.benchmark
Benchmark runner for steering pipelines.
Provides a Benchmark class for evaluating one or more steering pipeline configurations on a single UseCase.
Benchmark
Benchmark functionality for comparing steering pipelines on a use case.
A Benchmark runs one or more steering pipeline configurations on a given use case, optionally with multiple trials per configuration. Each trial reuses the same steered model and re-samples any generate-time randomness (e.g., few-shot selection, sampling-based decoding, etc.).
Attributes:
| Name | Type | Description |
|---|---|---|
use_case |
Use case that defines prompt construction, generation logic, and evaluation metrics. |
|
base_model_name_or_path |
Hugging Face model ID or local path for the base causal language model. |
|
steering_pipelines |
Mapping from pipeline name to a list of controls or |
|
runtime_overrides |
Optional overrides passed through to |
|
hf_model_kwargs |
Extra kwargs forwarded to |
|
gen_kwargs |
Generation kwargs forwarded to :meth: |
|
device_map |
Device placement strategy used when loading models. |
|
num_trials |
Number of evaluation trials to run per concrete pipeline configuration. |
Source code in aisteer360/evaluation/benchmark.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
base_model_name_or_path = base_model_name_or_path
instance-attribute
batch_size = int(batch_size)
instance-attribute
device_map = device_map
instance-attribute
gen_kwargs = gen_kwargs or {}
instance-attribute
hf_model_kwargs = hf_model_kwargs or {}
instance-attribute
num_trials = int(num_trials)
instance-attribute
runtime_overrides = runtime_overrides
instance-attribute
steering_pipelines = steering_pipelines
instance-attribute
use_case = use_case
instance-attribute
export(profiles, save_dir)
Export benchmark results to disk.
Sanitize to a JSON-friendly structure before delegating to the use case's export method.
Source code in aisteer360/evaluation/benchmark.py
302 303 304 305 306 307 308 309 310 311 | |
run()
Run the benchmark on all configured steering pipelines.
Each pipeline configuration is expanded into one or more control settings (via ControlSpecs when present).
For each configuration, the model is steered once and evaluated over num_trials trials.
Returns:
| Type | Description |
|---|---|
dict[str, list[dict[str, Any]]]
|
A mapping from pipeline name to a list of run dictionaries. Each run dictionary has keys:
|
Source code in aisteer360/evaluation/benchmark.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |