Resources for Large Language ModelResources for Large Language Model
After some learnings, I have tried to summarise my understanding into different sections, and write them in [[LLM]]
Top Tech News
Amazon Q
Google Vertex Generative AI Studio
Google Duet
...
Prerequisite
It would be easier if we have knowledge on NLP or Embedding, I would recommend Databricks course, the course start from the NLP knowledge till putting LLM to production.
What is LLM
LLM stands for Large Language Model, which aim to predict the next words. There are long history of LLM from word2vec, LSTM, Transformer, BERT, ELMo, till the PaLM, GPT (Generative Pre-training Transformer), an interesting blog post explain how GPT3 works , and the Gemini, multimodal model from google
Any model lead to the same results, the only difference is dataset
The model itself trying to predict the probability distribution of the next word, after training for the very large dataset, and massive parameters, as a result we can use it to do most of the work. On the other hand, since it is a next word prediction, it can produce the hallucination result.
What we should know about it
We can read a good comprehensive blog post by Eugene - compile the patterns for building LLM-based system, and also great blog post by Chip - addressing the challenges in LLM research
To start using it
- The easiest way to start using is to use ChatGPT
- Then we start to learn different type of prompting technique
- Then we may would like to apply LLM with our own data, so I recommend start learning about RAG
- Then we may would like to create our own application, I would recommend start learning about LangChain or LlamaIndex
- At this point, I may recommend to start reading the below information, to understand the overview, approaches, and technique of LLM.
The first few courses, we would learn about LangChain from Deep Learning.AI, these courses are easy to follow, and we can start building our PoC right away.
- LangChain for LLM App DevelopmentLangChain for LLM App Development
Summary:
The LangChain for LLM Application Development Course, focuses on utilizing the LangChain Python/TypeScript framework to streamline the creation of Language Model (LLM) applications. The c...: Link - LangChain Chat with Your DataLangChain Chat with Your Data
Summary:
The LangChain Chat with Your Data course provides a step-by-step exploration of [[RAG Essentials]], guiding users through fundamental processes. The course covers loading various document ...: Link - Functions, tools, and Agents with LangChainFunctions, tools, and Agents with LangChain
Summary
OpenAI Function Calling
Recent update from OpenAI to support Function calling
import json
# Example dummy function hard coded to return the same weather
# In production, this could be y...: Link - Bonus: if we have no experience with building PoC website using python, we can check out the streamlit or Gradio
Evaluations
As mention by Eugene, evaluation is crucial. Then we would need to learn how to evaluate our LLM or RAG.
- Quality and Safety for LLM ApplicationsQuality and Safety for LLM Applications
Whylogs help logs the data, as well as profiling and monitoring the data issue with LLM.
In the note, we will cover
Hallucination
Data Leakage
Refusals and Prompt Injections
Passive and a...: Link - Building and Evaluating Advanced RAGBuilding and Evaluating Advanced RAG
RAG Triad from Truera
RAG Triad
Answer Relevance
Context Relevance
Groundedness
Answer Relevance
from trulens_eval import Feedback
f_qa_relevance = Feedback(
provider.relevan...: Link - Ragas
- WhyLogs
- Span Markers
- LLM Security
To maximizing LLM performance
I would recommend starting with youtube video from OpenAI, it will give us an overview of RAG and fine-tuning with the result.
Starting with prompting
- I would recommend learning this course ChatGPT Prompt Engineering for DevelopersChatGPT Prompt Engineering for Developers
This is a cool course, which help you understand the tips, tactics to write a better prompt. Check it out ChatGPT Prompt Engineering for Developers
Prompting Principles
Principle 1: Write clear a...: Link - Component of Prompts
- Then we can explore different type of prompting in promptingguide.ai, which will summarise different prompting technique with the example such as zero-shot prompting, ReAct prompting
- There are also some challenges with the long text address in the Chip blog, and we can read more the detail Lost in the Middle: How Language Models Use Long Contexts, also with the new findings from Anthropic on their model Claude 2.1 which said, only adding 'Here is the most relevant sentence in the context:' yield the better result
Then if we focusing on the RAG, we read the follow.
- Retrieval augmented generation: Keeping LLMs relevant and current
- 10 Ways to Improve the Performance of Retrieval Augmented Generation Systems
- A Guide on 12 Tuning Strategies for Production-Ready RAG Applications
- Enterprise LLM Challenges and how to overcome them - Snorkel
WE can skip this for later - To go deeper on improving RAG, we can go deeper to understand how vector store works, and different retrieval algorithms, or strategies.
- We may start by learning the course by weaviate
- Then scan through different retrievers implemented by LLamaIndex
- Also start reading about vector store
- Finally, there are a different ANN embedding approach mention in Eugene blog also a good to read through (LSH, FAISS, HNSW, and ScaNN)
Then it's a good time to start exploring about different model, and how to fine-tune them
- To start with course from LAMINI on DeepLearning.ai: Fine-tuning Large Language Models
- then read a good summary from Eugene
- Then you will need to prepare your dataset
- Select the pre-trained models
- Update model architecture
- Pick a fine-tuning approach
- Training them
- A great courses by Databricks: Large Language Models: Foundation Models from the Ground Up
Put the model to production
Start by reading Emerging Architectures for LLM Application, this help us paint the big picture of the solutions we should apply in production, with additional resources to read from on different component.
- Databricks: Large Language Models: Application through Production
- GPTCache
- LangSmith
- LangFuse
- Fiddler