Repository navigation
fix(generation): ground v1 exercises in the module that teaches them - #79
Merged
Merged
Conversation
The v1 generator and reviewer only anchored questions to the source, so an exercise could quote any fact of the document whatever the module covered. Add an alignment rule to both prompts, scope each module's context to its own material instead of the whole document, and drop exercises whose answer key cannot be graded (out-of-range correct, mismatched blanks, non-permutation order) so an unpassable exercise never ships.
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.
Testers reported exercises that don't match the module's lessons: a question about a fact the module never explained.
Two causes, both in v1 generation:
_module_contextloaded all chunks and then ran a similarity search that could add nothing, since each hit was already in the map. A module could write a question about any section. It now retrieves chunks for its own title and summary, and only falls back to the full document if embeddings are unavailable.I also drop exercises whose answer key can't be graded (correct index out of range, blank count that doesn't match, an order that isn't a permutation). An unpassable exercise blocks the whole course, so dropping it is the lesser failure. It logs a warning.
Testing:
test_llm_client.py::test_a_model_whose_thinking_is_opt_in_is_left_alonefails the same way onmain.deepseek-chatonmainand on this branch, and had the same model check each exercise against its module's lessons. Both came out at 0 unanswerable (30 and 34 exercises). That document is short and goes through the full-text path, so it doesn't exercise the per-module retrieval. I couldn't test that path: it needs a real embedding model.Backport to
developafter release.