The Research Report
Agent-GWO: When Prompts and Decoding Settings Evolve Together
Prompt optimization and decoding parameter tuning have always lived in separate worlds. You craft your prompt, then you fiddle with temperature and top_p afterward. Two disconnected loops. Two different workflows. Two sets of knobs that never talk to each other.
Agent-GWO (arXiv:2604.18612) merges them into a single optimization loop. And it works. The paper, accepted to ACL 2026, is the first framework to jointly optimize prompt templates and decoding hyperparameters as a unified agent configuration.
The Core Idea
Agent-GWO treats every agent as an inheritable configuration object. Each configuration bundles three things: a prompt template, decoding hyperparameters (temperature, topp, topk, repetition penalty), and a fitness score. These configurations evolve together through a Grey Wolf Optimizer, a metaheuristic search algorithm inspired by wolf pack hunting dynamics.
The wolf metaphor maps directly to the search process. A small set of "leader" agents hold the best configurations discovered so far. "Follower" agents explore variations around those leaders. Leaders get replaced when followers discover higher fitness. The pack adapts.
This is not random search. The Grey Wolf Optimizer balances exploitation (refining the best-known configs) against exploration (trying novel directions). The key insight is that prompt text and decoding settings mutate and crossover together, not independently. A prompt change that works better at temperature 0.3 gets selected alongside that temperature. A prompt that demands deterministic output naturally pushes repetition penalty higher. The two dimensions co-evolve.
Why Joint Optimization Matters
Separate optimization creates a chicken-and-egg problem. The best prompt depends on the decoding settings. The best decoding settings depend on the prompt. Optimizing them independently means you find local optima in each dimension while missing better solutions that only exist in the combined space.
The paper demonstrates this concretely. Joint prompt+decoding optimization outperforms prompt-only optimization by significant margins across their evaluation tasks. The gap widens on tasks that require calibrated output distributions, like structured generation and multi-class classification, where decoding parameters directly shape what the model produces.
This connects to a broader trend. The "reasoning_effort replaces temperature" shift and the rise of model-specific prompt guidance both point in the same direction: the prompt and the inference configuration are one system. Agent-GWO formalizes that intuition with a search algorithm that treats them as a single optimization target.
The Inheritance Mechanism
Agent-GWO's configuration inheritance is its most practical feature. When a follower discovers a better configuration, the old leader's settings persist as ancestors. New agents inherit from successful predecessors and introduce controlled mutations.
This creates an evolutionary lineage. You can trace which prompt-decoding pairs descended from which ancestors. That lineage is auditable. You can debug why a particular configuration works by examining its mutation history. This is a meaningful advantage over black-box prompt optimization tools that return a single optimized prompt with no explanation of how they got there.
Inheritance also enables composition. The paper shows that configurations optimized for one task transfer well to related tasks through inheritance, reducing the number of optimization steps needed for new domains. Start from a parent config that works on similar problems. Mutate from there. Faster convergence than starting from scratch.
Practical Takeaways
Stop treating temperature as a post-hoc knob. If you optimize prompts without considering decoding settings, you leave performance on the table. The two interact. Test prompt variants across different temperature and top_p ranges, not just at your default.
Co-evolution beats sequential optimization. Do not first tune your prompt, then tune your temperature. Run them together. Even a simple grid search over prompt variants and decoding settings will outperform sequential tuning. Agent-GWO's Grey Wolf search is more efficient than grid search, but the principle works at any scale.
Treat agent configs as versioned artifacts. Agent-GWO's inheritance model is essentially git for prompt+decoding configurations. Store your prompt text and inference settings together in a single configuration file. Version them together. Track which configurations descend from which. This makes debugging tractable and enables reuse across tasks.
Use metaheuristic search for prompt optimization. Gradient-based prompt optimization (like soft prompt tuning) requires model access and differentiability. Agent-GWO's Grey Wolf Optimizer is gradient-free. It works with any model through API calls alone. This matters for production systems where you optimize against proprietary models you cannot backprop through.
Broader Context
Agent-GWO sits at the intersection of two major trends. The first is prompt optimization as a discipline. Tools like DSPy, PromptWizard, and GEPA all automate prompt search. Agent-GWO extends that automation to include the inference configuration alongside the prompt text.
The second is the shift from prompt engineering to harness engineering. A harness is the full wrapper around a model: the prompt, the tool definitions, the decoding settings, the safety constraints, the context pipeline. Agent-GWO optimizes two harness components simultaneously. That is a step toward optimizing the entire harness, not just the text inside it.
The paper's acceptance at ACL 2026 signals mainstream NLP recognition that prompt optimization is not just about words. It is about the entire inference configuration. The model, the prompt, and the decoding settings form a coupled system. Optimizing them together is not a nice-to-have. It is the correct formulation of the problem.
The missing piece is context engineering. Agent-GWO optimizes prompts and decoding but does not address the retrieval pipeline, tool definitions, or memory architecture that surround the model in production systems. The next frontier is joint optimization of the full harness: prompt, decoding, tools, retrieval, and safety constraints in a single search loop. Agent-GWO proves the approach works for two components. The path to full harness optimization is open.