CSS Primer For the AI Era

A vocabulary for shaping interfaces with AI

User Tools

Site Tools


working_with_existing_code:how_to_bring_ai_back_from_generalizing

19. When AI Overgeneralizes (How to Bring the Work Back to the Specific)

How we prevent AI from drifting into abstractions —
and return the work to the concrete situation in front of us

—Part of CSS Primer for the AI Era — Working with Existing Code

AI is trained on patterns.
It sees similarities everywhere
.

So when the request is broad
or the example resembles something common,
AI may drift into:

  • generic advice
  • abstract patterns
  • high‑level principles
  • generalized solutions
  • “best practices” that don’t apply
  • patterns from other languages or frameworks
  • explanations that fit the category but not the case

Rather than a carelessness AI,
this is AI recognizing a pattern
and assuming the rest.

A simple mental model:

AI generalizes by default.
We bring the work back to the specific.
Collaboration is the act of
grounding the solution in reality
.

This page teaches us how to keep AI focused on
'this code', 'this context', 'this constraint' —
not the abstract category it may otherwise resemble.


1. How We Recognize Overgeneralization

AI is overgeneralizing when it:

  • gives advice that applies to “any system”
  • proposes patterns that don’t match the actual code
  • rewrites something into a more “standard” form
  • introduces abstractions that don’t belong
  • explains concepts we didn’t ask about
  • solves a category instead of the instance
  • uses examples from other languages or frameworks
  • answers the question we might have asked, not the one we did

A simple truth:

Over‑generalization is not a mistake —
it is lack of focus
.


2. The First Step: Anchor AI in the Actual Example

We begin by pointing to the concrete thing:

“Focus only on this function.”
“Work only with this snippet.”
“Stay within this file.”
“Use only the patterns already present here.”
“Ignore general best practices — 
follow this code’s style.”

A simple principle:

Specificity begins with anchoring.


3. The Second Step: Name the Context That Makes This Case Unique

AI needs to know
what makes this situation different
from the general case.

So we clarify:

“This is legacy code — do not modernize it.”
“This must remain compatible with older versions.”
“This plugin has unusual constraints.”
“This system uses a non‑standard pattern.”
“This code is intentionally simple for beginners.”

A simple reminder:

AI becomes specific when
we reveal what makes the case unique
.


4. The Third Step: Ask AI to Restate the Specific Task

Before continuing with the next step,
we ask AI to summarize:

“What exactly are we trying to do here?”
“What is the specific goal?”
“What is the concrete change?”
“What is the real constraint?”

If the restatement is abstract,
the intent is still unclear.

A simple truth:

Specificity becomes visible when
AI can describe the task precisely
.


5. The Fourth Step: Remove the Abstractions AI Introduced

We identify and remove the drift:

“We don’t need a general solution.”
“Ignore the broader pattern.”
“Skip the best‑practice explanation.”
“Don’t generalize this to other cases.”
“Focus only on the behavior in this file.”

A simple principle:

Clarity improves when we remove
the abstraction
.


6. The Fifth Step: Provide the Concrete Inputs, Outputs, and Constraints

AI becomes specific when the boundaries are specific.

For that, we provide:

  • the exact input
  • the exact output
  • the exact constraint
  • the exact behavior
  • the exact environment

For example:

“This function only receives these three shapes.”
“This value is always a string.”
“This array is never empty.”
“This must run on PHP 7.4.”
“This plugin does not support async behavior.”

A simple truth:

Specific constraints
produce specific solutions
.


7. The Sixth Step: Ask AI to Re‑Solve the Task Using Only the Specific Context

Once grounded,
we ask AI to try again:

“Now solve this using only the details of this case.”
“Stay within the constraints we listed.”
“Use only the patterns already present.”
“Do not generalize beyond this example.”

A simple reminder:

Specificity is not limitation —
it is alignment
.


8. The Seventh Step: Decline and Redirect When Needed

If AI continues to generalize,
we decline:

“This is too abstract.”
“This applies to the category, not this case.”
“Let’s return to the specific example.”
“This introduces patterns that don’t belong here.”

A three‑line principle:

Declining is part of grounding.
Grounding is part of collaboration.
Collaboration is how we keep the work specific
.


9. The Eighth Step: Shrink the Window to Remove General Patterns

AI over‑generalizes when it sees:

  • too many examples
  • too many files
  • too many patterns
  • too much context
  • too much similarity to common cases

So, we shrink the window of reference:

  • showing only the relevant snippet
  • removing unrelated files
  • removing similar examples
  • removing anything that suggests a broader category

A simple principle:

When AI over‑generalizes,
we shrink the window of reference
to reveal the specific
.


10. Closing Note — Specificity Is the Foundation of Real Work

AI sees patterns everywhere.
It drifts toward the general
unless we anchor it in the particular.

We keep the work specific by:

  • anchoring in the actual example
  • naming what makes this case unique
  • asking AI to restate the task
  • removing abstractions
  • providing concrete constraints
  • asking AI to re‑solve
  • declining when needed
  • shrinking the window of reference

A simple closing thought:

AI generalizes by default.
We bring the work back to the specific.
That is how the work stays true
to the real situation
.



Tony de Araujo —New York | Lisbon


working_with_existing_code/how_to_bring_ai_back_from_generalizing.txt · Last modified: by editor