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

Synthetic preference dataset #332

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

vwxyzjn
Copy link
Collaborator

@vwxyzjn vwxyzjn commented Sep 5, 2024

Useful to reuse our existing rejection sampling infra and build on top of it to create synthetic preference dataset

# 1. first sample a bunch of completions given prompts
# Here is an example created dataset: https://huggingface.co/datasets/vwxyzjn/generation_1725567768
python open_instruct/rejection_sampling/generation.py \
    --dataset_name HuggingFaceH4/no_robots \
    --model_name_or_path allenai/llama-3-tulu-2-8b \
    --num_completions 3 \
    --save_filename output/completions.jsonl \
    --sanity_check \
    --push_to_hub

Create preference pairs

# 2.1 do LLM as a judge to create synthetic preference dataset
# Here is an example created dataset: https://huggingface.co/datasets/vwxyzjn/synthetic_preference_dataset_1725567862
python open_instruct/rejection_sampling/synthetic_preference_dataset.py \
    --input_filename output/completions.jsonl \
    --model gpt-4o-2024-08-06 \
    --save_filename output/synthetic_preferences.jsonl \
    --num_completions 3 \
    --push_to_hub \

Multiple prompt pairs as well.

image

image

@ValentinaPy
Copy link
Contributor

Very cool! I can run it over the WildChat prompts!

@vwxyzjn vwxyzjn changed the title push changes Synthetic preference dataset Sep 5, 2024
@nouhadziri
Copy link
Contributor

This is pretty cool Costa! thanks for adding this. LGTM

@vwxyzjn vwxyzjn mentioned this pull request Sep 11, 2024
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.

3 participants