跳到正文
Simon Willison 博客·· 1 小时前AI 评分69

提示 Claude Fable 5.2:声明代码归属影响重构行为

Quoting Prompting Claude Fable 5.2

AI 导读

Simon Willison 转引 Anthropic 文档:Claude Fable 5.2 对提示词中代码归属表述很敏感,提示不提及归属或把代码库说成别人的,模型倾向沿用现有结构、即使代码重复。文档建议写明 This codebase is yours,小任务测试中加这句话后模型约一半尝试会合并重复代码,不加则不足十分之一。

正文 · 原文

Claude Fable 5.2 responds closely to what the prompt says about who owns the code it works on. In Anthropic’s testing on small coding tasks, when a prompt said nothing about ownership or presented the code base as someone else’s, the model tended to add to the existing structure, even when that repeated existing code. [...]

If you want the model to improve the structure as it works, say that the code is its own:

This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it.

In Anthropic’s testing on small coding tasks, the model merged repeated code in about half of the tries with this sentence, and in under a tenth of the tries without it.

— Prompting Claude Fable 5.2, Anthropic documentation

Tags: prompt-engineering, anthropic, generative-ai, ai, llms, claude-mythos-fable

来源:Simon Willison 博客 · simonwillison.net