Skip to content

Add top-score magnitude gating to hybrid fusion alpha #282

@Destrayon

Description

@Destrayon

Description

Entropy-based adaptive alpha alone misses the failure mode where a retrieval leg has a peaked distribution but absolutely low scores. Add magnitude gating: multiply the entropy-derived weight by clamp(max_raw_score / threshold, 0, 1) so that legs with low absolute scores are downweighted regardless of distribution shape. This approach was validated at the ICML 2025 Workshop on Vector Databases (entropy-based dynamic hybrid retrieval paper).

Evidence: exp-020 showed +2.77% retrieval quality improvement with no speed cost.

Acceptance Criteria

  • ComputeEffectiveAlpha incorporates magnitude factor alongside entropy
  • VectorMagnitudeThreshold and KeywordMagnitudeThreshold settings added
  • EnableMagnitudeGating toggle added (default: true)
  • Magnitude gating can be disabled without affecting existing entropy logic
  • Tests pass (dotnet test)

Implementation Notes

  • Key files: src/Connapse.Search/Hybrid/HybridSearchService.cs, src/Connapse.Core/Models/SettingsModels.cs
  • Pattern: Extend existing ComputeEffectiveAlpha method
  • Reference: auto-rag-eval/results/exp-020-query_adaptive_alpha-e0a55f-changespec.json

Size Estimate

S — ~60 lines across 2 files

Related

none

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: searchSearch functionalitysize/S50-150 lines changedtype: enhancementImprovement to existing functionality

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions