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

questions regarding AugmentedSafetyDataCollator #4

Open
Immortalise opened this issue Nov 17, 2024 · 1 comment
Open

questions regarding AugmentedSafetyDataCollator #4

Immortalise opened this issue Nov 17, 2024 · 1 comment

Comments

@Immortalise
Copy link

Thanks for sharing your insightful work!

I have some questions regarding the implementation of AugmentedSafetyDataCollator and its relationship to equation (2) in the paper:

  1. In finetune.py line 98, I notice that num_shift_tokens in AugmentedSafetyDataCollator is initialized to 0 (default value).

  2. The safety_augmentation data collator (AugmentedSafetyDataCollator) contains two types of input ids:

    • instruction + harmful_response
    • instruction + refusal

From my understanding, the first part of equation (2) should create something like:
instruction + harmful_response[:k] + refusal

Given the current implementation where num_shift_tokens=0 and the structure of the two input ids, I'm unclear how equation (2) is actually implemented. Could you help clarify the relationship between these components? Thanks!

@Unispac
Copy link
Owner

Unispac commented Nov 28, 2024

Hi, the implementation of the data augmentation is in the function starting at https://github.com/Unispac/shallow-vs-deep-alignment/blob/main/finetuning_buckets/trainer/trainer.py#L1000

Sorry for the late reply.

Let me know if you have any other questions :)

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

No branches or pull requests

2 participants