How Gen-AI works

SATYASATYA
3 min read

In my previous blog, I discussed the difference between AI, ML, DL, and Gen-AI. Where we also discussed what they actually are, along with their uses.

In this blog, let's double click on the topic of How exactly gen-ai works?

So for people who do not understand what gen-ai is, let's take a look at the definition and then we will move forward towards the working.

Gen-AI

Generative AI, sometimes called “Gen AI,” refers to deep learning models that can create complex original content, such as long-form text, high-quality images, realistic videos or audio, and more, in response to a user prompt or request.

So in general, AI operates in three phases.

  • Training - to create a foundation model

  • Tuning - to adopt the model to a specific application

  • Generation, evaluation, and more tuning to improve accuracy

Training

Gen-AI begins with a foundation model, a deep learning model that serves as the basis for multiple different types of gen-AI applications.

The most common foundation model today is large language models (LLMs), created for text generation applications. But there are also foundation models for image, video, sound, or music generation, and multimodal foundation models that support several kinds of content.

To createa foundation model, practitioners train a deep learning algorithm on huge volumes of relevant, unstructured, unlabeled data. Such as terabytes or petabytes of data ,text or images, or video from the internet.

The training yields a neural network of billions of parameters - encoded representations of the entities, patterns, and relationships in the data that can generate content autonomously in response to prompts. This is the foundation model.

This training process is computationally intensive, time-consuming, and expensive. It requires thousands of clustered GPUs and weeks of processing, all of which typically costs millions of dollars. Open source models, such as Meta Llama-2, enable gen-AI developers to avoid this step and its costs.

Tuning

Next, the model must be tuned to a specific content generation task. This can be done in various way, including

  • Fine-tuning = involves feeding the model applications - specific labeled data, question or prompts the application is likely to receive, and corresponding correct answer in the wanted format.

  • Reinforcement Learning = with human feedback (RLHF), in which users evaluate the accuracy or relevance of model outputs so that the model can improve itself. This can be done as simple as having people type or talk back corrections to a chatbot or virtual assistant.

Generation, evaluation and more tuning

Developers and users regularly assess the output of their genai apps and further tune the model - even as often as once a week - for greater accuracy or relevance. In contrast, the foundation model itself is much less frequently, perhaps every year or 18 months.

Another option for improving a a gen AI app’s performance is retrival augmented generation (RAG), a technique for extending the foundation model to use relevant sources outside of the training data to refine the parameters for greater accuracy or relevance

I hope you learnt something from this blog and if you did make sure to like , share and leave a feedback in comments below.

Make sure to follow me on

X | Linkedin

5
Subscribe to my newsletter

Read articles from SATYA directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

SATYA
SATYA

Hey there! I'm Satya. I love exploring different aspects of tech and life, and I enjoy sharing what I learn through stories and real-life examples. Whether it's web development, DevOps, networking, or even AI, I find joy in breaking down complex ideas into simple, relatable content. If you're someone who loves learning and exploring these topics, I'd be really glad if you followed me on Hashnode. Let's learn and grow together! 😊