Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements learned filter cascade #23

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

pgasawa
Copy link
Collaborator

@pgasawa pgasawa commented Oct 28, 2024

  • Adds learned filter cascade code from research experiments
  • Updates op_examples and github tests for the filter cascade operations

@pgasawa pgasawa requested review from sidjha1 and liana313 October 28, 2024 17:55
Copy link
Collaborator

@sidjha1 sidjha1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @pgasawa, looks great!


assert "I am really excited to go to class today!" in filtered_df["Text"].values
assert "I am very sad" not in filtered_df["Text"].values
assert stats["filters_resolved_by_helper_model"] > 0, stats
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a simple question for my own understanding - is assert stats["filters_resolved_by_helper_model"] > 0 ever going to be flaky depending on the large/small model. Or is this super safe?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question -- I think achieving >0 helper calls with a .9/.9 targets for this task should be simple enough for language models that I really wouldn't expect it to be flaky. Worst case if it comes to it the line can be removed, though I'd personally be a bit surprised if it failed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying, let's keep it then

def importance_sampling(
proxy_scores: list[float],
sample_percentage: float,
):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful to have output types here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added for all util funcs in the file!

@pgasawa pgasawa merged commit 9dab975 into main Oct 29, 2024
2 checks passed
@pgasawa pgasawa deleted the pgasawa/learned-filter-cascade branch October 29, 2024 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants