# How to Make AI Stop Writing Like AI: Prompts, Few-Shot Examples and Style Editing

> AI Release · @ai_release1 · https://ai-release.org/guides/kak-zastavit-neyroset-pisat-ne-kak-neyroset-prompty-pri_en.html

## TL;DR
- Time: 45–60 minutes
- Difficulty: Intermediate
- You need: Python 3.x, `curl`, a text editor, an API key, and a chat-completions-style endpoint. No specific model is required.
- Goal: make an LLM (large language model — the text model behind a chat API) produce direct, concrete prose instead of generic “helpful assistant” text.
- Method: capture a baseline, write a style contract, add few-shot examples, then run an automated scan plus a human edit pass.

## Requirements and setup
![Illustration: Requirements and setup](https://ai-release.org/guides/img/kak-zastavit-neyroset-pisat-ne-kak-neyroset-prompty-pri-en-1.jpg)

- macOS, Linux, or Windows with WSL. Use equivalent PowerShell commands if you do not have a Bash shell.
- Python 3.x and `curl`. Check them before starting.
- An API key and the full chat-completions URL for your provider.
- A plain-text editor. Do not use a rich-text editor that inserts smart quotes into code files.
- Source-fact rule: the supplied material does not name a model, price, or benchmark. Replace `<your-model>`, `<your-api-endpoint>`, and `<your-api-key>` with values from your provider documentation.
- For system-prompt patterns, see [How to Set Up an Empathetic AI Assistant: System Prompts, RAG and TTS](https://ai-release.org/guides/kak-nastroit-empatichnogo-ii-assistenta-sistemnye-promp.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

**Example:** run the checks below. You should see a Python 3 version and a curl version, not a “command not found” error.

```bash
python3 --version
curl --version
```

## Step 1. Capture a baseline and write a style contract

**What to do:** create a working folder, generate one generic draft, and save it as your baseline. Then write a short style contract that names the voice, audience, sentence limit, and banned phrases.

```bash
mkdir -p style-lab/{prompts,drafts}
export API_URL="<your-api-endpoint>"
export API_KEY="<your-api-key>"
export MODEL="<your-model>"

curl -sS "$API_URL" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Write 150 words about why API logs matter. Use a generic, helpful tone.\"}],\"temperature\":0.7}" \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["choices"][0]["message"]["content"])' \
  > style-lab/drafts/v1.md

wc -w style-lab/drafts/v1.md
```

Expected output: a word count close to `150 style-lab/drafts/v1.md`.

Create the style contract and banned-phrase list:

```bash
cat > style-lab/style_guide.md <<'EOF'
Voice: direct, concrete, second person.
Audience: interns who know basic API calls.
Sentence limit: 25 words. Paragraph limit: 4 sentences.
Use active voice. Name the actor. Give one example per claim.
Do not invent facts, versions, prices, or URLs.
Mark unknowns as "check documentation".
Ban: in today's, it is important to note, delve, unlock, seamless, game-changer, not only.
EOF

cat > style-lab/banned_phrases.txt <<'EOF'
in today's
it is important to note
delve
unlock
seamless
game-changer
not only
EOF
```

**Why:** the baseline gives you something to compare against. The style contract turns vague instructions like “write naturally” into rules you can test with `grep` (a command that searches text for a pattern).

**How to check:** run the commands below. You should see the voice line in the style guide and seven banned phrases.

```bash
grep -n "Voice:" style-lab/style_guide.md
wc -l style-lab/banned_phrases.txt
```

**Example:** `grep -n "Voice:" style-lab/style_guide.md` prints `1:Voice: direct, concrete, second person.`

## Step 2. Build a prompt stack with examples and a revision pass
![Illustration: Step 2. Build a prompt stack with examples and a revision pass](https://ai-release.org/guides/img/kak-zastavit-neyroset-pisat-ne-kak-neyroset-prompty-pri-en-2.jpg)


**What to do:** create a system prompt, a small examples file, and a Python script that sends all three inputs to the model: the style guide, two before/after examples, and the draft to rewrite.

A system prompt is the instruction block sent before the user message. Few-shot examples are short sample inputs and outputs included in the prompt so the model can copy the target pattern.

```bash
cat > style-lab/prompts/system.md <<'EOF'
You are a line editor. Rewrite the draft for the stated audience.
Keep every fact. Replace vague claims with concrete actions.
Do not add model names, prices, URLs, or benchmark numbers.
If a fact is missing, write "check documentation".
Return only the revised text.
EOF

cat > style-lab/prompts/examples.md <<'EOF'
BAD: It is important to note that API logs are a game-changer for reliability.
GOOD: API logs record the request ID, status code, and latency for each call, so you can find the first failed request.

BAD: In today's fast-paced API landscape, teams must leverage observability.
GOOD: Add one log line at the API gateway: method, path, status, latency, and request ID.
EOF
```

Create `style-lab/generate.py`:

```python
import json, os, pathlib, sys, urllib.request

root = pathlib.Path("style-lab")
system = (root / "prompts/system.md").read_text()
examples = (root / "prompts/examples.md").read_text()
style = (root / "style_guide.md").read_text()
draft = pathlib.Path(sys.argv[1]).read_text()

user = f"""STYLE GUIDE
{style}

EXAMPLES
{examples}

DRAFT TO REWRITE
{draft}

Rewrite the draft. Keep every fact. Replace generic claims with concrete actions. Return only the revised text."""

payload = json.dumps({
    "model": os.environ["MODEL"],
    "messages": [
        {"role": "system", "content": system},
        {"role": "user", "content": user},
    ],
    "temperature": 0.4,
}).encode()

req = urllib.request.Request(
    os.environ["API_URL"],
    data=payload,
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
        "Content-Type": "application/json",
    },
)
with urllib.request.urlopen(req) as response:
    data = json.load(response)
print(data["choices"][0]["message"]["content"])
```

Run the rewrite:

```bash
python3 style-lab/generate.py style-lab/drafts/v1.md > style-lab/drafts/v2.md
```

**Why:** the model now receives positive targets, explicit bans, and a revision instruction. That leaves less room for generic filler than a one-line “make it human” prompt. Temperature is a sampling setting that controls randomness; `0.4` is a starting example, not a guarantee. Check your provider’s allowed range.

**How to check:** scan the revised file for banned phrases and compare word counts.

```bash
grep -nEi -f style-lab/banned_phrases.txt style-lab/drafts/v2.md || echo "PASS: no banned phrases"
wc -w style-lab/drafts/v1.md style-lab/drafts/v2.md
```

Expected: `PASS: no banned phrases` and two word counts in the same general range. If the count collapses, the model deleted content; rerun with the instruction “keep every fact.”

**Example:** a generic line such as “API logs are a game-changer for reliability” should become “API logs record the request ID, status code, and latency, so you can find the first failed request.”

## Step 3. Run a style-edit loop and verify the result
![Illustration: Step 3. Run a style-edit loop and verify the result](https://ai-release.org/guides/img/kak-zastavit-neyroset-pisat-ne-kak-neyroset-prompty-pri-en-3.jpg)


**What to do:** check sentence length, inspect the diff, and edit only the lines that still sound generic. A diff shows what changed between two files.

```bash
python3 - <<'PY'
import re, pathlib
text = pathlib.Path("style-lab/drafts/v2.md").read_text()
sentences = re.split(r'(?<=[.!?])\s+', text)
long = [s for s in sentences if len(s.split()) > 25]
if long:
    for s in long:
        print("LONG:", s)
else:
    print("PASS: 0 sentences over 25 words")
PY
```

Then inspect the change:

```bash
diff -u style-lab/drafts/v1.md style-lab/drafts/v2.md | sed -n '1,120p'
```

Expected: `-` lines contain vague phrases; `+` lines contain actors, actions, and concrete examples. If the diff is empty, the model ignored the prompt stack; rerun Step 2 and check that `style-lab/prompts/system.md` is not empty.

Use this checklist before publishing:

- [ ] No banned phrase remains.
- [ ] No sentence exceeds 25 words unless the long sentence is necessary.
- [ ] Every claim has a concrete example or is marked “check documentation.”
- [ ] No invented model name, price, URL, or benchmark number.
- [ ] The final text names the actor and the action.

**Why:** automated checks catch repeated patterns; the diff catches silent deletions and invented facts. Human review is still required for accuracy.

**How to check:** the sentence-length script prints `PASS: 0 sentences over 25 words`, and the checklist has no unchecked boxes.

**Example:** if the script prints `LONG: In today's fast-paced environment, teams must leverage...`, rewrite it as `Add one log line at the API gateway: method, path, status, latency, and request ID.`

Before shipping a public prompt, run a robustness check with [How to Test an LLM Application for Jailbreaks: Methodology and Ready-to-Use Prompts](https://ai-release.org/guides/kak-proverit-llm-prilozhenie-na-dzheylbreyki-metodika-t.html?utm_source=tg&utm_medium=channel&utm_campaign=guide_inline&utm_content=guide_to_guide).

## Troubleshooting

**Problem. The banned-phrase check cannot find its file.**
- Error: `grep: style-lab/banned_phrases.txt: No such file or directory`
- Cause: the command is running from the wrong directory, or the file was never created.
- Solution: run `pwd`, move to the project root with `cd <your-project>`, then recreate the file with the `cat > style-lab/banned_phrases.txt <<'EOF'` block from Step 1.

**Problem. The API rejects a request during a batch run.**
- Error: `429 Too Many Requests`
- Cause: too many parallel requests, or the provider’s rate limit is lower than your loop.
- Solution: run one draft at a time, wait, and check your provider’s rate-limit documentation. Re-run with `python3 style-lab/generate.py style-lab/drafts/v1.md > style-lab/drafts/v2.md`.

**Problem. The prompt is rejected as too long.**
- Error: `400 Bad Request: context_length_exceeded`
- Cause: the style guide, examples, and draft together exceed the model’s context limit.
- Solution: check sizes with `wc -w style-lab/prompts/*.md style-lab/drafts/v1.md`, keep only two example pairs, and shorten the style guide to the rules you actually test.

## Summary and next steps
You now have a repeatable loop: baseline, style contract, prompt stack, automated scan, and human edit. Next, turn the checklist into a pre-publish test and run a prompt-robustness check before shipping.

## FAQ

**Can this make AI text undetectable?**
No. AI detectors are unreliable, and the practical goal is clear, specific prose — not evasion.

**Do I need a specific model?**
No. Use any chat-completions-style endpoint that accepts system and user messages. Check your provider documentation for the exact request shape.

**How many examples should I include?**
Start with two short before/after pairs. Add another pair only when the same failure appears twice; check your context limit before expanding.

**Should I lower the temperature?**
Use a lower value when you need consistency, but test it. Temperature does not fix missing facts or a weak style contract.
