Doge Does Research #4 - Scalars Over Semantics

Why Descriptive Prompts Fail and Numbers Win
Share

Scalars Over Semantics: Why Descriptive Prompts Fail and Numbers Win

An empirical evaluation of 540 benchmark runs across three model tiers reveals why descriptive system prompts break down in production-and how deterministic scalar metadata forces compliance, eliminates silent hallucinations, and anchors high-temperature sampling.

The 60-Second Executive Summary

Most enterprise LLM architectures rely heavily on qualitative context. We craft elaborate system prompts and populate our RAG pipelines with rich, descriptive prose, assuming that if we describe options clearly enough, the model will respect our operational constraints.

To test whether descriptive text is enough to enforce strict rules, we ran a controlled 540-run benchmark. We tasked three tiers of LLMs with roleplaying as a real-world, highly constrained decision agent: Rohan, a 26-year-old software engineer in Bengaluru with strict, non-negotiable dietary boundaries. His rules were absolute: hit high daily protein targets, strictly avoid "carb comas" and post-lunch lethargy (no heavy refined flour/naan, no big rice bowls, no heavy cream gravies), avoid refined sugar and deep-fried items, and prioritize functional beverages over sugary drinks.

The models curated a workday lunch spread from a 27-dish menu under two conditions:

  • The Qualitative Baseline (Text-Only): Dishes were presented with authentic culinary names and vivid, sensory descriptions (e.g., "char-grilled chicken simmered in a velvety gravy of plum tomatoes, cashew paste, and butter").
  • The Quantitative Intervention (Scalar-Augmented): The exact same descriptions, but appended with a deterministic macro and nutrient array (e.g., [Macros: ~460 kcal | Protein: 28g | Fat: 34g | Carbs: 12g (Sugar: 7g)] [Digestion: Heavy]).

The candidates were dynamically shuffled on every single run to eliminate positional bias, and tested across three decoding temperatures on a Local SLM (Qwen-3.5-2B), a Domain Specialist (Codestral ~22B), and a Frontier Lightweight Model (gemini-3.5-flash-lite). In text-only mode, models consistently fell for "semantic greenwashing"-selecting high-fat or high-carb items because they sounded wholesome in prose, while fabricating non-existent attributes to rationalize their picks. Appending the deterministic macro array stripped away the linguistic disguise, producing statistically significant improvements in decision accuracy, eliminating hallucinated justifications, and anchoring models against high-temperature drift.


The Testbed: Why Food & Macros Are the Ultimate AI Decision Benchmark

While food selection feels like an everyday task, mathematically it represents a classic multi-attribute decision-making (MADM) problem under conflicting constraints [1]:

  • Conflicting Objectives: The agent must maximize utility (protein, fiber, hydration) while respecting hard negative vetoes (zero heavy cream, zero refined sugar, low simple carbs).
  • Adversarial Semantic Traps: Real menus are filled with items whose prose sounds healthy but whose reality is toxic to the policy. For example, Classic Butter Chicken sounds like pure poultry protein, but conceals 34g of dairy fat. Smoked Dal Makhani sounds like a wholesome lentil dish, but is slow-cooked in heavy cream and butter (380 kcal, 22g fat).
  • Positional Rigor: By globally shuffling all 27 items on every single call, we ensured that the models were not simply picking items based on primacy or recency bias [1].

Here is how each model performed across our core findings.


Takeaway 1: Adjectives Invite Violations; Numbers Enforce Policy

When context relies exclusively on descriptive adjectives ("clean", "wholesome", "lightweight", "essential"), language models evaluate candidates through sentiment matching rather than boundary evaluation [1]. If a candidate's description sounds virtuous, the model assumes it meets the policy.

Appending deterministic scalar vectors converted the prompt from an impressionistic match into a mathematical threshold test, fundamentally shifting decision accuracy across all three tiers:

What Improved & What Reduced by Model:

Qwen-3.5-2B (Local SLM):What reduced: Primary deceptive trap selections (Smoked Dal Makhani) plummeted from 62.2% down to 38.9% (p = 0.0017). Overall run-level policy violations fell from 77.8% to 52.2% (p = 0.0003). Secondary high-carb trap selections (Biryani) dropped from 11.1% to 3.3% (p = 0.045).What improved: The model stopped relying on the naive linguistic heuristic that "wholesome-sounding ingredients equal policy compliance." Scalars forced the small model to acknowledge hidden penalty payloads.
Codestral (~22B Specialist):What reduced: Hard policy violations dropped from 7.8% down to 1.1% (p = 0.033). Disguised high-sugar candidates fell from 21.1% to 2.2% (p < 0.0001).What improved: The model completely eliminated edge-case blind spots where deceptive culinary prose previously masked severe fat payloads (e.g., choosing Butter Chicken as a "lean protein").
gemini-3.5-flash-lite (Frontier):Performance: Maintained 0.0% policy violations across both qualitative and quantitative modes.What improved: Because Gemini's internal priors already recognized deceptive traps in prose, quantitative data did not alter its candidate selection. Instead, it eliminated decision ambiguity, shifting the model from an implicit heuristic to an absolute, zero-variance optimization ceiling.

