DSPy - save and load the compiled program
You don't need to compile every time, train once, and then save the configuration into json file, next time just load the json file to ge...
DSPY blocks - Signature
Signature --------- A signature is a declarative specification of input/output behavior of a DSPy module. Signature class 幫我們定義 in...
How to use DSPy
[https://dspy-docs.vercel.app/docs/building-blocks/solving_your_task](https://dspy-docs.vercel.app/docs/building-blocks/solving_your_task...
DSPy blocks - Data
DSPy 用 `Example` object 來代表每一個 Dataset,例如 `qa_pair = dspy.Example(question="This is a question?", answer="This is an answer.")` `ds...
DSPY blocks - Module
Module ------ [https://dspy-docs.vercel.app/docs/building-blocks/modules](https://dspy-docs.vercel.app/docs/building-blocks/modules?r...
LLM - RAG - Retrieval-Augmented Generation
RAG 全名是 Retrieval-Augmented Generation RAG 的好處是針對一些新聞時事或是一些在 changing 的 fact 我們沒辦法花 multi millions to retrain the base model,所以就把這些相關知...
LLM training stage
1. Pre-training 搜集海量的網路文本資料訓練出一個 Base Model 1. Fine-tuning 藉由人工介入,輸入各類資料,主要有兩種做法 1) 很多人工餵的 QA 資料讓 LLM 知道 How to answer ques...
LLM and Tokenization
所謂的 Tokenization 就是把文字轉化為數字的方法,你也許在想這不是很簡單嗎?就一個文字對應一個數字就行了,但如果這樣做的話我們需要太多的空間去儲存這些可以無限新增的文字(for example: 人類狂增加 Emoji lol) Andrej 大神在[他的...
General Text Embeddings (GTE) model
Supabase open sourced 了一個 embedding 跑分比 text-embedding-ada-002 (open AI)厲害的 model,有興趣的話可以搭配 [Ollama](https://blog.waynechu.cc/docker-like...
Docker-like LLM setup - ollama
看到這個 [ollama](https://github.com/jmorganca/ollama?ref=blog.waynechu.cc) github repo,挺有趣的,簡化了很多 local setup LLM 的麻煩,並且支援 HTTP interface,這樣...
Open AI 的 prompt guide
[https://platform.openai.com/docs/guides/prompt-engineering/strategy-provide-reference-text?](https://platform.openai.com/docs/guides/pro...
LLM RAG 簡單實作範例以及限制
這篇文章作者用 Python 實作了一個簡單的 Harry Potter Q&A https://medium.com/@petrpan/llm-101-build-your-own-book-reading-bot-or-search-engine-with-llm...
GPT prompt concepts
#### 1. Chain of Thought Chain of Thought (CoT) is a prompting technique used to encourage the model to generate a series of intermedia...