Skip to content

Commit 3b3d5c2

Browse files
committed
docs: fix token veto mechanism
1 parent b1d5c12 commit 3b3d5c2

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

docs/algo/rollout_corr.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ Lower threshold for rejection sampling. Default: `null`
266266

267267
### `rollout_token_veto_threshold` (float or null)
268268
Per-token veto for catastrophic outliers. Default: `null`
269-
- Checks **unclamped per-token ratios** before safety bounds
270-
- If ANY token has ratio < threshold, entire sequence is rejected
269+
- Checks **unclamped per-token absolute ratios** before safety bounds
270+
- If ANY token has an absolute ratio > threshold, entire sequence is rejected
271271
- Independent of `rollout_is` and `rollout_rs` settings
272272
- Typical values: `1e2` to `1e4` when enabled
273273
- Example: `1e4` catches tokens 10,000x less likely
@@ -829,7 +829,7 @@ IS weights (`rollout_is_weights`) go through a fixed processing pipeline:
829829
Rejection sampling modifies `response_mask` (NOT weights) through `compute_rollout_rejection_mask()`:
830830
- Computes safety-bounded ratios independently
831831
- Creates binary mask: tokens/sequences outside [lower_threshold, upper_threshold] → 0 (rejected)
832-
- Veto: Checks **unclamped per-token ratios** (before safety bound), rejects entire sequences containing catastrophic tokens
832+
- Veto: Checks **unclamped per-token absolute ratios** (before safety bound), rejects entire sequences containing catastrophic tokens
833833
- Modified mask used for loss aggregation (rejected samples excluded from training)
834834

835835
## Operation Modes
@@ -1009,14 +1009,14 @@ These metrics cover both:
10091009
- **`rollout_is_veto_fraction`**: Fraction of sequences rejected by veto mechanism
10101010
- **Important**: Sequences are rejected via `response_mask=0`, NOT by modifying IS weights
10111011
- **IS weights unchanged by veto**: Already safety-bounded and truncated
1012-
- Veto checks **unclamped per-token ratios** (true ratios before safety bound)
1013-
- Decoupled mode: π_old(t)/π_rollout(t)
1014-
- Bypass/Pure IS mode: π_θ(t)/π_rollout(t)
1012+
- Veto checks **unclamped per-token absolute ratios** (true absolute ratios before safety bound)
1013+
- Decoupled mode: |π_old(t)/π_rollout(t)|
1014+
- Bypass/Pure IS mode: |π_θ(t)/π_rollout(t)|
10151015
- Detects catastrophic tokens (true abs(ratio) > veto_threshold, e.g., > 1e4)
10161016

10171017
- **`rollout_is_catastrophic_token_fraction`**: Fraction of tokens above veto threshold
10181018
- Identifies problematic tokens before sequence-level veto is applied
1019-
- Checks **unclamped per-token ratios** (true ratios, not safety-bounded)
1019+
- Checks **unclamped per-token absolute ratios** (true absolute ratios, not safety-bounded)
10201020
- Each catastrophic token causes its entire sequence to be rejected
10211021

10221022
#### **Threshold Exceedance Metrics**
@@ -1146,8 +1146,8 @@ is_weights = weights_proto.batch["rollout_is_weights"]
11461146
11471147
# modified_response_mask has rejection applied (since rollout_rs="token"):
11481148
# 1. RS rejection: tokens outside [0.5, 2.0] masked to 0 via response_mask
1149-
# 2. Veto rejection: sequences with catastrophic tokens (ratio < 1e-4) masked to 0
1150-
# Note: Veto checks unclamped per-token ratios (before safety bounds)
1149+
# 2. Veto rejection: sequences with catastrophic tokens (abs ratio > 1e4) masked to 0
1150+
# Note: Veto checks unclamped per-token absolute ratios (before safety bounds)
11511151
# Note: RS and IS are separate mechanisms - both can be enabled independently
11521152
11531153
# All metrics have 'rollout_corr/' prefix

docs/algo/rollout_corr_math.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ rollout_rs_threshold_lower = 0.5 # Lower threshold (auto-reciprocal if null)
597597

598598
### 3.5 Veto Mechanism
599599

600-
An **independent** safety layer that rejects sequences with catastrophically low token probabilities.
600+
An **independent** safety layer that rejects sequences with catastrophic token.
601601

602602
**Configuration:**
603603
```python
@@ -607,14 +607,14 @@ rollout_token_veto_threshold = 1e4 # null = disabled
607607
**Veto condition:**
608608

609609
$$
610-
\text{Reject entire sequence if } \exists t \in T \text{ such that } \rho_t < C_{\text{veto}}
610+
\text{Reject entire sequence if } \exists t \in T \text{ such that } |\rho_t| > C_{\text{veto}}
611611
$$
612612

613613
**Properties:**
614-
- Prevents catastrophic updates from tokens with near-zero probability
614+
- Prevents catastrophic updates from tokens with probability $\rho_t \gg 1$ or $\rho_t \ll 1$
615615
- **Independent** of IS/RS settings (always applied if enabled)
616-
- Checks **unclamped per-token ratios** before safety bounds
617-
- Typical values: $10^{-4}$ to $10^{-6}$
616+
- Checks **unclamped per-token absolute ratios** before safety bounds
617+
- Typical values: $10^{2}$ to $10^{4}$
618618

619619
**Implementation:** [rollout_corr_helper.py](../../verl/trainer/ppo/rollout_corr_helper.py#L620-L640)
620620

0 commit comments

Comments
 (0)