Why is a Gruyère sweet when it contains 0 carbohydrates?
Cheese is a complex variety of chemical compounds some of which can taste sweet. I don't know the exact make up of Gruyère but according to this article there are a couple of compounds that are known to lend a sweet flavor. Including: butyric acid, Alanine, glycine, serine, threonine, ethanol, etc. 

Wikipedia says that Gruyère is a "sweet" cheese so I would assume these compounds mentioned above are in higher amounts than other cheeses.