Text Generation
Transformers
Safetensors
gpt2
latent-reasoning
continuous-thought
coconut
grpo
reinforcement-learning
text-generation-inference
Instructions to use jihwan1205/svp-v-coconut-gpt2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jihwan1205/svp-v-coconut-gpt2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jihwan1205/svp-v-coconut-gpt2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jihwan1205/svp-v-coconut-gpt2") model = AutoModelForCausalLM.from_pretrained("jihwan1205/svp-v-coconut-gpt2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jihwan1205/svp-v-coconut-gpt2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jihwan1205/svp-v-coconut-gpt2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jihwan1205/svp-v-coconut-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jihwan1205/svp-v-coconut-gpt2
- SGLang
How to use jihwan1205/svp-v-coconut-gpt2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "jihwan1205/svp-v-coconut-gpt2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jihwan1205/svp-v-coconut-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "jihwan1205/svp-v-coconut-gpt2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jihwan1205/svp-v-coconut-gpt2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jihwan1205/svp-v-coconut-gpt2 with Docker Model Runner:
docker model run hf.co/jihwan1205/svp-v-coconut-gpt2
Update README.md
Browse files
README.md
CHANGED
|
@@ -28,16 +28,11 @@ Only the value-projection weights (the V columns of each `c_attn`) differ from t
|
|
| 28 |
checkpoint. The perturbation is a training-time exploration mechanism and is **not** used
|
| 29 |
at deployment: inference is ordinary greedy decoding.
|
| 30 |
|
| 31 |
-
This repository contains the paper's GPT-2 SVP-V-GRPO checkpoint from epoch 9
|
| 32 |
-
`B=32`, `lr=6e-5`, seed-0 run. The results below are the paper's Figure 3
|
| 33 |
-
evaluations; they have not been independently rerun for this model-card update.
|
| 34 |
|
| 35 |
## Results
|
| 36 |
|
| 37 |
-
Clean greedy decoding, `max_new_tokens=64`, exact-match on the final answer
|
| 38 |
-
measured in one harness. COCONUT, SLPO, SIM-CoT, and CoDi are the checkpoints released by
|
| 39 |
-
those works; Temp-GRPO / Gaussian-V-GRPO / Dropout-GRPO are GRPO runs from the same
|
| 40 |
-
COCONUT start under the same recipe, differing only in the rollout exploration.
|
| 41 |
|
| 42 |
| Model (GPT-2 124M) | GSM8K | GSM-Hard | MultiArith | SVAMP | ASDiv-A | GSM-Plus |
|
| 43 |
|---|---|---|---|---|---|---|
|
|
@@ -45,9 +40,6 @@ COCONUT start under the same recipe, differing only in the rollout exploration.
|
|
| 45 |
| SLPO | 34.9 | 7.6 | 82.8 | 34.3 | 58.7 | 18.2 |
|
| 46 |
| SIM-CoT | 44.7 | 9.3 | 90.5 | 40.6 | 67.2 | 21.5 |
|
| 47 |
| CoDi | 42.5 | 9.3 | 91.9 | 40.0 | 65.4 | 23.1 |
|
| 48 |
-
| Temp-GRPO (answer-token sampling, T=1) | 38.4 | 8.7 | 85.3 | 37.1 | 61.5 | 19.8 |
|
| 49 |
-
| Gaussian-V-GRPO (entry-wise noise on `W_V`) | 40.6 | 9.0 | 88.6 | 39.1 | 62.7 | 21.9 |
|
| 50 |
-
| Dropout-GRPO (native dropout, p=0.2) | 45.2 | 9.3 | 90.9 | **44.6** | 71.1 | 24.8 |
|
| 51 |
| **This model** (SVP on `W_V`, α=0.6) | **50.3** | **11.3** | **93.4** | 43.6 | **71.2** | **27.6** |
|
| 52 |
|
| 53 |
## Usage
|
|
@@ -55,8 +47,7 @@ COCONUT start under the same recipe, differing only in the rollout exploration.
|
|
| 55 |
This is a fixed-length continuous-thought model: the prompt ends with
|
| 56 |
`<|start-latent|>`, six latent steps feed each step's last hidden state back as the next
|
| 57 |
input embedding, `<|end-latent|>` closes the latent phase, and the answer is then decoded
|
| 58 |
-
as ordinary tokens.
|
| 59 |
-
the two-phase loop is required.
|
| 60 |
|
| 61 |
```python
|
| 62 |
from transformers import AutoTokenizer, GPT2LMHeadModel
|
|
@@ -82,11 +73,6 @@ COCONUT inference code works as well.
|
|
| 82 |
| Optimizer | AdamW, constant `lr=6e-5`, seed 0, no warmup or weight decay, gradient clipping at 1.0; epoch-9 checkpoint from 15 epochs |
|
| 83 |
| Reward | Final-answer correctness only |
|
| 84 |
|
| 85 |
-
## Limitations
|
| 86 |
-
|
| 87 |
-
English grade-school arithmetic word problems only; the six benchmarks above are the
|
| 88 |
-
extent of tested generalization.
|
| 89 |
-
|
| 90 |
## License
|
| 91 |
|
| 92 |
MIT, inherited from the base checkpoint (which derives from `openai-community/gpt2`).
|
|
|
|
| 28 |
checkpoint. The perturbation is a training-time exploration mechanism and is **not** used
|
| 29 |
at deployment: inference is ordinary greedy decoding.
|
| 30 |
|
| 31 |
+
This repository contains the paper's GPT-2 SVP-V-GRPO checkpoint from epoch 9 `B=32`, `lr=6e-5`, seed-0 run.
|
|
|
|
|
|
|
| 32 |
|
| 33 |
## Results
|
| 34 |
|
| 35 |
+
Clean greedy decoding, `max_new_tokens=64`, exact-match on the final answer.
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
| Model (GPT-2 124M) | GSM8K | GSM-Hard | MultiArith | SVAMP | ASDiv-A | GSM-Plus |
|
| 38 |
|---|---|---|---|---|---|---|
|
|
|
|
| 40 |
| SLPO | 34.9 | 7.6 | 82.8 | 34.3 | 58.7 | 18.2 |
|
| 41 |
| SIM-CoT | 44.7 | 9.3 | 90.5 | 40.6 | 67.2 | 21.5 |
|
| 42 |
| CoDi | 42.5 | 9.3 | 91.9 | 40.0 | 65.4 | 23.1 |
|
|
|
|
|
|
|
|
|
|
| 43 |
| **This model** (SVP on `W_V`, α=0.6) | **50.3** | **11.3** | **93.4** | 43.6 | **71.2** | **27.6** |
|
| 44 |
|
| 45 |
## Usage
|
|
|
|
| 47 |
This is a fixed-length continuous-thought model: the prompt ends with
|
| 48 |
`<|start-latent|>`, six latent steps feed each step's last hidden state back as the next
|
| 49 |
input embedding, `<|end-latent|>` closes the latent phase, and the answer is then decoded
|
| 50 |
+
as ordinary tokens.
|
|
|
|
| 51 |
|
| 52 |
```python
|
| 53 |
from transformers import AutoTokenizer, GPT2LMHeadModel
|
|
|
|
| 73 |
| Optimizer | AdamW, constant `lr=6e-5`, seed 0, no warmup or weight decay, gradient clipping at 1.0; epoch-9 checkpoint from 15 epochs |
|
| 74 |
| Reward | Final-answer correctness only |
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
## License
|
| 77 |
|
| 78 |
MIT, inherited from the base checkpoint (which derives from `openai-community/gpt2`).
|