We investigate the impact of various audit schemes on the provision of public goods, when contributing less than the average of the other group members is centrally sanctioned and the probability of an audit is unknown. We study how individuals update their beliefs about the probability of being audited, both before and after audits are permanently withdrawn. We find that when individuals have initially experienced systematic audits, they decrease both their beliefs and their contributions almost immediately after audits are withdrawn. In contrast, when audits were initially less frequent and more irregular, they maintain high beliefs and continue cooperating long after audits have been withdrawn. This identifies the compliance effect of irregularity and uncertainty due to learning difficulties. By increasing both the frequency of audits and the severity of sanctions, we also identify an educative effect of frequent and high sanctions on further cooperation.