feat: improve skill_fitness_metric with multi-dimensional scoring#28
Open
vominh1919 wants to merge 1 commit intoNousResearch:mainfrom
Open
feat: improve skill_fitness_metric with multi-dimensional scoring#28vominh1919 wants to merge 1 commit intoNousResearch:mainfrom
vominh1919 wants to merge 1 commit intoNousResearch:mainfrom
Conversation
Replaces the single keyword-overlap scorer with a weighted composite of five independent signals that spread scores across a much wider range: 1. Keyword overlap (25%) - stop-word filtered, F1-style blend 2. Character 3-gram similarity (25%) - Jaccard on char shingles 3. Structural pattern matching (20%) - code blocks, lists, headers 4. Length quality (15%) - proportional to expected output length 5. Content density (15%) - unique token ratio, avg token length, variety Also: - Returns dspy.Prediction(score=float, feedback=str) for GEPA reflective mutation compatibility - Feedback string highlights specific weaknesses for optimizer use - All scoring is deterministic (no LLM calls) for speed during optimization loops Fixes NousResearch#12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the single keyword-overlap scorer in
skill_fitness_metric()with a weighted composite of five independent signals that spread scores across a much wider range.Fixes #12
Problem
The original metric used only keyword overlap (
len(expected & output) / len(expected)), producing scores in a narrow 37-49% band regardless of actual output quality.Solution
Five scoring components, each providing independent signal:
Additional changes
dspy.Prediction(score=float, feedback=str)for GEPA reflective mutation compatibilityTesting
The new metric produces varied scores across different output qualities rather than clustering in a narrow band.