Why "Wish-Style Prompting" with LLMs Is Unreliable—and How to Engineer Around It

    This article examines why large language models behave unpredictably when input materials contradict each other, tracing the problem to sampling randomness, answer-biased training objectives, attention dilution in long contexts, and the absence of external validation. It presents practical engineering countermeasures—splitting contradiction detection into a separate step, enforcing structured output contracts, using multi-sample consistency voting, adding tool- and rule-based hard checks, and enabling full observability and rollback—along with an evaluation methodology based on fixed test sets, repeated sampling, failure categorization, and regression gates. Readers will learn how to shift the model's role toward drafting while deterministic components handle adjudication, turning unreliable output into a measurable, interceptable, and recoverable engineering process.

    1. What Happened: From “Looks Fine” to Two Failures in a Row

    A developer ran repeated samples on the same type of task within a single day. In the morning, only one out of thirty rounds failed; in the evening, two casual attempts both failed. The failure logs showed a highly consistent defect pattern: the price page in the input material conflicted with the content of an announcement, and instead of flagging the contradiction, the model selectively ignored part of it and returned an unverified, definitive answer.

    The value of this case is not a single accuracy number. It exposes a structural problem: when the input itself is self-contradictory, the model’s behavior is unpredictable. The difference between morning and evening was not a change in capability, but result drift caused by sampling randomness. Handing that drift to a production pipeline amounts to handing delivery quality to luck.

    It is worth stressing that this is not a defect unique to one class of models. It is a common weakness of current generative models in the “conflicting evidence resolution” stage. The correct engineering response is not to complain, but to design invocation and validation mechanisms that tolerate uncertainty.

    2. Root Causes: Why the Model “Selectively Ignores Contradictions”

    2.1 Sampling randomness amplifies tail risk

    Generation is probabilistic sampling. Small differences in temperature, context length, or the system prompt can shift the output distribution. A single call that looks correct does not mean the distribution is correct under arbitrary sampling. Evaluation must estimate an error-rate interval through multiple rounds of sampling, not draw conclusions from one success.

    2.2 Training objectives favor “giving an answer”

    Models are optimized to produce fluent, helpful replies. “I don’t know” or “there is a conflict here” is often weak in the reward signal. So when facing contradictory material, the model tends to pick the source that looks more authoritative and keep reasoning from it.

    2.3 Attention dilution in long contexts

    The price page and the announcement are usually far apart, and key information is surrounded by large amounts of irrelevant text, so conflicting fragments are easily downweighted. The longer the context, the more explicit evidence-location methods are needed.

    2.4 No external validation loop

    Pure text generation has no fact-checking stage. Without retrieval, a rule engine, or test execution, errors can only be caught by the human eye—and the human eye is precisely the part most easily persuaded by a confident tone.

    3. Practical Engineering Countermeasures

    3.1 Move “contradiction detection” ahead as a separate step

    Do not let the model complete “read the material + draw a conclusion” in one shot. Split it into two stages: first extract structured facts, then compare for conflicts.

    1. Step A: Extraction
    2. Output JSON: {field_name, value, source_location, original_snippet}
    3. Step B: Comparison
    4. Run consistency checks on fields with the same name; mark conflicting items with status="conflict" and block them from entering the conclusion stage

    3.2 Constrain the output contract with structured prompts

    Explicitly require the model to return a fixed structure when evidence is insufficient or conflicting, rather than free text. Example:

    1. {
    2. "answer": null,
    3. "confidence": "low",
    4. "conflicts": [{"field": "price", "sources": ["page", "notice"]}],
    5. "next_action": "request_clarification"
    6. }

    The key is to make “admitting uncertainty” a legitimate and low-cost output path.

    3.3 Multi-sample voting for consistency

    Fire N calls in parallel with the same prompt and tally the distribution of conclusions. Adopt the result if the majority agrees; if the distribution is dispersed, downgrade directly to human review. Pseudocode:

    1. results = [call_model(prompt, temperature=0.7) for _ in range(N)]
    2. votes = Counter(normalize(r) for r in results)
    3. if votes.most_common(1)[0][1] / N < threshold:
    4. return escalate_to_human(results)

    The threshold should be set according to business risk. Scenarios involving money, permissions, or compliance should be significantly stricter.

    3.4 Use tools and rules for hard validation

    Hand the verifiable parts to deterministic components: numerical calculations to a compute engine, prices and inventory to query APIs, formatting to schema validation, and code to compilation and unit tests. The model is responsible only for intent understanding and solution organization; it does not make factual rulings.

    3.5 Full observability and rollback

    Log the prompt version, sampling parameters, original evidence snippets, and final output to form a traceable chain. Logging services and monitoring alerts can track metrics such as conflict rate and escalation rate, enabling fast rollback of the prompt or model version when abnormal fluctuations appear.

    4. Evaluation: Stop Drawing Conclusions from a Single Try

    • Fixed evaluation set: Prepare layered samples containing contradictory material, missing information, and extra-long contexts.
    • Repeated sampling: Call each sample multiple times and measure error rate and variance, not a single data point.
    • Categorized attribution: Classify failures into “ignored conflict,” “overconfidence,” “format violation,” and “factual error,” and improve each separately.
    • Regression gate: After any prompt or version change, run the full regression; if metrics fall short, release is not allowed.

    5. Repositioning Human-AI Collaboration

    “Wish-style programming” is exhausting because it demotes the developer from commander to error-corrector, constantly on guard against confidently wrong output. A sound division of roles is: the model handles drafts and enumeration, deterministic components handle adjudication, and humans handle risk decisions. Once the validation loop is in place, the model’s inconsistency is no longer a blocker but merely a probabilistic event that costs one extra sampling round.

    6. Conclusion

    The high cost-effectiveness and impressive performance of generative models are worth acknowledging, but reliable delivery depends on process, not luck. Combining contradiction detection, structured contracts, multi-sample voting, tool-based validation, and observable rollback turns “one-click wish fulfillment” from a wish into a reproducible engineering result. Baidu AI Cloud continues to invest in model services and engineering implementation, and developers can build the validation loop described above on top of general-purpose capabilities, so that uncertainty is measured, intercepted, and backed up.