专栏名称: 待字闺中
深度分析大数据、深度学习、人工智能等技术,切中实际应用场景,为大家授业解惑。间或,也会介绍国内外相关领域有趣的面试题。
目录
相关文章推荐
51CTO官微  ·  端午假期即将到来,让我看看是谁还没下班 ·  3 天前  
阿里技术  ·  MCP ... ·  3 天前  
51好读  ›  专栏  ›  待字闺中

吴恩达教你提示词的高级心法

待字闺中  · 公众号  · 程序员  · 2025-04-20 11:00

正文

请到「今天看啥」查看全文


直到我阅读到吴恩达老师最近的推文(见后面的正文),真的有共鸣,而且名字起的非常好。Lazy Prompting——懒提示。程序员们都知道懒加载,就是直到明确要用了才加载。

提示词也是,直到真的要用了再写。

正文

Contrary to standard prompting advice that you should give LLMs the context they need to succeed, I find it's sometimes faster to be lazy and dash off a quick, imprecise prompt and see what happens. The key to whether this is a good idea is whether you can quickly assess the output quality, so you can decide whether to provide more context. In this post, I'd like to share when and how I use "lazy prompting."
与标准提示建议相反,标准建议是应该给大语言模型(LLMs)提供成功所需的上下文,但我发现有时候偷懒一下,快速写一个不太精确的提示,看看会发生什么,这样做更快。这种做法是否合适的关键在于你能否快速评估输出质量,从而决定是否需要提供更多上下文。在这篇文章中,我想分享我何时以及如何使用"懒提示"。

When debugging code, many developers copy-paste error messages — sometimes pages of them — into an LLM without further instructions. Most LLMs are smart enough to figure out that you want them to help understand and propose fixes, so you don't need to explicitly tell them. With brief instructions like "Edit this: …" or "sample dotenv code" (to remind you how to write code to use Python's dotenv package), an LLM will often generate a good response. Further, if the response is flawed, hopefully you can spot any problems and refine the prompt, for example to steer how the LLM edits your text.
在调试代码时,许多开发人员会将错误信息——有时是好几页——复制粘贴到LLM中,而不提供进一步的指示。大多数LLM都足够聪明,能够理解你想要它们帮助理解并提出修复方案,所以你不需要明确告诉它们。使用简短的指令,如"编辑这个:..."或"sample dotenv code"(提醒你如何编写使用Python's dotenv包的代码),LLM通常会生成良好的响应。此外,如果响应有缺陷,希望你能发现任何问题并完善提示,例如引导LLM如何编辑你的文本。







请到「今天看啥」查看全文