Summary / 摘要
EN: A survey of prompt engineering for autoregressive LLMs — methods for steering model behavior without updating weights. It covers zero-shot and few-shot prompting (with example selection/ordering tips and the biases that make few-shot performance high-variance), instruction prompting, self-consistency sampling, chain-of-thought and its extensions (STaR, complexity-based consistency, Self-Ask, ReAct, Tree of Thoughts), automatic prompt design (AutoPrompt, APE, augment-prune-select), and augmented language models that retrieve knowledge, generate code (PAL/PoT), or call external APIs (TALM, Toolformer). The core theme: prompt engineering is an empirical science of alignment and steerability, and its effects vary heavily across models.
ZH: 本文是对自回归 LLM 提示工程的综述——即在不更新权重的情况下引导模型行为的方法。内容涵盖零样本与少样本提示(含示例选择/排序技巧及导致少样本性能高方差的偏差)、指令提示、自洽性采样、思维链及其扩展(STaR、基于复杂度的一致性、Self-Ask、ReAct、思维树)、自动提示设计(AutoPrompt、APE、augment-prune-select),以及检索知识、生成代码(PAL/PoT)或调用外部 API(TALM、Toolformer)的增强语言模型。核心主题:提示工程是一门关于对齐与可引导性的经验科学,其效果在不同模型间差异很大。
Key Takeaways / 核心要点
-
EN: Few-shot example choice, format, and order can swing performance from near-random guess to near-SoTA, driven by majority-label, recency, and common-token biases. ZH: 少样本示例的选择、格式与顺序可使性能从接近随机猜测波动到接近 SoTA,背后是多数标签偏差、近因偏差和常见 token 偏差。
-
EN: Chain-of-thought prompting yields large gains only on complex reasoning tasks with large models (e.g. >50B parameters); simple tasks benefit only slightly. ZH: 思维链提示仅在大模型(如超过 500 亿参数)的复杂推理任务上带来显著收益;简单任务受益甚微。
-
EN: Self-consistency sampling — sampling multiple reasoning paths and taking a majority vote — improves accuracy, and verifiable tasks can be checked directly (e.g. unit tests). ZH: 自洽性采样——采样多条推理路径并多数投票——可提高准确率,可验证任务还能直接检验(如单元测试)。
-
EN: Explanations in prompts are more often nonfactual than inconsistent, and nonfactual explanations most likely lead to incorrect predictions. ZH: 提示中的解释更多是不符合事实而非前后不一致,而不符合事实的解释最可能导致错误预测。
-
EN: Prompts can be optimized automatically: APE searches model-generated instruction candidates scored on training data, then refines the best via iterative Monte Carlo search. ZH: 提示可以自动优化:APE 在模型生成的指令候选中搜索、按训练数据打分,再用迭代蒙特卡洛搜索精炼最优候选。
-
EN: Toolformer learns tool use self-supervised: a candidate API call is kept only if adding its result reduces the loss on predicting future tokens. ZH: Toolformer 以自监督方式学习工具使用:仅当加入 API 调用结果能降低未来 token 预测损失时才保留该调用。
-
EN: Retrieval augments post-cutoff knowledge, but performance on post-cutoff questions remains worse than pre-cutoff ones, suggesting conflict between contextual and parametric knowledge. ZH: 检索可补充截止日期后的知识,但模型在截止日期后问题上的表现仍更差,表明上下文知识与参数知识存在冲突。
Extracted Notes / 提取笔记
- Few-shot prompt performance swings wildly with example choice and order
- Chain-of-thought pays off only for complex reasoning in large models
- Self-consistency sampling improves reliability through majority vote
- Automatic prompt engineering treats instructions as programs
- Prompt explanations fail by being nonfactual rather than inconsistent
- Keep a tool call only when it improves prediction of future tokens