Manual intervene on sequence#184
Merged
karinazad merged 15 commits intoprescient-design:mainfrom Sep 10, 2025
Merged
Conversation
…/lobster into add_mps_support
ncfrey
reviewed
Aug 13, 2025
src/lobster/model/_cbmlm.py
Outdated
| concept: str, | ||
| edits: int, | ||
| intervention_type: str, | ||
| manual_positions: list[int] | None = None, # <-- added arg |
Contributor
There was a problem hiding this comment.
can you add some tests for this new feature?
Contributor
Author
There was a problem hiding this comment.
As of right now, it allows for negative indexing because I thought I'd keep it in line with Pythonic features. Is that okay?
Contributor
Author
|
Also while working on this, I thought it'd be useful for us if the |
Collaborator
|
this looks good to me. happy to approve - can you please make sure the UME changes from the MPS PR are not merged here? |
Contributor
Author
|
hi @karinazad, just made those changes, should be good to merge now! |
karinazad
approved these changes
Sep 10, 2025
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.
Description
Added capability to set indices for mutation in
intervene_on_sequencesin CBMPMLM. Addresses #182.Behavior
If manual_positions is None → keep current attribution-based masking.
If manual_positions is provided:
Skip attribution computation entirely.
Create a (B, L) boolean mask with True at those positions for all sequences in the batch.
Pass that mask to
._mask_inputsso CLS/EOS/PAD are automatically excluded.Proceed with existing concept override and sequence regeneration logic.
Example Usage
Type of Change