본문 바로가기

Generative AI

[Databricks] Generative AI Engineering Pathway

반응형

 

 

 

 

 

https://www.databricks.com/learn/training/generative-ai-fundamentals-accreditation

 

https://customer-academy.databricks.com/pages/29/customer-academy-home-page

 

 

1. Generative AI Fundamentals

2. Generative AI Fundamentals Accreditation

3. Generative AI Engineering with Databricks 

 

 

 

 

 

generative-ai-fundamentals-v1.pdf
3.98MB

 

 

Generative AI Engineering with Databricks.zip
0.10MB

 

 

 

 

Generative AI fundamentals 

 

- Synthetic image generation :

Synthetic image generation refers to the process of creating artificial images from scratch using machine learning models, particularly generative models like Generative Adversarial Networks (GANs) or Variational Autoencoder (VAEs). These images can range from realistic photographs to artistic visual content, and are used in diverse fields such as entertainment, art, and training AI models

 

- Style transfer / edit :

Style transfer is a technique in computer vision and deep learning where the style of one imagge is applied to another without altering the contentt. This is commonly used to make one image resemble the artistic style of another (e.g., transforming a regular photo to have the styel of a famous painting). Style editing can also refer to more targeted modifications where specific stylistic elements of an image are adjusted while keeping its general content intact. 

 

- Translation :

In the context of AI, translation referes to the process of converting text or speech from one language to another using machine learning models. Neural machine translation (NMT) systems use deep neural networks to provide translations that capture the context and semantics of the original content, providing more fluent and accurate translations than earlier statistical methods. 

- Question Answering :

Question answering systems are AI applications designed to answer questions posed by humans in natural lanuages. These systems can range from simple fact-based models, where answers are retrieved from a structured database, to more complex ones using natural language understanding to comprehend and respond based on large bodies of unstructured text. 

- Semantic Search :

Unlike traditional keyword-based search, semantic search uses AI to understand the intent and contextual meaning of a search query. It aims to provide more relevant search results by understanding associative relationships between terms and concepts, making it especially useful for complex query interpretations.

 

- Sppech-to-text :

Speech-to-text, also known as automatic speech recognition (ASR), is the technology that converts spoken language into written text. This is widely used in applications like virtual assistants, voice-enabled devices, and accessibility technologies for those who are unable to type or prefer speaking.

- Music transcription :

Music transcription in the context of AI involves converting a piece of music into a written form, typically standard musical notation. This involves detecting the notes, rhythms, and sometimes even the instruments from audio files. AI models for music transcription help in automating this process, making it easier to create sheet music from recordings.

 

- Hugging Face is a company known for its work in the field of artificial intelligence, particularly within natural language processing (NLP). It provides a host of open-source tools and resources widely used by the AI community for building, training, and deploying state-of-the-art machine learning models. 

- Reinforcement Learning from Human Feedback (RLHF) is an advanced machine learning technique that combines traditional reinforcement learning (RL) with human feedback to train models, particularly in environments where defining a clear reward function in challenging. This method is especially prominent in training AI systems for complex decision-making tasks where ethical considerations, nuanced judgements, or subjective preferences are involved. 

 

GPT-4, BART, and MPT-7B are all examples of advanced language models developed using different architetectures annd methodologies in the field of natural language processing (NLP). Each has distinct characteristics and uses: 

 

1) GPT-4 (Generative Pre-trained Transformer 4) :

- Architecture : GPT-4 is a large transformerbased language model developed by OpenAI. It follows the architecture principles set by its predecessors (like GPT-3), using a stacked transformer design optimized for autoregressive language generation.

- Functionality : GPT-4 is designed to generate human-like text based on the input it receives. It can continue a piece of text, answer questions, summarize information, translate languages, and more, based on patterns it has learned from a vast amount of text data. 

- Use cases : GPT-4 is versatile and used in applications ranging from conversational AI to content creation, and even complex problem solving in various domains.

 

2) BART (Bidirectional and Auto-Regressive Transformers) 

