Optimize multi-agent LLM workflows with ScoreFlow: continuous, score-aware preference finetuning

February 6, 20257 min

Overview

Decision SnapshotNeeds Validation

Evidence comes from six public datasets, ablations comparing Score-DPO to DPO/PPO/SFT, and cost tables; results are consistent but rely on LLM executors and dataset selection.

Citations0

Evidence Strength0.70

Confidence0.85

Risk Signals11

Trust Signals

Findings with numeric evidence: 3/3

Findings with evidence refs: 3/3

Results with explicit delta: 3/3

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 70%

Production readiness: 70%

Novelty: 70%

Authors

Yinjie Wang, Ling Yang, Guohao Li, Mengdi Wang, Bryon Aragam

Links

Abstract / PDF / Code / Data

Why It Matters For Business

ScoreFlow reduces manual workflow design and optimization cost by using a continuous, score-aware finetuning loop; this lets smaller, cheaper generator models reach or exceed larger-model baselines while lowering API optimization bills.

Who Should Care

Summary TLDR

ScoreFlow is a system that generates and optimizes multi-agent (workflow) code using gradient-based finetuning on preference data. It replaces discrete search with a continuous optimization loop (Score-DPO) that uses numeric evaluation scores to weight preference pairs. On six benchmarks across question answering, coding, and math, ScoreFlow reports an average solve rate of 85.3%, beating prior automated and manual workflow methods by 8.2% and reducing optimization costs versus a representative baseline (Aflow). The method makes small open-source generators (e.g., Llama-3.1-8B-Instruct) competitive with larger models when paired with a strong executor.

Problem Statement

Manually authored LLM agent workflows are brittle and expensive to design. Prior automated methods use discrete search or single static workflows and struggle with scalability, adaptability, and noisy evaluation feedback. ScoreFlow aims to generate per-task code-style workflows and optimize the generator using evaluation scores directly, improving convergence and per-task adaptivity.

Main Contribution

ScoreFlow: an automated framework that generates code-style multi-agent workflows and iteratively refines the generator with execution feedback.

Score-DPO: a variant of Direct Preference Optimization that weights preference samples by score gaps and injects numeric scores into the ranking objective.

Key Findings

ScoreFlow improves average solve rate across six benchmarks.

Numbers85.3% (ScoreFlow) vs 76.0% (best baseline average); +8.2%

Practical UseUse ScoreFlow to raise end-task solve rates across diverse tasks without hand-crafting workflows.

Evidence RefTable 1 (main results)

Score-DPO outperforms standard DPO, PPO, and supervised finetuning inside the ScoreFlow pipeline.

NumbersExample: MATH test 64.4% (Score-DPO) vs 60.4% (DPO); GSM8K 94.6% vs 91.7%

Practical UseIf you have numeric evaluation scores, prefer Score-DPO over raw DPO/PPO for faster, more stable finetuning of the generator.

Evidence RefTable 2 (optimization comparisons)

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Average solve rate (six benchmarks)85.3% (ScoreFlow average)76.0% (average of listed baselines)+8.2%Average across HotpotQA, DROP, HumanEval, MBPP, GSM8K, MATHTable 1 reports per-dataset solve rates and averageTable 1
Per-dataset example — HumanEval (pass@1 / solve rate)95.9% (ScoreFlow reported)92.9% (Aflow)+3.0%HumanEval testTable 1 and Table 3Table 1, Table 3

What To Try In 7 Days

Clone the ScoreFlow repo and run the included demo with Llama-3.1-8B and GPT-4o-mini executor.

Use k=8 workflow samples per task and f(x)=x, d(x,y)=(x-y)^3 as default Score-DPO settings.

Measure solve rate and API cost vs a simple Chain-of-Thought baseline on one task (e.g., HumanEval).

Agent Features

Memory
no explicit long-term retrieval memory reportedper-workflow operator state passed via code
Planning
per-task adaptive workflow generationconditional control flow (if/loops) in workflows
Tool Use
vLLM for inferenceLoRAGPT-4o-mini / GPT-4o / DeepSeek as executors
Frameworks
ScoreFlow (this work)Aflow (comparison)ADAS (comparison)
Is Agentic

Yes

Architectures
code-as-workflowoperator-based agents (programmer, reviewer, ensemble, test)
Collaboration
multi-agent coordination through assembled operatorsensemble and reviewer patterns for collaboration

Optimization Features

Token Efficiency
generator outputs compact code workflows (reduces repeated prompt length)no explicit context compression technique
Infra Optimization
experiments run on 2x A6000 GPUsuse of vLLM to speed inference
Model Optimization
LoRA
System Optimization
replace discrete search with gradient-based optimization for scalabilityiterative loop with k=8 samples and M=3 iterations (default)
Training Optimization
Score-DPO: score-weighted preference finetuningupweighted sampling of high score-gap pairs (d(x,y)=(x-y)^3)
Inference Optimization
use of smaller generator models to lower API costsexecutor temperature 0 for evaluation consistency

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Data URLs

HumanEvalMBPPGSM8KMATHDROPHotpotQA

Risks & Boundaries

Limitations

Performance depends on executor quality and the chosen judge model.

Score-DPO requires numeric evaluation scores; noisy or biased scores slow convergence.

When Not To Use

You lack a reliable automatic executor or judge to produce numeric scores.

Cost or latency prohibits running multiple workflow executions per task (k=8).

Failure Modes

Overfitting to judge/executor biases—generator optimizes for the judge, not true correctness.

Excessive upweighting (α too large) discards useful but noisy pairs and reduces generalization.

Core Entities

Models

Llama-3.1-8B-InstructQwen2.5-7B-InstructGPT-4o-miniGPT-4oDeepSeek-V3DeepSeek-coder

Metrics

solve rateF1 scorewin rateAPI cost ($)

Datasets

HumanEvalMBPPGSM8K (test subset)MATH (difficulty 5 subset)DROPHotpotQA

Benchmarks

coding (HumanEval, MBPP)math reasoning (GSM8K, MATH)question answering (DROP, HotpotQA)