This project builds on the idea from Quiet-STaR of leveraging RL to train a model to generate text for reasoning prior to predict the next token. There are some key limitations of the original approach:
conda create -n ntp_rl python=3.11
conda activate ntp_rl
# for quietstar
git clone git+https://github.com/wise-east/transformers.git@quietstar
cd transformers
pip install -e .
cd ..
pip install -r requirements-quietstar.txt
# for current version of huggingface transformers where fasttokenizers work
pip install -r requirements.txt
Example:
# compute entropy at each token position
python compute_entropy.py --model mistralai/Mistral-7B-v0.1
# for quietstar
python inference_quietstar.py
# activate the conda environment with current version of huggingface transformers where fasttokenizers work
# visualize the entropies on a web page. darker color means the token position has higher entropy (i.e., given the text before the highlighted position, the model is more uncertain about predicting the current position).
python visualize_entropies.py --port 7860 --host 127.0.0.1 --n 20
./sync_ntp_rl.sh./sync_ntp_rl.sh -pThe reason we do this is because cursor doesn't make code suggestions with SSH FS and USC's cluster doesn't allow Remote-SSH for direct development on the remote machine. Refer to guidelines on USC CARC website.
6 commits
Python
69.4%
HTML
22.4%
Shell
8.2%
This project builds on the idea from Quiet-STaR of leveraging RL to train a model to generate text for reasoning prior to predict the next token. There are some key limitations of the original approach:
conda create -n ntp_rl python=3.11
conda activate ntp_rl
# for quietstar
git clone git+https://github.com/wise-east/transformers.git@quietstar
cd transformers
pip install -e .
cd ..
pip install -r requirements-quietstar.txt
# for current version of huggingface transformers where fasttokenizers work
pip install -r requirements.txt
Example:
# compute entropy at each token position
python compute_entropy.py --model mistralai/Mistral-7B-v0.1
# for quietstar
python inference_quietstar.py
# activate the conda environment with current version of huggingface transformers where fasttokenizers work
# visualize the entropies on a web page. darker color means the token position has higher entropy (i.e., given the text before the highlighted position, the model is more uncertain about predicting the current position).
python visualize_entropies.py --port 7860 --host 127.0.0.1 --n 20
./sync_ntp_rl.sh./sync_ntp_rl.sh -pThe reason we do this is because cursor doesn't make code suggestions with SSH FS and USC's cluster doesn't allow Remote-SSH for direct development on the remote machine. Refer to guidelines on USC CARC website.
6 commits
Python
69.4%
HTML
22.4%
Shell
8.2%