
{"id":4301,"date":"2025-01-19T01:50:32","date_gmt":"2025-01-18T17:50:32","guid":{"rendered":"https:\/\/infernews.com\/?p=4301"},"modified":"2025-01-19T01:50:33","modified_gmt":"2025-01-18T17:50:33","slug":"dspy-%e7%b7%a8%e7%a8%8b%e8%aa%9e%e8%a8%80%e6%a8%a1%e5%9e%8b%e6%a1%86%e6%9e%b6","status":"publish","type":"post","link":"https:\/\/infernews.com\/blog\/dspy-%e7%b7%a8%e7%a8%8b%e8%aa%9e%e8%a8%80%e6%a8%a1%e5%9e%8b%e6%a1%86%e6%9e%b6\/","title":{"rendered":"DSPy \u7de8\u7a0b\u8a9e\u8a00\u6a21\u578b\u6846\u67b6"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/stanfordnlp\/dspy\" target=\"_blank\" rel=\"noreferrer noopener\">DSPy<\/a>\uff0c\u4e00\u500b\u7528\u65bc\u7de8\u7a0b\u800c\u975e\u7528 Prompt \u7684\u5927\u578b\u8a9e\u8a00\u6a21\u578b (LLM) \u6846\u67b6\u3002DSPy \u8b93\u4f7f\u7528\u8005\u80fd\u4ee5\u6a21\u7d44\u5316\u65b9\u5f0f\u5feb\u901f\u5efa\u69cb AI \u7cfb\u7d71\uff0c\u4e26\u63d0\u4f9b\u6f14\u7b97\u6cd5\u4f86\u512a\u5316\u63d0\u793a\u548c\u6b0a\u91cd\u3002\u5b83\u8457\u91cd\u65bc\u4f7f\u7528\u00a0Python \u7a0b\u5f0f\u78bc\u4f86\u53d6\u4ee3\u63d0\u793a\u8a5e(Prompt)\uff0c\u8b93 LLM \u7522\u751f\u9ad8\u54c1\u8cea\u7684\u8f38\u51fa\u3002\u5176\u76ee\u6a19\u662f\u63d0\u4f9b\u4e00\u500b\u5f37\u5927\u4e14\u6613\u7528\u7684 LLM \u7a0b\u5f0f\u8a2d\u8a08\u6846\u67b6\u3002\u00a0<\/p>\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"lyte-wrapper\" title=\"Stop Prompt Engineering! Program Your LLMs with DSPy\" style=\"width:853px;max-width:100%;margin:5px auto;\"><div class=\"lyMe\" id=\"WYL_Zv4LjO8teqE\" itemprop=\"video\" itemscope itemtype=\"https:\/\/schema.org\/VideoObject\"><div><meta itemprop=\"thumbnailUrl\" content=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZv4LjO8teqE%2Fhqdefault.jpg\" \/><meta itemprop=\"embedURL\" content=\"https:\/\/www.youtube.com\/embed\/Zv4LjO8teqE\" \/><meta itemprop=\"duration\" content=\"PT53M24S\" \/><meta itemprop=\"uploadDate\" content=\"2025-01-17T13:00:51Z\" \/><\/div><div id=\"lyte_Zv4LjO8teqE\" data-src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZv4LjO8teqE%2Fhqdefault.jpg\" class=\"pL\"><div class=\"tC\"><div class=\"tT\" itemprop=\"name\">Stop Prompt Engineering! Program Your LLMs with DSPy<\/div><\/div><div class=\"play\"><\/div><div class=\"ctrl\"><div class=\"Lctrl\"><\/div><div class=\"Rctrl\"><\/div><\/div><\/div><noscript><a href=\"https:\/\/youtu.be\/Zv4LjO8teqE\" rel=\"nofollow\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/infernews.com\/blog\/wp-content\/plugins\/wp-youtube-lyte\/lyteCache.php?origThumbUrl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZv4LjO8teqE%2F0.jpg\" alt=\"Stop Prompt Engineering! Program Your LLMs with DSPy\" width=\"853\" height=\"460\" \/><br \/>Watch this video on YouTube<\/a><\/noscript><meta itemprop=\"description\" content=\"Can algorithmically optimizing prompts outperform prompt engineering? Resources: DSPy Breakdown: https:\/\/github.com\/ALucek\/dspy-breakdown\/blob\/main\/dspy_breakdown.ipynb DSPy Documentation: https:\/\/dspy.ai\/ DSPy Repo: https:\/\/github.com\/stanfordnlp\/dspy Chapters: 00:00 - What is DSPy? 02:51 - Setup 04:12 - Signatures Overview 10:41 - Modules Overview 12:01 - Modules: Chain of Thought 13:04 - Modules: Program of Thought 14:53 - Modules: ReAct 17:47 - Modules: Others 19:22 - Why We Need Metrics 20:49 - Metrics: Example Data Type &amp; Overview 23:07 - Metrics: Simple 24:46 - Metrics: Intermediate 27:21 - Metrics: Advanced 30:01 - Optimizers Overview 33:20 - Optimizer: Labeled Few Shot 34:45 - Optimizer: Bootstrap Few Shot 36:48 - Optimizer: Bootstrap Few Shot With Random Search 38:49 - Optimizer: KNN Fewshot 40:07 - Optimizer: COPRO 43:01 - Optimizer: MIPROv2 45:28 - Fine Tuning Based Optimizers 46:10 - Optimizer: Bootstrap Fine Tune 49:06 - Choosing Optimizers 50:05 - Optimizing Optimizers 51:17 - Is DSPy Worth it? #ai #DSPy #datascience\"><\/div><\/div><div class=\"lL\" style=\"max-width:100%;width:853px;margin:5px auto;\"><\/div><figcaption><\/figcaption><\/figure>","protected":false},"excerpt":{"rendered":"<p>DSPy\uff0c\u4e00\u500b\u7528\u65bc\u7de8\u7a0b\u800c\u975e\u7528 Prompt \u7684\u5927\u578b\u8a9e\u8a00\u6a21\u578b (LLM) \u6846\u67b6\u3002DSPy \u8b93\u4f7f\u7528\u8005\u80fd\u4ee5\u6a21\u7d44\u5316\u65b9\u5f0f\u5feb\u901f\u5efa\u69cb AI \u7cfb\u7d71\uff0c\u4e26\u63d0\u4f9b\u6f14\u7b97\u6cd5\u4f86\u512a\u5316\u63d0\u793a\u548c\u6b0a\u91cd\u3002\u5b83\u8457\u91cd\u65bc\u4f7f\u7528\u00a0Python \u7a0b\u5f0f\u78bc\u4f86\u53d6\u4ee3\u63d0\u793a\u8a5e(Prompt)\uff0c\u8b93 LLM \u7522\u751f\u9ad8\u54c1\u8cea\u7684\u8f38\u51fa\u3002\u5176\u76ee\u6a19\u662f\u63d0\u4f9b\u4e00\u500b\u5f37\u5927\u4e14\u6613\u7528\u7684 LLM \u7a0b\u5f0f\u8a2d\u8a08\u6846\u67b6\u3002\u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowvqSiDA:productID":"","footnotes":""},"categories":[27,146],"tags":[],"class_list":["post-4301","post","type-post","status-publish","format-standard","hentry","category-paper","category-146"],"_links":{"self":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/4301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/comments?post=4301"}],"version-history":[{"count":0,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/posts\/4301\/revisions"}],"wp:attachment":[{"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/media?parent=4301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/categories?post=4301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infernews.com\/blog\/wp-json\/wp\/v2\/tags?post=4301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}