Limit a value to a range: clip(x, a, b) is a if x < a, b if x > b, else x.
In ML papers
clip(x,a,b) (or clamp) forces x into the range [a,b]: values below a become a, values above b become b, the rest pass through. It equals min(max(x,a),b).
Its best-known use is PPO (Schulman et al. 2017): the probability ratio rt(θ) is clipped to [1−ϵ,1+ϵ] so one update cannot move the policy too far. Gradient clipping is a related idea that usually rescales the whole gradient vector when its norm exceeds a threshold, rather than clipping each entry.
How to type it
LaTeX
Shows
\operatorname{clip}(x, a, b)
clip(x,a,b)
\operatorname{clamp}(x, a, b)
clamp(x,a,b)
A worked example
clip(1.3,0.8,1.2)=1.2,clip(0.95,0.8,1.2)=0.95
With ϵ=0.2, a ratio of 1.3 is cut back to 1.2.
Common confusions
Outside the range, the gradient of a clipped value with respect to x is 0.