Deterministic scoring is the ranking layer that produces the same ordered stack for the same profile every time, using only stable inputs and fixed rules before any experimental modifiers are layered on. It is what keeps a recommendation engine from drifting week to week when the core facts about the user have not changed.
Why it matters
A recommendation system should be legible. If a user's goals, medications, and adherence pattern have not changed, the top three candidates should not swap places on a Tuesday. Deterministic scoring is the contract that makes that legibility possible, and it is the part of the recommendation ranking a user can reason about without a statistics background.
What counts as a deterministic input
Deterministic inputs are facts about the user or the compound library that do not shift on short timescales:
- Active goals and goal weights (focus, sleep, recovery, mood).
- Hard contraindications (medications, conditions, known allergies).
- Required exclusions (pregnancy, stimulant-sensitive, SSRI overlap).
- Adherence class from the last 28 days.
- Ingredient metadata pulled from evidence tier and evidence quality metadata.
Non-deterministic inputs include freshness of evidence, novelty bonuses, and short-window effect signals that should influence the final list but should not be allowed to destabilize the base order.
A worked before-and-after example
Same user, same goals (focus + recovery), same meds. Only the stack state changes after two weeks.
| Rank | Baseline week | Score | After 2 weeks, magnesium adherence 95%, caffeine skipped 4 days | Score |
|---|---|---|---|---|
| 1 | Caffeine + L-theanine (AM) | 0.82 | Creatine 5g | 0.81 |
| 2 | Magnesium glycinate (PM) | 0.79 | Magnesium glycinate (PM) | 0.79 |
| 3 | Creatine 5g | 0.77 | L-theanine (AM, standalone) | 0.74 |
| 4 | L-theanine (AM, standalone) | 0.70 | Caffeine + L-theanine (AM) | 0.68 |
| 5 | Ashwagandha 600mg (PM) | 0.64 | Ashwagandha 600mg (PM) | 0.64 |
What moved and why. Caffeine's adherence collapsed (4 skips across 14 days), so the stacked item fell and the deterministic stimulant-exposure rule downweighted the pairing. Creatine rose because magnesium's strong adherence pulled a recovery-adjacent neighbor up through the goal weighting. Ashwagandha did not move — no input about it changed, which is exactly the behavior reproducibility requires.
Deterministic vs experimental factors
| Layer | Inputs | Allowed to change rank? |
|---|---|---|
| Deterministic | Goals, contraindications, adherence, ingredient metadata | Yes, always |
| Semi-stable | Fresh evidence additions, updated interaction warnings | Yes, clearly disclosed |
| Experimental | Novelty bonus, seasonal modifiers, cohort effect signals | Only with a visible tag |
The semi-stable and experimental layers are added after the deterministic ranking is fixed, and the UI surfaces which layer moved a line item. A user can turn experimental layers off and see the pure deterministic list on demand.
Reproducibility contract
For the same profile, goals, and medication context, the top 10 deterministic candidates should reproduce exactly across cycles. Any change to the order should map to one of:
- A goal was added, removed, or reweighted.
- A medication or exclusion changed.
- Adherence class shifted a full band (for example, 65% → 85%).
- An ingredient's metadata was updated in the library, with a visible changelog entry.
- The user used a manual override.
Anything outside this list is a bug, not a feature. Reproducibility is the check that tells a user whether the system is reasoning or guessing.
How this appears in Unfair
Unfair computes deterministic rank first, freezes the top 10, and then renders experimental modifiers as visible chips next to each line item — never as silent re-orders. A profile change that reshuffles the order is accompanied by a one-line rationale, so the user can trace why the list moved. This is the contract behind every ranked output and every current supplements input review.
Clinical safety note
Deterministic scoring does not substitute for clinical judgment. A ranking that places a compound high because no contraindication is on file cannot know about a diagnosis the user has not entered. Keep the medication and condition profile current, and verify any stimulant or mood-active compound with a clinician before adding it to an active stack.