|
Algorithm 2 Adaptive Runtime Defense Monitor |
-
1:
Input: query x, baseline distribution q, threshold , window size n
-
2:
State: query window , defense level
-
3:
Add x to W
-
4:
if then
-
5:
Compute from W
-
6:
Compute using Equation (5)
-
7:
if then
-
8:
-
9:
Apply output rounding and rate limit
-
10:
else
-
11:
-
12:
end if
-
13:
Clear W
-
14:
end if
-
15:
return model output at defense level L
|