你让模型写 “10 条降噪耳机的营销 slogan”。它写了 3 条好的,然后 “and here are some more ideas: catchy, focused, premium.” 就停了。或者它老老实实写够 10 行——但 7-10 条是 1-3 条的同义改写。或者它写到 10 条后又开始写 11 条,因为不知道在哪停。这是最可预测的 LLM 失败模式之一——list-N 任务没有 scaffold,模型中途”想不出新的”,然后要么诚实截断、要么注水、要么过头。
修复不是”再多给几个 example”,而是把 prompt 重新设计成 10 个独立生成步骤,每一步带自己的约束。
常见原因
1. 合理答案的空间比 N 小
你问 “10 unique benefits of drinking water”。真正不同的好处可能就 5 个。第 6-10 条只能是改写或灌水。不是模型的锅。
怎么判断:在看模型回答前先自问,“如果让我自己写,能想到 10 条真正不同的吗?“想不到就是 prompt 要太多。
2. 没有 diversity 约束
“List 10 startup ideas.”模型会扑向高概率答案(AI for X、marketplace for Y),很快重复。没有 “diverse across industries” 或 “each from a different sector”,items 会收敛。
怎么判断:看模型给的 10 条,7 条是 SaaS 或 marketplace——你没约束 diversity。
3. 模型撞到了软长度预算
即使 max_tokens=4000,模型也有自己的 “答完了” 启发,通常 400-600 token 左右就开始收尾,不管你问的 N 有多大。
怎么判断:数 response 的 tokens。不管 N 多少,输出长度都差不多就是软预算。
4. 没有 item 模板——质量在飘
“List 10 product ideas” 没结构:模型前 3 个写得详细,4-10 草草一句。没有 per-item 模板,深度就漂。
怎么判断:1-3 各 3 段;4-10 每个一句话。
5. items 太相似——模型自我去重
写完 “1. Bluetooth connectivity” 后,模型不太愿意再写另一个无线相关的——它 pattern-match 成 “我已经覆盖过 wireless 了”。没明确允许相似,list 就塌缩。
怎么判断:7-10 条的语义跳跃明显比 1-3 大——它在硬撑”不重复”。
6. stop sequence 提前触发
API 调用里设了 "\n\n" 或 "###" 这种 stop。模型在 items 之间输出了一个,API 就截断。
怎么判断:输出在 list 中间断掉。看 API response 里的 finish_reason——stop 意味着 stop sequence 触发了,不是自然结束。
7. 长 context 里的 list 请求被忽视
8000 tokens 的 context,你的 “give me 10 ideas” 只是最后 20 个 token。模型对埋在长 context 里的短指令系统性低关注。
怎么判断:prompt 单独跑没问题;在你的真实 pipeline 里 under-deliver。
最短修复路径
第 1 步:检查 N 是否现实
自己列不出 10 条就改要 5 条。封在现实数量。
第 2 步:加 diversity 维度
别只说 “10 different”,指定 axis:
List 10 startup ideas. Each idea must be in a DIFFERENT industry
(no two from the same sector). Span at least 8 of: healthcare,
education, fintech, climate, logistics, agriculture, retail,
entertainment, dev tools, B2B services.
模型现在有 10 个明确的槽要填。
第 3 步:给 per-item 模板
List 10 marketing taglines. For each tagline:
[N]. **<tagline>** (max 8 words)
— Angle: <pain point | aspiration | wit | technical>
— Target: <persona>
模板化的 item 强制全 list 深度一致。
第 4 步:预先把序号摆出来
Fill in items 1 through 10 below. Do not skip numbers. Do not stop early.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
意外地有效——模型把它当 “填空” 任务而不是自由生成。
第 5 步:N 大时分批生成
N >= 20 就拆:
all_items = []
for batch_start in range(0, 50, 10):
items = call_llm(f"""
Generate items {batch_start+1} through {batch_start+10} of a list of 50.
Already covered: {all_items}
Generate 10 NEW items not in the covered list.
""")
all_items.extend(items)
第 6 步:校验数量、补缺口
items = parse_list(output)
if len(items) < N:
extra = call_llm(f"You previously gave {len(items)} items. Give {N - len(items)} MORE distinct items, none from this list: {items}")
items.extend(parse_list(extra))
第 7 步:拉高 max_tokens、删掉激进 stop sequence
短 item 设 N * 80,详细 item 设 N * 200。生成 list 时把 "\n\n" 从 stop sequences 拿掉。
哪些情况可能不是你操作错了
有些任务确实没 N 个好答案。逼模型造 7-10 条比诚实给 6 条说 “more would be fluff” 更差。看下游代码能不能接受变长 list——能就放它一马。
容易误判的情况
当成 max_tokens 问题。有时是,但更多时候模型在到 token cap 前就自己收尾了,因为它没新想法了。先看 finish_reason 和 token 数再调 max_tokens。
预防建议
- 只问主题能合理支撑的 N。
- 永远带 diversity axis(industry / persona / format / angle)。
- 用 per-item 模板保证深度一致。
- 定长 list 预先编号占位。
- 校验数量、按缺口重试,别信第一次回答。
- N 大就分批、把已覆盖项传进去。
FAQ
- 能不能直接说 “as many as you can think of”? N 会变得不可预测。下游在乎数量就明确写 N 并校验。
- 加 “high quality” 或 “creative” 有用吗? 边际作用。diversity axis 和 per-item 模板更有效。
相关阅读
- 没指定输出格式
- 一个 prompt 塞太多任务
- AI 回答太空泛
- 没给例子导致输出漂移
- Prompt 范围太宽
- 没定义成功标准
- 模型自己补足缺失细节
- 评估标准含糊
- 输出很漂亮但没法执行
- AI 给列表不给执行
标签: #Prompt 工程 #排查 #llm-output #list-output #structured-output