DSPy: Transforming Language Model Calls into Smart Pipelines // Omar Khattab // #194 episode artwork

EPISODE · Dec 5, 2023 · 1H 5M

DSPy: Transforming Language Model Calls into Smart Pipelines // Omar Khattab // #194

from MLOps.community · host Demetrios

MLOps podcast #194 with Omar Khattab, PhD Candidate at Stanford, DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines.// AbstractThe ML community is rapidly exploring techniques for prompting language models (LMs) and for stacking them into pipelines that solve complex tasks. Unfortunately, existing LM pipelines are typically implemented using hard-coded "prompt templates", i.e., lengthy strings discovered via trial and error. Toward a more systematic approach for developing and optimizing LM pipelines, we introduce DSPy, a programming model that abstracts LM pipelines as text transformation graphs, i.e., imperative computational graphs where LMs are invoked through declarative modules. DSPy modules are parameterized, meaning they can learn (by creating and collecting demonstrations) how to apply compositions of prompting, finetuning, augmentation, and reasoning techniques. We design a compiler that will optimize any DSPy pipeline to maximize a given metric. We conduct two case studies, showing that succinct DSPy programs can express and optimize sophisticated LM pipelines that reason about math word problems, tackle multi-hop retrieval, answer complex questions, and control agent loops. Within minutes of compiling, a few lines of DSPy allow GPT-3.5 and llama2-13b-chat to self-bootstrap pipelines that outperform standard few-shot prompting and pipelines with expert-created demonstrations. On top of that, DSPy programs compiled to open and relatively small LMs like 770M-parameter T5 and llama2-13b-chat are competitive with approaches that rely on expert-written prompt chains for proprietary GPT-3.5. DSPy is available as open source at https://github.com/stanfordnlp/dspy // BioOmar Khattab is a PhD candidate at Stanford and an Apple PhD Scholar in AI/ML. He builds retrieval models as well as retrieval-based NLP systems, which can leverage large text collections to craft knowledgeable responses efficiently and transparently. Omar is the author of the ColBERT retrieval model, which has been central to the development of the field of neural retrieval, and author of several of its derivative NLP systems like ColBERT-QA and Baleen. His recent work includes the DSPy framework for solving advanced tasks with language models (LMs) and retrieval models (RMs).// MLOps Jobs board jobs.mlops.community// MLOps Swag/Merchhttps://mlops-community.myshopify.com/// Related LinksWebsite: https://omarkhattab.com/DSPy https://github.com/stanfordnlp/dspy ⁠--------------- ✌️Connect With Us ✌️ -------------Join our Slack community: https://go.mlops.community/slackFollow us on Twitter: @mlopscommunitySign up for the next meetup: https://go.mlops.community/registerCatch all episodes, blogs, newsletters, and more: https://mlops.community/Connect with Demetrios on LinkedIn: https://www.linkedin.com/in/dpbrinkm/Connect with Omar on Twitter: https://twitter.com/lateinteractionTimestamps:[00:00] Omar's preferred coffee[00:26] Takeaways[06:40] Weight & Biases Ad[09:00] Omar's tech background[13:35] Evolution of RAG[16:33] Complex retrievals[21:32] Vector Encoding for Databases[23:50] BERT vs New Models[28:00] Resilient Pipelines: Design Principles[33:37] MLOps Workflow Challenges [36:15] Guiding LLMs for Tasks[37:40] Large Language Models: Usage and Costs[41:32] DSPy Breakdown[51:05] AI Compliance Roundtable[55:40] Fine-Tuning Frustrations and Solutions[57:27] Fine-Tuning Challenges in ML[1:00:55] Versatile GPT-3 in Agents[1:03:53] AI Focus: DSP and Retrieval[1:04:55] Commercialization plans[1:05:27] Wrap up

