4. As shown in Figure $2, P$ is a point on the incircle of square $A B C D$, and let $\angle A P C=\alpha$, $\angle B P D=\beta$. Then $\tan ^{2} \alpha+\tan ^{2} \beta$ $=$
4. 8 .

As shown in Figure 5, establish a Cartesian coordinate system.
Let the equation of the circle be $x^{2}+y^{2}=r^{2}$.
Then the coordinates of the vertices of the square are
$$
A(-r,-r), B(r,-r), C(r, r), D(-r, r) \text {. }
$$

If $P(r \cos \theta, r \sin \theta)$, then the slopes of the lines $P A, P B, P C$, and $P D$ are respectively
$$
\begin{array}{l}
k_{P A}=\frac{1+\sin \theta}{1+\cos \theta}, k_{P B}=-\frac{1+\sin \theta}{1-\cos \theta}, \\
k_{P C}=\frac{1-\sin \theta}{1-\cos \theta}, k_{P D}=-\frac{1-\sin \theta}{1+\cos \theta} \text {. } \\
\text { Therefore, } \tan ^{2} \alpha=\left(\frac{k_{P C}-k_{P A}}{1+k_{P A} k_{P C}}\right)^{2}=4(\cos \theta-\sin \theta)^{2} \text {, } \\
\tan ^{2} \beta=\left(\frac{k_{P D}-k_{P B}}{1+k_{P B} k_{P D}}\right)^{2}=4(\cos \theta+\sin \theta)^{2} \text {. } \\
\end{array}
$$

Therefore, $\tan ^{2} \alpha+\tan ^{2} \beta=8$.