Skip to main content

DelegationCohortScenario

Agents scenarios · Implementation: mlsysim/engine/scenario_definitions/agents.py.

Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.

A single controller and a delegated design on one matched cohort, priced alike.

Spend charges every initiated attempt at the same prices; cost per accepted task divides it by the accepted count. A policy passes the screen if it meets both acceptance floors within the budget.

Notes

Equation: Spend sums token counts times their prices and service duration times its price; accepted-task cost divides spend by accepted count.

Assumptions: Both policies share the same cohort, prices, deadlines, and acceptance contract; ratio denominators are nonzero.

Excludes: Prediction of acceptance rates or latency; supplied outcomes are inputs rather than results generated by the model.

References

Derivation: Spend sums token counts times their prices and service duration times its price; accepted-task cost divides spend by accepted count. This is declared scenario accounting rather than a fitted empirical law.

Examples

>>> from mlsysim import Scenarios
>>> scenario = Scenarios.MatchedDelegationCohort
>>> value = scenario.extra_spend
>>> str(value.units)
'dollar'

Attributes

Name Description
accepted_floor
attempted
budget
cost_ratio Delegated cost per acceptance divided by single-controller cost, dimensionless.
cutoff
deadline
delegated
discard_share Fraction of delegated spend attributable to failed or canceled work.
extra_on_time Additional on-time accepted tasks under delegation, allowing a negative difference.
extra_spend Delegated minus single-controller spend in USD, allowing a negative saving.
input_price
marginal_on_time_cost Additional USD per additional on-time acceptance; requires nonzero additional count.
on_time_floor
output_price
service_price
single

Methods

Name Description
cost_per_accepted Total spend divided by positive accepted count, in USD per accepted task.
discarded USD spent on the arm’s failed or canceled work already included in its total usage.
passes Whether acceptance count, on-time count, and total spend jointly meet the declared
spend Total USD charged to arm for input tokens, output tokens, and settled service time.

cost_per_accepted

engine.scenario_types.DelegationCohortScenario.cost_per_accepted(arm)

Total spend divided by positive accepted count, in USD per accepted task.

Equation: spend(arm) / arm.accepted.

discarded

engine.scenario_types.DelegationCohortScenario.discarded(arm)

USD spent on the arm’s failed or canceled work already included in its total usage.

Equation: (arm.discard_input_tokens * input_price + arm.discard_output_tokens * output_price + arm.discard_service_time * service_price).to('dollar').

passes

engine.scenario_types.DelegationCohortScenario.passes(arm)

Whether acceptance count, on-time count, and total spend jointly meet the declared screen.

Equation: arm.accepted >= accepted_floor and arm.on_time >= on_time_floor and (spend(arm) <= budget).

spend

engine.scenario_types.DelegationCohortScenario.spend(arm)

Total USD charged to arm for input tokens, output tokens, and settled service time.

Equation: (arm.input_tokens * input_price + arm.output_tokens * output_price + arm.service_time * service_price).to('dollar').

attempted

Type: int.

Declared default: required.

accepted_floor

Type: int.

Declared default: required.

on_time_floor

Type: int.

Declared default: required.

deadline

Type: Quantity.

Declared default: required.

cutoff

Type: Quantity.

Declared default: required.

budget

Type: Quantity.

Declared default: required.

input_price

Type: Quantity.

Declared default: required.

output_price

Type: Quantity.

Declared default: required.

service_price

Type: Quantity.

Declared default: required.

single

Type: CohortArmRecord.

Declared default: required.

delegated

Type: CohortArmRecord.

Declared default: required.

extra_spend

engine.scenario_types.DelegationCohortScenario.extra_spend

Delegated minus single-controller spend in USD, allowing a negative saving.

Equation: spend(delegated) - spend(single).

extra_on_time

engine.scenario_types.DelegationCohortScenario.extra_on_time

Additional on-time accepted tasks under delegation, allowing a negative difference.

Equation: delegated.on_time - single.on_time.

marginal_on_time_cost

engine.scenario_types.DelegationCohortScenario.marginal_on_time_cost

Additional USD per additional on-time acceptance; requires nonzero additional count.

Equation: extra_spend / extra_on_time.

cost_ratio

engine.scenario_types.DelegationCohortScenario.cost_ratio

Delegated cost per acceptance divided by single-controller cost, dimensionless.

Equation: (cost_per_accepted(delegated) / cost_per_accepted(single)).to('').magnitude.

discard_share

engine.scenario_types.DelegationCohortScenario.discard_share

Fraction of delegated spend attributable to failed or canceled work.

Equation: (discarded(delegated) / spend(delegated)).to('').magnitude.

Back to top