Importance of compartment formation for a self-encoding system