Skip to content

feat: Improve ranking diversity - #23

Merged
Pringled merged 2 commits into
mainfrom
improve-ranking-diversity
Apr 16, 2026
Merged

feat: Improve ranking diversity#23
Pringled merged 2 commits into
mainfrom
improve-ranking-diversity

Conversation

@Pringled

@Pringled Pringled commented Apr 16, 2026

Copy link
Copy Markdown
Member

This PR improves ranking diversity by penalizing chunks from the same file sooner. This boosts the benchmark score from 0.867 to 0.882. It also generalizes re-export files and adds a java specific file that we can safely ignore.

…enalty

Reduce _FILE_SATURATION_THRESHOLD from 2 to 1 so the second chunk from the
same file is penalised immediately. Since search results are evaluated at the
file level, duplicate chunks from the same file waste ranking slots that could
surface different target files. This is the dominant failure mode across all
languages in the benchmark.

Also add a moderate penalty for package-info.java (Java package documentation
metadata), matching the existing __init__.py treatment.

Benchmark (main's 29-repo suite): NDCG@10 0.867 → 0.882 (+0.015).
All 12 languages improved or held steady (Kotlin +0.048, Python +0.024,
JavaScript +0.022, Swift +0.020, TypeScript +0.020).
NDCG@10: 0.882 (baseline 0.867, +0.015)
@Pringled
Pringled merged commit 467eef7 into main Apr 16, 2026
8 checks passed
@Pringled
Pringled deleted the improve-ranking-diversity branch April 22, 2026 05:05
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.

1 participant