Prompt Engineering: How to Trick AI into Solving Your Problems

  Рет қаралды 17,371

Shaw Talebi

Shaw Talebi

Күн бұрын

This is the 4th video in a series on using large language models (LLMs) in practice. Here, I review Prompt Engineering, 7 prompting tricks, and walk through example code that uses LangChain to build an AI application.
Series Playlist: • Large Language Models ...
📰 Read more: towardsdatascience.com/prompt...
💻 Example code: github.com/ShawhinT/KZbin-B...
More Resources
[1] arXiv:2302.11382 [cs.SE]
[2] arXiv:2106.09685 [cs.CL]
[3] State of GPT by Andrej Karpathy at Microsoft Build 2023
[4] arXiv:2206.07682 [cs.CL]
[5] ChatGPT Prompt Engineering for Developers by deeplearning.ai
[6] arXiv:2005.14165 [cs.CL]
[7] arXiv:2201.11903 [cs.CL]
[8] arXiv:2210.03493 [cs.CL]
--
Book a call: calendly.com/shawhintalebi
Homepage: shawhintalebi.com/
Socials
/ shawhin
/ shawhintalebi
/ shawhint
/ shawhintalebi
The Data Entrepreneurs
🎥 KZbin: / @thedataentrepreneurs
👉 Discord: / discord
📰 Medium: / the-data
📅 Events: lu.ma/tde
🗞️ Newsletter: the-data-entrepreneurs.ck.pag...
Support ❤️
www.buymeacoffee.com/shawhint
Intro - 0:00
Agenda - 1:23
What is Prompt Engineering? - 1:52
Two Levels of Prompt Engineering - 4:31
Building AI Apps w/ Prompt Engineering - 5:41
7 Tricks for Prompt Engineering - 9:43
Trick 1: Be Descriptive - 12:00
Trick 2: Give Examples - 13:31
Trick 3: Use Structured Text - 15:13
Trick 4: Chain of Thought - 17:00
Trick 5: Chatbot Personas - 18:31
Trick 6: Flipped Approach - 19:55
Trick 7: Reflect, Review, and Refine - 21:24
Example Code: Automatic Grader with LangChain - 22:39
Limitations - 28:19

