AgentScope Tuner - A one-stop automatic optimization engine launched by Alitongyi
AgentScope Tuner is a one-stop automatic optimization engine launched by Alibaba Tongyi Labs for Agentic AI. It is deeply integrated into the AgentScope ecosystem and connects the entire process of development, tuning, deployment, and regression testing.
AgentScope Tuner What is it?
AgentScope Tuner is a one-stop automatic optimization engine launched by Alibaba Tongyi Labs for Agentic AI. It is deeply integrated into the AgentScope ecosystem, connecting the entire process of development, tuning, deployment, and regression. The tool provides three major capabilities: Prompt tuning, model selection, and AgentRL enhancement fine-tuning. It allows existing Agent workflows to be optimized with almost zero modification cost, achieving full lifecycle coverage from lightweight validation to enterprise-level distributed training, making the agent smarter the more it is used.
AgentScope Tuner Main functions
-
Prompt tuningSystematically explore the prompt word space through automated search algorithms (such as MIPROv2), optimize the Prompt template for Agent trajectories, and iterate quickly without the need for GPUs.
-
Model selectionAutomatically evaluates and filters candidate models, combining multiple indicators such as accuracy, response speed, and token consumption to select the base model with the best overall cost performance with one click.
-
Enhanced Fine-tuning (RFT)Based on the Trinity-RFT framework, it learns from real interaction trajectories, performs deep parameter optimization on an end-to-end interaction basis, and supports distributed training on a 100-card cluster.
-
Unified optimization interfaceThe three optimization strategies share the same API design paradigm, allowing developers to freely switch between optimization methods without learning different frameworks.
-
Development-Optimization Closed LoopThe training metrics are consistent with the online results, eliminating the need for tedious steps such as manually exporting data, format adaptation, and environment switching.
AgentScope Tuner Technical principles
- Workflow-as-Function Abstraction and Asynchronous Execution DiagramAbstracting the Agent workflow into pure functions
async def workflow(task, model, system_prompt) -> WorkflowOutputDeclarative binding of optimizable variables is achieved through parameter injection. The Judge function returns a scalar reward, forming a standard (state, action, reward) reinforcement learning triple. The entire execution graph is scheduled using asynchronous coroutines. - Optimized combination search mechanism with prompt wordsBased on MIPROv2, an iterative search is performed in the discrete instruction space, consisting of "meta-hint generation candidate → few-shot evaluation → local filtering". An example pool is constructed using the training set, and local optima are found in the syntactic-semantic joint space of the Prompt template through combinatorial optimization.
- Multi-objective Pareto calculation for model selectionThe system transforms accuracy, latency, and token cost into weighted utility functions, performs batch inference on a set of candidate models, calculates the expected reward of each model on the task distribution, and selects the overall optimal base through Pareto front analysis, thus achieving automatic decision-making under multiple objective trade-offs.
- Group-based policy optimization in trajectory-level reinforcement learningBased on the Trinity-RFT framework, the complete agent interaction trajectory (multiple rounds of tool calls, observations, and inferences) is used as a single training sample. Group Relative Policy Optimization (GRPO) is employed to solve the long-trajectory credit allocation problem through within-group relative advantage estimation, avoiding the estimation bias of traditional PPO value networks in discrete action spaces.
- Training-Inference Isomorphic RuntimeThe Tuner directly reuses the training data generated by AgentScope at runtime, ensuring that the training distribution is consistent with the inference distribution. By directly injecting the parameters to be optimized into the workflow, the data export and format conversion steps of the traditional pipeline are eliminated, fundamentally avoiding the "good training, poor deployment" problem caused by environmental drift.
How to use AgentScope Tuner
- Environmental preparationInstall AgentScope to ensure that existing Agent workflows are functioning correctly.
- Prepare datasetOrganize the task data into the Hugging Face Datasets format.
train.jsonlandtest.jsonlEach line contains the task input and the expected output. - Define workflow functionsEncapsulate the Agent logic as
async def workflow(task, ...)Function, returnsWorkflowOutputObject. - Define the evaluation function:accomplish
async def judge_function(task, response)Returns a list containingrewardofJudgeOutputProvides optimized signals. - Startup optimizationCall according to demand
tune_prompt(),select_model()ortune()The interface takes in workflow, dataset, and configuration, and can automatically perform optimization and regression deployment.
Key information and usage requirements for AgentScope Tuner
-
Producer: Alibaba Tongyi Lab (AgentScope official ecosystem).
-
Open source addressGitHub
agentscope-ai/agentscope(The tuner module is located in...)src/agentscope/tuner). -
Hardware RequirementsPrompt tuning and model selection do not require a GPU; enhancement and fine-tuning require a GPU, supporting 100-card clusters and cloud-based distributed training.
-
Data formatRequires Hugging Face Datasets format (JSONL), and you need to prepare your own training and evaluation sets.
-
Access costThe existing AgentScope workflow requires almost no code refactoring; it can be implemented through injection.
system_promptormodelParameters can be optimized. -
Dependency frameworkDeep training is based on Trinity-RFT and supports inference acceleration such as vLLM.
-
Recommended CasesGitHub
agentscope-ai/agentscope-samples/tree/main/tunerExamples are provided, such as Math Agent, Werewolf Multi-Agent, and Deep Finance Agent.
AgentScope Tuner's project address
- Project official website: https://docs.agentscope.io/tune-agent/tune-your-first-agent
- GitHub repository: https://github.com/agentscope-ai/agentscope/tree/main/src/agentscope/tuner
AgentScope Tuner's core advantages
-
Agent native closed loopIt is the only optimized engine designed around the multi-round interaction trajectory of the Agent, and the training and online effects are highly consistent, avoiding the disconnect between "good training and poor online performance".
-
Zero-cost accessExisting workflows can be optimized by simply modifying a few lines of parameters, without needing to switch environments or rewrite logic.
-
Full-cycle step optimizationFrom early lightweight prompt iterations to later deep model training, it provides a continuous optimization path throughout the R&D lifecycle.
-
Unified experienceThe three optimization strategies share the same interface and evaluation criteria, reducing the learning cost of multiple frameworks.
-
Enterprise scalabilitySupports distributed reinforcement learning on cloud-based clusters of hundreds of cards, meeting the large-scale training needs of complex business scenarios.
Comparison of AgentScope Tuner with similar products
| Dimension | AgentScope Tuner | DSPy | LangChain LangSmith |
|---|---|---|---|
| position | Agent One-Stop Automated Optimization Engine | Prompt word engineering and optimization framework | LLM Application Observation and Evaluation Platform |
| Prompt optimization | Support for Agent trajectory optimization | Core functionality: signature-based compilation | Limited, mainly relying on manual iteration |
| Model selection | Built-in automatic evaluation and filtering | You need to implement it yourself. | Supports, with a focus on monitoring and A/B testing. |
| Model fine-tuning | Supports enhanced fine-tuning (RFT/RL) | Native RL training is not supported. | Not supported |
| Agent native | Deeply adapt to multi-round tool calls and planning | General-purpose, requires custom Agent encapsulation. | Observation-based, not directly optimized |
| Access cost | Zero modifications, seamless switching within the same workflow | Code needs to be refactored according to the framework. | SDK tracking is required. |
| Distributed training | Supports 100-card clusters/cloud environments | Not supported | Not supported |
| Producer | Ali Tongyi Lab | Stanford NLP | LangChain |
Application scenarios of AgentScope Tuner
-
Mathematical Reasoning Agent: Optimize chained thinking paths and tool call descriptions to improve the accuracy of solving complex mathematical problems.
-
Multi-agent game systemIn scenarios like Werewolf, multiple agents can be trained and enhanced to develop advanced strategies such as reasoning, deception, and collaboration.
-
Financial In-Depth Analysis AgentFor long-chain report generation tasks, optimize the end-to-end interaction trajectory to automate the integration of text analysis and financial data.
-
Enterprise internal tool calling AgentWhen the Agent needs to make precise calls to a dozen internal APIs and generate reports according to complex business rules, RFT can break through the performance ceiling.
-
Model for cost reduction and efficiency improvementIt automatically replaces expensive, large models with more cost-effective, lightweight models while maintaining almost no loss in accuracy.