3. Given real numbers $a$ and $b$ satisfy $a^{3}-b^{3}-3 a b=1$. Then $a-b=$ $\qquad$ .
3.1 or -2.

Let $a-b=k$. Then from the condition we know
$$
\begin{array}{l}
k\left(k^{2}+3 a b\right)-3 a b-1=0 \\
\Rightarrow k^{3}+3 k a b-3 a b-1=0 \\
\Rightarrow(k-1)\left(k^{2}+k+1\right)+3 a b(k-1)=0 \\
\Rightarrow(k-1)\left(k^{2}+k+1+3 a b\right)=0 .
\end{array}
$$

Thus, $k-1=0$ or $k^{2}+k+1+3 a b=0$.
When $k=1$, we get $a-b=1$.
When $k^{2}+k+1+3 a b=0$, we have
$$
(a-b)^{2}+(a-b)+1+3 a b=0 \text {, }
$$

which is $a^{2}+(b+1) a+b^{2}-b+1=0$.
Since $a$ is a real number, we have
$$
\Delta=(b+1)^{2}-4\left(b^{2}-b+1\right) \geqslant 0 \text {, }
$$

which is $(b-1)^{2} \leqslant 0$.
Since $(b-1)^{2} \geqslant 0$, we have
$$
(b-1)^{2}=0 \Rightarrow b=1 \text {. }
$$

Substituting into equation (1) gives $a=-1$.
In this case, $a-b=-2$.
In summary, $a-b=1$ or -2.