- Architecture : Developed by Facebook AI, BART combines two main mechanisms - bidirectional encoding and autoregressive decoding. This model is first trained to reconstruct original text from corrupted versions of text (a process similar to denoising autoencoders), utilizing a transformer-based bidirectional encoder (like the one used in BERT) and a transformer-based autoregressive decoder

- Functionality : BART is particularly effective for tasks that involve generating or transforming text, such as summarization, translation, and text generation, but starting from a context that requires understanding and then generating appropriate outputs. 

- Use cases : BART excels in text generation tasks that benefit from a deep understanding of context, such as summarizing long documents or correcting grammer in sentences. 

 

3) MPT-7B (Multimodal Pre-trained Transformer - 7 Billion) 

Introducing MPT-7B: A New Standard for Open-Source, Commercially Usable LLMs | Databricks Blog

MPT-7B, the first entry in our MosaicML Foundation Series. 

MPT-7B is a transformer trained from scratch on 1T tokens of text and code. It is open source, available for commercial use, and matches the quality of LLaMA-7B. MPT-7B was trained oon the MosaicML platform in 9.5 days with zero huma intervention at a cost of ~$200k.

 

4) BERT 

 

 

In the field of language modeling, particularly with large language models (LLMs) like GPT and BERT, 'tokenization' and 'token embeddings' are fundamental concepts that help these models process and understand text data effectively. 

1) Tokenization is the process of converting text into smaller units called tokens. These tokens can be as small as individual characters, or as large as words or even subwords (parts of words). The choice of tokenization method depends on the model and the specific task. 

- Word tokenization

- Subword tokenization

 

2) Token embeddings are numerical representations of tokens that capture semantic and syntactic meanings of the tokens. Each token is mapped to a vector in a high-dimensional space. These vectors are learned in a way that tokens with similar meanings have embeddings that are close to each other in the vecgor space. 

- Learning embeddings 

- Contextual Embeddings

- Embedding Layer

 

Introducing DBRX: A New State-of-the-Art Open LLM | Databricks Blog

 

Hugging Face is the AI community building the future. The platform where the machine learning community collaborates on models, datasets, and applications. https://huggingface.co/docs/transformers/model_doc/bart

 

Falcon LLM is a generative large language model (LLM) that helps advance applications and use caes to future-proof our world. Today the Falcon 180B, 40B, 7.5B, and 1.3B parameter AI models, as well as our high-quality REFINEDWEB dataset, form a suite of offerings  https://falconllm.tii.ae/index.html

 

MPT (Multimodal Pre-trained Transformer) https://huggingface.co/docs/transformers/main/model_doc/mpt is proposed by the MosaicML team and released with multiple sizes and finetuned variants. The MPT models is a series of our open source and commercially usable LLMs pre-trained on 1T tokens. 

* Mosaic research : https://www.databricks.com/blog/category/generative-ai/mosaic-research

 

Dolly https://www.databricks.com/blog/2023/04/12/dolly-first-open-commercially-viable-instruction-tuned-llm is the world's first truly open instruction tuned LLM models developed by databricks. 

 

Pythia is a suite for analyzing large language models across training and scaling. https://www.eleuther.ai/about

 

GPT-4 is the latest milestone in OpenAI's effort in scaling up deep learning. GPT-4 is a large multimodal model (accepting image and text inputs, emitting text outputs) that, while less capable than humans in many real-world scenarios, exhibits human-level performance on various professional and academic benchmarks. 

https://openai.com/research/gpt-4

 

BLOOM https://huggingface.co/bigscience/bloom is BigScience LArge Open-science Open-access Multilingual Language Model. BLOOM is an autoregressive Large Language Model (LLM), trained to continue text from a prompt on vast amounts of text data using industrial-scale computatinoal resources. 

 

FLAN-T5 https://huggingface.co/docs/transformers/model_doc/flan-t5 was released in the paper https://arxiv.org/pdf/2210.11416.pdf . It is methods to improve training for existing architectures. 

 

BART https://huggingface.co/docs/transformers/model_doc/bart was proposed in https://arxiv.org/abs/1910.13461 , is a denosing autoencoder for pretraining sequence-to-sequence models. 

 

