How can the compressed UTXO set be stored in just 4GB?
The sizes you give don't match the paper. I can't even find mention of the sizes you give in the paper itself. Those sizes are incredibly wrong and way too large. They seem to be for input sizes, not output sizes. Input sizes are irrelevant to the UTXO set.

P2PKH are 21 bytes, P2SH are 21 bytes, P2PK are 33 bytes, everything else is their actual script size.


P2PKH = 1.147 GB
P2SH = 0.2393 GB


I've decided to omit the other outputs types because there are so few of them that their size is negligible.

The amounts are at most 0.5328 GB. However the amounts are compressed, so that should actually be smaller.

The outpoints (txids and output indexes) are at most 2.398 GB.

So in total the serialized UTXO set is approximately 4.3171 GB which is close to what we actually observe.

There are some more bytes due to the omitted scripts and because of the LevelDB's overhead, but there shouldn't be much (and certainly not several GB). Additionally the amounts and the output indexes are compressed which significantly reduces the serialized size. So in total, it's ~4 GB. My node reports 3.9 GB.