Empirical evidence shows that R&D spending is highly correlated with firm productivity, highly concentrated among large firms, and responsive to trade liberalization. This paper develops a model of product upgrading with heterogeneous firms that captures these characteristics by allowing firms...