AI optimization: what happens when different mechanisms work together?
reduction in total tokens
OpenAI Codex / GPT-6.1 Sol
What was tested
Implement and verify late-fee, grace-period and cap rules in a book lending system; three sequential requests.
Detailed measurements
| Metric | Reference without Dorothy Merge | Studied configuration | Second configuration |
|---|---|---|---|
| Model / Modelo | GPT-6.1 Sol | GPT-6.1 Sol | GPT-6.1 Sol |
| Total tokens | 376,466 | 54,259 | 62,039 |
| Input tokens | 375,113 | 53,815 | 61,549 |
| Cached input | 369,024 | 26,496 | 30,336 |
| New input | 6,089 | 27,319 | 31,213 |
| Output tokens | 1,353 | 444 | 490 |
| Model calls | 10 | 2 | 2 |
| Quality criteria | 6/8 | 8/8 | 8/8 |
| Total token reduction | — | 85.6% | 83.5% |
| Recorded duration (s) | 67.633 | 32.989 | 42.545 |
Total consumption includes cached input tokens. Cache states differed, so total token reduction is not equivalent to monetary cost reduction. Reference time sums request durations; optimized time is recorded wall time. Runs took place at different times on the same day.
Experimental methodology
Integrated task lifecycle optimization
Coordinated, adaptive operation of optimization mechanisms from beginning to completion.
Experiment definition
Implement and verify late-fee, grace-period and cap rules in a book lending system; three sequential requests.
Comparative execution
Conventional reference and experimental configurations on December 2, 2026, in separate runs, using the same model and initial code. Collection of total tokens, calls and eight quality criteria; verification of records and SHA-256 hashes.
Metric collection
Total consumption includes cached input tokens. Cache states differed, so total token reduction is not equivalent to monetary cost reduction. Reference time sums request durations; optimized time is recorded wall time. Runs took place at different times on the same day.
Result validation
In the reference, the fee cap was not met in verification (BRL 72 and BRL 582 rather than BRL 50), and the third request changed a file. Both experimental configurations met all eight criteria, preserved the five original tests and added a new test. All six tests in the optimized delivery passed.
Files and evidence
SHA-256 — original records
Reference without Dorothy Merge
| original_usage_log | 95eae1342725f8d65e6be2dddc5f058fdae155d7e08c6ad9bca5eeb46f28294e |
| measurement | 9364f8c0bef784929261c952a9af0a9d4762379cc1cab072009ec5b1c11250d6 |
| quality_verification | cf88e18dc0aaabbd98737261d0ff015123ae3a65e355444901a48ffc55aefde5 |
Studied configuration
| original_usage_log | 746cbd626c1a49815a5c96e2d375392da165b48fdc3df52f2a70dc080e023a77 |
| measurement | 86880e74030db5ac816e1b76078f721e07b115861b2f7896dc4887c1d9abe449 |
| quality_verification | 5d5dd347fcea9c3783bc0520f173ef891317028fe8e129e614f75faab152a2f5 |
| acceptance_gate | 842d1a250799ecd49cd983e8c58a6e25d659194c2542bbadecc25bf853379017 |
| final_tree_digest | 03953057ff878c9e05bffd02cd78150695514abb09b9a5f2300c57127970e30b |
Second configuration
| original_usage_log | fcbaa194f8d1d4b1d7f6aac0bb9532f72fe62d789256cc93f2c792397ceae2c4 |
| measurement | cc8eeee302729f930c90490382f0e82d5ad47cc4f255a097497629b5b4b3f3d1 |
| quality_verification | d54cb84c8977aebdb5c23953465b72d4c6b9d07082e11f3ca40349e6a11b5f9b |
| final_tree_digest | 550a0bae719f654b5d474e401ced4853ae1eaa6982c597ebc2386b18e151dae0 |
Operation record (JSON)
Public extract of the laboratory records, in the same format as the other studies. The original files stay in the development environment and are identified by the SHA-256 hashes above.
{
"title": "AI optimization: what happens when different mechanisms work together?",
"experiment_date": "2026-12-02",
"source_type": "editorial extract from lab experiment records",
"provider": "OpenAI",
"scenario": "Codex, GPT-6.1 Sol, medium reasoning, three sequential requests, same initial commit",
"reference": {
"total_tokens": 376466,
"input_tokens": 375113,
"output_tokens": 1353,
"model_calls": 10,
"checks": "6/8"
},
"studied": {
"total_tokens": 54259,
"input_tokens": 53815,
"output_tokens": 444,
"model_calls": 2,
"checks": "8/8"
},
"reduction_pct": 85.59
}