BERT https://huggingface.co/docs/transformers/model_doc/bert was proposed in https://arxiv.org/abs/1810.04805 , is a Bidirectional Encoder Representations from Transformers. Unlike recent language representation models, BERT is designed to pre-train deep bidirectional representations from unlabeld text by jointly conditioning on both left and right context in all layers. 

 

 

 

- Unity Catalog is a feature within the Databricks platform that offers a unified governance solution for data and AI. It provides a central place to manage metadata across all data assets in an organization, enhancing data security and governance. 

 

 

Data Collection and Preparation

- Vector search, also known as similarity search or approximate nearest neighbor (ANN) search, involves finding the closest vectors (points in a high-dimensional space) to a given query vector. This technique is fundamental in many modern AI applications, especially those involving natural language processing (NLP), image recognition, and recommendation systems.

- Feature serving refers to the process of providing machine learning models with the necessary features (data inputs) in real-time to make predictions. 

 

Use Existing Model or Build Your Own 

- Curated AI models refer to pre-trainned model that are selected and optimized for specific tasks and are readily available for deployment or further fine-tuning. In a platform lake databricks

- AutoML for LLM training refer to automated machine learning, which automates the process of applying machine learning to real-world problems. It automated model selection, data preparation, and hyperparameter tuning.

- MLflow evaluation is an open-source platform for managing the end-to-end machine learning lifecycle, and it's tightly integrated with databricks. It involves experiment tracking, model evaluation, and model registry. 

 

Model Serving and Monitoring

- MLflow AI Gateway refer to a conceptual or future integration that acts as a gateway or interface for managing AI workflows and deployments using MLflow in a more accessible or centralized manner. An AI Gateway could hypothetically manage the ingress and egress of data and model predictions, serving as a bridge between ML models and business applications, however, for specifics, it's best to refer directlyl to the latest Databricks and MLflow documentation or announcements. 

- Model Serving optimized for LLMs involves models to production so they can handle inference requests efficiently. Optimizing model serving for LLMs in Databricks could involve several strategies: 

1) Dedicated Resource : Allocating sufficient computatinal resources (like GPUs) specifically for inference tasks to handle the heavy computational demands of LLMs. 

2) Batch Inference : Optimizing the serving system to handle batch requests where appropriate, which can improve throughput and efficiency when processing multiple queries at once. 

3) Model Compression : Applying techniques such as quantization, pruning, and distillation to reduce the model size and inference time without significantly compromising on performance. 

4) Load Balancing : Implementing load balancing to distribute inference requests evenly across multiple nodes or instances, ensuring that no single node becomes a bottleneck. 

Lakehouse Monitoring is a term used by databricks to describe their unified platform that combines the featuers of data lakes and data warehouses, providing capabilites for managing large-scale data storage and advanced analytics under one roof. Monitoring in a lakehouse architecture would involve: 

1) data quality check 2) performance metrics 3) security and compliance monitoring, 3) workflow monitoring 

 

1) Classic ML refers to a set of algorithms and statistical models that enable computers to perform specific tasks without using explicit instructions, relying instead on patterns and inference. 

- Three categories : Supervised, Unsupervised, Reinforcement Learning

- Libraries : Sklearn, XGBoost

2) Deep Learning is a subset of machine learning based on artificial neural networks with representation learning. 

- Categories : RNN, CNN, DBN, ... 

- Libraries : PyTorch, Tensorflow, JAX

3) Proprietary LLMs refer to Large Language Models that are developed and managed by private organizations. 

- OpenAI GPT-3 or GPT-4

4) Open source generative AI + LLMs refers to models that are freely available for anyonee to use, modify, and distribute.

- Eleuther AI's GPT-Neo, Hugging Face's models, MosaicML MPT, stability.AI Stable diffusion. 

5) Chains & Agents in the context of AI typiically refers to a framework or architecture where multiple AI models or components work in sequence or in collaboratioon to achieve complex tasks: 

- Chains : This can refer to a sequence of models where the output of one model serves as the input to the next. This is often seen in pipelines that involve multiple stages of processing, such as data preprocessing, feature extraction, prediction, and post-processing

