fix(gate): resolve issue #100#102
Open
SparshGarg999 wants to merge 1 commit into
Open
Conversation
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.
Root Cause
SkillOpt uses score-based rollouts to accept or reject edits to the prompt skill text. Currently, the validation gate score does not account for the semantic steerability or conciseness of the prompt content itself. This makes it harder for the optimizer to favor terminology carrying strong, well-defined associations for the target model or to prune unnecessary verbosity.
Solution
We introduced a "semantic density" heuristic into the validation gate's score projection mechanism.
compute_semantic_densityinskillopt/evaluation/gate.py, which computes the density of high-influence prompt words ("leading words") relative to the total active words in a skill document, stripping metadata comment regions.select_gate_scoreandevaluate_gateto accept configuration parameters (use_semantic_density,semantic_density_weight, andleading_words). When enabled, the heuristic bonusweight * densityis added to the metric score.skillopt/config.pyand parsed config parameters inskillopt/engine/trainer.pyto seamlessly pass these parameters during training run evaluations.Files Changed
skillopt/config.pyskillopt/engine/trainer.pyskillopt/evaluation/gate.pytests/test_sleep_engine.pytests/test_semantic_density.py(NEW)Testing/Benchmark Performed
tests/test_semantic_density.pyto verify case-insensitive word count density calculation, bonus score projection, and gating decisions favoring more concise/steerable skills when accuracy is tied.Fixes #100