0Pricing
AI Prompt Engineering · Lesson

Removing Ambiguity from Prompts

Techniques to eliminate multiple interpretations in your instructions.

Removing Ambiguity from Prompts is a free AI Prompt Engineering lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Prompt Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Ambiguity Does to AI

Ambiguous prompts force the model to choose between multiple valid interpretations. It picks one — usually the most common — and runs with it confidently, with no indication that it made a choice.

The result: you get a perfectly well-formed answer to the wrong question. Recognizing and eliminating ambiguity before sending is faster than rewriting the output afterward.

The Classic: 'Make It Better'

'Make it better' is perhaps the most ambiguous prompt in existence. Better how?

  • Shorter? Longer?
  • More formal? More casual?
  • More examples? Fewer?
  • Different tone? Different structure?
  • Fixed grammar? Different vocabulary?

The model picks one dimension and changes it. If that is not the dimension you wanted, you are stuck in a rewrite loop.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

original_text = (
    'Our software helps companies manage their data. '
    'It has many features. Customers like it a lot.'
)

# Ambiguous improvement request
vague = f'Make this better:\n\n{original_text}'

# Unambiguous improvement request
specific = (
    f'Rewrite this product description to be exactly 50% shorter, '
    f'more confident in tone, and replace vague phrases like "many features" '
    f'and "a lot" with specific claims. Do not add new features I have not mentioned.\n\n'
    f'{original_text}'
)

for label, prompt in [('VAGUE', vague), ('SPECIFIC', specific)]:
    response = client.messages.create(
        model='claude-opus-4-5',
        max_tokens=200,
        messages=[{'role': 'user', 'content': prompt}]
    )
    print(f'--- {label} ---')
    print(response.content[0].text)
    print()

Multiple Interpretations: Practical Examples

Any prompt with an undefined pronoun, a relative adjective, or a missing subject is potentially ambiguous. Examples:

  • 'Improve the performance' — of what? Speed, accuracy, user engagement?
  • 'Write about the impact' — positive, negative, economic, social?
  • 'Fix this' — fix the logic, the style, the formatting, or the grammar?
  • 'Make it professional' — formal vocabulary? Structured paragraphs? Remove emojis?
import openai

client = openai.OpenAI(api_key='sk-your-key-here')

# Disambiguating 'fix this code'
buggy_code = 'def divide(a, b): return a / b'

ambiguous = f'Fix this:\n{buggy_code}'

unambiguous = (
    f'Fix only the division-by-zero bug in this function. '
    f'Add a guard that raises a ValueError with message "b cannot be zero" when b=0. '
    f'Do not change anything else — keep the function signature and return type identical.\n\n'
    f'{buggy_code}'
)

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{'role': 'user', 'content': unambiguous}]
)
print(response.choices[0].message.content)

Disambiguation Technique: State the Interpretation

If you know your prompt could be interpreted multiple ways, explicitly state which interpretation you want.

Template: 'When I say [ambiguous term], I mean [specific definition].'

Examples:

  • 'When I say edit, I mean fix grammar and spelling only — do not change content.'
  • 'When I say brief, I mean 3 sentences maximum.'
  • 'When I say professional, I mean no first-person pronouns and no contractions.'
import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=256,
    messages=[{
        'role': 'user',
        'content': (
            'Edit the following paragraph. '
            'When I say "edit", I mean: fix grammar and punctuation only. '
            'Do NOT change vocabulary, sentence structure, or content. '
            'When done, list each change you made in a numbered list below the edited text.\n\n'
            'The team have went to the meeting early, but the manager '
            'werent there so they waited for alot of time before leaving.'
        )
    }]
)
print(response.content[0].text)

Disambiguation Technique: Define the Scope

Scope ambiguity is common when asking for improvements or expansions. Fix it by defining exactly what is in and out of scope.

In scope: what the model is allowed to change
Out of scope: what must remain unchanged

This is especially important for code editing, document revision, and dataset processing tasks where unintended changes can cause serious problems.

import openai

client = openai.OpenAI(api_key='sk-your-key-here')

