4. Let $x_{n}$ denote the unit digit of the number $n^{4}$. Then
$$
x_{1}+x_{2}+\cdots+x_{2012}=
$$
$\qquad$
4.6640 .

Notice that, the unit digit of $(10+n)^{4}$ is the same as that of $n^{4}$, and the unit digits of $1^{4}, 2^{4}, \cdots, 10^{4}$ are $1,6,1,6,5,6,1,6,1,0$ respectively.
Thus, $x_{1}+x_{2}+\cdots+x_{10}=33$.
Therefore, $x_{1}+x_{2}+\cdots+x_{2012}$
$$
=201 \times 33+(1+6)=6640 \text {. }
$$