Apply to my task
arXiv:2507.17165 ★ 74 Jul 23, 2025

The Hyper-Specific Prompt: Corner the Model and It Stops Making Things Up

Key result

GPT-4o nails YAML config generation in just 3 cases out of 100. In the other 97 it invents something: sneaks in a step nobody asked for, reads a vague phrase its own way, adds a 'popular' pattern from its training data. The hyper-specific prompt method lets you get precise structured output for any task: YAML, JSON, tables, emails, plans. The trick: your job isn't to 'explain' to the model what you need, but to box it in so tightly that the only likely answer is the one you want. Three levers: detail down to the last parameter, explicit bans ('do not add X'), a rigid output template, and the room for 'improvisation' collapses to zero.

CanLLMsWrite CI? A Study on Automatic Generation of GitHub Actions Configurations

Key Aspects of the Study:

The study looks at how well large language models generate YAML configuration files for GitHub Actions from a plain-text description. It turns out that even the best models, like GPT-4o, are not very accurate (only 3% exact matches): they often skip important details, misread vague instructions, or add unnecessary but "standard" elements. Surprisingly, general-purpose models did better than code-specialized ones.

Key Result: The accuracy of structured-code generation depends directly on how detailed and unambiguous the prompt instructions are, because LLMs tend to "fill in" missing information from common patterns rather than from the actual requirements of the task.


The Core of the Method, Explained:

The method that follows from this study is to treat the LLM as a very diligent but completely uninitiative, context-free "junior employee." The model does not "understand" your goal; it just statistically predicts the next token. So to get an accurate structured result, you have to shrink its "room for improvisation" to a minimum.

The approach boils down to three core principles:

  1. Hyper-Specificity: Leave nothing to the model's discretion. If you need a specific parameter, name it. If a step must be done a certain way, describe it. Instead of "add caching," write "add a caching step for Node.js dependencies with the key my-app-node-modules-${{ hashFiles('**/package-lock.json') }}".

  2. Explicit negative constraints: Directly forbid the model from doing what you don't want. The study showed that models add "popular" steps (like actions/checkout@v4) even when nobody asked for them. The prompt should contain phrases like: "Do not add any steps other than the ones listed," "Output only YAML code, no comments or explanations," "Do not use any third-party actions."

  3. A clear output format definition: Define the structure of the answer up front. That means not just the type (YAML, JSON, Markdown) but the specific fields, their order and names. This helps the model focus on filling in a template rather than inventing one.


Practical Applicability:

  • Direct applicability: Users can start writing more detailed prompts right away for any task that demands precision. For example, when asking for a table, specify the exact column names and count. When asking for code, name the specific libraries and functions. The prompt template from the study (role, task, positive and negative constraints) can be adapted directly to your own needs.

  • Conceptual value: The big insight: an LLM doesn't think, it guesses. Understanding this changes how you prompt: your job isn't to "explain" what you want, but to box the model into such a narrow corridor that the only statistically likely answer is the one you need. It also explains why short, "clever" prompts so often fail on complex tasks.

  • Adaptation potential: The approach transfers easily from YAML generation to any other structured task.

    • For JSON generation: "Create a JSON object with three keys: name (string), age (integer), isStudent (boolean). Do not add any other keys."
    • For writing an email: "Write a business email. Structure: 1. Greeting. 2. Main body (1 paragraph). 3. Call to action. 4. Signature. Do not use emoji or informal expressions."
    • For a recipe: "Give the recipe as a numbered list. Every step must start with a verb. Do not write the history of the dish."

A Practical Example:

You are an experienced social media manager who specializes in promoting local businesses (coffee shops).

Your task is to create a 3-day content plan for the Instagram account of the coffee shop "Morning Breeze."

**Strict requirements for the output:**
1.  **Format:** Output the result as a Markdown table.
2.  **Columns:** The table must contain exactly 4 columns with these exact names: "Day", "Post Type", "Visual Idea", "Text (Key Message)".
3.  **Content:**
    *   **Day 1:** The post must be about the new dessert "Lemon Tart."
    *   **Day 2:** The post must be about the barista named Emma.
    *   **Day 3:** The post must announce the "coffee + croissant" deal.

**Constraints (what NOT to do):**
*   Do not suggest ideas for Reels or Stories.
*   Do not write full post captions, only the key message (up to 15 words).
*   Do not add a hashtag column to the table.
*   Do not write any accompanying text, intros or conclusions. Output **only** the table.

Why This Works:

