This study examines how the modularity of intra-firm collaboration networks—i.e., the extent to which a firm’s inventor network is partitioned into relatively autonomous subgroups—influences both the quantity and quality of firm innovation. Drawing on a panel of 461 healthcare firms over 26 years, we construct inventor networks from patent data and employ the Louvain algorithm to detect community structures. The findings reveal a U-shaped relationship between modularity and innovation quantity: low modularity enhances production through widespread collaboration, while high modularity facilitates parallel innovation within specialized subgroups. Conversely, an inverted U-shaped relationship emerges for innovation quality, peaking at moderate levels of modularity where knowledge specialization and cross-group integration are balanced. These results highlight the nuanced tradeoffs inherent in organizing networks around specialized communities, as firms must balance the depth of expertise with the need for diverse inputs. The study extends existing literature by foregrounding meso-level network structures—communities and their interconnections—as critical determinants of firm-level innovation outcomes. It also offers practical guidance to managers on how to tailor collaboration architectures to optimize different dimensions of innovative performance.