- Agents : Agents are entities capable of perceiving their environment through sensors and acting upon that environment through actuators. In the context of reinforcement learning, an agent learns to make decisions by interacting with its environment in order to maximize some notion of cumulative reward. 

 - mental model is a conceptual framework or a way of thinking that we unconsciously use to understand and interpret the world around us. It represents a person's thought process for how something works in the real world. Mental models guide our perception and behavior, and they help us understand life, make decisions, and solve problems. They are bsaed on beliefs, not on facts, and they are built from our personal experiences, education, and cultural upbringing. 

- Vector Database 

 

 

 

 

 

 

Generative AI Fundamentals Accreditation 

What is the correct order of fields of Artificial Intelligence (AI) from general to specific ? 

- Artificial Intelligence > Deep Learning > Generative AI 

 

Which of these two Databricks Lakehouse AI features are used in the production phase of Generative AI applications? Choose 2 options. 

- Lakehouse Monitoring

- MLFlow Evaluation

 

A use intentionally crafts intructions to manipulate the normal behavior of an AI model in an attempt to extract confidential information from the model. What is the term used to describe this security issue? 

Generative AI Engineering with Databricks - Overview 

 

Generative AI Engineering with Databricks.zip
0.10MB

 

 

 

Welcome to Generative AI Engineering with Databricks!

This course, which focuses on LLMS, is aimed at data scientists, machine learning engineers, and other data practitioners looking to build LLM-centric applications with the latest and most popular frameworks. In this course, you will build common LLM applications using Hugging Face, develop retrieval-augmented generation (RAG) applications, create multi-stage reasoning pipelines using LangChain, fine-tune LLMs for specific tasks, assess and address societal considerations of using LLMs, and learn how to deploy your models at scale leveraging LLMOps best practicesn this course, you will explore how to leverage the Databricks Lakehouse Platform to productionalize ETL pipelines. You will learn how to use Delta Live Tables with Spark SQL and PySpark to define and schedule pipelines that incrementally process new data from a variety of data sources into the Lakehouse, orchestrate tasks with Databricks Workflows, and promote code with Databricks Repos. 

By the end of this course, you will have learned how to build an end-to-end LLM workflow that is ready for production.

Note: This course currently utilizes open-source technologies. Over time, additional Databricks capabilities will be leveraged by the course.

Course goals

By the end of our time together, you’ll be able to:

  • Apply LLMs to real-world problems in natural language processing (NLP) using popular libraries, such as MLFlow and LangChain and leverage models from HuggingFace and other hubs.
  • Leverage your own data to enhance the domain knowledge or task-performance of LLMs by using embeddings and vector databases.
  • Understand the nuances of pre-training, fine-tuning, and prompt engineering, and apply that knowledge to fine-tune a custom chat model.
  • Evaluate the efficacy and bias of LLMs using different methods. 
  • Implement LLMOps and multi-step reasoning best practices for an LLM workflow. 

Prerequisites

Before attempting this course, please ensure that you meet these prerequisites. If you don’t, you might have trouble following along with course content. 

Course pre-requisites:

 

 

 

Knowledge/Skill pre-requisites 

  • Intermediate-level experience with Python
  • Working knowledge of machine learning and deep learning is helpful

Technical considerations

Please pay special attention to these technical considerations to ensure your success in this course: 

  • Databricks Runtime: This course runs on DBR 13.3 for Machine Learning. Please use this DBR when working through this course.
  • This course cannot be run on Databricks Community Edition.

Next, we'll discuss course logistics. 

 

 

Working through this course 

This course contains a series of lectures and product demos that guide you through important concepts and best practices on Databricks. 

Databricks Academy Labs

If you wish to practice the course labs, we have provided the DBC files that you can use. However, please note that these files were created specifically for the Databricks environment and may not work as expected in other environments. To access labs provided through our lab partner Vocareum, you can purchase the Databricks Academy Labs subscription directly from the Databricks Academy website -

customer-academy.databricks.com for Databricks customers and the general public

partner-academy.databricks.com for Databricks partners

Technical issues? If you run into technical difficulties with this course, please submit a ticket here. When you submit a ticket please be sure to include the name of this course, screenshots of your issue, and detailed information to help us troubleshoot your issue. 

