Skip to content

SelfLearningRvfBackend feedback and contrastive learning are disconnected from retrieval #14

Open

Description

@thesoulpole

Versions

Reproduction

  1. Create SelfLearningRvfBackend with learning: true.
  2. Insert two vectors.
  3. Call searchAsync().
  4. Call recordFeedback(firstHit.id, 1.0), using the returned document ID.
  5. Inspect getLearningStats().

Observed:

  • Returned hits expose only id, distance, similarity, and metadata; there is no query or trajectory handle.
  • Feedback using the returned hit ID records zero trajectories.
  • Guessing the hidden internal ID q_0 records one trajectory, proving the trajectory exists but its identifier is unreachable through the public result.
  • Feeding one low-quality and one high-quality trajectory through guessed q_N identifiers still creates zero contrastive samples and zero training batches.
  • forceLearn() does not change that result.

Root cause

There are three independent breaks in the loop:

  1. searchAsync() creates a private q_N key but never returns it or accepts a caller-owned correlation key.
  2. recordFeedback() does not assign the matching recentSearches[].quality, while contrastive sample creation requires that value.
  3. ContrastiveTrainer.project() is not called by the search path, so even trained projection weights cannot affect retrieval.

Impact

The advertised self-learning path can collect neither normal asynchronous feedback safely nor use contrastive training to change rankings. Applications may believe retrieval is learning when it is effectively unchanged.

Requested fix

  • Accept a caller-provided opaque feedbackId in search options, with duplicate-ID validation.
  • Link feedback quality to the matching recent search.
  • Apply the trained projection to retrieval only after a trained batch exists.
  • Add concurrent and out-of-order feedback tests.
  • Add an end-to-end held-out test showing that feedback measurably changes ranking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions