Skip to content

fix(activation): prevent boost saturation under rapid queries#8

Merged
aayoawoyemi merged 1 commit into
aayoawoyemi:mainfrom
maichler:fix/boost-saturation
Mar 21, 2026
Merged

fix(activation): prevent boost saturation under rapid queries#8
aayoawoyemi merged 1 commit into
aayoawoyemi:mainfrom
maichler:fix/boost-saturation

Conversation

@maichler

Copy link
Copy Markdown
Contributor

Fixes #7.

Two complementary fixes:

  1. Per-query cap (0.05): limits how much a single query can contribute to any one note, making accumulation rate-independent.

  2. Log-scale accumulation: replaces linear existing + new with 1 - (1 - existing) * (1 - new). Each successive boost has diminishing returns as the value approaches 1.0.

After 20 rapid queries a note reaches ~0.64 instead of saturating at 1.0. The 7-day half-life decay is unchanged, so human-pace usage still accumulates meaningfully.

Includes tests covering per-query cap, diminishing returns, bulk ingestion, and human-pace accumulation.

The spreading activation accumulation was vulnerable to saturation:
any note reachable within 2 hops would hit the 1.0 ceiling after
~11 queries (hop-1) or ~19 queries (hop-2). The 7-day half-life
decay couldn't compensate because within-session queries share
the same timestamp, so boosts accumulated at full strength.

This affects not just machine-speed evaluation runs but any bulk
ingestion scenario (conversation logs, note migration, backfills)
where many queries arrive faster than the decay timescale.

Two complementary fixes:

1. Per-query cap (PER_QUERY_CAP = 0.05): limits how much a single
   query can contribute to any one note, regardless of RRF score.
   This makes accumulation rate-independent -- 30 queries in 30
   seconds or 30 days contribute the same bounded amount each.

2. Log-scale accumulation: replaces linear `existing + new` with
   `1 - (1 - existing) * (1 - new)`. Each successive boost has
   diminishing returns as the value approaches 1.0. After 20
   rapid queries, a note reaches ~0.64 instead of saturating.
   After 100 queries, still under 0.995.

The 7-day half-life decay is completely unchanged -- human-pace
usage (queries spread across days/weeks) still accumulates
meaningfully, and inter-session decay works as before.

Math for the chosen cap value (0.05):
- 5 queries  -> ~0.23 (noticeable but not dominant)
- 10 queries -> ~0.40 (a focused research session)
- 30 queries -> ~0.79 (heavy use, still not saturated)
- 100 queries -> ~0.994 (bulk ingestion, asymptotic)

@aayoawoyemi aayoawoyemi left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right approach to prevent boost saturation. Updated existing tests in tests/core/activation.test.ts to match the new cap + log-scale behavior. New test file at src/core/activation.test.ts — project convention is tests/core/. Appreciate you, merging.

@aayoawoyemi aayoawoyemi merged commit 65db12f into aayoawoyemi:main Mar 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spreading activation saturates under rapid queries

2 participants