Questions about course content? If you have questions about this course content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

Good luck! Let's get started. 

 

 

 

 

 

Databricks, Generative AI, and Natural Language Processing

- Generative AI and LLMs

- Practical NLP Primer

- Databricks and LLMs

- Module Recap

- Knowledge Check

 

Common Applications with Large Language Models

- Common Applications Overview

- Demo: Common Applications with LLMs

- Lab: Common Applications with LLMs

- Knwledge Check 

 

Retrieval-Augmented Generation with Vector Search and Storage

- Retrieval-Augmented Generation with Vector Overview

- Demo: RAG with FAISS and Chroma

- Lab: Retrieval-Augmented Generation

- Knowledge Check

 

Multi-Stage Reasoning with Large Language Models Chains

- Welcome to Multi-Stage Reasoning with Large Language Models Chains

- Multi-stage Reasoning with Large Language Models Chains Overview

- Demo: Multi-stage Reasoning with Large Language Models Chains

- Lab: Multi-stage Reasoning with Large Language Models Chains

- Knowledge Check

 

Fine-Tuning Large Language Models

- Welcome to Fine-Tuning LLMs

- Fine-tuning LLMs Overview

- Demo: Fine-tuning LLMs

- Lab: Fine-tuning Large Language Models

- Knowledge Check

 

Evaluating Large Language Models

- Welcome to Evaluating LLMs 

- Evaluating LLMs Overview

- Demo: Evaluating LLMs

- Lab: Evaluating LLMs

 

Society and  Large Language Models

- Welcome to Society and LLMs

- Society and LLMs Overview

- Society and LLMS Demo

- Lab: Society and LLMs

- Knowledge Check

 

Large Language Models Operations

- Welcome to LLMOps

- LLMOps Overview

- Demo: LLMOps

- Lab: LLMOps

- Knowledge Check

 

 

 

 

 

 

Course Summary and Next Steps

Congratulations - you completed the Generative AI Engineering with Databricks course!

In this course, we discussed how to build LLM-centric applications with the latest and most popular frameworks. Specifically, we built common LLM applications using Hugging Face, developed retrieval-augmented generation (RAG) applications, created multi-stage reasoning pipelines using LangChain, fine-tuned LLMs for specific tasks, assessed and addressed societal considerations of using LLMs, and learned how to deploy models at scale leveraging LLMOps best practices. Hopefully, you are now comfortable building an end-to-end LLM workflows that is ready for production. 

Specifically, you should be able to: 

  • Apply LLMs to real-world problems in natural language processing (NLP) using popular libraries, such as MLFlow and LangChain and leverage models from HuggingFace and other hubs.
  • Leverage your own data to enhance the domain knowledge or task-performance of LLMs by using embeddings and vector databases.
  • Understand the nuances of pre-training, fine-tuning, and prompt engineering, and apply that knowledge to fine-tune a custom chat model.
  • Evaluate the efficacy and bias of LLMs using different methods. 
  • Implement LLMOps and multi-step reasoning best practices for an LLM workflow. 

Evaluate this Course
Do you have any feedback about this course? If so, please take this brief, one-minute survey. Your feedback is valuable and helps us improve our offerings.

Databricks Certification - Coming Soon!
Ready to demonstrate your expertise in Generative AI Engineering on Databricks? We're currently working on the upcoming Generative AI Engineer Associate certification exam. This exam is currently under development and will draw from this course and other resources. Stay tuned! 

 

 

 

 

 

 

Generative AI Engineering with Databricks - Detail

 

Databricks, Generative AI, and Natural Language Processing

1) Generative AI and LLMs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2) Practical NLP Primer

 

 

 

3) Databricks and LLMs

 

4) Module Recap

 

 

 

5) Knowledge Check

 

 

 

Common Applications with Large Language Models

1) Common Applications Overview

 

 

 

 

2) Demo: Common Applications with LLMs

Summarization can take two forms 

- extractive (selecting representative excerpts from the text) 

- abstractive (generating novel text summaries) 

https://huggingface.co/docs/transformers/tasks/summarization

* Summarization creates a shorter version of a documnet or an article that captures all the important information. 

 