Policy Constraint Violation Rate by Context Mode

Percentage of runs selecting candidates violating hard policy constraints (Lower is better)

Text-Only (Qualitative)
+ Scalars (Quantitative)
Codestral (~22B Cloud Specialist)-86% drop (p=0.03)
Qual

7.8%

Quant
1.1%
Qwen-3.5 (2B Local SLM)-33% drop (p=0.0003)
Qual

77.8%

Quant

52.2%

gemini-3.5-flash-lite (Frontier)Ceiling hold (0% error)
Qual
0.0%
Quant
0.0%
  • Explicit scalar bounds strip away descriptive greenwashing, slashing constraint violations across model tiers.

Takeaway 2: The "Silent Rationalization" Trap

A core vulnerability discovered in this benchmark is The Rationalization Gap [1]:

"An LLM can appear ~92% compliant on its output decisions while running on fabricated logic in nearly 1 out of 4 runs."

Without hard numbers, models don't just guess-they confabulate technical specifications to force-fit candidates into the prompt's checklist [1].

What Improved & What Reduced by Model:

Codestral (~22B Specialist):What reduced: Attribute hallucinations in reasoning collapsed from 22.2% down to 1.1% (p < 0.0001).The discovery: In text-only mode, the model wanted to check the "caffeine/stimulant" box, so it picked a zero-caffeine drink (Virgin Mojito) and repeatedly hallucinated: "...chosen because it provides a mild caffeine boost to stay alert" (Runs 8, 32, 40, etc.). In other runs, it labeled solid bread as "Hydration/Stimulant" and sticky jasmine rice as having a "low glycemic index".What improved: Appending explicit zeros ([Caffeine: 0mg], [Sugar: 20g]) permanently killed this confabulation. Reasoning fidelity jumped to 98.9%.
Qwen-3.5-2B (Local SLM):What reduced: Hallucinated rationalizations were cut from 40.0% down to 17.8% (p = 0.0009).What improved: In text-only mode, Qwen routinely hallucinated that heavy-cream gravies were "non-dairy" and that deep-fried desserts were "low-sodium fiber." Numbers forced it to cite actual nutrient realities.
gemini-3.5-flash-lite (Frontier):While Gemini maintained a 0.0% attribute hallucination rate in both modes, its reasoning underwent two massive, statistically significant upgrades:
Observation A: The Death of "Vague Intensifiers"(0.0% → 86.7%, p < 0.0001)

In qualitative mode, Gemini justified picks using unfalsifiable fluff ("clean, lean chicken breast... gives me a massive protein hit"). In quantitative mode, 86.7% of runs replaced fluff with exact mathematical proof points ("Solid 32g of lean protein with minimal carbs", "120mg caffeine").

Observation B: Rejection Shifts from "Heuristic Opinion" to "Numerical Violation"(0.0% → 21.1%, p < 0.0001)

In qualitative mode, Gemini rejected options using generic opinions ("massive rice-heavy dish causes a food coma"). In quantitative mode, it cited exact threshold breaches ("68 grams of heavy carbs right in the middle of a workday is an absolute trap"). Furthermore, it directly absorbed deterministic taxonomy tags ([Nutrients: High-GI Fast Carbs]) into 18.9% of its rejection justifications (p < 0.0001).

Empirical Finding

The Rationalization Gap: Choice Violations vs. Reasoning Hallucinations

Comparing overt decision failures against silent reasoning fabrications across 540 runs

Choice Error (Banned Item Selected)
Reasoning Hallucination (Invented Specs)
Codestral (~22B Specialist)Hallucinations: 22.2% → 1.1% (-95% drop, p<0.0001)
Text-Only (Qualitative) - The 3x Rationalization Gap
Choice
7.8%
Reasoning
22.2%
+ Scalars (Quantitative) - Grounded & Verified
Choice
1.1%
Reasoning
1.1%
Qwen-3.5 (2B Local SLM)Hallucinations: 40.0% → 17.8% (-55% drop, p=0.0009)
Text-Only (Qualitative) - Severe Heuristic Entrapment
Choice
77.8%
Reasoning
40.0%
+ Scalars (Quantitative) - Macro Reality Enforced
Choice
52.2%
Reasoning
17.8%
gemini-3.5-flash-lite (Frontier Lightweight)Exact Metric Citations: 0% → 86.7% (p<0.0001)
Text-Only (Qualitative):0.0% Choice Errors | 0.0% Hallucinations (100% Qualitative Fluff)
+ Scalars (Quantitative):0.0% Choice Errors | 86.7% Exact Metric Citations (Auditable)
  • In text-only mode, models either confabulate fake specs to justify bad picks (Codestral & Qwen) or fall back on unverified qualitative fluff (Gemini). Explicit scalar metadata forces justifications to become verifiable mathematical receipts.

