Ants seek out compost bins for warmth and protection. Although they may actually benefit the compost bin by introducing bacteria and fungi that help with decomposition, too many ants can be problematic. You can take some steps--both organic and non-organic--to discourage ants from staying in your compost bin.
Keep compost moist to deter ants. Ants prefer warm dry areas and may seek out your compost bin if it provides a dry area to shelter them form the weather.
Turn the compost to expose ants to the elements and to break up their nests. Disturbing their hiding place while wetting the area may encourage them to move on to drier ground where they can find shelter.
Sprinkle corn meal or dry cream of wheat around the compost bin. Ants will carry the cereal back to the nest and eat it, but they are unable to digest cornmeal or cream of wheat. The grain will swell inside the ant and kill it.
Place commercial ant traps around the perimeter of your compost bin to prevent ants from returning to the bin. However, if you are opposed to a chemical solution to your ant problem, avoid ant traps.