Llm workflows cluster queries to improve task solving efficiency

RA-MoWE: Workflow-Affinity Embeddings for Query Clustering and Agentic Workflow Generation

Artificial Intelligence

Summary

Solving complex problems often requires a series of steps or a 'workflow.' The authors found that one general workflow doesn’t work well for all types of questions. They created a method called RA-MoWE that groups similar questions together based on which existing workflows work well on them. This grouping helps generate special workflows for each group, making it easier and faster to solve new questions without starting from scratch each time. Their tests showed this method improves accuracy while using fewer resources.

What this means in practice

  • For software developers: Create more efficient AI-assisted tools that better tailor reasoning workflows to categories of programming queries, reducing runtime costs.
  • For data analysis teams: Group related scientific and mathematical queries to generate specialized workflows that improve solution accuracy with fewer computational resources.
  • For customer support platforms: Use query clustering to assign better automated workflows for handling varied customer questions more accurately and efficiently.$Commercial implications: Enables delivery of customized AI workflows for customer inquiry automation, improving service quality and response speed commercially.

Authors

Qi Cheng, Shengyu Chen, Wei Cheng, Yiqun Xie, Haoyu Wang, Haifeng Chen, Xiaowei Jia

Abstract

Agentic workflows enable large language models (LLMs) to solve complex tasks by coordinating reasoning, tool use, and verification. However, a workflow optimized for an entire task collection can overlook differences in the reasoning strategies that individual queries need, while searching for a new workflow for every query repeats costly optimization. To address this tradeoff, we introduce RA-MoWE, a framework that uses workflow-affinity embeddings to cluster queries and guide the generation of reusable expert workflows. Each embedding records how well a fixed set of reference workflows solves a query, revealing similarities in which reasoning strategies are effective. RA-MoWE uses each cluster's queries and average embedding to initialize and refine a specialized workflow through execution feedback. An embedding encoder predicts these embeddings from query text, allowing new queries to select a generated expert without first executing the reference workflows. On a 300-query test set drawn from four benchmarks spanning mathematics, science, and programming, RA-MoWE improves average task score by 4.04 percentage points over selecting among the reference workflows, while using 27.7% fewer language-model calls at inference.