The dot product of two vectors \( \mathbf{a} = (a_1, a_2, a_3) \) and \( \mathbf{b} = (b_1, b_2, b_3) \) is given by: \[ \mathbf{a} \cdot \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3. \] For \( \mathbf{a} = (2, 3, 1) \) and \( \mathbf{b} = (1, -1, 4) \), we have: \[ \mathbf{a} \cdot \mathbf{b} = 2 \times 1 + 3 \times (-1) + 1 \times 4 = 2 - 3 + 4 = 3. \] Thus, the dot product is: \[ \boxed{7}. \]