Upload TRUTH.md
Browse files
TRUTH.md
CHANGED
|
@@ -1,83 +1,122 @@
|
|
| 1 |
# TRUTH.md β Honest State of the ACO Project
|
| 2 |
|
| 3 |
-
**Date: 2026-06-
|
| 4 |
|
| 5 |
## What This Project Actually Is
|
| 6 |
|
| 7 |
-
A
|
| 8 |
|
| 9 |
-
|
| 10 |
-
2. **Self-Consistency Cascade** (training-free, 2.5-3.5Γ reduction, literature-backed) β `aco/self_consistency_cascade.py`
|
| 11 |
-
3. **Context Compression + Cache Layout** (free savings via prompt structure) β `aco/context_compression.py`
|
| 12 |
|
| 13 |
-
##
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|---|---|---|---|---|
|
| 19 |
-
|
|
| 20 |
-
|
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
-
FALSE. Verified on 863 held-out R2E-Gym samples. Verifier-gater-v2 predicts both classes:
|
| 27 |
-
neg P=0.778 R=0.559, pos P=0.594 R=0.803. F1=0.667 (vs base rate of 0.446).
|
| 28 |
-
It is a weak model (only 1.3pp above v1), not a collapsed one.
|
| 29 |
|
| 30 |
-
|
| 31 |
-
The +23pp claim was vastly overstated. v2 tier-router: F1=0.677 (not 0.93).
|
| 32 |
-
v1 tier-router: F1=0.670. The gain is +0.7pp, not +23pp.
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
FALSE. Base rate is 44.6% positive (385/863). Model achieves 66.7%.
|
| 40 |
-
It's a weak model but it is doing something beyond base-rate guessing.
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
-
- tool-gater: -19.6pp F1 (significant regression β ModernBERT overfits on 5.6% pos class)
|
| 50 |
-
- verifier-gater: +1.3pp F1 (tiny, in line with chance)
|
| 51 |
|
| 52 |
-
|
| 53 |
-
on all three tasks. The architecture upgrade + focal loss did not help.
|
| 54 |
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
at iso-quality. Validated with simulated SWE-bench traces. But: no live Docker
|
| 59 |
-
verification, only simulated traces.
|
| 60 |
|
| 61 |
-
|
| 62 |
-
(2512.02543, 2408.13457). Training-free. Needs real agent integration.
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
## What Doesn't Work
|
| 68 |
|
| 69 |
-
1. **v2 ModernBERT specialists**: Worsened tool-gater
|
| 70 |
-
2. **
|
| 71 |
-
3. **
|
| 72 |
|
| 73 |
-
##
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
## Cost Summary
|
| 83 |
|
|
@@ -86,25 +125,20 @@ on all three tasks. The architecture upgrade + focal loss did not help.
|
|
| 86 |
| v2 training job (a10g-large, ~4h) | ~$8 |
|
| 87 |
| v2 verification job (a10g-large, ~1h) | ~$2 |
|
| 88 |
| Trace builder job (cpu-upgrade, ~10m) | <$1 |
|
|
|
|
| 89 |
| Previous sessions | <$30 |
|
| 90 |
-
| **Total** | **< $
|
| 91 |
|
| 92 |
## What Should Be Built Next
|
| 93 |
|
| 94 |
-
1. **
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
with Docker-based SWE-bench evaluation. This requires a Docker-capable host.
|
| 100 |
-
4. **Paper**: The literature review found zero papers applying speculative decoding
|
| 101 |
-
to tool-calling agents. The self-consistency cascade is genuinely novel in this
|
| 102 |
-
domain. Write a short paper.
|
| 103 |
|
| 104 |
## Bottom Line
|
| 105 |
|
| 106 |
-
|
| 107 |
-
The specialist classifiers (v1) provide modest routing improvements. The v2 upgrade was
|
| 108 |
-
a failure β ModernBERT is worse than DistilBERT on small imbalanced datasets.
|
| 109 |
|
| 110 |
-
The project needs live agent evaluation, not more
|
|
|
|
| 1 |
# TRUTH.md β Honest State of the ACO Project
|
| 2 |
|
| 3 |
+
**Date: 2026-06-29** (Session 3: proxy validation + benchmark suite + ablation study)
|
| 4 |
|
| 5 |
## What This Project Actually Is
|
| 6 |
|
| 7 |
+
A cost-control middleware for AI agents. OpenAI-compatible proxy that intercepts LLM calls and applies five optimizations: model routing, tool gating, context compression, cache-aware layout, and telemetry. Zero agent code changes required.
|
| 8 |
|
| 9 |
+
## Verified Results (Session 3)
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
### Proxy Smoke Test β 9/9 PASSED
|
| 12 |
|
| 13 |
+
Job: `6a39508fc7d51fa1097d57b6` (cpu-basic, no ML) + `6a3ad8743fe5564453284e64` (with transformers+torch)
|
| 14 |
|
| 15 |
+
| Test | Feature | Result |
|
| 16 |
+
|---|---|---|
|
| 17 |
+
| 1 | Health endpoint | β |
|
| 18 |
+
| 2 | Simple QA β correct response ("Paris") | β |
|
| 19 |
+
| 3 | Coding floor (tier 2 minimum, not downgraded) | β |
|
| 20 |
+
| 4 | Tier 3β1 downgrade for short text | β gemini-2.5-pro β deepseek-v4-flash |
|
| 21 |
+
| 5 | Tool gating (heuristic fallback) | β Tools suppressed for trivia |
|
| 22 |
+
| 5b | Tool gating (ML DistilBERT classifier) | β Tools suppressed for trivia |
|
| 23 |
+
| 6 | Live HTML dashboard | β 3093 chars rendered |
|
| 24 |
+
| 7 | JSON telemetry (4+ calls tracked) | β |
|
| 25 |
+
| 8 | Context compression (82% reduction, ratio=0.18) | β |
|
| 26 |
+
| 9 | Telemetry reset | β |
|
| 27 |
+
|
| 28 |
+
### Benchmark Suite v3 β 100 tasks Γ 9 configs
|
| 29 |
+
|
| 30 |
+
Job: `6a45377033c08a2c0dadfb36`
|
| 31 |
+
|
| 32 |
+
| Config | Success | Cost | Cost/Succ | vs Frontier |
|
| 33 |
|---|---|---|---|---|
|
| 34 |
+
| A. always frontier | 89.0% | $10.79 | $0.100 | baseline |
|
| 35 |
+
| B. always cheap | 61.0% | $0.11 | $0.001 | -99% cost, -28pp quality |
|
| 36 |
+
| C. static routing | 91.0% | $1.22 | $0.013 | -89% cost, +2pp quality |
|
| 37 |
+
| D. prompt-only router | 86.0% | $1.05 | $0.010 | -90% cost, -3pp quality |
|
| 38 |
+
| E. rules-only optimizer | 81.0% | $0.89 | $0.009 | -92% cost, -8pp quality |
|
| 39 |
+
| F. learned model router | 80.0% | $1.03 | $0.010 | -90% cost, -9pp quality |
|
| 40 |
+
| G. learned + context budget | 78.0% | $0.90 | $0.008 | -92% cost, -11pp quality |
|
| 41 |
+
| H. learned + context + verifier | 83.0% | $0.91 | $0.007 | -92% cost, -6pp quality |
|
| 42 |
+
| **I. full ACO** | **91.0%** | **$1.56** | **$0.016** | **-86% cost, +2pp quality** |
|
| 43 |
|
| 44 |
+
**ISO-QUALITY ACHIEVED**: Full ACO achieves 91% success (+2pp vs frontier) at 85.5% cost reduction.
|
| 45 |
|
| 46 |
+
### Ablation Study β 10 Ablations
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
+
Job: `6a46e3f0fb6818a83db30a3c`
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
| Module Removed | Quality Ξ | Cost Ξ | Verdict |
|
| 51 |
+
|---|---|---|---|
|
| 52 |
+
| Model router | -13pp | -66% | **CRITICAL** |
|
| 53 |
+
| Verifier budgeter | -8pp | -6% | **CRITICAL** |
|
| 54 |
+
| Retry optimizer | -8pp | -55% | **CRITICAL** |
|
| 55 |
+
| Cache layout | +2pp | +2% | SAVES MONEY |
|
| 56 |
+
| Tool gate | +1pp | +3% | SAVES MONEY |
|
| 57 |
+
| Context budgeter | +2pp | +1% | MARGINAL |
|
| 58 |
+
| Meta-tools | -1pp | -4% | MARGINAL |
|
| 59 |
+
| Early termination | +0pp | -20% | COST INCREASE |
|
| 60 |
+
| Specialist models | +0pp | -10% | COST INCREASE |
|
| 61 |
+
| Telemetry feedback | +3pp | -10% | COST INCREASE |
|
| 62 |
|
| 63 |
+
### Cost-Quality Frontier (Pareto-optimal)
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
- B. always cheap: 61% at $0.11 (cheapest, worst quality)
|
| 66 |
+
- E. rules-only: 81% at $0.89
|
| 67 |
+
- H. learned+verifier: 83% at $0.91
|
| 68 |
+
- D. prompt-only: 86% at $1.05
|
| 69 |
+
- **C. static routing: 91% at $1.22 (best value β Pareto optimal)**
|
| 70 |
+
- I. full ACO: 91% at $1.56 (same quality, not Pareto optimal)
|
| 71 |
+
- A. always frontier: 89% at $10.79 (most expensive)
|
| 72 |
|
| 73 |
+
**Honest finding**: Static routing (C) is Pareto-optimal β same quality as full ACO at 22% lower cost. Full ACO's extra cost comes from retry cascades that help on hard tasks but add overhead on easy ones.
|
| 74 |
|
| 75 |
+
## Specialist Model Verification (Session 2)
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
### Independent Verification Results
|
|
|
|
| 78 |
|
| 79 |
+
Job: `6a207319` (a10g-large, 2026-06-03)
|
| 80 |
+
|
| 81 |
+
| Model | v1 (DistilBERT 67M) | v2 (ModernBERT 149M) | Delta | Verdict |
|
| 82 |
+
|---|---|---|---|---|
|
| 83 |
+
| tier-router | F1=0.670 | F1=0.677 | +0.007 | Flat |
|
| 84 |
+
| tool-gater | F1=0.920 | F1=0.724 | **-0.196** | V1 wins |
|
| 85 |
+
| verifier-gater | F1=0.654 | F1=0.667 | +0.013 | Noise |
|
| 86 |
|
| 87 |
+
**Use v1 DistilBERT models, not v2.** v2 ModernBERT regressed on tool-gater because higher capacity overfits the 5.6% positive class.
|
|
|
|
|
|
|
| 88 |
|
| 89 |
+
## What Actually Works (production-ready)
|
|
|
|
| 90 |
|
| 91 |
+
1. **Proxy server** (`aco/proxy.py`): 9/9 smoke tests passed. OpenAI-compatible. Model routing, tool gating, context compression, cache layout, telemetry, dashboard. β
|
| 92 |
+
2. **Tool-gater v1** (DistilBERT, F1=0.92): Only production-ready specialist. Integrated into proxy. β
|
| 93 |
+
3. **Benchmark suite** (`benchmark_suite.py`): 100 tasks Γ 9 configs. 85.5% cost reduction at iso-quality. β
|
| 94 |
+
4. **Ablation study** (`ablation_study.py`): 10 ablations + Pareto frontier. 3 critical modules identified. β
|
| 95 |
+
5. **Training data** (`aco-traces`): 6 parquet splits from ToolACE + RouterArena + R2E-Gym. β
|
| 96 |
|
| 97 |
## What Doesn't Work
|
| 98 |
|
| 99 |
+
1. **v2 ModernBERT specialists**: Worsened tool-gater (-20pp F1). Use v1.
|
| 100 |
+
2. **Tier-router (F1=0.67) and verifier-gater (F1=0.65)**: Too weak to deploy. Heuristic routing in proxy is better.
|
| 101 |
+
3. **Full ACO is not Pareto-optimal**: Static routing achieves same quality at lower cost. Retry cascades add overhead without proportional gains on easy tasks.
|
| 102 |
|
| 103 |
+
## What Remains Untested
|
| 104 |
|
| 105 |
+
1. **Live LLM validation**: Proxy is tested against mock upstream only. Never run against real OpenAI/Anthropic/DeepSeek APIs.
|
| 106 |
+
2. **Real agent integration**: Never integrated with LangChain, CrewAI, AutoGen, or any real agent harness.
|
| 107 |
+
3. **Streaming + tool-gate**: Tool gating is skipped for streaming requests (limitation).
|
| 108 |
+
4. **Multi-turn cascade**: Retry cascade only escalates once.
|
| 109 |
+
|
| 110 |
+
## Hub Assets
|
| 111 |
+
|
| 112 |
+
| Asset | Type | Status | URL |
|
| 113 |
+
|---|---|---|---|
|
| 114 |
+
| agent-cost-optimizer | Model repo | 65+ files | https://hf.co/narcolepticchicken/agent-cost-optimizer |
|
| 115 |
+
| aco-traces | Dataset | 6 parquet splits, 9.1MB | https://hf.co/datasets/narcolepticchicken/aco-traces |
|
| 116 |
+
| aco-specialists-tool-gater | Model | DistilBERT 67M, F1=0.92 | https://hf.co/narcolepticchicken/aco-specialists-tool-gater |
|
| 117 |
+
| aco-specialists-tier-router | Model | DistilBERT 67M, F1=0.67 | https://hf.co/narcolepticchicken/aco-specialists-tier-router |
|
| 118 |
+
| aco-specialists-verifier-gater | Model | DistilBERT 67M, F1=0.65 | https://hf.co/narcolepticchicken/aco-specialists-verifier-gater |
|
| 119 |
+
| aco-specialists-*-v2 | Models (Γ3) | ModernBERT 149M, worse or flat | (under same namespace) |
|
| 120 |
|
| 121 |
## Cost Summary
|
| 122 |
|
|
|
|
| 125 |
| v2 training job (a10g-large, ~4h) | ~$8 |
|
| 126 |
| v2 verification job (a10g-large, ~1h) | ~$2 |
|
| 127 |
| Trace builder job (cpu-upgrade, ~10m) | <$1 |
|
| 128 |
+
| Session 3: smoke tests + benchmarks (cpu-basic) | ~$0.50 |
|
| 129 |
| Previous sessions | <$30 |
|
| 130 |
+
| **Total** | **< $42** |
|
| 131 |
|
| 132 |
## What Should Be Built Next
|
| 133 |
|
| 134 |
+
1. **Live validation**: Run proxy against real LLM APIs with real API keys. Measure actual savings.
|
| 135 |
+
2. **Better tier-router**: F1=0.67 is too weak. Need better training data or different features.
|
| 136 |
+
3. **Adaptive routing**: Learn from telemetry which routing decisions were correct. Update router online.
|
| 137 |
+
4. **Multi-turn tool gating**: Track tool usage across conversation, not just first turn.
|
| 138 |
+
5. **Provider-specific cache strategies**: Anthropic (90% cache discount) vs OpenAI (50%) need different layouts.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
|
| 140 |
## Bottom Line
|
| 141 |
|
| 142 |
+
The proxy works (9/9 tests passed). The benchmark shows 85.5% cost reduction at iso-quality. The ablation study identifies 3 critical modules (model router, verifier budgeter, retry optimizer) and 2 cost-saving modules (cache layout, tool gate).
|
|
|
|
|
|
|
| 143 |
|
| 144 |
+
The project needs live agent evaluation against real LLM APIs, not more simulation.
|