Sentiment Analysis is a text classification task of estimating whether a piece of text is positive, negative, or another "sentiment" label. The precise set of sentiment labels can vary across applications. 

https://huggingface.co/tasks/text-classification

* Sentiment analysis (Text Classification) is the task of assigning a label or class to a given text.

 

Translation models may be designed for specific pairs of languages, or they may support more than two languages. 

https://huggingface.co/tasks/translation

* Traslation is the task of converting text from one language to another.

 

Zero-shot classifcation (or zero-shot learning) is the task of classifying a piece of text into one of a few given categories or labels, without having explicitly trained the model to predict those categories beforehand. 

https://huggingface.co/tasks/zero-shot-classification

* Zero-shot text classification is a task in natural language processing where a model is trained on a set of labeled examples but is then able to classify new examples from previously unseen classes. 

 

Few-shot learning tasks , you give the model an instruction, a few query-response examples of how to follow that instruction, and then a new query. The model must generate the response for that new query. This technique has pros and cons: it is very powerful and allows models to be reused for many more applications, but it can be finicky and require significant prompt engineering to get good and reliable results. 

https://huggingface.co/blog/few-shot-learning-gpt-neo-and-inference-api

Few-Shot Learning refers to the practice of feeding a machine learning model with a very small amount of training data to guide its predictions, like a few examples at inference time, as opposed to standard fine-tuning techniques which require a relatively large amount of training data for the pre-trained model to adapt to the desired task with accuracy. 

 

 

 

 

3) Lab: Common Applications with LLMs

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Common Applications with Large Language Models folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

4) Knowledge Check 

 

 

 

 

Retrieval-Augmented Generation with Vector Search and Storage

1) Retrieval-Augmented Generation with Vector Overview

 

 

 

 

2) Demo: RAG with FAISS and Chroma

 

Retrieval Augmented Generation (RAG) is composed two main model types ; the retrieval model and the generation model.

- to build a retrieval model, we can use vector library (FAISS) and a vector databse (chroma), hugging face, 

- FAISS : https://faiss.ai/ is a library for efficient similarity search and clustering of dense vectors. 

 

Vector library examples 

- Chroma DB : https://docs.trychroma.com/ is the open-source embedding database. 

- ScaNN:  https://github.com/google-research/google-research/tree/master/scann  is a method for efficient vector similarity search at scale. 

- ANNOY : https://github.com/spotify/annoy  approximate nearest neighbors in C++/Python optimized for memory usage and loading/saving to disk 

- HNSM : https://arxiv.org/abs/1603.09320   is fully graph-based, without any need for additional search structures, which are typically used at the coarse search stage of the most proximity graph techniques. 

comparison of vector library vs. databses  https://weaviate.io/blog/vector-library-vs-vector-database#feature-comparison---library-versus-database

 

- embedding : https://docs.trychroma.com/embeddings

 

 

 

 

3) Lab: Retrieval-Augmented Generation

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Retrieval-Augmented Generation with Vector Search and Storage folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

 

 

 

4) Knowledge Check 

 

 

 

 

 

 

 

 

 

 

 

 

 

Multi-Stage Reasoning with Large Language Models Chains

1) Welcome to Multi-Stage Reasoning with Large Language Models Chains

1. LangChain 

2. Open AI (Proprietary)

3. Hugging Face (Open source model) 

 

LLM Task : Summarization, Sentiment analysis, Translation, Zero-shot classificaiton, Few-shot learning, Conversation, ... 

LLM based Workflow : 

 

 

 

 

 

 

 

 

 

 

 

 

2) Multi-stage Reasoning with Large Language Models Chains Overview

 

 

 

3) Demo: Multi-stage Reasoning with Large Language Models Chains

 

- Building multi-stage reasoning systems with LLM Chains 

Two Systems 

1. JekyllHyde : will be a prototype AI self-commenting-and-moderating tool that will create new reaction comments to a piece of text with one LLM and use another LLM to critique those comments and flag them if they are negative. 

