Files
myWiki/concepts/prompt-engineering.md

47 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Prompt Engineering提示词工程"
created: 2026-06-29
updated: 2026-06-29
type: concept
tags: [prompt-engineering, LLM, methodology]
sources: [[prompt-to-loop-engineering-2026]]
confidence: high
---
# Prompt Engineering
> AI 开发范式四次浪潮的第一阶段20222024核心问题是"如何跟 AI 沟通"。
## 经典方法论
- **Zero-shot / Few-shot**:不给或给少量示例
- **Instruction Prompting**:结构化指令引导
- **Chain-of-Thought / Tree-of-Thought**:多步推理提示策略
- **APEAutomatic Prompt Engineering**:自动搜索最优 Prompt
## Prompt Engineering ≠ Blind Prompting
正确的 Prompt Engineering 是一套包含"定义问题 → demonstration set → 候选 prompt → 实测准确率 → 成本/精度权衡 → 持续迭代"的工程方法论。[[blind-prompting|盲提示Blind Prompting]] 则是纯 trial-and-error、缺乏测试的反模式。
## 声明式框架DSPy
[[dspy|DSPyDeclarative Self-improving Python]] 将 Prompt 从"人工手写"变为"可编译、可学习的程序":开发者声明输入输出签名,优化器自动搜索最优 Prompt + Few-shot 组合。底座模型切换时一键重新编译。
## 瓶颈
1. 上下文窗口限制,无法承载海量上下文
2. 缺乏记忆与工具调用,无法多步执行
3. 容错率极低,需不断人工介入
4. 技术债务:应用规模稍大就需维护成百上千条模板,模型升级时集体失效
## 嵌套定位
Prompt ⊂ [[context-engineering|Context]] ⊂ [[harness-engineering|Harness]] ⊂ [[loop-engineering|Loop]]
## 相关概念
- [[blind-prompting|盲提示]]
- [[dspy|DSPy]]
- [[prompt-engineering-vs-fine-tuning|Prompt Engineering vs Fine-tuning]]
- [[prompt-to-harness-evolution|三阶段工程演进]]