Weird Current Mirror
I believe both the resistor and the cascode are techniques for keeping \$v_{DS}\$ constant to avoid short-channel effects.

Resistor \$R_1\$

A regular diode-connected transistor (\$R_1 = 0\$) will also change \$v_{DS1}\$. Increasing \$I_{REF}\$ will make \$v_{GS1}\$ larger, which in turn also causes \$v_{DS1}\$ to increase as they are short-circuited.

If \$R_1 &gt; 0\$, then as \$v_{GS1}\$ increases with \$I_{REF}\$, \$R_1\$ will push \$v_{DS1}\$ down compared to \$v_{GS1}\$. If you choose \$R_1\$ carefully you can make it compensate the change of \$v_{GS1}\$ such that \$v_{DS1}\$ remains approximately constant.

Cascode M3

Cascodes are a technique that employ negative feedback to keep the current constant.

If we try decreasing \$v_{DS2}\$ by sinking extra current to ground, then \$v_{GS3}\$ increases which makes M3 conduct more current. As M3 injects more current into the node between M2 and M3, it counteracts the decrease of \$v_{DS2}\$ (negative feedback).

\$v_{DS2}\$ variation is reduced by M3, reducing short channel effects.