Workflow Design for Creating Generative AI Solutions

Workflow Design for Creating Generative AI Solutions This image was generated using FLUX.1 schnell running locally on M3 Pro, including the text.

Introduction

Creating generative ai solutions while being very popular right now, it can get overwhelming very soon if a well defined workflow agreed upon by all stakeholders is not in place.

Here I will try to give a simple yet effective workflow that can be used to create generative ai solutions, coming from learnings I got from the good people at NVIDIA.

Workflow

The workflow is divided into 7 main steps:

  1. Data Collection or Acquisition
  2. Data Preprocessing Or Curating
  3. Pretraining Model
  4. Fine Tuning Model
  5. Evaluation
  6. Deployment or Inference
  7. Guardrailing or Monitoring

Data Collection / Acquisition

Depending on the problem statement, the data can be collected from various sources. The data can be in the form of images, text, audio, video, etc. The data can be collected from various sources like the internet, forums, social media, etc. Companies sharing their proprietary data can also be a source of data. You need to be careful about the data you are collecting and make sure it is legal and ethical to use it.

Data Preprocessing / Curating

In this step, the data collected is cleaned and preprocessed. You will be removing all the noise, missing values, etc. You will also be normalizing the data, converting it into a format that can be used by the model. This step is very important as the quality of the data will determine the quality of the model.

Pretraining Model

Now that the data is ready, you can start training the model. You can use a pretrained model and fine tune it on your data. The choice of the model will depend on the problem statement and the data you have. You can use currently available open source models e.g Mistral, LLama2/3 etc or create your own model from scratch if the problem statement is very specific.

Fine Tuning Model

Time to get that optimal performance from the model. What we are looking here is to train the model in our specific domain or problem statement. This data will be very task specific and will help the model to perform better on the task or the domain we are targeting.

Evaluation

Now that the model is trained, it is time to evaluate it. Again you can use any metric that is relevant to your problem statement, this also includes human evaluation. This also is checking point where you can identify how good the model performes on data it was trained on and now on the data it has never seen before.

Deployment or Inference

Now that we are happy with the model, it is time to deploy it for the end users. This can be in the form of an API, a web app, etc. The model should be able to handle the load and should be scalable.

Guardrailing or Monitoring

While most of the users are happy with the model, there will be some users who will try to break the model or deviate from the intended use case. We need to make sure the ethical and legal guidelines are followed. Hence, it is important to monitor the model and make sure it is performing as expected.

Conclusion

While very brief, this workflow can be used as a starting point to create generative ai solutions. Always remember to keep the end user in mind and make sure the model is solving the problem it was intended to solve ethically and legally.