Add difficulty-controlled Sample-N preference generation pipeline#209
Open
EMZEDI wants to merge 1 commit into
Open
Add difficulty-controlled Sample-N preference generation pipeline#209EMZEDI wants to merge 1 commit into
EMZEDI wants to merge 1 commit into
Conversation
Implement RLCD-style persona-conditioned candidate sampling, rubric-based scoring, and West-of-N margin pair selection. - Add pair selector with margin/length constraints - Add persona prompt generation and default schedule - Add rubric judge prompt/schema/scoring helper - Add opt-in generation_config path in engine - Add CLI knobs (--n-candidates, --target-margin) with YAML generation block support - Add/extend tests for selector and response mapper - Preserve legacy generation behavior when generation config is absent
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
This PR implements an opt-in difficulty-controlled preference data generation pipeline for AIF-Gen using:
The pipeline follows: Sample-N -> Score -> Select-by-Margin and introduces two primary knobs:
n_candidates(cost/coverage)target_margin(0hardest,1easiest)Legacy behavior is preserved when no generation config is provided.
What was added
New pair selector module:
aif_gen/generate/mappers/pair_selector.pyScoredCandidatedataclassselect_pair(...)with:Response mapper enhancements:
generate_candidate_prompt(...)with personas:alignedanti_alignedneutraldefault_persona_schedule(...)aif_gen/generate/mappers/__init__.pyRubric judge additions in
aif_gen/validation/llm_judge.py:_get_rubric_judge_prompt(...)_RubricResponseschema_get_rubric_score(...)preference_adherence: 0.6objective_fidelity: 0.25coherence: 0.15Generation engine refactor (
aif_gen/generate/engine.py):generate_continual_dataset(..., generation_config=None)_generate_sample_sampled(...)generation_configis absentCLI wiring (
aif_gen/cli/commands/generate.py):--n-candidates--target-margingeneration:blockTests
test/test_generate/test_pair_selector.pytest/test_generate/test_response_mapper.pyValidation run:
pytest test/ -x -q-> 197 passedNotes
generation:block.