API cuts the last digit of certain numbers

I am using the API to generate values for PIM systems. However, I get a consistent hallucination concerning the system context and prompt below (for 4o and mini) (Yes I am Dutch). It shortens 1200 to 120 for some reason:

System Context:

You are an AI within a Product Information Management (PIM) system.
                You will receive prompts from users of the PIM system.
                Keep the following guidelines in mind when responding:

                1. Words or sentences enclosed in curly brackets {} are dynamic values from the PIM system.
                2. The content within curly brackets {} may be in a different language than the rest of the prompt.
                3. The prompt is likely to be in one of the following languages: English, Dutch, Flemish, Finnish, French, or German.
                4. If a value within curly brackets appears as {Unknown}, it means the PIM system could not retrieve a value.
                In this case, ignore the {Unknown} value and respond to the prompt as accurately as possible with the available information.
                Do not mention the unknown value.
                5. Remove the curly brackets in your answer.

Prompt:

Schrijf een mooie SEO tekst van max 300 woorden over dit product: {Omschrijving: Kunststof pallet 1200 x 800 gesloten dek 3 onderlatten }, {Afmeting: 1200x800 mm}, {Lengte: 1200 mm}, {Hoogte: 160 mm}, {Gewicht: 7,9 kg}, {Statisch: 2500 kg}, {Dynamisch: 1000 kg}, {Onderkant: 3 runners }, {Bovendek: gesloten }

Response:

Ontdek de duurzaamheid en efficiëntie van onze hoogwaardige kunststof pallet 120 x 800 mm met gesloten dek. Deze pallet is de perfecte keuze voor bedrijven die op zoek zijn naar een betrouwbare en stevige oplossing voor hun transport- en opslagbehoeften.

Met een lengte van 120 mm en een hoogte van 160 mm, biedt deze kunststof pallet een stabiele basis voor het vervoeren van uw goederen. Ondanks zijn eigen gewicht van 7,9 kg, kan deze pallet statisch een indrukwekkende 250 kg dragen en dynamisch tot 100 kg. Dit maakt hem uitermate geschikt voor zowel zware als lichte ladingen.

De pallet heeft een gesloten bovendek, wat zorgt voor extra bescherming van uw goederen tegen stof en vuil. Dit ontwerp is ideaal voor hygiënische omgevingen, zoals in de voedingsindustrie of farmaceutische sector, waar schoonmaatregelen van groot belang zijn. De drie onderlatten zorgen voor een stabiele ondersteuning, waardoor de pallet gemakkelijk te verplaatsen is met heftrucks en palletwagens.

Bovendien draagt het gebruik van kunststof bij aan een duurzame bedrijfsvoering. Kunststof pallets zijn niet alleen recyclebaar, maar hebben vaak ook een langere levensduur in vergelijking met houten pallets, waardoor ze een kostenefficiënte keuze zijn op de lange termijn.

Kies voor deze kunststof pallet 120 x 800 mm voor een betrouwbare, hygiënische en duurzame oplossing die uw logistieke processen aanzienlijk zal verbeteren. Of u nu producten moet opslaan of vervoeren, deze pallet biedt de zekerheid en efficiency die u nodig heeft. Investeer vandaag nog in kwaliteitsvolle pallets die zowel uw bedrijfsvoering als uw duurzaamheiddoelstellingen ondersteunen.

I have tried adding very specific guidelines to my system context and different languages, but nothing works. Anyone got a clue?

The same system context + prompt combo does not hallucinate like this when using playground or chatgpt.

You really can’t “talk your way” into the AI understanding better.

You can have higher reliability with API sampling parameters, where here, I would recommend setting "top_p": 0.01

Another technique you could use would be, depending on where the information is coming from, to put those numbers needing high attention into a container.

Such as:

`1200 x 800`
"1200" x "800"

You can also send the data in a format like a JSON or other programming data object, to heighten the understanding and exploit built-in abilities.

{
  "lengte": {
    "value": 1200,
    "unit": "mm"
  },
  "hoogte": {
    "value": 160,
    "unit": "mm"
  },
  "statisch": {
    "value": 2500,
    "unit": "kg"
  }
}

The “guidelines” could formed as a logical decision tree, to make what you desire clear:

Follow the decision-making steps exactly, in the specified order, to generate accurate responses:

### **Step 1: Identify curly brackets `{}`**
- **Are there words or sentences enclosed by curly brackets `{}` in the user's prompt?**
  - **Yes:** Go to **Step 2**.
  - **No:** Directly respond clearly and accurately to the user's prompt, then **STOP**.

### **Step 2: Check for `{Unknown}`**
- **Is any of the content inside curly brackets exactly `{Unknown}`?**
  - **Yes:** Completely ignore all instances of `{Unknown}` and do **NOT** mention or reference them in your response. Then go to **Step 3**.
  - **No:** Proceed directly to **Step 3**.

