Skip to content

Conversation

@Yohjishong
Copy link
Contributor

What does this PR do?

Fixes #160

Now, the "aggregator" is expanded to three types: "closer_to_1_better", "true_better", "prob_mean".

You can modify the “aggregator” in the file "configs/eval/tofu_metrics/forget_Truth_Ratio.yaml" to change the method to calculate the Truth_Ratio.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Have you gone through the contributions guide?
  • Are your changes documented? Read documentation guidelines here.

Copy link
Collaborator

@molereddy molereddy left a comment

Choose a reason for hiding this comment

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

Thank you for adding this. Few small comments to clean things up and clarify some comments, and we can merge this in.


handler: truth_ratio
aggregator: closer_to_1_better
aggregator: prob_mean
Copy link
Collaborator

Choose a reason for hiding this comment

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

This edit can be removed. The prob_mean is best added only as an option as it is not the way truth ratio is usually used in the literature, which follows how the TOFU paper implemented it.

# Original definition: wrong / correct
truth_ratios = wrong_prob / (correct_prob + 1e-10)
else:
# New definition: correct / (correct + wrong)
Copy link
Collaborator

Choose a reason for hiding this comment

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

better call this as the definition from OpenUnlearning than "new"

truth_ratios = wrong_prob / (correct_prob + 1e-10)

if use_original_ratio:
# Original definition: wrong / correct
Copy link
Collaborator

Choose a reason for hiding this comment

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

better call this as the definition from TOFU paper for clarity

@molereddy
Copy link
Collaborator

Also, make sure the lint tests pass. Instructions for formatter setup here: https://github.com/locuslab/open-unlearning/blob/main/docs/contributing.md#create-a-pull-request

@Yohjishong
Copy link
Contributor Author

Thank you for your guidance. I have changed and commited again. It has "make quality" in my own computer.

Copy link
Collaborator

@molereddy molereddy 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!!

@molereddy molereddy merged commit d3d7cf9 into locuslab:main Dec 24, 2025
1 check passed
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.

Truth Ratio implementation question

2 participants