ADHD Scoring Algorithm: How Novelty, Viability, and Fit Are Weighted
ADHD employs a weighted scoring algorithm that assigns 40% weight to viability, 35% to novelty, and 25% to fit, calculating a composite total from LLM-generated 0–10 ratings for each dimension.
The ADHD project (UditAkhourii/adhd) implements a multi-dimensional evaluation system to rank generated ideas based on their potential impact and feasibility. This scoring algorithm processes raw ratings through a fixed formula to ensure selected ideas balance innovation with practical constraints.
How the ADHD Scoring Algorithm Works
The scoring algorithm evaluates every generated idea across three distinct dimensions, applying fixed coefficients to raw ratings returned by an LLM-as-judge.
The Three Evaluation Dimensions
- Novelty (35%): Measures how far the idea strays from obvious solutions. This dimension accounts for 35% of the final score.
- Viability (40%): Reflects whether the idea could realistically be shipped. At 40%, this is the heaviest-weighted dimension, acting as a gatekeeper to trap unshippable concepts.
- Fit (25%): Checks how well the idea addresses the original problem statement, representing 25% of the total.
The Weighting Formula
In src/engine.ts (lines 16–19), the algorithm computes the weighted total using the following coefficients:
// Weight: novelty matters because the whole point is escaping the obvious,
// but viability is the gatekeeper — a brilliant unshippable idea is a trap.
const total = r.novelty * 0.35 + r.viability * 0.4 + r.fit * 0.25;
The resulting total is stored alongside individual ratings in the Score object defined in src/types.ts (lines 12–19).
Implementation in the Codebase
The scoring logic resides in src/engine.ts within the scoreIdeas function, which returns a Map<string, Score> linking idea IDs to their evaluated metrics. The Score type interface in src/types.ts captures the individual components—novelty, viability, and fit—along with the computed total. The src/render.ts module subsequently consumes these values to display weighted results in the CLI output.
Working with the Scoring Algorithm
Using the scoreIdeas Function
To evaluate ideas programmatically using the built-in scoring algorithm:
import { scoreIdeas } from "./engine";
import { Idea } from "./types";
const problem = "Create a tool for brainstorming product ideas.";
const ideas: Idea[] = [
{ id: "1", frameId: "f1", text: "AI-driven sketchpad", depth: 0 },
{ id: "2", frameId: "f1", text: "Crowdsourced idea board", depth: 0 },
];
// Use the default model (or pass a specific one)
const scoresMap = await scoreIdeas(problem, ideas, undefined);
// Inspect a single scored idea
const score = scoresMap.get("1");
if (score) {
console.log(`Novelty: ${score.novelty}`);
console.log(`Viability: ${score.viability}`);
console.log(`Fit: ${score.fit}`);
console.log(`Weighted total: ${score.total}`);
}
Manual Weight Calculation
You can replicate the internal scoring algorithm manually:
function weightedTotal(novelty: number, viability: number, fit: number): number {
return novelty * 0.35 + viability * 0.4 + fit * 0.25;
}
// Sample raw scores (0-10)
const raw = { novelty: 8, viability: 5, fit: 7 };
const total = weightedTotal(raw.novelty, raw.viability, raw.fit);
console.log(`Weighted total = ${total}`); // → 6.85
Summary
- The ADHD scoring algorithm applies fixed weights of 35% for novelty, 40% for viability, and 25% for fit to evaluate generated ideas.
- Core calculation occurs in
src/engine.ts(lines 16–19) within thescoreIdeasfunction after receiving raw 0–10 ratings from the LLM. - Results are stored in the
Scoretype defined insrc/types.ts(lines 12–19), which includes both individual dimension scores and the weighted total. - The algorithm prioritizes viability as the gatekeeper metric to ensure only shippable ideas receive high rankings.
Frequently Asked Questions
What is the ADHD scoring algorithm?
The ADHD scoring algorithm is a weighted evaluation system that converts LLM-generated ratings into a composite score. It processes three dimensions—novelty, viability, and fit—using coefficients of 0.35, 0.4, and 0.25 respectively, ensuring that ideas must be both innovative and practical to rank highly.
How are the weights distributed in ADHD?
Viability receives the highest weight at 40% (0.4), serving as the primary gatekeeper to prevent unshippable ideas from advancing. Novelty accounts for 35% (0.35) to reward creative deviation from obvious solutions, while fit represents 25% (0.25), ensuring alignment with the original problem statement.
Where is the scoring logic implemented in ADHD?
The weighting formula is implemented in src/engine.ts at lines 16–19 within the scoreIdeas function. The supporting data structure is declared in src/types.ts at lines 12–19, which defines the Score interface containing the individual ratings and computed total field.
Can I customize the weights in the ADHD scoring algorithm?
According to the current implementation in UditAkhourii/adhd, the weights are hardcoded constants (0.35, 0.4, 0.25) in the scoreIdeas function within src/engine.ts. To modify the weighting scheme, you must edit the source code directly, as the algorithm does not expose configuration parameters for these coefficients.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →