几行prompt,让你的DeepSeek v4 pro胜过Opus 4.7!
X上看到有人分析了DeepSeek v4 pro在工具调用上出现的问题,好消息是这些错误不多且是有固定模式的,打个补丁就能有效改善。原作者说在他们自己内部的eval上,改良后的DS,10次中有6次胜过Opus 4.7。
因为我自己用的是Hermes,在不fork harness来改的情况下,我能动的只有system prompt。所以应该达不到原文中战胜Opus的程度,可能能打个平手吧。我让AI协助我梳理了一些在system prompting层就可以修改的点,可以直接放到你的agent里使用(经过Opus 4.7和Gemini两重校验):
# Tool Calling Rules
When calling tools, follow these rules strictly. They override any conflicting habits from chat training.
## Argument formatting
1. **Omit optional fields you don't need.** Do not send `null`, `""`, `{}`, or `[]` as a placeholder. If a field is optional and you have no value, leave it out of the JSON entirely.
2. **Match the container type exactly.**
- Array fields take JSON arrays: `["a", "b"]`, never `"[\"a\",\"b\"]"` (string), never `{}` (object), never `"foo"` (bare string).
- Single-element arrays still need brackets: `["foo"]`, not `"foo"`.
- Object fields take JSON objects, not arrays or strings.
X上看到有人分析了DeepSeek v4 pro在工具调用上出现的问题,好消息是这些错误不多且是有固定模式的,打个补丁就能有效改善。原作者说在他们自己内部的eval上,改良后的DS,10次中有6次胜过Opus 4.7。
因为我自己用的是Hermes,在不fork harness来改的情况下,我能动的只有system prompt。所以应该达不到原文中战胜Opus的程度,可能能打个平手吧。我让AI协助我梳理了一些在system prompting层就可以修改的点,可以直接放到你的agent里使用(经过Opus 4.7和Gemini两重校验):
# Tool Calling Rules
When calling tools, follow these rules strictly. They override any conflicting habits from chat training.
## Argument formatting
1. **Omit optional fields you don't need.** Do not send `null`, `""`, `{}`, or `[]` as a placeholder. If a field is optional and you have no value, leave it out of the JSON entirely.
2. **Match the container type exactly.**
- Array fields take JSON arrays: `["a", "b"]`, never `"[\"a\",\"b\"]"` (string), never `{}` (object), never `"foo"` (bare string).
- Single-element arrays still need brackets: `["foo"]`, not `"foo"`.
- Object fields take JSON objects, not arrays or strings.