Back to articles
Instruction Best Practices: Precision Beats Clarity
News

Instruction Best Practices: Precision Beats Clarity

via Dev.toGábor Mészáros

Two rules in the same file. Both say "don't mock." When working with external services, avoid using mock objects in tests. When writing tests for src/payments/, do not use unittest.mock. Same intent. Same file. Same model. One gets followed. One gets ignored. I stared at the diff for a while, convinced something was broken. The model loaded the file. It read both rules. It followed one and walked past the other like it wasn't there. Nothing was broken. The words were wrong. The experiment I ran controlled behavioral experiments: same model, same context window, same position in the file. One variable changed at a time. Over a thousand runs per finding, with statistically significant differences between conditions. Two findings stood out. First (and the one that surprised me most) : when instructions have a conditional scope ("When doing X..."), precision matters enormously. A broad scope is worse than a wrong scope. Second : instructions that name the exact construct get followed rough

Continue reading on Dev.to

Opens in a new tab

Read Full Article
8 views

Related Articles