4. Given a right triangle $\triangle A B C$ with the two legs $A C=4$, $B C=3$, and $D$ is a moving point on the hypotenuse $A B$. Now, fold the right triangle along $C D$ to form a right dihedral angle $A-C D-B$. Then, when $A B$ reaches its minimum value, the size of the dihedral angle $B-A C-D$ is
4. $\arctan \sqrt{2}$.

As shown in Figure 1, construct $A E \perp C D$ at point $E$, and $B F \perp C D$ at point $F$.
Let $\angle A C D=\theta$.
From the folded figure, we have
$$
\begin{array}{l}
|A B|^{2} \\
=|A E|^{2}+|E F|^{2}+|B F|^{2} \\
=(4 \sin \theta)^{2}+(3 \cos \theta)^{2}+ \\
|4 \cos \theta-3 \sin \theta|^{2} \\
= 25-12 \sin 2 \theta .
\end{array}
$$

Therefore, when $\theta=\frac{\pi}{4}$, $|A B|$ is minimized.
Next, we find the size of the dihedral angle $B-A C-D$.
Construct $F M \perp A C$ at point $M$. After folding, $\angle F M B$ is the plane angle of the dihedral angle $B-A C-D$. In the right triangle $\triangle B F M$,
$$
\tan \angle F M B=\frac{|B F|}{|M F|}=\frac{|C F|}{|M F|}=\sqrt{2} \text {. }
$$

Thus, $\angle F M B=\arctan \sqrt{2}$.