This is not an issue of prompting ChatGPT.
It is an API concern, performed against trials and gathering statistics. It demonstrates the AI having a decent chance of emitting a stop sequence or other output beyond that desired and instructed.
However, one does not need to gather such statistics or make multiple runs.
For such a 1-token classification, you can use logprobs, and thus bypass the random sampler and get quite reliable results.
Another strategy is to use the logit_bias parameter on chat completions to promote the desired answers against others.
Then finally, use structured outputs so the AI is compelled to write JSON containing that answer.
Here’s some code that gives a “boolean” answer, and also shows the logprob of the answer position in a structured output. The sampled answer is also highly affected by developer_enum_bias = {“Yes”: -99 , “No”: 0} where you can just put +3 for a bit of promotion. Then those enums are automatically instructed.
The demonstration of a fault could instead be turned into a classification application.