Generating a Low-code Complete Workflow via Task Decomposition and RAG

Orlando Marquez Ayala,Patrice Béchard
2024-11-30
Abstract:AI technologies are moving rapidly from research to production. With the popularity of Foundation Models (FMs) that generate text, images, and video, AI-based systems are increasing their complexity. Compared to traditional AI-based software, systems employing FMs, or GenAI-based systems, are more difficult to design due to their scale and versatility. This makes it necessary to document best practices, known as design patterns in software engineering, that can be used across GenAI applications. Our first contribution is to formalize two techniques, Task Decomposition and Retrieval-Augmented Generation (RAG), as design patterns for GenAI-based systems. We discuss their trade-offs in terms of software quality attributes and comment on alternative approaches. We recommend to AI practitioners to consider these techniques not only from a scientific perspective but also from the standpoint of desired engineering properties such as flexibility, maintainability, safety, and security. As a second contribution, we describe our industry experience applying Task Decomposition and RAG to build a complex real-world GenAI application for enterprise users: Workflow Generation. The task of generating workflows entails generating a specific plan using data from the system environment, taking as input a user requirement. As these two patterns affect the entire AI development cycle, we explain how they impacted the dataset creation, model training, model evaluation, and deployment phases.
Software Engineering,Artificial Intelligence
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to effectively utilize two techniques, Task Decomposition and Retrieval - Augmented Generation (RAG), in the design and development process of Generative Artificial Intelligence (GenAI) systems to enhance software quality attributes such as system performance, flexibility, maintainability, security, etc. Specifically: 1. **Task Decomposition**: By decomposing complex machine - learning tasks into simpler subtasks, the extensibility, modularity, functional correctness, response time, modifiability, and testability of the model can be improved. This method helps to reduce the performance risks brought by large - scale output and enables different base models to focus on solving different parts of the problem, thereby improving the overall maintainability and efficiency of the system. 2. **Retrieval - Augmented Generation (RAG)**: By providing environmental data to the base model, it can adjust its output according to real - time and available inputs, thereby improving the system's security, functional correctness, self - descriptiveness, testability, and analysis capabilities. RAG helps to reduce the hallucination phenomenon in model output and improves the ability to access the latest data or knowledge, especially when the model needs to process domain - specific data. The paper conducts a detailed exploration of how to implement these design patterns in practical applications and their impact throughout the AI development cycle (from data labeling to model deployment) through a case study - "Workflow Generation". Through this case, the author aims to show how task decomposition and RAG can help solve the challenges encountered in the development of generative AI systems and discuss the trade - offs involved in using these techniques.