narcolepticchicken's picture
Update ML Intern artifact metadata
3ab9733 verified
|
Raw
History Blame
2.89 kB
metadata
tags:
  - ml-intern

Agent Cost Optimizer (ACO)

A universal control layer that reduces total cost of autonomous agent runs while preserving task quality.

Core Thesis

Most agent cost is wasted through:

  • Overusing frontier models
  • Sending huge context every turn
  • Using tools unnecessarily
  • Failing and retrying blindly
  • Ignoring cache boundaries
  • Using verifiers everywhere instead of selectively
  • Not learning from previous traces

ACO learns when to spend and when not to spend.

Architecture

10 Core Modules

  1. Cost Telemetry Collector β€” Structured trace collection with normalized schema
  2. Task Cost Classifier β€” Predicts expected cost, risk, model strength needed
  3. Model Cascade Router β€” Dynamic model selection (tiny β†’ cheap β†’ medium β†’ frontier β†’ specialist)
  4. Context Budgeter β€” Decides what context is needed vs. what can be omitted/summarized/cached
  5. Cache-Aware Prompt Layout β€” Optimizes prompt structure for prefix-cache reuse
  6. Tool-Use Cost Gate β€” Predicts whether a tool call is worth the cost
  7. Verifier Budgeter β€” Selective verification based on risk, confidence, task type
  8. Retry/Recovery Optimizer β€” Intelligent failure recovery without blind retry loops
  9. Meta-Tool Miner β€” Compresses repeated workflows into reusable deterministic scripts
  10. Early Termination / Doom Detector β€” Detects runs unlikely to succeed and stops them

Installation

pip install agent-cost-optimizer

Quick Start

from aco import AgentCostOptimizer

optimizer = AgentCostOptimizer.from_config("config.yaml")
result = optimizer.optimize(agent_request, run_state)

Reward Objective

cost_adjusted_score =
  task_success_score
  + safety_bonus
  + artifact_completion_bonus
  + calibration_bonus
  - model_cost_penalty
  - tool_cost_penalty
  - latency_penalty
  - retry_penalty
  - unnecessary_verifier_penalty
  - false_done_penalty
  - unsafe_cheap_model_penalty
  - missed_escalation_penalty

Benchmarks

  • Coding Agent Tasks
  • Research Agent Tasks
  • Tool-Use Tasks
  • Document / Contract / QA Tasks
  • Long-Horizon Agent Tasks

License

MIT

Generated by ML Intern

This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "narcolepticchicken/agent-cost-optimizer"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.