Gnat's are attracted to fruit, if that's what you're putting in the bin, you've identified the problem. One way is to Freeze your fruit/vegetable scraps in the freezer, this eliminates their odor, then shred em in a blender/food processsor. Mix it deep in the pile so bugs cant get at it.

Only top voted, non community-wiki answers of a minimum length are eligible