2. DaScie (pronounced "dae-see") will take the form of an LLM-based agent that will be tasked with performing data science tasks on data that will be stored in a vector database using ChromaDB. We will use LangChain agents as well as the ChromaDB library, as well as the Pandas Dataframe Agent and python REPL(Read-Eval-Print Loop) tool.

 

1. Build prompt template and create new prompts with different inputs

2. Create basic LLM chains to connect prompts and LLMs

3. Construct sequential chains of multiple LLMChains to perform multi-stage reasoning analysis 

4. Use langChain agents to build semi-automated systems with an LLM-centric agent to perform internet searches and dataset analysis.

 

- hugging face : https://huggingface.co/welcome

- google search engine : https://serpapi.com/search-api

 

 

 

 

 

 

 

 

 

 

 

 

4) Lab: Multi-stage Reasoning with Large Language Models Chains

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Multi-stage Reasoning with Large Language Models Chains
folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

 

 

5) Knowledge Check

 

 

Fine-Tuning Large Language Models

1) Welcome to Fine-Tuning LLMs

 

1. fine-tuning

2. advantages & disadvantages of each methods 

3. potential advantages of building own model using own data

4. common tools for training and fine-tuning such as those from hugging face and deep-speed

 

 

 

 

 

 

 

 

 

2) Fine-tuning LLMs Overview

 

 

 

 

 

3) Demo: Fine-tuning LLMs

 

 

- DeepSpeed : https://github.com/microsoft/DeepSpeed  is a deep learning optimization library that makes distributed training and inference easy, efficient, and effective. it can make the model training process accelerated 

 

 

 

 

 

 

 

 

4) Lab: Fine-tuning Large Language Models

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Fine-Tuning Large Language Models folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

 

5) Knowledge Check

 

 

 

 

Evaluating Large Language Models

1) Welcome to Evaluating LLMs 

 

 

 

 

 

2) Evaluating LLMs Overview

loss function is nothing really in LLM 

Perplexity is a measure used in statistics, information theory, and especially in the field of natural language processing (NLP) to evaluate language models. 

- Accuracy : next word is right or wrong. 

- Perplexity : how confident was that choice. 

 

 

In translation, we will use BLEU index 

In summarization, we will use ROUGE index

1) BLEU (Bilingual Evaluation Understudy) is a metric used to evaluate the quality of machine translations. It measures how similar the machine-translated text is to a human translation (the reference text) in the target language. 

 

2) ROUGE (Recall-Oriented Understudy for Gisting Evaluation) is primarily used to assess the quality of text summarization. 

This metric evaluates how closely an automatically generated summary resembles a human-generated reference summary, focusing particularly on recall. 

 

 

 

 

 

 

 

 

 

3) Demo: Evaluating LLMs

- ROUGE is a set of evaluation metrics designed for comparing summaries from Lin et al.

 

 

 

 

4) Lab: Evaluating LLMs

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Evaluating Large Language Models folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

5) Knowledge Check

 

 

Society and Large Language Models

1) Welcome to Society and LLMs

 

 

2) Society and LLMs Overview

 

 

 

 

3) Society and LLMS Demo

 

4) Lab: Society and LLMs

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the Society and Large Language Models folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

5) Knowledge Check

 

 

 

 

 

 

Large Language Models Operations

1) Welcome to LLMOps

 

 

2) LLMOps Overview

 

 

 

 

 

3) Demo: LLMOps

 

 

4) Lab: LLMOps

At this point in the course materials, we encourage you to complete the hands-on lab portion.     

In order to complete this lab, you'll need to download the course materials from the Course Materials Widget (below). Once the material is imported into your Databricks Workspace, navigate to the LLMOps folder, and look for the notebook that contains the word "Lab". As you navigate through the lab you'll notice code that reads "#todo" - whenever you see that code, please fill in the correct answer/code to proceed with the lab. 

Technical issues? If you run into technical difficulties with the lab, please submit a ticket here. When you submit a ticket, please be sure to include the name of this course as well as the questions you have.

Questions about the content? If you have questions about the content itself or need clarification on a certain topic, we recommend you reach out to the Databricks Academy Learners group in the Databricks Community. 

 

 

 

5) Knowledge Check

 

 

반응형
LIST