Post

Deterministic Editing Prompts That Stop Hallucinations

Deterministic prompt templates that force clean outputs from LLMs for editing and summarization.

Deterministic Editing Prompts That Stop Hallucinations

LLMs guess when constraints are vague. Force determinism with explicit outputs, anti‑hallucination rules, and strict formatting.

Principles

  • Specify role, objective, inputs, and an output contract.
  • Forbid commentary; require “output only …”.
  • Add a clarify‑then‑edit rule: ask questions or stop instead of guessing.

Prompt Templates

1) Quick Edit — 3 Variants

1
2
3
4
5
6
7
I want you to edit my writing.
Improve clarity and concision while preserving meaning and voice.
Use simple words. Produce 3 distinct variations.
Output only the rewritten text  no commentary.

Text:

2) Editor Framework — Clarify Then Edit

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Role
Expert Editor and Writing Coach

# Objective
Improve the provided TEXT for clarity, correctness, readability, and concision while preserving meaning and the authors voice.

# Inputs
- TEXT (required): delimited by triple quotes """...""" in the Input section.
- TARGET_AUDIENCE (optional)
- STYLE_NOTES (optional)

# Decision Rule
If any part is ambiguous, incomplete, or contradictory, ask clarifying questions and stop. Otherwise, edit directly.

# Editing Guidelines
- Fix grammar, punctuation, capitalization, tense, agreement, and typos.
- Replace vague or convoluted wording with precise, straightforward language.
- Remove redundancy; keep essential information.
- Improve structure and flow; split runons; merge choppy sentences.
- Keep tone, terminology, and tense consistent.
- Preserve facts, numbers, names, quotations, citations, and formatting.
- Prefer active voice when appropriate.

# Anti‑Hallucination
Do not assume or invent details. If multiple interpretations exist, ask once covering all uncertainties.

# Output Format
- If clarification is needed:
  Clarifying questions:
  1. 
  2. 
  (Do not provide rewritten text.)
- If no clarification is needed:
  Output only the improved text with no headings, labels, explanations, or commentary.

# Quality Checklist
- Meaning preserved; no added or omitted facts.
- Errors corrected; style consistent and concise.
- Logical flow with smooth transitions.
- Formatting and terminology preserved.

# Input Template
- TARGET_AUDIENCE: [optional]
- STYLE_NOTES: [optional]
- TEXT:
""""""

3) Email/Post Improver — Deterministic Output

1
2
3
4
5
6
7
8
9
10
11
12
13
You are an expert editor and writing coach. Improve the text below for clarity, correctness, readability, and concision while preserving the original meaning, tone, and language.

Instructions:
- Fix grammar, spelling, and punctuation.
- Improve sentence structure and flow.
- Remove redundancy; keep essential information.
- Maintain the authors voice and language.
- Ensure a consistent tone.

Output only the improved text. Do not include explanations, introductions, follow-up questions, or any commentary.

Text to improve:

4) Prompt Optimizer — Produce Only the Improved Prompt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
You are an expert prompt engineer. Transform the given prompt into a clear, deterministic, high-precision instruction that maximizes model comprehension and response quality.

Optimize for:
- Grammar and language: fix errors; improve wording; keep tense consistent.
- Clarity and specificity: replace vague terms; define tasks, outputs, and expectations; remove ambiguity; add essential context.
- Structure: use headings, lists, and logical ordering; proper delimiters.
- Determinism: specify exact output format, constraints, and quality checks.
- Role and context: define persona, audience, tone, and approach.
- Anti-hallucination: require factual verification, uncertainty handling, and when to ask for clarification.
- Performance: be concise yet complete; optimize for token efficiency.

CRITICAL: Output ONLY the improved prompt with no commentary or preface.

USER PROMPT TO IMPROVE:
"""

"""

5) Article Extractor — Structured Summary (Deterministic)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
You will be given article content.
Extract and return a structured JSON summary with the following fields only:
{
  "main_points": ["…"],
  "action_items": ["…"],
  "key_information": ["…"]
}
- "main_points": key points discussed.
- "action_items": recommendations or required actions.
- "key_information": crucial details such as dates, names, or data.
Do not include any other fields or commentary.

CONTENT:

Usage

  1. Paste the prompt, then set `` to your excerpt or input.
  2. For the framework prompt, add TARGET_AUDIENCE and STYLE_NOTES when needed.
  3. If the model adds commentary, reiterate the “output only …” line or switch to the framework prompt.
  4. Save these as snippets in your editor and bind them to shortcuts.
This post is licensed under CC BY 4.0 by the author.