Comments (3)
Thanks for the issue. Regarding the model
The default AutoModelForSequenceClassification implementation in Transformers uses bias=False for the classification nn.Linear
That is expected because bias
cancels out in the RM loss. Here is a script that trains using the said RM
examples/scripts/ppo/ppo.py --output_dir models/minimal/ppo1 --num_ppo_epochs 4 --num_mini_batches 1 --learning_rate 3e-6 --per_device_train_batch_size 32 --gradient_accumulation_steps 16 --local_rollout_forward_batch_size 32 --total_episodes 100000 --model_name_or_path EleutherAI/pythia-1b-deduped --sft_model_path EleutherAI/pythia-1b-deduped --reward_model_path trl-internal-testing/rm_sentiment_1b --kl_coef 0.1 --stop_token period --non_eos_penalty --min_response_length 13 --penalty_reward_value -3
wandb here: https://wandb.ai/costa-huang/huggingface/runs/fmof4oxq/workspace?nw=nwusercostahuang
You can see the model's completion works as intended: the output text becomes more positive.
Screen.Recording.2024-06-27.at.1.40.49.PM.mov
t seems the value model is instantiated separately. Is my understanding correct here?
yes. separate value network is per OpenAI's setting in summarize from feedback and instructGPT
P.S. For context, I've been working on a PPO implementation in parallel in Torchtune pytorch/torchtune#1005, and I've found all the empirical work and implementation details invaluable so far.
that's amazing 💪👍!
from trl.
Thanks so much for the reply!
Here is a script that trains using the said RM
I've been hunting for this whilst I was doing some replication work against PPOV2 - so helpful, thanks :)
separate value network is per OpenAI's setting in summarize from feedback and instructGPT
I'd be really interested to hear if you have any thoughts on reducing the memory footprint of PPO - I noticed you guys were trying out some PEFT stuff similar to PPOV1, did you end up scaling the PEFT experiments to compare?
from trl.
Yes peft absolutely helps with the memory. In the N+ impl work @mnoukhov did some peft work and they perform pretty well, too. See screenshot below (missing the 6.9B lora checkpoint results, but it's pretty promising).
![image](https://private-user-images.githubusercontent.com/5555347/343965538-a9d7c219-0af3-4a3d-8606-ced9c4efb62c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwMjU3MDIsIm5iZiI6MTcyMDAyNTQwMiwicGF0aCI6Ii81NTU1MzQ3LzM0Mzk2NTUzOC1hOWQ3YzIxOS0wYWYzLTRhM2QtODYwNi1jZWQ5YzRlZmI2MmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDNUMTY1MDAyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzVlYWFmZmEyMjY4NTVlNzgyMWIwZDc5MjJhNTEyYTNmODFiNWIxMmU5ZjAxMmM5YjljZjI2ODYzNzhmM2ZlYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.L65qsdYpAGM3gH88NZ7vpIypvfIs6pU5ctU0r9AosTg)
from trl.
Related Issues (20)
- What is the difference between PPOv2Trainer and PPOTrainer? HOT 1
- Using IterableDataset crashed the SFTTrainer
- Neftune is applied twice; in trl and transformers BOTH! HOT 1
- SFTTrainer device error even though it doesn't take device as an argument
- Can bert be used for dpo training?
- Want to use zero3 to train KTO and met error
- DDPO trained model error when used to generate images HOT 1
- Getting "KeyError: None" when passing conversational dataset HOT 1
- The DPO 'grad_norm': 0.0,
- Conflict in start index under `batched_forward_pass`
- Supports of SFTTrainer / PPOTrainer / DPOTrainer for LLaVA-alike model HOT 5
- Error with SFT of LLaVA-Next HOT 2
- Lora seems to be invalid when using vsft_llava.py HOT 4
- Optimizing an LLM Using DPO: nan Loss Values During Evaluation
- Low loss but can't get the expected output during inference
- In PPOv2Config and RLOOConfig, the base_model parameter doesn't seem to be used, why does it exist? HOT 1
- what's the difference between PPO Trainer and PPOv2 Trainer? HOT 1
- [Feature] Add DiscoPOP algorithm
- Drop `use_cache=False if training_args.gradient_checkpointing` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trl.