(coauthored with Cailin O'connor) Confirmation bias has been widely studied for its role in failures of reasoning. Individuals exhibiting confirmation bias fail to engage with information that contradicts their current beliefs, and, as a result, can fail to abandon inaccurate beliefs. But although most investigations of confirmation bias focus on individual learning, human knowledge is typically developed within a social structure. How does the presence of confirmation bias influence learning and the development of consensus within a group? In this paper, we use network models to study this question. We find, perhaps surprisingly, that moderate confirmation bias often improves group learning. This is because confirmation bias leads the group to entertain a wider variety of theories for a longer time, and prevents them from prematurely settling on a suboptimal theory. There is a downside, however, which is that a stronger form of confirmation bias can cause persistent polarization, and hurt the knowledge producing capacity of the community. We discuss implications of these results for epistemic communities, including scientific ones.