code_block = '''
def calculate_tax(income, rate):
    return income * rate

def calculate_net(income, tax):
    return income - tax
'''

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{
        'role': 'user',
        'content': (
            'Add Python type hints to the following code.\n'
            'IN SCOPE: adding type hints to parameters and return values only.\n'
            'OUT OF SCOPE: changing function names, logic, docstrings, or formatting.\n'
            'Do not add any comments or docstrings.\n\n'
            + code_block
        )
    }]
)
print(response.choices[0].message.content)

Disambiguation Technique: Specify the Output Form

Output ambiguity happens when you want a specific format but do not say so. 'Give me the data' — as a paragraph? A list? A table? A JSON object?

Always name the exact output form you expect. The model will match it precisely when told explicitly.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

candidates_text = (
    'Alice: 5 years Python, worked at Stripe, has a CS degree.\n'
    'Bob: 3 years JavaScript, worked at a startup, self-taught.\n'
    'Carol: 8 years Java, worked at Google, has an MS in CS.'
)

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=300,
    messages=[{
        'role': 'user',
        'content': (
            'Extract the candidate data below into a JSON array. '
            'Each object must have exactly these keys: name, years_experience, primary_language, '
            'previous_employer, education_level. '
            'education_level values: DEGREE, MASTERS, SELF_TAUGHT.\n\n'
            + candidates_text
        )
    }]
)
print(response.content[0].text)

Disambiguation Technique: Ask the Model to Clarify

When writing a complex prompt that you know is ambiguous, you can instruct the model to ask clarifying questions before attempting the task.

This is especially useful when building AI assistants — you want the model to gather information rather than assume, just as a good human consultant would.

import openai

client = openai.OpenAI(api_key='sk-your-key-here')

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[
        {
            'role': 'system',
            'content': (
                'You are a professional copywriter. '
                'Before starting any writing task, ask exactly 3 clarifying questions '
                'that would most improve the output quality. '
                'Only proceed to write after the user answers those questions.'
            )
        },
        {
            'role': 'user',
            'content': 'Write a landing page headline for my business.'
        }
    ]
)
print(response.choices[0].message.content)

Relative Terms That Need Anchoring

Relative terms carry no fixed meaning — they mean different things to different people:

  • 'Brief' — 1 sentence? 3 sentences? 1 paragraph?
  • 'Formal' — no contractions? Academic citation style? Legal language?
  • 'Simple' — 5th-grade reading level? No technical terms? Short sentences only?
  • 'Comprehensive' — cover all major cases? Include edge cases? With examples?

Replace every relative term with a concrete, measurable equivalent.

import anthropic

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

# Relative terms mapped to concrete equivalents
mapping = [
    ('Give me a brief summary',   'Summarize in exactly 2 sentences'),
    ('Write something formal',    'Write using no contractions, no first person, and Flesch-Kincaid grade 12+'),
    ('Make it simple',            'Use only words a 10-year-old would know; max 15 words per sentence'),
    ('Be comprehensive',          'Cover at least 5 distinct subtopics with one example each'),
]

for vague, concrete in mapping:
    print(f'Vague:    "{vague}"')
    print(f'Concrete: "{concrete}"')
    print()

Subject Ambiguity: Who Performs the Action?

Subject ambiguity happens when it is unclear who or what the instruction applies to.

'Rewrite the introduction' — of what? The document you pasted? The one we discussed 5 turns ago? A new one?

'Translate this' — which part? The whole response? Just the summary section? The code comments?

Always name the specific object or section you mean, especially in multi-turn conversations.

import openai

client = openai.OpenAI(api_key='sk-your-key-here')

# Clear subject reference prevents wrong-section edits
contract_text = (
    '## Section 1: Payment Terms\nPayment is due within 30 days.\n\n'
    '## Section 2: Termination\nEither party may terminate with 30 days notice.'
)

response = client.chat.completions.create(
    model='gpt-4o',
    messages=[{
        'role': 'user',
        'content': (
            'In the contract below, rewrite ONLY Section 2 (Termination). '
            'Change the notice period from 30 days to 90 days. '
            'Do not change Section 1 or any other text.\n\n'
            + contract_text
        )
    }]
)
print(response.choices[0].message.content)

