8. Let $M=\{1,2, \cdots, 17\}$. If there are four distinct numbers $a, b, c, d \in M$, such that $a+b \equiv c+d$ $(\bmod 17)$, then $\{a, b\}$ and $\{c, d\}$ are called a balanced pair of the set $M$. The number of balanced pairs in the set $M$ is $\qquad$
8. 476 .

Divide the circumference into 17 equal parts, and label the points in a clockwise direction as $A_{1}, A_{2}, \cdots, A_{17}$. Then
$$
m+n \equiv k+l \quad(\bmod 17) \Leftrightarrow A_{m} A_{n} / / A_{k} A_{l} .
$$

Note that none of the chords connecting any pair of the 17 equally divided points are diameters, so there are 17 directions for all the chords (each parallel to the tangent at $A_{i}(i=1,2, \cdots, 17)$).

There are 8 chords parallel to the tangent at $A_{i}$, forming $\mathrm{C}_{8}^{2}=28$ pairs of parallel chords. Considering all 17 directions, we get $28 \times 17=476$ pairs of parallel chords. Therefore, $M$ contains 476 balanced pairs.