We discuss generalizations of the notion of i) the group of unitary elements of a (real or complex) finite-dimensional C*-algebra, ii) gauge transformations and iii) (real) automorphisms in the framework of compact quantum group theory and spectral triples. The quantum analogue of these groups are defined as universal (initial) objects in some natural categories. After proving the existence of the universal objects, we discuss several examples that are of interest to physics, as they appear in the noncommutative geometry approach to particle physics: in particular, the C*-algebras M-n(R), M-n(C) and M-n(H), describing the finite noncommutative space of the Einstein-Yang-Mills systems, and the algebras A(F) = C circle plus H circle plus M-3 (C) andA(ev) = H circle plus H circle plus M-4 (C), that appear in Chamseddine-Connes derivation of the Standard Model of particle physics coupled to gravity. As a byproduct, we identify a "free" version of the symplectic group Sp(n) (quaternionic unitary group).