DEV Community

Cover image for The Wine Glass Model : GenAI Application Ecosystem
vishalmysore
vishalmysore

Posted on

The Wine Glass Model : GenAI Application Ecosystem

Prelude
Some years ago, I watched a movie called "I, Robot." Later, someone told me it came from a book. So, I got the book and read it. This book talks about robots and AI from a very deep and thought provoking mindset. In the story, there are rules for robots. Three Laws (rules) for robots as defined by Isaac Asimov in this book are,

First Law: A robot may not harm a human or, through inaction, allow harm to come to a human.

Second Law: A robot must obey orders given by humans, except where it conflicts with the First Law.

Third Law: A robot must protect its own existence, as long as it doesn't conflict with the First or Second Law.

These rules make you think about big ideas, like what is right and wrong. The book also shows robots as smart and having feelings. This is interesting because we usually think of robots and AI as just machines. The movie is good, but the book makes you think even more. It makes you wonder about life and what it means to be alive, even for a robot.

Image description
CH9 👉here. CookGPT 👉here. New to AI? 👉 here .

Image description

Image description

Overview
Developing AI apps involves several important aspects:

Foundation Model: It's like a starting point for AI. This model already knows many things from big data. Examples are GPT and BERT. We use it to build more specialized models. To know more click here.

Prompt Engineering: We tell the AI what to do with specific instructions called prompts. This helps it understand what we want. This is the left part of the wine glass and we will go over this in detail.

Fine-tuning: We make small changes to the model to make it work better for a specific job. It's necessary to get the best results. For step by step guide to fine tune click here

RAG (Retrieval-Augmented Generation): This makes AI better at writing by combining knowledge from different sources. It's useful when AI needs more information to give better answers. This is the right part of the wine glass.

Response Validation: Click here to know more about Hallucination. To know more details on how to avoid Hallucinations and toxicity click here . This is the bottom part of the wine glass

Governance and Monitoring. The entire wine glass model is immersed in governance and monitoring aspects, signifying the overarching framework that ensures responsible and ethical AI usage throughout every dimension.

Image description
Want to write AI application in pure Java? 👉 click here
Image description

Prompt Engineering - Left side of the Wine Glass

Most of us are already familiar with PE but here I would discuss some of the advanced concepts with examples. Few of the open source tools you can use for prompt engineering are Manifest , Promptify and Chainforge

Lets look at how I am doing it in my CookGPT project.

Prompt Selection : Prompt selection involves choosing the most appropriate prompt from a set of candidate prompts for a given task or input query. Prompt selection methods may rely on custom rules, or user feedback to determine the optimal prompt for maximizing task performance.

User : I want a recipe for vegetable biryani


Mapped Prompt : Generate a classic recipe for Vegetable Biryani, including ingredients and step-by-step cooking instructions. Also provide calories and serving instructions.
Enter fullscreen mode Exit fullscreen mode

Prompt Compression : Here the goal is to reduce the length and complexity of prompts without sacrificing the quality or relevance of model outputs.

User: Hey, I was wondering if you could maybe help me out with something? I'm craving a dish right now, you know? It's like, this Indian thing, with paneer and some kind of sauce, I think. Do you think you could give me a recipe for that?


Compressed Prompt : Requesting Indian paneer dish recipe.
Enter fullscreen mode Exit fullscreen mode

...continue reading the article for free here

Top comments (0)