Пікірлер: 46
@GBangalore
@GBangalore 4 ай бұрын
Great introduction. Thanks for putting this together.
@ShawhinTalebi
@ShawhinTalebi 3 ай бұрын
Glad it was helpful!
@sarahmestiri1855
@sarahmestiri1855 6 ай бұрын
Great series! Thanks
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Glad you enjoyed it!
@davesandberg
@davesandberg 3 ай бұрын
Thank you! Awesome content and excellent presentation. Sincerely appreciated 👍
@ShawhinTalebi
@ShawhinTalebi 3 ай бұрын
Glad you liked it!
@weiyeeong1212
@weiyeeong1212 6 ай бұрын
it's really resourceful! keep up the good work
@ShawhinTalebi
@ShawhinTalebi 6 ай бұрын
Thanks, glad it helped!
@helrod6131
@helrod6131 5 ай бұрын
Another excellent video!
@ShawhinTalebi
@ShawhinTalebi 5 ай бұрын
Thanks :)
@heavenleighbliss
@heavenleighbliss 7 ай бұрын
So many of your videos really resonate with my experience as a traditional data scientist exploring LLMs. Your "at first I thought prompt engineering was bunk" is definitely my journey as well. I find this to be super highly related to your previous video where you said potentially 95% of use cases can be covered by generalized pre-trained models or fine-tuned models. These models are truly so powerful that the secret sauce is in 1.) choosing the right pre-trained base model 2.) asking it the right questions in an efficient way. Thanks so much for all your work in putting together this content, I find it some of the best-explained LLM content on the interwebs
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Thanks for the kind words. I’m glad you’re enjoying the content. More to come!
@user-hv6is9gx6r
@user-hv6is9gx6r 20 күн бұрын
curious, could you please share, what's your reasoning when choosing the 'right' pre-trained base model?
@heavenleighbliss
@heavenleighbliss 19 күн бұрын
@@user-hv6is9gx6r like using a model pre trained for an appropriate purpose, general purpose models work for a lot, but if I were using a tool to write code, a code specialty model would be better
@user-hv6is9gx6r
@user-hv6is9gx6r 19 күн бұрын
@@heavenleighbliss thanks! that makes sense
@youssefkabir6664
@youssefkabir6664 2 ай бұрын
Thank you so much
@simbabuilds9338
@simbabuilds9338 7 ай бұрын
Your videos are great man; I hope your channel grows. Quick question: Langchain seems very integrated with OpenAI's API and software packages; have you tried using Langchain with an open-sourced free of charge LLM? Thanks! I am trying to build an LLM based app for a portfolio for PhD application in AI.
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
Thanks for the kind words, I'm glad you like the videos. While I've only used LangChain with OpenAI's API, it is has integrations with many other LLM providers. Here's more on how to use it with HF: python.langchain.com/docs/integrations/providers/huggingface
@DC-xt1ry
@DC-xt1ry Ай бұрын
It's a very nice series! By the way, it would be nice if you considered including examples of using Olama side by side with Chatgpt in your series. I rather use Ollama for testing than ChatGPT
@ShawhinTalebi
@ShawhinTalebi Ай бұрын
Thanks for the suggestion :)
@AsadShaikh-qc9ev
@AsadShaikh-qc9ev 2 ай бұрын
Great work my friend! Can there be a situation where after fine-tuning a model, you still have to do prompt engineering to get the desired output? In other words, can you fine tune a model where one-shot inference works all the time?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
While you can always do additional prompt engineering after fine-tuning, it may not be necessary based on the use case. With that being said, no system will ever be perfect. So it is hard to imagine a situation in which one-shot inference will work all the time.
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
📰 Read more: towardsdatascience.com/prompt-engineering-how-to-trick-ai-into-solving-your-problems-7ce1ed3b553f?sk=c92e4bb4b026bdc263f01a9310c8ec11 💻 Example code: github.com/ShawhinT/KZbin-Blog/tree/main/LLMs/langchain-example More Resources [1] arXiv:2302.11382 [cs.SE] [2] arXiv:2106.09685 [cs.CL] [3] State of GPT by Andrej Karpathy at Microsoft Build 2023 [4] arXiv:2206.07682 [cs.CL] [5] ChatGPT Prompt Engineering for Developers by deeplearning.ai [6] arXiv:2005.14165 [cs.CL] [7] arXiv:2201.11903 [cs.CL] [8] arXiv:2210.03493 [cs.CL]
@thisurawz
@thisurawz 3 ай бұрын
Can you do a video on finetuning a multimodal LLM (Video-LlaMA, LLaVA, or CLIP) with a custom multimodal dataset containing images and texts for relation extraction or a specific task? Can you do it using open-source multimodal LLM and multimodal datasets like video-llama or else so anyone can further their experiments with the help of your tutorial. Can you also talk about how we can boost the performance of the fine-tuned modal using prompt tuning in the same video?
@ShawhinTalebi
@ShawhinTalebi 3 ай бұрын
Thanks for the suggestion! Multi-modal models are an exciting next step for AI research. I added it to my list.
@CouchProgrammer
@CouchProgrammer 2 ай бұрын
If a programmer builds a working vocabulary and does language design, then prompt engineer as opposed does reverse "engineering" of an existing language in order to find a working vocabulary. The "Fake it till you make it" approach is not usually called science or engineering. So calling this profession “prompt writer” would be more appropriate.
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
That's a cool way to think about it. The name isn't great. I can see it being replaced or becoming obsolete.
@yankeephan87x
@yankeephan87x 4 ай бұрын
what do the ' \ ' represent in the prompts ? do they break up specific parts of text? Thanks!
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
Good question. Since the prompt goes over multiple lines, '\' prevents the newline character " " from appearing in the prompt string.
@kevinbowe
@kevinbowe Ай бұрын
Please explain WHY the correct answer is required in the prompt. I would expect the model to know what the correct answer is. PS: I have enjoyed your other vids and intend on sharing them to my dev friends. Cheers !
@ShawhinTalebi
@ShawhinTalebi Ай бұрын
Good question. The model does know the correct answer to this particular question. However, there may be questions where the model does not know the answer and providing it in the prompt is necessary.
@kevinbowe
@kevinbowe Ай бұрын
So the answer acts like a 'break-glass' test. -- Thanks. I like the way you present the subject. -- Keep up the good work. -- Cheers @@ShawhinTalebi
@RobertSpiller
@RobertSpiller 2 ай бұрын
I'm so new at this, but I have to ask...where or which ones are the previous 3?
@ShawhinTalebi
@ShawhinTalebi 2 ай бұрын
Here's the series playlist: kzbin.info/aero/PLz-ep5RbHosU2hnz5ejezwaYpdMutMVB0
@sherpya
@sherpya 4 ай бұрын
how can you avoid prompt escape / jailbreak in response?
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
That's an important (and technical) question. Here is a nice write up on prompt injection: llmtop10.com/llm01/
@ifycadeau
@ifycadeau 7 ай бұрын
0:58 😂😂😂
@ShawhinTalebi
@ShawhinTalebi 7 ай бұрын
😂😂 thanks
@jaa928
@jaa928 21 күн бұрын
Fine. I'll roll my eyes less. JK. Great insights on how to improve prompts.
@ShawhinTalebi
@ShawhinTalebi 15 күн бұрын
LOL!
@SetsunaKiryuKengan
@SetsunaKiryuKengan 4 ай бұрын
I was here for the Sound Effects
@ShawhinTalebi
@ShawhinTalebi 4 ай бұрын
I hope it was worth it 😂😂
@jeffg4686
@jeffg4686 Ай бұрын
@1:03 - they paid you for that didn't they?
@ShawhinTalebi
@ShawhinTalebi 29 күн бұрын
That'll be my next career if data science doesn't work out 😂
@ErikLandvall
@ErikLandvall 9 күн бұрын
there is something wrong with you...
@ShawhinTalebi
@ShawhinTalebi 8 күн бұрын
LOL what gave it away?
[1hr Talk] Intro to Large Language Models
59:48
Andrej Karpathy
Рет қаралды 1,8 МЛН
Fine-tuning Large Language Models (LLMs) | w/ Example Code
28:18
Shaw Talebi
Рет қаралды 213 М.
Что будет с кроссовком?
00:35
Аришнев
Рет қаралды 2,4 МЛН
Сын Расстроился Из-за Новой Стрижки Папы 😂
00:21
Глеб Рандалайнен
Рет қаралды 5 МЛН
0% Respect Moments 😥
00:27
LE FOOT EN VIDÉO
Рет қаралды 35 МЛН
Useful Gadget for Smart Parents 🌟
00:29
Meow-some! Reacts
Рет қаралды 8 МЛН
CHATGPT : Rédiger le PROMPT PARFAIT (Tuto Prompt Engineering)
30:59
Prompt Engineering Tutorial - Master ChatGPT and LLM Responses
41:36
freeCodeCamp.org
Рет қаралды 1,2 МЛН
This AI Skill Will Put You Ahead of 98% of People
30:19
David Ondrej
Рет қаралды 15 М.
AutoGen Studio: Build Self-Improving AI Agents With No-Code
27:06
The most important AI trends in 2024
9:35
IBM Technology
Рет қаралды 172 М.
10 AI Prompts That Will Make You a BETTER Writer
11:39
Brie Kirbyson
Рет қаралды 12 М.
Prompt Engineering Techniques (extended version)
52:38
Jonathan Yarkoni
Рет қаралды 9 М.
I Analyzed My Finance With Local LLMs
17:51
Thu Vu data analytics
Рет қаралды 360 М.
Что будет с кроссовком?
00:35
Аришнев
Рет қаралды 2,4 МЛН