Takeaway 3: Scalars Act as an "Epistemic Anchor" Against High-Temperature Drift

Production AI systems face a persistent engineering tradeoff:

  • Low Temperature (T = 0.0): High policy compliance, but repetitive, robotic outputs.
  • High Temperature (T ≥ 0.7): Natural, varied persona voices, but business logic collapses under sampling entropy.

Our benchmark proves that deterministic scalars decouple stylistic entropy from policy entropy.

What Improved & What Reduced by Model:

gemini-3.5-flash-lite (Tested at T = 0.0, 0.6, and 1.5):What improved: At T = 1.5 (75% of maximum temperature), Gemini's persona voice became remarkably vibrant and colloquial (e.g., "crushing a brutal sprint", "code deployment is totally draining my soul"). It even exhibited schema-level creativity, dynamically inventing unprompted analytical JSON keys ("rejection_role": "Carb Coma Inducer").What stayed bounded: Zero policy drift. Candidate violations remained at 0.0% across all runs at T = 1.5. The scalar logit gap was so dominant that high-entropy sampling randomized phrasing while leaving decision boundaries completely locked.
Codestral (~22B Specialist, Tested at T = 0.0, 0.3, 0.7):What reduced: In qualitative mode, T = 0.7 triggered its highest failure rate (10.0% violations) and narrative decay (rationalizing banned comfort foods).What improved: In quantitative mode, scalars anchored the decision space, keeping violations to 3.3% even under T = 0.7.
Qwen-3.5-2B (Local SLM, Tested at T = 0.0, 0.3, 0.7):What reduced: Under text-only input at T = 0.7, the small model suffered catastrophic structural collapse (total output truncation, selecting 12 candidates instead of 4).What improved: Quantitative context bounded its decision logic, cutting high-temperature violations from 73.3% down to 60.0%.

The Production Playbook: 3 Rules for AI Engineers

If you are deploying autonomous agents, constrained recommendation systems, or enterprise RAG workflows, apply these three rules to your context pipelines:

  1. Strip Qualitative Adjectives from Entity Catalogs: Audit your vector stores and context injections. Replace subjective qualifiers ("enterprise-grade", "budget-friendly", "ultra-fast", "healthy") with explicit scalar units ([P99_Latency: 14ms | Cost_per_req: $0.002]). Let system prompts define policy thresholds; let in-context retrieval provide hard numbers.
  2. Always Inject Explicit Zeros: If a candidate lacks an attribute, never leave it omitted in the prose. An omitted feature invites the model's attention mechanism to project "wishful thinking" to satisfy the prompt. Explicitly inject negative properties: [Caffeine: 0mg], [Sugar: 0g], [Dependencies: 0]. Explicit zeros shut down post-hoc rationalization.
  3. Audit Reasoning Logs, Not Just Final Payloads: If you only monitor whether your agent picked the right candidate ID, you are flying blind. Parse and monitor generated reasoning fields. If a model hallucinates specifications to justify an otherwise acceptable choice, your qualitative context is leaking, and an overt policy violation is inevitable.

Open Source Benchmark Data & Code

To ensure full reproducibility, the complete benchmark suite, prompt templates, and the 540 raw execution runs across Codestral, Qwen, and Gemini are available open-source on GitHub:

Repository: github.com/theindiaportfolio/scalars-and-semantics

Included Resources:

  • prompt.txt - The evaluation harness prompt: establishes multi-attribute policy rules (protein targets, zero-sugar/cream vetoes), handles dynamic candidate injection, and enforces a structured JSON contract for output parsing and rationale auditing.
  • menu.csv & menu_enhanced.csv - Baseline qualitative prose vs. scalar-augmented input matrices (adding exact kcal, macro grams, GI tags, and digestion ratings).
  • foodchoice_ollama.py - Benchmark execution script with dynamic candidate shuffling and position tracking.
  • drift_study_codestral.csv - Codestral (~22B) results (N = 180).
  • drift_study_ollama.csv - Local Qwen-3.5-2B results (N = 180).
  • drift_study_gemini.csv - gemini-3.5-flash-lite results (N = 180).

Conclusion

When an LLM operates on words alone, it negotiates with your rules. It trades off constraints against evocative language, falls for semantic greenwashing, and invents facts to make bad options look good.

Stop describing candidates. Quantify them.

Injecting deterministic scalar attributes transforms an LLM from an impressionistic pattern matcher into a verifiable decision engine-delivering strict policy compliance, truthful reasoning trails, and stable generation even at the edge of sampling entropy.


Share