I think that’s not how is suppose to work either. As I understood the algorithm, k1 only refers to the steps the model does before actually doing the backpropagation. k2 refers to the length of that backpropagation.

I might be mistaken, but you can always look at better sources. The code shown is from this phd thesis 92 (section 2.8.6).