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

Dummy token for prompts in HH datasets #308

Open
louieworth opened this issue May 28, 2024 · 2 comments
Open

Dummy token for prompts in HH datasets #308

louieworth opened this issue May 28, 2024 · 2 comments

Comments

@louieworth
Copy link

I am issue regarding the Anthropic/hh-rlhf dataset, in reward_dataset.py:

# Anthropic/hh-rlhf
# tasksource/oasst1_pairwise_rlhf_reward
if exist_and_not_none(data, "chosen") and exist_and_not_none(data, "rejected"):
    prompt = data["prompt"] if exist_and_not_none(data, "prompt") else ""
    if prompt.startswith("prompter:"):
        prompt = (
            prompt.replace("prompter:", "\nHuman:\n").replace("assistant:", "\nAssistant:\n")
            + "\nAssistant:\n"
        )
    chosen = data["chosen"]
    reject = data["rejected"]
    input_template = None  # do not modified with input template again

This will result in prompt="" for every sample as the Anthropic/hh-rlhf = {'chosen', rejected}`. Will this cause an issue in accounting the logits of prompts in the following code:

mask[:source_len] = False

@hijkzzz
Copy link
Collaborator

hijkzzz commented May 29, 2024

Theoretically, whether mask prompt or not has no effect on DPO loss.

@louieworth
Copy link
Author

It seems true as the prompt logits will be canceled by (chosen_logits - rejected_logits). Will this affect other algorithms? such as KTO?

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