TLDR: Repeating the instruction in your prompt helps especially when the model’s default behavior is to do the exact opposite.
That’s the major qualitative finding in this tiny experiment. Above is a chart that tries to capture a distribution of 11 programming tasks given to AI with a single rule that it must abide by. The spread is right in front of you to examine but what is hard to ignore is that among these the median task is more compliant if you repeat the mantra twice to the machine.
Why test this?
I have heard from numerous people repeating instructions helps. In fact, call it scatter-brained or not, I have done that myself especially in long prompts where I am just typing as stream of consciousness.
Then I saw a paper appear in my automated AI briefings - When More Becomes Less: Position-Dependent Repetition Effects in Language Models (paper: arXiv 2608.04021, briefing: 6 August). Though the paper’s version seems to be a more complicated position-dependent testing, I felt inspired to do not a replication study but a small, dumb version of this for my first field test. I just wanted to see if number of repetitions have anything to do with the model output.
What I did
I chose a single constraint: use single quotes, never double quotes. Then I asked for 11 different programming tasks in python. Simple ones. Strip tags out of HTML. Convert title to a slug. Parse a version string. To find the most stubborn model habits, I experimented with 22 tasks and chose these 11 which showed most stubbornness to the rule that had a starting compliance between 17% and 83%- making it a rather narrow test. In fact, these tasks had their compliance moving in both directions.
This constraint was repeated: zero times, once, twice, four, eight, or sixteen. Same rule, just repeated more. I did twenty tries of each combination, to get the mean compliance rate, on Gemini 2.5 Flash, all of it on Vertex. This constraint was chosen because by default the model would always use double quotes over single quotes. It was hard to find a case like this for example on my previous tries of “no comments,” and “no type hints”, the model showed nearly 99% compliance right away.
Checking the answers was pretty simple - use python’s own tokenize module to count double quoted string tokens. I did not rely on an evaluator LLM for this.
Results and Takeaways
As I stated earlier, the model’s adherence to double quotes can be easily seen in the control row (never stated). One thing I realized in my experiments is that it is hard to come up with a general, task-independent rule for whether repetition works or not.
Two repetitions lifted up the median task pretty fast. The tough cases needed more. There is not much else to conclude here, in fact it is hard to conclude anything more because the actual picture is quite messy (see below) and shows heavy task dependence. In fact, repeating twice hurts in one case- http_status_name which eventually improves. The median curve across 11 tasks shows a nice jump at 2x and saturation beyond that. So, if I were to take my chances with a rule on my next programming AI exercise, I am better off repeating myself twice to the agent.
When I examined the cases with poor compliance http_status_name and validate_config, I discovered that it boiled down to doc strings continuing to use double quotes essentially revealing the shape - the model has a habit of not treating doc strings as strings when not specified and repeating yourself up to 16 times helps wear down the habit.
Caveats and weighing mountains
A Hacker News reader made a great point about the flaw in the earlier version of this post that worked with 6 tasks. I made claims about “4 times” being this golden number of times to repeat yourself to AI. They put it rather poetically “Weighing six rocks a hundred times doesn't tell you the average weight of a mountain.”
They are right about that. In fact, the actual picture is rather messy to make any global statements on repeating yourself in AI prompts. Counting tasks rather than runs, compliance improved moving from 1x to 2x, on 9 of the 10 non-tied tasks, with a statistically significant p-value of 0.021 on a sign test. However, we must remind ourselves that this is a finding about the chosen tasks and not programming tasks in general.
It is hard to say that this would generalize well in all the cases where the model views some constraint as contradictory to its own convention. This is just a dumb experiment using a Gemini 2.5 Flash model with a small sample of 11 programming tasks. It is hard to think that I have stumbled upon even an inch of a jagged intelligence edge here, but I will keep knocking at these blackboxes in my future experiments to see what I may discover.






