# How Humanizer Detects and Corrects the "Not X But Y" Contrast Pattern in AI Text

> Learn how Humanizer detects and corrects the not X but Y AI writing pattern. It identifies lexical cues and rewrites sentences to state claims directly, removing unnecessary negations.

- Repository: [Siqi Chen/humanizer](https://github.com/blader/humanizer)
- Tags: deep-dive
- Published: 2026-09-13

---

**Humanizer identifies the "not X but Y" construction as a classic AI-generated tell by matching predefined lexical cues in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md), then rewrites sentences to remove unnecessary negations and state the positive claim directly.**

The "not X but Y" contrast pattern is a notorious marker of AI-generated prose that adds rhetorical weight without substantive content. In the **blader/humanizer** open-source project, this pattern is detected through lexical pattern matching and corrected via aggressive rewrite rules. The implementation treats these constructions as "tells" that inflate statements artificially, processing them through a transformation pipeline defined in the project's Markdown-based skill architecture.

## Pattern Detection: Lexical Cues in SKILL.md

Humanizer’s detection logic resides in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md), where the "Not X but Y" section defines specific lexical patterns that trigger identification. The system watches for any expression that contrasts a negative clause with a positive clause, including:

- **"not X but Y"** – The base construction
- **"not just X, but Y"** – Variations with intensifiers
- **"it's not X; it's Y"** – Semicolon-separated contrasts
- **Split-sentence versions** – Such as "This does not mean X. It means Y."

According to the source code at line 58, these patterns are flagged immediately during the initial scan as **pattern #1**, marking the sentence as an AI tell before any semantic analysis occurs.

## The Three-Step Correction Process

When Humanizer encounters a matching pattern, it applies a structured transformation pipeline to eliminate the rhetorical fluff while preserving factual content.

### Step 1: Flagging the Tell

During the initial document scan, the system flags any sentence matching the lexical cues defined in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) (see line 58). This flagging happens regardless of context, ensuring that all instances of the contrast pattern are marked for review.

### Step 2: Evaluating the Negative Half

The critical analysis occurs at lines 60-62, where Humanizer evaluates whether the negative clause merely negates something that was never claimed. If the negation addresses a strawman rather than an actual reader misconception, the system determines that the contrast adds weight without new factual content. Only when the negative clause corrects a belief the reader actually holds does the system preserve the contrast structure.

### Step 3: Direct Rewrite

The final transformation removes the unnecessary negation entirely. As implemented in the rewrite rules, the system states the point directly, keeping the positive half of the construction while dropping the artificial contrast. This produces concise prose that communicates the same substantive claim without the AI-generated rhetorical padding.

## Rewrite Examples and Transformations

The [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) file provides concrete examples of the transformation at lines 63-66. Consider this before-and-after comparison:

**Before:**

```text
It's not just about the beat riding under the vocals; it's part of the aggression and atmosphere.

```

**After:**

```text
The heavy beat adds to the aggressive tone.

```

This example demonstrates how the rewrite eliminates both the negative clause ("not just about the beat riding under the vocals") and the contrast structure, preserving only the substantive claim about the beat's contribution to atmosphere.

## Implementation: Loading the Skill in Agents

The Humanizer skill is implemented as a Markdown prompt rather than traditional code, meaning usage occurs through LLM systems that load the skill definition. According to [`AGENTS.md`](https://github.com/blader/humanizer/blob/main/AGENTS.md) and [`README.md`](https://github.com/blader/humanizer/blob/main/README.md), you can invoke the pattern detection through various agent platforms.

### Python Integration

When using Humanizer via a language-model wrapper, the system processes input text containing the tell and returns cleaned output:

```python

# Example: Using Humanizer via a language-model wrapper

input_text = """
It's not merely a song, it's a statement.
This does not mean every choice is equal. It means there is no external system that confirms which choice is right.
"""

# Humanizer processes the text and returns a cleaned version

rewritten = humanizer_process(input_text)
print(rewritten)

```

**Output:**

```text
The song functions as a statement.  
No external system confirms which choice is right, although the choices still have different consequences.

```

### OpenAI-Compatible API Usage

For command-line or API integration, load the skill from the raw [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) URL as specified in [`AGENTS.md`](https://github.com/blader/humanizer/blob/main/AGENTS.md):

```bash

# Example: Command-line usage through the OpenAI-compatible plugin

curl -X POST https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "model": "gpt-4o",
        "messages": [
          {"role":"system","content":"<load skill from https://github.com/blader/humanizer/blob/main/SKILL.md>"},
          {"role":"user","content":"The options come from the selected item, no guessing."}
        ]
      }'

```

**Output:**

```text
The options come from the selected item without forcing the user to guess.

```

## Summary

- **Humanizer** treats the "not X but Y" construction as an AI-generated tell detected through lexical pattern matching in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) (line 58).
- The correction process involves three stages: flagging the pattern, evaluating whether the negative clause addresses real misconceptions (lines 60-62), and rewriting to state the positive claim directly.
- Valid contrasts are preserved only when the negative clause corrects an actual belief the reader holds, not when it negates strawman arguments.
- Integration occurs through LLM-compatible skill loading mechanisms documented in [`AGENTS.md`](https://github.com/blader/humanizer/blob/main/AGENTS.md) and [`README.md`](https://github.com/blader/humanizer/blob/main/README.md).

## Frequently Asked Questions

### What specific phrases trigger the "not X but Y" detection in Humanizer?

The detection triggers on several lexical variations defined in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md): "not X but Y," "not just X, but Y," "it's not X; it's Y," and split-sentence constructions like "This does not mean X. It means Y." These patterns are matched literally during the initial scan phase.

### How does Humanizer decide whether to keep or remove the negative clause?

The system evaluates whether the negative half negates something the reader actually believes or merely attacks a strawman. According to lines 60-62 in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md), if the negative clause merely negates something that was never claimed, the rewrite keeps only the positive half. Genuine contrasts are preserved only when correcting actual reader misconceptions.

### Where is the pattern logic defined in the repository?

The complete definition resides in [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) at lines 58-66, which contains the detection rules, evaluation criteria, and transformation examples. Usage instructions appear in [`README.md`](https://github.com/blader/humanizer/blob/main/README.md), while [`AGENTS.md`](https://github.com/blader/humanizer/blob/main/AGENTS.md) explains how different agent platforms load these rules into LLM contexts.

### Can I use Humanizer with OpenAI-compatible APIs?

Yes. As documented in [`AGENTS.md`](https://github.com/blader/humanizer/blob/main/AGENTS.md), you can load the skill by reference to the raw [`SKILL.md`](https://github.com/blader/humanizer/blob/main/SKILL.md) URL in your API calls. The system works with any LLM that supports system prompt injection, including OpenAI's GPT-4o and compatible endpoints, processing the contrast pattern detection and correction server-side.