AI/ML Best Practices During a Gold Rush: Functional Web App (FWA) and Retrieval Augmented Generation (RAG)

tfc

Hatched by tfc

May 09, 2024

4 min read

0

AI/ML Best Practices During a Gold Rush: Functional Web App (FWA) and Retrieval Augmented Generation (RAG)

In the midst of the AI/ML gold rush, it's important to adopt best practices to ensure the success and effectiveness of your projects. Two emerging trends in the AI/ML space are Functional Web Apps (FWA) and Retrieval Augmented Generation (RAG). These approaches offer unique benefits and can greatly enhance the capabilities of your AI models.

Retrieval Augmented Generation (RAG) is a technique that allows AI models, particularly large language models (LLMs), to take advantage of additional context information to produce more specific and accurate responses. By incorporating snippets of relevant documents into the prompt as context, the LLM can generate responses that are more informed and tailored to the specific question at hand. RAG is a promising approach that offers the benefits of fine-tuning without the need for retraining the entire model.

To implement RAG, you can partner with platforms like Cnvrg.io, which provide turnkey solutions for integrating RAG into your AI workflow. These platforms leverage storage solutions like MinIO to store the documents used for context in the prompts. By keeping the document index updated in real time, these platforms ensure that the context remains relevant and up to date.

Another best practice in the AI/ML space is fine-tuning existing LLMs. Fine-tuning involves training a pre-trained model with additional information to make it more specific and up to date. This approach is particularly useful if you have a specific domain or industry in mind and want to make the model more of an expert in that area. Publicly available LLMs often provide fine-tuning features, allowing you to start from a base model, upload your data for fine-tuning, and train a custom model. However, caution must be exercised when fine-tuning models with sensitive data, as both the new model and the training data will be in the public cloud.

If you're looking for a quick way to incorporate generative AI capabilities into your application without hosting a model yourself, using the APIs provided by public LLMs is a viable option. These APIs allow you to send prompts to the LLM and receive responses without the need for additional infrastructure. However, there are some considerations to keep in mind. Public LLMs can quickly become out of date, requiring you to find and incorporate relevant information into the prompts. Additionally, if you contextualize your prompts, you may be sending private data to the public cloud, so it's essential to carefully assess the data policy of the LLM provider.

On the other hand, if you have the resources and specific requirements, training a large language model from scratch may be the best option. This approach allows you to have complete control over the data the model sees and can be particularly useful for organizations with proprietary information or those operating in highly regulated industries. By starting with a proven LLM model architecture, you can leverage open-source code as a starting point and build a domain-specific LLM tailored to your needs.

In order to successfully implement these best practices, it's crucial to invest in all phases of the AI/ML workflow. From storage solutions that can handle large datasets and feed GPUs efficiently to tools for preprocessing, feature engineering, model training, testing, and model serving, each phase requires the right tools and infrastructure. Using software-defined, high-performance object storage like MinIO ensures future-proof storage capabilities, while tools like Kubeflow, MLflow, and Airflow facilitate the efficient management of data pipelines and model-training pipelines. Distributed training libraries like PyTorch, TensorFlow, and Ray help maximize compute resources, and tools like TorchServe, TensorFlow Serving, and KServe enable smooth model serving in production environments.

Before diving into the complexities of large language models, it's advisable to start with simple prediction models that address low-hanging fruit within your organization. Regression, categorization, or classification models require less compute resources and can provide value with less investment. Building these models allows you to establish the necessary processes and infrastructure for more complex projects in the future.

In conclusion, as the AI/ML gold rush continues, it's important to adopt best practices to ensure the success of your projects. Exploring approaches like Functional Web Apps (FWA) and Retrieval Augmented Generation (RAG) can greatly enhance the capabilities of your AI models. By considering options like fine-tuning, using public LLM APIs, or training models from scratch, you can choose the method that best suits your needs. Additionally, investing in all phases of the AI/ML workflow and starting with simple prediction models can set you up for success in more complex projects down the line.

Actionable Advice:

  1. Assess your specific requirements and resources before choosing an approach. Consider factors like data sensitivity, domain expertise, and the need for real-time updates.

  2. Invest in the right tools and infrastructure for each phase of the AI/ML workflow. From storage solutions to data preprocessing, model training, testing, and serving, the right tools can greatly enhance efficiency and results.

  3. Start small with simple prediction models to address low-hanging fruit within your organization. This allows you to establish processes and infrastructure that will be valuable in more complex projects in the future.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