MLOps podcast #194 with Omar Khattab, PhD Candidate at Stanford, DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines.// AbstractThe ML community is rapidly exploring techniques for prompting language models (LMs) and for stacking them into pipelines that solve complex tasks. Unfortunately, existing LM pipelines are typically implemented using hard-coded "prompt templates", i.e., lengthy strings discovered via trial and error. Toward a more systematic approach for developing and optimizing LM pipelines, we introduce DSPy, a programming model that abstracts LM pipelines as text transformation graphs, i.e., imperative computational graphs where LMs are invoked through declarative modules. DSPy modules are parameterized, meaning they can learn (by creating and collecting demonstrations) how to apply compositions of prompting, finetuning, augmentation, and reasoning techniques. We design a compiler that will optimize any DSPy pipeline to maximize a given metric. We conduct two case studies, showing that succinct DSPy programs can express and optimize sophisticated LM pipelines that reason about math word problems, tackle multi-hop retrieval, answer complex questions, and control agent loops. Within minutes of compiling, a few lines of DSPy allow GPT-3.5 and llama2-13b-chat to self-bootstrap pipelines that outperform standard few-shot prompting and pipelines with expert-created demonstrations. On top of that, DSPy programs compiled to open and relatively small LMs like 770M-parameter T5 and llama2-13b-chat are competitive with approaches that rely on expert-written prompt chains for proprietary GPT-3.5. DSPy is available as open source at https://github.com/stanfordnlp/dspy // BioOmar Khattab is a PhD candidate at Stanford and an Apple PhD Scholar in AI/ML. He builds retrieval models as well as retrieval-based NLP systems, which can leverage large text collections to craft knowledgeable responses efficiently and transparently. Omar is the author of the ColBERT retrieval model, which has been central to the development of the field of neural retrieval, and author of several of its derivative NLP systems like ColBERT-QA and Baleen. His recent work includes the DSPy framework for solving advanced tasks with language models (LMs) and retrieval models (RMs).// MLOps Jobs board jobs.mlops.community// MLOps Swag/Merchhttps://mlops-community.myshopify.com/// Related LinksWebsite: https://omarkhattab.com/DSPy https://github.com/stanfordnlp/dspy ⁠--------------- ✌️Connect With Us ✌️ -------------Join our Slack community: https://go.mlops.community/slackFollow us on Twitter: @mlopscommunitySign up for the next meetup: https://go.mlops.community/registerCatch all episodes, blogs, newsletters, and more: https://mlops.community/Connect with Demetrios on LinkedIn: https://www.linkedin.com/in/dpbrinkm/Connect with Omar on Twitter: https://twitter.com/lateinteractionTimestamps:[00:00] Omar's preferred coffee[00:26] Takeaways[06:40] Weight & Biases Ad[09:00] Omar's tech background[13:35] Evolution of RAG[16:33] Complex retrievals[21:32] Vector Encoding for Databases[23:50] BERT vs New Models[28:00] Resilient Pipelines: Design Principles[33:37] MLOps Workflow Challenges [36:15] Guiding LLMs for Tasks[37:40] Large Language Models: Usage and Costs[41:32] DSPy Breakdown[51:05] AI Compliance Roundtable[55:40] Fine-Tuning Frustrations and Solutions[57:27] Fine-Tuning Challenges in ML[1:00:55] Versatile GPT-3 in Agents[1:03:53] AI Focus: DSP and Retrieval[1:04:55] Commercialization plans[1:05:27] Wrap up

NOW PLAYING

DSPy: Transforming Language Model Calls into Smart Pipelines // Omar Khattab // #194

0:00 1:05:39

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

She’s a Hazard to Herself She’s a Hazard Hi there, I’m Mallory, and I’d like to invite you into our world with “She’s a Hazard to Herself!” Join us as we navigate life with Multiple Sclerosis from the seat of my power wheelchair. Discover stories of resilience, family, and the community we’ve built around chronic illness. Whether you’re impacted by MS or want to learn from our journey, there’s something here for you. So why wait? Subscribe to “She’s a Hazard to Herself” on your favorite podcast app and be part of our journey today. Let’s lift each other up, one episode at a time! Tips, News and Stories for Older Adults Esther C Kane CAPS, C.D.S. "Tips, News, and Stories for Older Adults" delivers weekly insights tailored for seniors. We bring you summaries of curated news, practical advice, and inspiring stories that matter to the 55+ community. From health and finance to technology and lifestyle, our content keeps you informed and engaged. Sourced from trusted outlets, each episode offers valuable information for navigating your golden years. Join us as we explore aging with positivity, wisdom, and engaging stories. Your perfect companion for staying active, learning, and embracing life's later chapters. Prayer Time Heir Waves Prayer Time A podcast especially for our Prayer Time community NEWMORROW SESSIONS - A PodCast Series on the Future of Hospitality Mario C. Bauer, Florian Schneider, Axel Weber & Dr. Tillman Bardt The Newmorrow PodCast is more than a podcast — it's a platform for open dialog on the future of our business, a platform for those building what doesn’t exist yet. Here, we share and embrace our passion for the hospitality industry, but we won’t romanticize the journey. We ask the tough questions, confront uncomfortable truths, and prepare for a future that resists easy answers. We believe that the tougher and wilder times become, the more openly, honestly and humanely people need to talk to each other and act together. We believe, openness, togetherness, and truthfulness should also be cornerstones of a professional community to develop our utopian idea of „open source“. This is a space where visionaries don’t just imagine the future — they wrestle with the paradoxes that shape it: success vs. happiness, data vs. instinct, stability vs. reinvention. Join leaders, entrepreneurs, and thinkers as they share not what made them — but what’s actively shaping them, now and next. So tune in

Frequently Asked Questions

How long is this episode of MLOps.community?

This episode is 1 hour and 5 minutes long.

When was this MLOps.community episode published?

This episode was published on December 5, 2023.

What is this episode about?

MLOps podcast #194 with Omar Khattab, PhD Candidate at Stanford, DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines.// AbstractThe ML community is rapidly exploring techniques for prompting language models (LMs) and for...

Can I download this MLOps.community episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!