知识卡片
确定性可解时不要用 LLM
第一次接触 LLM 的人容易把所有问题都交给它:本该写 if 判断的地方写成提示词,本该用字符串展开的地方让模型去解释缩写。这类做法的共同特征是——明明存在能给出完美准确率的确定性实现。
判断标准可以压缩成一句经验法则:如果你能用确定性软件解决这个问题,就用确定性软件。这样既避开了 AI 应用的全部麻烦(评估、幻觉、成本、延迟),又通常得到更好、更安全、更便宜的软件。
它的另一面是成本意识:把确定性任务交给模型,等于用不确定的、按 token 付费的推理去替代一段可验证的代码,收益为负。真正需要模型的是那些无法用固定规则表达的判断——输入是非结构化的、路径需要在运行时决定、或者输出空间本身是开放的。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- AI Applications and Their Lifecycle · 查看原书依据
As a simple rule of thumb, if you can write deterministic software to solve the problem, do it. This avoids all the challenges of AI applications and often leads to better, safer, and cheaper software.
参考来源
- 位置:《Building AI Agent Platforms》第01章《AI Applications and Their Lifecycle》(源文件:extracted/Building AI Agent Platforms/_epub-src/OEBPS/ch01.html,来源项目 book-source)
- 结论依据:原文举"用提示词替代 if 语句""用模型展开缩写"两个误用,并给出"能写确定性软件就写"的经验法则及其收益。
- 原始内容:As a simple rule of thumb, if you can write deterministic software to solve the problem, do it. This avoids all the challenges of AI applications and often leads to better, safer, and cheaper software.