What Makes ADHD Architecturally Different from Single-Shot Prompting

TLDR: ADHD (Adaptive Divergent-Thinking for Agents) replaces the monolithic generation-and-evaluation of single-shot prompting with a mechanically separated two-phase pipeline that isolates divergent idea generation from convergent critique, eliminating anchoring bias through parallel, context-isolated LLM calls.

The UditAkhourii/adhd repository introduces a fundamentally different approach to LLM reasoning that explicitly rejects the "think-then-answer" paradigm of conventional single-shot prompting. Instead of relying on one model instance to both generate ideas and evaluate them within the same context window, ADHD enforces strict architectural boundaries between creation and criticism. This design, implemented across src/engine.ts and src/frames.ts, systematically addresses the premature convergence and anchoring biases that plague single-shot methods.

The Two-Phase Pipeline: Mechanical Separation of Concerns

Single-shot prompting collapses reasoning into a single pass where the LLM implicitly both generates candidates and selects among them. In contrast, ADHD architecturally forbids this conflation.

Single-shot control flow forces one LLM call to handle generation, evaluation, and final selection within a shared context window. This causes the model to anchor on early outputs and bias subsequent reasoning.

ADHD's diverge-focus architecture explicitly splits these functions into mechanically distinct phases:

  • Phase 1 – Diverge: N parallel query() calls execute simultaneously, each fed a unique cognitive frame and governed by a generator system prompt that explicitly forbids evaluation (src/engine.ts, lines 61-70).
  • Phase 2 – Focus: A separate critic call scores, clusters, and deepens the top-K ideas using an opposite critic system prompt that specializes in evaluation (src/engine.ts, lines 71-89).

This separation ensures that the generative process remains uninhibited by premature judgment, while the evaluative process has full visibility of all generated options.

Isolated Contexts: Eliminating Anchoring by Construction

A critical vulnerability in single-shot prompting is context bleeding—where generated steps share the same context window, causing the model to anchor on the first output and bias subsequent ideas.

ADHD eliminates this by design. Each divergent branch runs in complete isolation; no branch can see another's output, effectively removing anchoring bias by construction (documentation/vs-cot-and-tot.md, lines 9-11). This architectural guarantee differs from simple "list five options" prompting, where the model still produces options sequentially within the same stateful context.

Cognitive Frames: Structured Perspective Shifting

Rather than relying on vague instructions like "be creative," ADHD drives divergence through cognitive frames that re-pose the entire problem from distinct viewpoints—such as "think as a regulator" or "think as a speed-runner" (documentation/vs-cot-and-tot.md, lines 22-24).

These frames, defined in src/frames.ts, serve as branch drivers that ensure true cognitive diversity. Unlike single-shot prompting where the model maintains a fixed persona, each parallel branch in ADHD adopts a fundamentally different reasoning stance, maximizing the solution space coverage.

True Parallelism and Concurrent Execution

Single-shot prompting is inherently sequential; the model produces one token stream after another. ADHD leverages true concurrency, with each frame spawning a separate LLM request that executes in parallel (documentation/vs-cot-and-tot.md, lines 13-14).

This is implemented using Promise.all to orchestrate concurrent API calls:

// Phase 1: Diverge - spawn N isolated branches with distinct frames
const branches = await Promise.all(
  frames.map((f) =>
    limit(async () => {
      const b = await divergeBranch(divergeProblem, context, f, ideasPerFrame, model);
      return b;  // Each branch is an independent LLM call with isolated context
    })
  )
);

The limit wrapper manages concurrency while ensuring each divergeBranch executes as a separate request, preventing any cross-contamination of reasoning chains.

The Mechanical Critic: Explicit vs. Implicit Evaluation

In single-shot prompting, evaluation is implicit and contaminated—the model "self-evaluates" within the same prompt that generated the candidates. ADHD introduces a mechanical split where the critic is a distinct LLM call with its own system prompt.

This critic scores each idea on novelty, viability, fit, and explicitly flags traps (src/engine.ts, lines 71-88):

// Phase 2: Focus - separate critic pass for scoring and clustering
const [scoreMap, clusters] = await Promise.all([
  scoreIdeas(problem, allIdeas, critic),   // Dedicated critic model/system prompt
  clusterIdeas(problem, allIdeas, critic),
]);

// Phase 3: Deepen - expand top-K ideas in a third isolated call
const deepened = await Promise.all(
  toDeepen.map((idea) => limit(() => deepenIdea(problem, idea, allIdeas, model)))
);

The critic parameter represents a separately configured LLM instance with evaluation-specific instructions, fundamentally different from the model used in the diverge phase.

Architectural Goals: Escaping Premature Convergence

The explicit goal of ADHD's architecture is to escape premature convergence by surfacing non-obvious, viable options and detecting reasoning traps that single-shot methods miss (README.md, lines 24-27).

Evaluation results in README.md (lines 88-95) demonstrate that this architectural separation yields higher breadth, novelty, and trap detection compared to conventional approaches. Where single-shot prompting optimizes for immediate answer generation, ADHD optimizes for thorough optionality and validated selection.

Summary

  • Mechanical separation: ADHD splits generation and evaluation into distinct LLM calls (diverge vs. focus phases), while single-shot prompting conflates them in one context.
  • Context isolation: Each divergent branch executes in complete isolation, eliminating the anchoring bias present in sequential single-shot generation.
  • Frame-driven diversity: Cognitive frames in src/frames.ts enforce distinct reasoning perspectives, unlike the uniform approach of single-shot prompting.
  • Explicit parallelism: True concurrent API calls replace sequential token generation, maximizing throughput and independence.
  • Dedicated critic: A separate mechanical critic with specialized system prompts performs evaluation, avoiding the self-evaluation contamination of single-shot methods.

Frequently Asked Questions

How does ADHD prevent anchoring bias?

ADHD prevents anchoring bias by mechanically isolating each reasoning branch. In src/engine.ts, each divergeBranch call executes as a separate LLM request with no shared context between branches, ensuring that the generation of one idea cannot influence another. This contrasts with single-shot prompting, where sequential generation within the same context window causes the model to anchor on early outputs.

What are cognitive frames in ADHD?

Cognitive frames are structured perspective prompts defined in src/frames.ts that re-pose the problem from distinct viewpoints (e.g., regulator, speed-runner, pessimist). Unlike simple prompting variations, each frame spawns an entirely isolated LLM branch, ensuring genuine cognitive diversity rather than surface-level lexical variation.

Why is the critic phase necessary?

The critic phase provides mechanical separation between generation and evaluation. By forcing ideas to pass through a distinct LLM call with a critic-specific system prompt (src/engine.ts, lines 71-88), ADHD avoids the "self-evaluation" problem where a generating model inflates the quality of its own outputs. This explicit scoring on dimensions like novelty and trap-risk validates ideas against objective criteria.

Does ADHD require more API calls than single-shot prompting?

Yes, ADHD trades latency for breadth by design. While single-shot prompting uses one API call, ADHD requires N+1 minimum calls (N parallel diverge calls plus at least one critic call). However, these calls run concurrently where possible, and the architectural trade-off is justified by significantly higher solution quality and trap detection as shown in the repository's evaluation metrics.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →