-
Notifications
You must be signed in to change notification settings - Fork 33
Add Visualize the Target pattern #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Visualize the Target pattern #19
Conversation
- New pattern focusing on avoiding negation in AI prompts - Explains why positive framing is more effective than negative - Includes examples for code generation and image generation - Solves selective-hearing and compliance-bias obstacles Co-authored-by: openhands <openhands@all-hands.dev>
- Remove compliance-bias relationship - Add limited-context-window and limited-focus relationships - Keep selective-hearing relationship Co-authored-by: openhands <openhands@all-hands.dev>
|
Hey @lexler happy to listen to your feedback! |
|
Hey @juanmichelini, thanks for putting this together! Sorry this took a while - this one gave me pause. The elephant example makes sense - there's research showing that when you tell a model "do not mention X" (a specific word), it can become more likely to say X. To suppress something, you first activate it. There's actually research on this and I think it's really interesting:
But I don't think your coding examples show the same thing. "Don't say Paris" fails because Paris appearing IS the failure - the word showing up is exactly what you didn't want. "Don't use global variables" is different. Thinking about global variables doesn't hurt (a little distraction, sure). The failure would be code structure - the model choosing to use globals. That's a design decision, not word suppression. Same with "don't create security vulnerabilities" - having that in context might actually help the model be aware of what to keep in mind. The failure isn't the words appearing, it's the code being insecure. There seems to be a jump between lexical suppression failures and architectural / design guidance - and the evidence only really supports the first. The White Bear paper actually says this:
The positive framing advice is reasonable - Anthropic, OpenAI, and Google all recommend it. But they also use negative instructions in their own examples almost in the same breath ("Avoid using bold and italics"), so even they don't follow it consistently. I haven't seen strong evidence for WHY it works - it might just be that positive instructions are more specific ("hash with bcrypt" gives direction, "don't store in plain text" requires inference), or it's part of general degradation under load where everything gets harder to follow. Honestly, the bigger issue I see in practice isn't negation - it's people not being selective about what goes into their context. They keep adding global rules indefinitely and end up with a distracted agent that can't focus on any of them. A couple of directions we could take this:
I'd lean toward the obstacle option myself. What do you think? If you go with keeping it as a pattern - "Visualize" in the name feels a bit misleading. Maybe "State What You Want" or "Name the Target"? Happy to chat more about any of this, and please let me know if I'm missing anything. |
|
@juanmichelini I discussed this with others, we'd like to make a separate section for tips&tricks / best practices. We'll add support for this on the website, but in the meantime if you are ok with turning it into an obstacle, we could merge that part immediately. |
Adds a new pattern focusing on avoiding negation in AI prompts.
Pattern: Visualize the Target
Problem: Negation is often counterproductive
Solution: Describe what you want directly instead of what you don't want
Examples included:
Solves obstacles: selective-hearing, limited-context-window, limited-focus