Temporal Ambiguity: When?

Time references in prompts can be ambiguous: 'recent', 'current', 'latest', 'now'.

The model's training has a cutoff date — it does not know what 'now' means unless you tell it. Always provide explicit dates for time-sensitive tasks.

  • 'Recent research' → 'Research published in 2024 or 2025'
  • 'Current best practices' → 'Best practices as of January 2025'
  • 'Latest version' → 'Version 3.12 (released October 2024)'
import anthropic
from datetime import date

client = anthropic.Anthropic(api_key='sk-ant-your-key-here')

today = date.today().isoformat()

response = client.messages.create(
    model='claude-opus-4-5',
    max_tokens=256,
    system=f'Today is {today}. Use this as the reference for any time-related words.',
    messages=[{
        'role': 'user',
        'content': (
            'Describe the best practices for Python async programming '
            'as of January 2025. If your knowledge does not cover this timeframe, '
            'say so explicitly and share what you know up to your cutoff.'
        )
    }]
)
print(response.content[0].text)

Building an Ambiguity Radar

Before sending any prompt, scan it for these ambiguity signals:

  • Pronouns without clear referents: it, this, that, they
  • Relative adjectives: better, shorter, formal, simple, comprehensive, recent
  • Vague verbs: fix, improve, update, make, do something about
  • Missing scope: no mention of what is in vs out of scope
  • Missing format: output format not specified
  • Missing context: who the audience is, what the output is for
def scan_prompt_for_ambiguity(prompt):
    '''Simple heuristic scanner for common ambiguity patterns.'''
    warnings = []
    vague_verbs = ['fix', 'improve', 'make it', 'update', 'change it', 'redo']
    relative_adj = ['better', 'shorter', 'longer', 'formal', 'simple', 'recent', 'comprehensive']
    missing_format = ['json', 'table', 'list', 'bullet', 'paragraph', 'word', 'sentence']

    lower = prompt.lower()
    for v in vague_verbs:
        if v in lower:
            warnings.append(f'Vague verb detected: "{v}" — specify what change exactly')
    for a in relative_adj:
        if a in lower:
            warnings.append(f'Relative adjective: "{a}" — anchor with a measurable definition')
    if not any(f in lower for f in missing_format):
        warnings.append('No output format specified — add format, length, or structure')
    return warnings

test = 'Make the report better and more formal.'
print('Prompt:', test)
for w in scan_prompt_for_ambiguity(test):
    print(' WARNING:', w)

Knowledge Check

A developer sends this prompt: 'Simplify the code.' The AI shortens the code but the developer wanted it to use more readable variable names, not make it shorter. What was the core problem?

Removing Ambiguity — Recap

Ambiguity forces the model to guess — and its guess is the most average interpretation, not yours. Key disambiguation techniques:

  • State the interpretation: 'When I say X, I mean Y'
  • Define scope: list what is in and out of scope
  • Name the output form: JSON / table / paragraph / sentence count
  • Anchor relative terms: 'brief' → '2 sentences', 'formal' → 'no contractions'
  • Name the subject: 'Section 2', not 'this part'
  • Ask for clarification: instruct the model to ask questions before proceeding

Frequently asked questions

Is the “Removing Ambiguity from Prompts” lesson free?

Yes — the full text of “Removing Ambiguity from Prompts” is free to read here on the web, and the AI Prompt Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Prompt Engineering course, upgrade to CoddyKit PRO.

What will I learn in “Removing Ambiguity from Prompts”?

Techniques to eliminate multiple interpretations in your instructions. You practise AI Prompt Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AI Prompt Engineering?

No prior experience is required. AI Prompt Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Removing Ambiguity from Prompts” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AI Prompt Engineering lesson?

Yes. Every AI Prompt Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Specificity Matters
  2. Removing Ambiguity from Prompts
  3. Adding Concrete Details
  4. Vague vs Specific Prompts Compared
← Back to AI Prompt Engineering