This prompt is effective because it applies the study's findings directly to minimize LLM errors:

  • Role ("You are an experienced social media manager"): Sets the context and activates the model's relevant knowledge.
  • Hyper-specificity: Instead of a generic "make a content plan," the prompt spells out the topic for each of the three days ("Lemon Tart," "barista Emma," "the deal").
  • A clear format definition ("Markdown table," "exactly 4 columns with these exact names"): This removes ambiguity and stops the model from producing a plain list or a table with a different set of columns.
  • Explicit negative constraints ("Do not suggest ideas for Reels," "Do not write full captions," "Do not add a hashtag column"): These instructions directly prevent "filling in the blanks": the model won't add popular but irrelevant elements, the way it did with actions/checkout@v4 in the study.

Another Practical Example

You are a personal travel assistant.

Your task is to put together a short 2-day trip plan to Boston for a first-time visitor who is mainly interested in history and architecture.

**Output structure requirements:**
*   The output must be a numbered list where each item is one day.
*   Each day must have a bulleted sub-list (`-`) with exactly 3 items: "Morning", "Afternoon", "Evening".
*   For each time slot (Morning, Afternoon, Evening), name one main place to visit and one sentence describing it.

**Constraints:**
*   Do not include restaurants or cafes in the plan.
*   Do not suggest shopping or nightclubs.
*   Do not mention transportation, just list the places.
*   Your answer must contain only the numbered list, with no greetings or wrap-ups.

Why This Example Works: The Mechanism.

This prompt runs on the same principles as the previous one and effectively prevents the errors identified in the study:

  • Preventing misinterpretation: The request clearly defines the visitor's interests ("history and architecture"), which narrows the model's choice of sights.
  • Fighting "speculative additions": Explicit bans ("Do not include... restaurants," "Do not suggest... shopping") keep the model from adding standard tourist activities nobody asked for. The model can't "assume" the visitor will probably want to eat or buy souvenirs.
  • Tight format control: Requiring "exactly 3 items: Morning, Afternoon, Evening" and "one main place" for each forces the model to be concise and structured, with no filler or fluff. It's the everyday-task equivalent of the study's "minimal and single valid YAML configuration" requirement.

Usefulness Score: 82

02

Main Evaluation Criteria

  • A. Relevance to prompting techniques: High. The study provides a ready-made prompt template (Listing 1) and, more importantly, analyzes typical LLM errors that the right wording can prevent.
  • B. Better conversational answers: High. The findings directly help make model answers more accurate and on-target, especially when generating structured data (code, YAML, JSON, tables).
  • C. Direct practical applicability: High. Users can immediately use the proposed prompt structure and principles (maximum detail, explicit bans) without any special tools.
  • D. Conceptual value: Very high. The study brilliantly exposes the LLM "mental model": it doesn't "understand" the task, it generates a statistically likely answer. That explains why models "fill in" details, ignore implicit instructions, and why general-purpose models can beat specialized ones.
  • E. New useful practice (clusters): The paper fits clusters 1 (Phrasing techniques), 2 (Behavioral patterns), 3 (Structure optimization), 5 (Extraction and structuring) and 7 (Reliability and stability).
  • Practicality checklist (+15 points): Yes: the paper gives ready-made constructions, shows how to structure requests, reveals non-obvious LLM behaviors and offers ways to improve accuracy.
03

Numeric Usefulness Score

Arguments for a score of 82: The study has huge practical and conceptual value. It doesn't just offer "one more trick"; it fundamentally explains why prompts for structured content so often fail. The error analysis (missed details, made-up additions, misinterpretation) is a ready-made checklist for anyone trying to get a precise result out of an LLM. The proposed prompt template is a great example of advanced prompting with a role, clear instructions and negative constraints. The finding that general-purpose models (GPT-4o) beat code-specialized ones (CodeGemma) on this task is an important insight for choosing the right tool.

Counterarguments (why the score could be higher): It could be 90+, since the principles drawn from the narrow task of YAML generation are completely universal for any task that needs precision and structured output (JSON, HTML, tables, lists). The LLM error analysis is essentially a manual for "debugging" your own prompts.

Counterarguments (why the score could be lower): It could be lower (around 70-75), since the study focuses on a very specific technical task (generating CI/CD configurations), which may scare off non-technical users. To benefit, a reader has to mentally map the findings onto their own, more everyday tasks, which takes some effort.


Research digest

Key result

GPT-4o nails YAML config generation in just 3 cases out of 100. In the other 97 it invents something: sneaks in a step nobody asked for, reads a vague phrase its own way, adds a 'popular' pattern from its training data. The hyper-specific prompt method lets you get precise structured output for any task: YAML, JSON, tables, emails, plans. The trick: your job isn't to 'explain' to the model what you need, but to box it in so tightly that the only likely answer is the one you want. Three levers: detail down to the last parameter, explicit bans ('do not add X'), a rigid output template, and the room for 'improvisation' collapses to zero.

Principle

The model doesn't understand your task; it guesses the next token. Give it room to guess and you get a 'plausible' answer, not a correct one. Compare: 'add caching' vs 'add a Node.js dependency caching step with the key my-app-node-modules-${{ hashFiles("**/package-lock.json") }}'. In the first case the model reproduces the most common pattern from thousands of GitHub repos. In the second it simply has no choice. Plus explicit bans: without the line 'do not add actions/checkout@v4' the model will insert it almost every time, because it saw that step in literally every other workflow in its training set. Not out of malice; it's just the most statistically likely next token.

Why it works

The LLM was trained on millions of GitHub Actions files. It sees 'make a workflow for Node.js', recalls the most typical version and reproduces it. The model isn't filling in blanks to annoy you; it fills gaps with the most likely options from its training data. Vague instructions = a huge space for those 'likely options' = 97% errors. Explicit bans sharply lower the probability of unwanted tokens in the output. And here's another interesting bit: in the study, general models beat code-specialized ones. It looks like narrow 'code' specialization locks in typical patterns even harder: the model seems to know 'how it's usually done' too well to step away from the template.

When to apply

Any structured output: JSON, YAML, Markdown tables, email templates, content plans, recipes, technical specs, especially when you need precision down to a specific field, step or wording. Especially useful for automation, when the model's output goes on into a script or system rather than to a human. Not a fit for tasks that need creative freedom: tight boxes will cut both quality and the occasional surprisingly good idea.

Mini recipe

1. Set a role with context: `You are an experienced DevOps engineer` or `You are a technical documentation editor`. The role activates the right layer of knowledge. 2. Spell out the task to the limit: Not 'add caching' but a specific key, a specific path, a specific action version. Every parameter you leave out, the model will invent itself. 3. Lock the format down hard: Exact field names, step order, data type, number of items. No freedom to interpret the structure. 4. Write the bans as a separate block: 'Do not add any steps other than those listed', 'Do not write comments in the code', 'Do not use third-party libraries'. This directly prevents 'filling in the blanks'. 5. Restrict the output in the last line: 'Output only the YAML code. No intros, explanations or wrap-ups.' Otherwise the model will wrap the answer in commentary.

Examples

[BAD]: `Write a GitHub Actions workflow to deploy a Python app` [GOOD]: `You are a DevOps engineer. Create a GitHub Actions workflow in YAML. Trigger: push to the main branch. Steps strictly in this order: 1) actions/checkout@v4, 2) actions/setup-python@v5 with Python 3.11, 3) the command pip install -r requirements.txt, 4) the command python -m pytest. Do not add any steps beyond the four listed. Do not add environment variables. Do not add caching. Do not write comments inside the YAML. Output only the YAML code, with no intro or explanations.` What changed: instead of one vague phrase, a role, a fixed step order with specific versions, and four explicit bans. The model literally has nowhere to swerve.

In plain words

Here's the deal: writing configs for GitHub Actions isn't creative work, it's a minefield of syntax and dependencies. The study shows that LLMs like GPT-4 or Claude 3.5 don't just "write code" here; they try to guess the structure of a YAML file from scraps of documentation they half-remember. The problem is that the tiniest mistake in an action version or an indent turns the whole pipeline into a pumpkin, and models often hallucinate parameters that don't exist.

It's like assembling an IKEA wardrobe with the manual for a nightstand, while half the parts came from a bicycle. You sort of get what goes where, but the whole thing collapses the first time you try to use it. The model acts like an overconfident intern: it cheerfully throws together build steps but has no clue that the chosen node-js version doesn't play nice with the container's OS. On paper it all looks logical; in practice it just doesn't run.

To get this thing to actually work, the researchers singled out concrete methods: Chain-of-Thought (make the model talk through the logic of the steps first) and Few-shot prompting with examples of real, working configs. The most important piece is on-the-fly syntax validation. Give the model a YAML schema and make it check itself, and the error count drops several times over. In-context learning from existing repositories beats trying to pull knowledge out of the model's "head."

Although all this was tested on CI/CD pipelines, the principle is completely universal for any structured config, be it Kubernetes, Terraform or web server settings. Anywhere a single step out of line gets punished with a parse error, you can't give the model free rein. Pin it down with strict examples and make it check dependencies before it hands over the final file. Creative freedom is your worst enemy here.

Bottom line: don't ask the model to "just write a config," it will mess up somewhere. Use structured prompts with a clear description of the environment and a couple of reference examples. The study's main takeaway: CI automation is possible, but only if you treat the LLM like a moody calculator that needs every step spelled out. Either you set up tight control on the input, or you spend hours later wondering why the build broke out of nowhere.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on The Hyper-Specific Prompt: Corner the Model and It Stops Making Things Up arXiv:2507.17165

Sign in to apply this study New accounts get 50 free credits.

Get the week’s best papers by email

One email on Sundays with the highest-rated new techniques. Unsubscribe with one click.