Helmsman: Autonomous Synthesis of Federated Learning Systems via Collaborative LLM Agents

Haoyuan Li, Mathias Funk, Aaqib Saeed

TL;DR

Federated Learning (FL) systems are notoriously complex to design, requiring experts to juggle data heterogeneity, privacy, and hardware constraints. This paper introduces Helmsman, a multi-agent LLM framework that automates the end-to-end creation of FL systems from high-level natural language prompts. By dividing the work into interactive planning, modular coding, and autonomous simulation-based debugging, Helmsman generates deployable, highly performant FL codebases that rival or beat hand-crafted expert baselines.

The Challenge of Federated Learning Design

Federated Learning allows multiple devices—such as smartphones or hospital servers—to collaboratively train AI models without sharing raw, sensitive data. However, real-world FL is incredibly messy. Devices have different hardware capabilities, unreliable network speeds, and highly skewed data distributions (e.g., one hospital might see entirely different diseases than another).

To handle this, researchers have created a massive catalog of specialized algorithms. Manually selecting, combining, and tuning these algorithms for a specific use case is a combinatorial nightmare, resulting in brittle, custom-built solutions. While modern LLM coding agents are great at writing isolated functions, they fail spectacularly when asked to architect an entire distributed system with interdependent client, server, and aggregation modules. The authors aim to bridge this gap by automating the holistic design and implementation of FL systems.

Introducing Helmsman: A Multi-Agent Framework

The authors built Helmsman, a multi-agent system that mimics a human software engineering and research team. It operates in three distinct phases:

Helmsman Framework Architecture
  1. Interactive Planning: A Planning Agent (equipped with web search and Retrieval-Augmented Generation over arXiv papers) drafts a research plan based on the user's prompt. A Reflection Agent critiques it, and a Human-in-the-Loop (HITL) gives final approval, ensuring the system stays on track and optimizing token costs.
  2. Modular Coding: A Supervisor Agent breaks the approved plan into logical modules (Task, Client, Strategy, Server). Dedicated Coder and Tester agents work on each module independently, enforcing a strict software engineering separation of concerns.
  3. Autonomous Evaluation: The integrated code is executed in a sandboxed simulation using the Flower FL framework. An Evaluator Agent checks for both hard crashes (Runtime Integrity) and silent algorithmic bugs like stagnant metrics or zero client participation (Semantic Correctness). If the code fails, a Debugger Agent patches it in a closed loop until it passes.

AgentFL-Bench: A New Standard for FL Generation

To rigorously evaluate their system, the authors introduce AgentFL-Bench, a new benchmark specifically designed to test LLM agents on system-level FL generation.

Unlike standard coding benchmarks that test isolated algorithmic puzzles, AgentFL-Bench contains 16 complex system-design tasks spanning 5 research areas: data heterogeneity, communication efficiency, personalization, active learning, and continual learning. The tasks utilize standard ML datasets adapted for federated settings, including CIFAR-10/100, FEMNIST, Office-Home, UCI-HAR, Speech Commands, and medical datasets like Fed-ISIC2019 and DermaMNIST.

Key Insights

  • Monolithic agents cannot build systems: Single-agent baselines completely failed the benchmark. Decomposing the problem into specialized roles (planner, supervisor, coder, evaluator) is mandatory for navigating the complexity of distributed system architecture.
  • Emergent algorithmic discovery: Helmsman doesn't just copy-paste existing algorithms; it can synthesize novel hybrid strategies. For example, in a complex continual learning task, it autonomously combined client-side experience replay with global model distillation to prevent catastrophic forgetting.
  • Semantic debugging is crucial: Catching syntax errors isn't enough for machine learning. Helmsman's ability to look at simulation logs and realize "the model isn't learning" or "clients aren't participating" (semantic verification) is what allows it to produce functional ML systems, rather than just code that compiles.

Performance and Results

Helmsman demonstrates remarkable capabilities in generating robust FL systems, significantly outperforming standard coding pipelines.

Performance Comparison on AgentFL-Bench
  • 100% Success Rate: Helmsman successfully generated working FL systems for all 16 tasks in AgentFL-Bench. In contrast, state-of-the-art coding pipelines like Codex and Claude Code only achieved 37.5% and 43.75% success rates, respectively.
  • Beating Expert Baselines: On a highly complex Federated Continual Learning task (Split-CIFAR100), Helmsman's synthesized solution achieved 51.04% accuracy, crushing the specialized state-of-the-art baseline (TARGET), which only hit 34.89%.
  • Cost Efficiency: Because the multi-agent workflow is highly structured and avoids endless hallucination loops, it is surprisingly cheap. Using the framework's backbone LLM, Helmsman cost an average of just $0.57 per task to generate a complete, validated FL codebase.

Limitations and Future Work

The authors note that while the iterative diagnose-and-repair process is highly effective, it isn't guaranteed to converge on a solution for every conceivable problem. To prevent infinite loops, they impose a hard limit of 10 debugging attempts before the system halts and asks for human intervention.

For future work, the authors plan to endow Helmsman with "self-evolutionary" capabilities. This would create a meta-optimization loop where the system learns from experimental feedback across multiple projects to permanently refine its own internal coding strategies and prompt templates, moving closer to a fully autonomous AI co-scientist.

Summary updated

BibTeX
@inproceedings{li2026helmsman,
  author = {Haoyuan Li and Mathias Funk and Aaqib Saeed},
  title = {{Helmsman: Autonomous Synthesis of Federated Learning Systems via Collaborative LLM Agents}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=Voiy13SK3r},
}
Figure