Skip to content

research(routing): AdaptOrch task-adaptive orchestration topology selection #1840

@bug-ops

Description

@bug-ops

Research Finding

Sources:

  • AdaptOrch — arXiv:2602.16873 (2025): task-adaptive topology selection, 12-23% improvement over static baselines
  • CASTER — arXiv 2601.19793 (Jan 2026): difficulty-aware routing, up to 72.4% cost reduction with no quality loss

Problem

Zeph's orchestration uses TaskGraph + DagScheduler + AgentRouter with a rule-based 3-step fallback. After LlmPlanner produces a task DAG, Zeph always uses the same execution topology and always routes to the same provider tier regardless of task structure or complexity. Two independent improvements from recent research can be layered on top:

Phase 1: Topology Selection (AdaptOrch)

After LlmPlanner produces a TaskGraph, classify its shape and pick the execution strategy:

DAG shape Topology
All nodes independent parallel dispatch via DagScheduler
Linear chain sequential (already default)
Fan-out root hierarchical (coordinator + workers)
Mixed hybrid (parallel sub-chains with merge step)

Implementation:

  1. Add TopologyClassifier in zeph-core::orchestration: heuristic on edge count / depth / fan-out ratio
  2. Pass topology hint to DagScheduler to control concurrency limits and aggregation strategy
  3. Config: [orchestration] topology_selection = true

Complexity: LOW — simple heuristic on existing TaskGraph structure, no new models required.

Phase 2: Difficulty-Aware Routing (CASTER)

For each task node in the DAG, estimate difficulty and route to appropriately sized model:

  • Simple nodes (file reads, formatting) → cheap model (compatible/ollama)
  • Complex reasoning nodes → cloud model (claude)

Implementation:

  1. Extend TaskNode with difficulty_hint: Option<f32> populated by LlmPlanner during decomposition
  2. In DagScheduler::spawn_task(), pass difficulty_hint to AgentRouter as weight modifier
  3. AgentRouter maps difficulty → preferred provider tier
  4. Log routing decisions per task node with difficulty score and provider selected
  5. Collect failed task outcomes → feed back into Thompson Sampling EMA (already tracks outcomes)
  6. Config: [llm.router] difficulty_routing = true

Complexity: HIGH — requires LLM-side difficulty estimation in LlmPlanner, DagScheduler integration, router extension. Implement incrementally: start with LlmPlanner emitting difficulty hints, wire routing later.

Integration Points

References

  • arXiv:2602.16873 (AdaptOrch)
  • arXiv:2601.19793 (CASTER)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Long-term / exploratoryresearchResearch-driven improvement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions