← Dorothy Merge Laboratory
AI efficiency

AI optimization: what happens when different mechanisms work together?

We tested the integrated operation of Dorothy Merge optimization mechanisms throughout the execution of a task in OpenAI Codex.

Ricardo Sargo·3 min read
CommentWhatsAppLinkedIn
Integrated task lifecycle optimization

Today, there are different technologies for optimizing artificial intelligence, including model routers, context compactors and memory management mechanisms.

One of the main challenges we study at Dorothy Labs is how to bring these different capabilities together in a single optimization engine.

At this stage of our research, we seek a more symbiotic relationship between Dorothy Merge and artificial intelligence, giving it greater autonomy to operate across the entire context of a task — beginning, middle and end.

The challenge of consistent optimization

Our goal is not merely to achieve high optimization percentages on specific tasks, but to reduce the variability of these results throughout the user journey.

We aim to establish optimization above 85% across the vast majority of task types, making resource savings more consistent, uniform and predictable.

This means narrowing the gap between the best and worst optimization results, raising the overall average and reducing fluctuations during AI use.

Research objective: reduce variability across tasks
100%85%
┄ Variable optimization━ Target level: 85%+
Conceptual representation of the consistency objective.

What we put to the test

We ran a series of experiments in OpenAI Codex using different Dorothy Merge optimization configurations.

In one scenario, we evaluated a software development task involving the implementation and validation of business rules in a loan management system.

The goal was to observe how optimization mechanisms working together could reduce resource consumption while preserving delivery quality.

Methodology and results

Our research team compared conventional Codex execution with execution optimized by Dorothy Merge. The model used was OpenAI GPT-6.1 Sol, with medium reasoning effort in both scenarios and the same initial code revision.

The reference recorded 376,466 tokens across ten model calls. The studied configuration consumed 54,259 tokens in two calls: 322,207 fewer tokens, equivalent to an 85.6% reduction in total consumption and 80% fewer model calls.

Conventional execution met six of eight quality criteria (75%). Optimized execution met all eight (100%). In a comparative assessment of responses, we also observed equivalent content and improved clarity.

Recorded total consumption
85.6% fewer tokens
Reference without Dorothy Merge376,466
Studied configuration54,259
Comparison of the December 2 experiment records.
Quality criteria
100% 8/8
Reference without Dorothy Merge6/8
Studied configuration8/8

What we learned

The most relevant result of this experiment is not necessarily the percentage reduction in tokens, but the ability to combine different optimization mechanisms during the execution of the same task.

Rather than reaching optimization peaks in specific scenarios, we seek to turn strong results into a consistent performance pattern, regardless of the nature or complexity of the task.

The results indicate that a more integrated and adaptive approach can contribute to that consistency while preserving the established quality criteria.

Conclusion

These experiments are part of our research for the next Dorothy Merge update, planned for the end of this week.

Methodology and evidence

Applied techniqueIntegrated task lifecycle optimization

Coordinated, adaptive operation of optimization mechanisms from beginning to completion.

Task evaluated: Implement and verify late-fee, grace-period and cap rules in a book lending system; three sequential requests.

How we evaluated: 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.

Operation record (JSON)

Official provider documentation

View experiment report

Conversation with the author

Share your experience, ask a question or leave your thoughts on the article.

Loading interactions…

Keep exploring