> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/ai/generative-ai.md).

# Generative AI

AI -> ML -> DL(deep) -> Generative AI (subsets)

That focuses on generative content (text, image, audio, code etc)

Generative Model -> a branch of ML which mathematically approx the world object

Factors making Generative Model possible now

* Large Datasets
* availble of computation resources
* innovative DL models

Generative AI use cases

* synthetic data generation

LLM and Generative AI

Generative AI -> LLM + Foundation Models (GPT-4 etc)

How Do LLM work

encoder, decoder, transformer

Common LLM&#x20;

<figure><img src="https://3632859567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPd6ktrA5pPLsZJktj2fm%2Fuploads%2FF2UdyRIqme7wPHyxdid1%2Fimage.png?alt=media&amp;token=bc18bb77-8266-448d-b775-ad6ed8f798b4" alt=""><figcaption></figcaption></figure>

Dolly -> Databricks (march 27, 2024)

Common LLM task

* content creation
* summarization
* question answer
* machine translation

LLM business use case

* customer persoanlization & segmentation
* feedback analysis
* virtual assistants
* code genration

LLM Application

LLM Falvours -> open source models (metabricks, llama fb) + proprietary models or LLM as service (openai, anthropic claude)

choose right model flavor ( LLM model selection factors -> consider privacy, quality, cost, latency)

Proprietary model (pros - quality, speed, cons -> cost, data privacy, vendor lock in)

open source models (pros - task tailoring, inference cost, control, cons - upfornt time investment, data requirment, skill sets)

Pre-trained model and training - (initial training with large corpus of data) - Foundation model + our data with fine tuning

FIne tuning model -> pre trained model/Foundation model + retrian on small data sets

Eg question answering model -> FOundation model + question anser data training

Mixing LLM flavors /models in a workflow (langchain helps on this) (multi-LLM)

eg summary + sentiment LLM

RAG - retrieval augmented Generation (enhance LLM output with external datasource)

Issue - new data comes in -> requires retriaing the model

Solution - RAG -> input — RAG + external vector database — return releavnt inputs to trained model

Databricks AI  + mossaic ML

Industry impacted with Generative AI

tech, bank, pharma

customize + secure env + our data

how to prepare for AI revolution  -> act urgently, underatand AI, develop strategy, identify use case, invest

potential risk and challenges

legal, ethical (bias, misinformation), social, environmental, security, intellectual property, issue

dont have forgetting feature in models, can reproduce model data,&#x20;

Active Regulatory Area

* EU AI Act

Bias reinforcement loops (bias input and output)

hallucination (intrincic and extrinsic

how to address each issue like ethical issue, privacy issue ec

AUdit -> model, governance, application

Human - AI interactio and impact on society


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/ai/generative-ai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
