{"id":844,"date":"2026-05-04T05:41:48","date_gmt":"2026-05-03T21:41:48","guid":{"rendered":"https:\/\/connectword.dpdns.org\/?p=844"},"modified":"2026-05-04T05:41:48","modified_gmt":"2026-05-03T21:41:48","slug":"a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling","status":"publish","type":"post","link":"https:\/\/connectword.dpdns.org\/?p=844","title":{"rendered":"A Developer\u2019s Guide to Systematic Prompting: Mastering Negative Constraints, Structured JSON Outputs, and Multi-Hypothesis Verbalized Sampling"},"content":{"rendered":"<p>Most developers treat prompting as an afterthought\u2014write something reasonable, observe the output, and iterate if needed. That approach works until reliability becomes critical. As LLMs move into production systems, the difference between a prompt that <em>usually<\/em> works and one that works <em>consistently<\/em> becomes an engineering concern. In response, the research community has formalized prompting into a set of well-defined techniques, each designed to address specific failure modes\u2014whether in structure, reasoning, or style. These methods operate entirely at the prompt layer, requiring no fine-tuning, model changes, or infrastructure upgrades.<\/p>\n<p>This article focuses on five such techniques: <strong>role-specific prompting<\/strong>,<strong> negative prompting<\/strong>, <strong>JSON prompting<\/strong>, <strong>Attentive Reasoning Queries (ARQ)<\/strong>, and <strong>verbalized sampling<\/strong>. Rather than covering familiar baselines like zero-shot or basic chain-of-thought, the emphasis here is on what changes when these techniques are applied. Each is demonstrated through side-by-side comparisons on the same task, highlighting the impact on output quality and explaining the underlying mechanism.<\/p>\n<h1 class=\"wp-block-heading\">Setting up the dependencies<\/h1>\n<p>Here, we\u2019re setting up a minimal environment to interact with the OpenAI API. We securely load the API key at runtime using getpass, initialize the client, and define a lightweight chat wrapper to send system and user prompts to the model (gpt-4o-mini). This keeps our experimentation loop clean and reusable while focusing only on prompt variations.<\/p>\n<p>The helper functions (section and divider) are just for formatting outputs, making it easier to compare baseline vs. improved prompts side by side. If you don\u2019t already have an API key, you can create one from the official dashboard here: <a href=\"https:\/\/platform.openai.com\/api-keys\">https:\/\/platform.openai.com\/api-keys<\/a><\/p>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">import json\nfrom openai import OpenAI\nimport os\nfrom getpass import getpass\n\nos.environ['OPENAI_API_KEY'] = getpass('Enter OpenAI API Key: ')\n\nclient = OpenAI()\nMODEL = \"gpt-4o-mini\"\n \n \ndef chat(system: str, user: str, **kwargs) -&gt; str:\n    \"\"\"Minimal wrapper around the chat completions endpoint.\"\"\"\n    response = client.chat.completions.create(\n        model=MODEL,\n        messages=[\n            {\"role\": \"system\", \"content\": system},\n            {\"role\": \"user\",   \"content\": user},\n        ],\n        **kwargs,\n    )\n    return response.choices[0].message.content\n \n \ndef section(title: str) -&gt; None:\n    print()\n    print(\"=\" * 60)\n    print(f\"  {title}\")\n    print(\"=\" * 60)\n \n \ndef divider(label: str) -&gt; None:\n    print(f\"n\u2500\u2500 {label} {'\u2500' * (54 - len(label))}\")<\/code><\/pre>\n<\/div>\n<\/div>\n<h1 class=\"wp-block-heading\">Role-Specific Prompting<\/h1>\n<p>Language models are trained on a wide mix of domains\u2014security, marketing, legal, engineering, and more. When you don\u2019t specify a role, the model pulls from all of them, which leads to answers that are generally correct but somewhat generic. Role-specific prompting fixes this by assigning a persona in the system prompt (e.g., \u201cYou are a senior application security researcher\u201d). This acts like a filter, pushing the model to respond using the language, priorities, and reasoning style of that domain.\u00a0<\/p>\n<p>In this example, both responses identify the XSS risk and recommend HttpOnly cookies \u2014 the underlying facts are identical. The difference is in how the model frames the problem. The baseline treats localStorage as a configuration choice with tradeoffs. The role-specific response treats it as an attack surface: it reasons about what an attacker can do once XSS is present, not just that XSS is theoretically possible. That shift in framing \u2014 from \u201chere are the risks\u201d to \u201chere is what an attacker does with those risks\u201d \u2014 is the conditioning effect in action. No new information was provided. The prompt just changed which part of the model\u2019s knowledge got weighted.\u00a0<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1112\" height=\"849\" data-attachment-id=\"79484\" data-permalink=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/image-475\/\" data-orig-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-5.png\" data-orig-size=\"1112,849\" data-comments-opened=\"0\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-5-1024x782.png\" src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-5.png\" alt=\"\" class=\"wp-image-79484\" \/><\/figure>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">section(\"TECHNIQUE 1 -- Role-Specific Prompting\")\n \nQUESTION = \"Our web app stores session tokens in localStorage. Is this a problem?\"\n \nbaseline_1 = chat(\n    system=\"You are a helpful assistant.\",\n    user=QUESTION,\n)\n \nrole_specific = chat(\n    system=(\n        \"You are a senior application security researcher specializing in \"\n        \"web authentication vulnerabilities. You think in terms of attack \"\n        \"surface, threat models, and OWASP guidelines.\"\n    ),\n    user=QUESTION,\n)\n \ndivider(\"Baseline\")\nprint(baseline_1)\n \ndivider(\"Role-specific (security researcher)\")\nprint(role_specific)<\/code><\/pre>\n<\/div>\n<\/div>\n<h1 class=\"wp-block-heading\">Negative Prompting<\/h1>\n<p>Negative prompting focuses on telling the model what not to do. By default, LLMs follow patterns learned during training and RLHF\u2014they add friendly openings, analogies, hedging (\u201cit depends\u201d), and closing summaries. While this makes responses feel helpful, it often adds unnecessary noise in technical contexts. Negative prompting works by removing these defaults. Instead of just describing the desired output, you also restrict unwanted behaviors, which narrows the model\u2019s output space and leads to more precise responses.<\/p>\n<p>In the output, the difference is immediately visible. The baseline response stretches into a longer, structured explanation with analogies, headers, and a redundant conclusion. The negatively prompted version delivers the same core information in a much shorter form\u2014direct, concise, and without filler. Nothing essential is lost; the prompt simply removes the model\u2019s tendency to over-explain and pad the response.\u00a0<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1097\" height=\"873\" data-attachment-id=\"79485\" data-permalink=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/image-476\/\" data-orig-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-6.png\" data-orig-size=\"1097,873\" data-comments-opened=\"0\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-6-1024x815.png\" src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-6.png\" alt=\"\" class=\"wp-image-79485\" \/><\/figure>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">section(\"TECHNIQUE 2 -- Negative Prompting\")\n \nTOPIC = \"Explain what a database index is and when you'd use one.\"\n \nbaseline_2 = chat(\n    system=\"You are a helpful assistant.\",\n    user=TOPIC,\n)\n \nnegative = chat(\n    system=(\n        \"You are a senior backend engineer writing internal documentation.n\"\n        \"Rules:n\"\n        \"- Do NOT use marketing language or filler phrases like 'great question' or 'certainly'.n\"\n        \"- Do NOT include caveats like 'it depends' without immediately resolving them.n\"\n        \"- Do NOT use analogies unless they are necessary. If you use one, keep it to one sentence.n\"\n        \"- Do NOT pad the response -- if you've made the point, stop.n\"\n    ),\n    user=TOPIC,\n)\n \ndivider(\"Baseline\")\nprint(baseline_2)\n \ndivider(\"With negative prompting\")\nprint(negative)<\/code><\/pre>\n<\/div>\n<\/div>\n<h1 class=\"wp-block-heading\">JSON Prompting (Schema-Constrained Output)<\/h1>\n<p>JSON prompting becomes important when LLM outputs need to be consumed by code rather than just read by humans. Free-form responses are inconsistent\u2014structure varies, key details are embedded in paragraphs, and small wording changes break parsing logic. By defining a JSON schema in the prompt, you turn structure into a hard constraint. This not only standardizes the output format but also forces the model to organize its reasoning into clearly defined fields like pros, cons, sentiment, and rating.<\/p>\n<p>In the output, the difference is clear. The baseline response is readable but unstructured\u2014pros, cons, and sentiment are mixed into narrative text, making it difficult to parse. The JSON-prompted version, however, returns clean, well-defined fields that can be directly loaded and used in code without any post-processing. Information that was previously implied is now explicit and separated, making the output easy to store, query, and compare at scale.<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1095\" height=\"892\" data-attachment-id=\"79486\" data-permalink=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/image-477\/\" data-orig-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-7.png\" data-orig-size=\"1095,892\" data-comments-opened=\"0\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-7-1024x834.png\" src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-7.png\" alt=\"\" class=\"wp-image-79486\" \/><\/figure>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">section(\"TECHNIQUE 3 -- JSON Prompting\")\n \nREVIEW = \"\"\"\nHonestly mixed feelings about this laptop. The display is stunning -- easily the best I've\nseen at this price range -- and the keyboard is surprisingly comfortable for long sessions.\nBattery life, on the other hand, barely gets me through a 6-hour workday, which is\ndisappointing. Fan noise under load is also pretty aggressive. For light work it's great,\nbut I wouldn't recommend it for anyone who needs to run heavy software.\n\"\"\"\n \nSCHEMA = \"\"\"\n{\n  \"overall_sentiment\": \"positive | negative | mixed\",\n  \"rating\": &lt;integer 1-5&gt;,\n  \"pros\": [\"&lt;string&gt;\", ...],\n  \"cons\": [\"&lt;string&gt;\", ...],\n  \"recommended_for\": \"&lt;string describing ideal user&gt;\",\n  \"not_recommended_for\": \"&lt;string describing user who should avoid&gt;\"\n}\n\"\"\"\n \nbaseline_3 = chat(\n    system=\"You are a helpful assistant.\",\n    user=f\"Summarize this product review:nn{REVIEW}\",\n)\n \njson_output = chat(\n    system=(\n        \"You are a product review parser. Extract structured information from reviews.n\"\n        \"You MUST return only a valid JSON object. No preamble, no explanation, no markdown fences.n\"\n        f\"The JSON must match this schema exactly:n{SCHEMA}\"\n    ),\n    user=f\"Parse this review:nn{REVIEW}\",\n)\n \ndivider(\"Baseline (free-form)\")\nprint(baseline_3)\n \ndivider(\"JSON prompting (raw output)\")\nprint(json_output)\n \ndivider(\"Parsed &amp; usable in code\")\nparsed = json.loads(json_output)\nprint(f\"Sentiment         : {parsed['overall_sentiment']}\")\nprint(f\"Rating            : {parsed['rating']}\/5\")\nprint(f\"Pros              : {', '.join(parsed['pros'])}\")\nprint(f\"Cons              : {', '.join(parsed['cons'])}\")\nprint(f\"Recommended for   : {parsed['recommended_for']}\")\nprint(f\"Avoid if          : {parsed['not_recommended_for']}\")<\/code><\/pre>\n<\/div>\n<\/div>\n<h1 class=\"wp-block-heading\">Attentive Reasoning Queries (ARQ)<\/h1>\n<p>Attentive Reasoning Queries (ARQ) build on chain-of-thought prompting but remove its biggest weakness\u2014unstructured reasoning. In standard CoT, the model decides what to focus on, which can lead to gaps or irrelevant details. ARQ replaces this with a fixed set of domain-specific questions that the model must answer in order. This ensures that all critical aspects are covered, shifting control from the model to the prompt designer. Instead of just guiding how the model thinks, ARQ defines what it must think about.<\/p>\n<p>In the output, the difference shows up as discipline and coverage. The baseline CoT response identifies key issues but drifts into less relevant areas and misses deeper analysis in places. The ARQ version, however, systematically addresses each required point\u2014clearly isolating vulnerabilities, handling edge cases, and evaluating performance implications. Each question acts as a checkpoint, making the response more structured, complete, and easier to audit.<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1106\" height=\"897\" data-attachment-id=\"79488\" data-permalink=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/image-479\/\" data-orig-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-9.png\" data-orig-size=\"1106,897\" data-comments-opened=\"0\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-9-1024x830.png\" src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-9.png\" alt=\"\" class=\"wp-image-79488\" \/><\/figure>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">section(\"TECHNIQUE 4 -- Attentive Reasoning Queries (ARQ)\")\n \nCODE_TO_REVIEW = \"\"\"\ndef get_user(user_id):\n    query = f\"SELECT * FROM users WHERE id = {user_id}\"\n    result = db.execute(query)\n    return result[0] if result else None\n\"\"\"\n \nARQ_QUESTIONS = \"\"\"\nBefore giving your final review, answer each of the following questions in order:\n \nQ1 [Security]: Does this code have any injection vulnerabilities?\n               If yes, describe the exact attack vector.\nQ2 [Error handling]: What happens if db.execute() throws an exception?\n                     Is that acceptable?\nQ3 [Performance]: Does this query retrieve more data than necessary?\n                  What is the cost at scale?\nQ4 [Correctness]: Are there edge cases in the return logic that could\n                  cause a silent bug downstream?\nQ5 [Fix]: Write a corrected version of the function that addresses\n          all issues found above.\n\"\"\"\n \nbaseline_cot = chat(\n    system=\"You are a senior software engineer. Think step by step.\",\n    user=f\"Review this Python function:nn{CODE_TO_REVIEW}\",\n)\n \narq_result = chat(\n    system=\"You are a senior software engineer conducting a security-aware code review.\",\n    user=f\"Review this Python function:nn{CODE_TO_REVIEW}nn{ARQ_QUESTIONS}\",\n)\n \ndivider(\"Baseline (free CoT)\")\nprint(baseline_cot)\n \ndivider(\"ARQ (structured reasoning checklist)\")\nprint(arq_result)<\/code><\/pre>\n<\/div>\n<\/div>\n<h1 class=\"wp-block-heading\">Verbalized Sampling<\/h1>\n<p>Verbalized sampling addresses a key limitation of LLMs: they tend to return a single, confident answer even when multiple interpretations are possible. This happens because alignment training favors decisive outputs. As a result, the model hides its internal uncertainty. Verbalized sampling fixes this by explicitly asking for multiple hypotheses, along with confidence rankings and supporting evidence. Instead of forcing one answer, it surfaces a range of plausible outcomes\u2014all within the prompt, without needing model changes.<\/p>\n<p>In the output, this shifts the result from a single label to a structured diagnostic view. The baseline provides one classification with no indication of uncertainty. The verbalized version, however, lists multiple ranked hypotheses, each with an explanation and a way to validate or reject it. This makes the output more actionable, turning it into a decision-making aid rather than just an answer. The confidence scores themselves aren\u2019t precise probabilities, but they effectively indicate relative likelihood, which is often sufficient for prioritization and downstream workflows.<\/p>\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1103\" height=\"909\" data-attachment-id=\"79487\" data-permalink=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/image-478\/\" data-orig-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-8.png\" data-orig-size=\"1103,909\" data-comments-opened=\"0\" data-image-meta='{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}' data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-8-1024x844.png\" src=\"https:\/\/www.marktechpost.com\/wp-content\/uploads\/2026\/05\/image-8.png\" alt=\"\" class=\"wp-image-79487\" \/><\/figure>\n<div class=\"dm-code-snippet dark dm-normal-version default no-background-mobile\">\n<div class=\"control-language\">\n<div class=\"dm-buttons\">\n<div class=\"dm-buttons-left\">\n<div class=\"dm-button-snippet red-button\"><\/div>\n<div class=\"dm-button-snippet orange-button\"><\/div>\n<div class=\"dm-button-snippet green-button\"><\/div>\n<\/div>\n<div class=\"dm-buttons-right\"><a><span class=\"dm-copy-text\">Copy Code<\/span><span class=\"dm-copy-confirmed\">Copied<\/span><span class=\"dm-error-message\">Use a different Browser<\/span><\/a><\/div>\n<\/div>\n<pre class=\" no-line-numbers\"><code class=\" no-wrap language-php\">section(\"TECHNIQUE 5 -- Verbalized Sampling\")\n \nSUPPORT_TICKET = \"\"\"\nHi, I set up my account last week but I can't log in anymore. I tried resetting\nmy password but the email never arrives. I also tried a different browser. Nothing works.\n\"\"\"\n \nbaseline_5 = chat(\n    system=\"You are a support ticket classifier. Classify the issue.\",\n    user=f\"Ticket:n{SUPPORT_TICKET}\",\n)\n \nverbalized = chat(\n    system=(\n        \"You are a support ticket classifier.n\"\n        \"For each ticket, generate 3 distinct hypotheses about the root cause. \"\n        \"For each hypothesis:n\"\n        \"  - State the category (Authentication, Email Delivery, Account State, Browser\/Client, Other)n\"\n        \"  - Describe the specific failure moden\"\n        \"  - Assign a confidence score from 0.0 to 1.0n\"\n        \"  - State what additional information would confirm or rule it outnn\"\n        \"Order hypotheses by confidence (highest first). \"\n        \"Then provide a recommended first action for the support agent.\"\n    ),\n    user=f\"Ticket:n{SUPPORT_TICKET}\",\n)\n \ndivider(\"Baseline (single answer)\")\nprint(baseline_5)\n \ndivider(\"Verbalized sampling (multiple hypotheses + confidence)\")\nprint(verbalized)<\/code><\/pre>\n<\/div>\n<\/div>\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n<p>Check out\u00a0the\u00a0<strong><a href=\"https:\/\/github.com\/Marktechpost\/AI-Agents-Projects-Tutorials\/blob\/main\/LLM%20Projects\/Prompt_Techniques.ipynb\" target=\"_blank\" rel=\"noreferrer noopener\">Full Codes with Notebook here<\/a><\/strong>.<strong>\u00a0<\/strong>Also,\u00a0feel free to follow us on\u00a0<strong><a href=\"https:\/\/x.com\/intent\/follow?screen_name=marktechpost\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Twitter<\/mark><\/a><\/strong>\u00a0and don\u2019t forget to join our\u00a0<strong><a href=\"https:\/\/www.reddit.com\/r\/machinelearningnews\/\" target=\"_blank\" rel=\"noreferrer noopener\">130k+ ML SubReddit<\/a><\/strong>\u00a0and Subscribe to\u00a0<strong><a href=\"https:\/\/www.aidevsignals.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">our Newsletter<\/a><\/strong>. Wait! are you on telegram?\u00a0<strong><a href=\"https:\/\/t.me\/machinelearningresearchnews\" target=\"_blank\" rel=\"noreferrer noopener\">now you can join us on telegram as well.<\/a><\/strong><\/p>\n<p>Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?\u00a0<strong><a href=\"https:\/\/forms.gle\/MTNLpmJtsFA3VRVd9\" target=\"_blank\" rel=\"noreferrer noopener\"><mark>Connect with us<\/mark><\/a><\/strong><\/p>\n<p>The post <a href=\"https:\/\/www.marktechpost.com\/2026\/05\/03\/a-developers-guide-to-systematic-prompting-mastering-negative-constraints-structured-json-outputs-and-multi-hypothesis-verbalized-sampling\/\">A Developer\u2019s Guide to Systematic Prompting: Mastering Negative Constraints, Structured JSON Outputs, and Multi-Hypothesis Verbalized Sampling<\/a> appeared first on <a href=\"https:\/\/www.marktechpost.com\/\">MarkTechPost<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Most developers treat promptin&hellip;<\/p>\n","protected":false},"author":1,"featured_media":845,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-844","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=844"}],"version-history":[{"count":0,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/posts\/844\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=\/wp\/v2\/media\/845"}],"wp:attachment":[{"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/connectword.dpdns.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}