Cathedrals Opening Bazaars: Placing Open-Source Software in the Patent Technology Space
Job market paper. Xiaofeng Gong. Draft of October 24, 2026.
The question
Large firms that file patents now also publish open-source code, which anyone can read, use and build on. A firm that does both draws a line between the knowledge it shares and the knowledge it protects. Existing data do not show where that line runs, because open-source code carries no patent class and so cannot be compared directly with a firm’s patents.
When firms make technology public through open-source code, do they reveal the technologies they protect with patents, or a separate set?
The main comparison
Firms also reveal technologies they do not patent. In the average firm-year, the share of a firm’s open-source code outside its patented technologies is more than twice the share under the randomization benchmark.
Abstract
When firms make technology public through open-source code, do they reveal the technologies they protect with patents, or a separate set? I link Compustat firms to their USPTO patents and to their GitHub accounts, and a large language model places their open-source projects in the patent classification. In the average firm-year, 35% of a firm’s open-source code lies in technologies it does not patent, against 15% under a randomization benchmark built from the firm’s own items. The excess of the distance between its open-source code and its patents over this benchmark rises with the count of open-source projects about as much as in simulated firms that keep one technology mix at every size. Outside its patented technologies, a firm’s open-source code is less co-located with its nearest technology neighbors’ patents than under the benchmark, consistent with the stated prediction that firms reveal less where rivals can use more of what is disclosed. Within a firm, however, new participants make up a larger share of projects inside its patented technologies than of its other projects, unlike the prediction that communities participate less near patented inventions.
Data and method
- Linking firms. Two crosswalks link Compustat firm records to their USPTO patents granted in 2015–2024 and to their accounts on GitHub. The comparison sample holds 595 large firms that both patent and actively publish open-source code.
- Classifying code. A language model reads each open-source project and assigns it main groups from the Cooperative Patent Classification, the scheme patent examiners use. When a second model applies the same two stages to patents, its labels share at least one main group with the examiners’ labels on 89% of the patents, against 21% when its labels are assigned at random within each CPC section.
- Comparing portfolios. The Bar–Leiponen distance is the share of a firm’s open-source code that would have to move to other main groups to match its patents, measured over the five years ending in each firm-year. Two small portfolios are some distance apart even when their technologies are assigned at random, so I compare each distance with its randomization benchmark. The observed distance minus the benchmark distance is the excess.
Findings
- Outside the patented set. In the average firm-year, 35% of a firm’s open-source code lies in technologies it does not patent, against 15% under the benchmark.
- Across program size. The excess rises with the count of open-source projects about as much as in simulated firms that keep one technology mix at every size.
- Near technology neighbors. Outside its patented technologies, a firm’s open-source code is less co-located with its nearest technology neighbors’ patents than under the benchmark. This is consistent with the stated prediction that firms reveal less where rivals can use more of what is disclosed.
- New participants. Within a firm, new participants make up a larger share of projects inside its patented technologies than of its other projects. This differs from the prediction that communities participate less near patented inventions.
How far the results go
- The paper measures where firms’ open-source code lies. Several reasons for opening predict the same signs, so these comparisons cannot tell the reasons apart.
- In the typical firm-year, most of the excess lies outside the firm’s patented technologies. In the largest programs and at coarser levels of the classification, most of it lies inside them, where code and patents differ in their shares across patent classes.
- The labels come from a language model, and checks against other classifications find agreement in many cases, but not all.
- The data omit the open-source code of accounts I cannot link to a firm, and the sample covers large listed firms that both patent and publish open-source code.
How to cite
Gong, Xiaofeng. 2026. “Cathedrals Opening Bazaars: Placing Open-Source Software in the Patent Technology Space.” Working paper, draft of October 24, 2026.
This is a draft, and the PDF is the reference for every number on this page.