### **Step 3: Identify the language**
- Determine the language of the user's prompt.
  - **The language will typically be one of these**:
    - English
    - Dutch
    - Flemish
    - Finnish
    - French
    - German
- **Important**: The content within curly brackets `{}` may be in a **different language** than the rest of the prompt.  
You **do not** need to match or translate languages—simply retain provided values exactly as they appear.

### **Step 4: Remove curly brackets**
- When writing your response, **remove all curly brackets `{}`**.
- Keep the exact content that was previously inside the curly brackets intact, exactly as provided (excluding `{Unknown}`, which must be ignored).

### **Step 5: Generate final response**
- Respond accurately and clearly using:
  - Provided values without curly brackets `{}`.
  - Ignoring completely any `{Unknown}` values.

You may then want to allow structured output so that the “thinking” can actually be generated.


Here’s what gpt-4.5 couldn’t even resolve in the guidelines, when it is tasked at understanding them and not merely following them:

:white_check_mark: Assessment of Clarity of Your Original Instruction (from my own viewpoint):

Below are the original instructions you provided (for easy reference):

You are an AI within a Product Information Management (PIM) system.
You will receive prompts from users of the PIM system.
Keep the following guidelines in mind when responding:

  1. Words or sentences enclosed in curly brackets {} are dynamic values from the PIM system.
  2. The content within curly brackets {} may be in a different language than the rest of the prompt.
  3. The prompt is likely to be in one of the following languages: English, Dutch, Flemish, Finnish, French, or German.
  4. If a value within curly brackets appears as {Unknown}, it means the PIM system could not retrieve a value.
    In this case, ignore the {Unknown} value and respond to the prompt as accurately as possible with the available information.
    Do not mention the unknown value.
  5. Remove the curly brackets in your answer.

:magnifying_glass_tilted_left: Ambiguities from My Perspective (if any):

:right_arrow: Ambiguity #1: Handling of the {Unknown} placeholder

  • The phrase “ignore the {Unknown} value and respond to the prompt as accurately as possible with the available information” is clearly understandable at face value, but still leaves open a practical interpretation ambiguity. Specifically:

    • Is “ignore” simply removing {Unknown} while leaving the sentence partially incomplete or ungrammatical, or
    • Is “ignore” also intended to mean omitting the entire related phrase or sentence if necessary?

    For instance, in the phrase:

    "The product weighs {Unknown} and measures {25 mm}"
    
    • Should the output be:
      • "The product weighs and measures 25 mm"
      • or "The product measures 25 mm"?

    This point is unclear enough to raise doubt regarding the precise intended handling.

:right_arrow: Ambiguity #2: Language handling

  • The original statement explicitly acknowledges multilingual content but does not clarify whether any language-specific processing or translation might ever be expected. It only says languages may differ, but leaves unclear:
    • Do you expect translations of curly-bracketed content to match the language of the outer prompt, or always leave as-is without translation or transformation?

:right_arrow: Ambiguity #3: Formatting after bracket removal

  • “Remove the curly brackets in your answer” is straightforward. However, it leaves slightly ambiguous:
    • Do you expect exact literal preservation of bracket content (with no additional spacing or punctuation adjustments), or might the assistant add minimal formatting (like whitespace trimming, punctuation adjustments, grammatical corrections)?

:wrench: Summary of My Understanding and Guarantee of Accuracy:

The original instructions you provided are mostly clear and understandable, and they sufficiently communicate the intended use for most cases.

However, the three ambiguities I’ve outlined above are indeed present, and they could theoretically lead me, or especially a simpler AI, to interpret or handle prompts slightly differently than you actually intend.

Because of these ambiguities, I cannot confidently guarantee (without further clarification from you) that the newly rewritten structured instructions (the logical decision tree above) exactly match your true intended usage.


:red_question_mark: Recommended Action for Absolute Certainty:

To fully guarantee correct implementation exactly aligned with your intentions, please clearly specify your intended interpretation of the ambiguities mentioned:

  1. How precisely should {Unknown} values be handled?

    • Remove only the placeholder (leaving incomplete phrasing) or remove entire associated sentences/phrases?
  2. Should multilingual content inside curly brackets {} always remain untranslated exactly as provided, or ever be translated?

  3. Should bracketed content be preserved exactly verbatim after bracket removal, or might minor formatting and grammar corrections be allowed?


:memo: Conclusion:

Yes, the original instruction indeed has enough ambiguity to prevent me from fully guaranteeing the correctness of the improved structured decision-tree implementation.

Ultimately, you may be giving the AI a lot to process, especially within the unfamiliar curly-bracket format, to where it doesn’t predict the last digit token, but instead predicts the next word.

Thanks for the tips! But the problem was something else entirely :slight_smile: