LiResolver: License Incompatibility Resolution for Open Source Software

Sihan Xu, Ya Gao, Lingling Fan, Linyu Li, Xiangrui Cai, Zheli Liu · DOI

TL;DR

LiResolver is an automated tool designed to navigate the legal minefield of Open Source Software (OSS) by detecting and resolving license incompatibilities. By combining fine-grained natural language processing (NLP) with an understanding of software project hierarchies, it identifies conflicting legal terms and suggests actionable fixes—either by recommending official licenses or generating custom ones.

What Problem Does This Paper Address?

Modern software is rarely built from scratch; it’s a mosaic of third-party libraries and frameworks. Each of these components comes with an OSS license—a legally binding contract. Problems arise when these licenses conflict. For example, a project license might allow sublicensing, but a nested component license might explicitly forbid it.

This "license incompatibility" is rampant—one study found it in nearly 73% of GitHub projects. Manually fixing these issues is a Herculean task because licenses are written in complex legal prose, and software dependencies create intricate, nested structures. Previous tools were often limited to a small set of well-known licenses and lacked the "legal common sense" to understand the nuances of custom license text.

Methods

The authors developed LiResolver, a multi-stage pipeline that treats license resolution as a structured optimization problem.

  1. License Hierarchy Extraction: Unlike previous "flat" approaches, LiResolver recognizes that a license's scope is determined by its location in the file system. It builds a tree structure representing how licenses nest within a project (see Figure 2).
  2. Fine-grained License Understanding: The tool uses a RoBERTa-based Named Entity Recognition (NER) model to decompose license sentences into four key elements: Action (e.g., distribute), Object (e.g., source code), Attitude (e.g., MUST, CANNOT), and Condition (e.g., provide attribution). Illustration of the BIO tagging for entities
  3. Relation Extraction: It then uses a prompt-based model (KnowPrompt) to understand how these entities relate (e.g., which action applies to which object).
  4. Incompatibility Localization: By traversing the hierarchy bottom-up, LiResolver checks if a parent license is at least as restrictive as its children. If a parent allows something a child forbids, an incompatibility is flagged.
  5. Resolution & Recommendation: To fix a conflict, LiResolver calculates the "legal boundaries" for a specific node: the new license must be no more restrictive than its parent and no looser than its children. It first tries to recommend an official SPDX license. If none fit, it uses a template-based approach to generate a custom license or adds specific "exceptions" to bridge the gap.
Illustration of the BIO tagging for entities
Overview of the LiResolver pipeline

Datasets

The researchers evaluated LiResolver using:

  • License Text Dataset: 212 official licenses and 188 custom licenses, totaling 21,844 sentences. These were manually labeled by three authors and a lawyer to create a ground-truth for the NLP models.
  • Real-world Projects: 300 popular GitHub projects (each with >1,000 stars). From these, they extracted over 81,000 licenses for analysis.

Key Insights and Ideas

  • Hierarchy is Critical: Licenses aren't just a list; they are a tree. A conflict at a deep sub-module level might not be fixable just by changing the root project license. Figure 2 illustrates how a "flat" analysis can miss the true source of incompatibility. Comparison of flat vs. hierarchical analysis
  • Copyright Holder Filtering: The authors observed that project owners often implement their own modules with separate licenses. If the copyright holder of a component license is the same as the project owner, that license is "mutable"—it can be changed to resolve conflicts. This significantly expands the search space for potential fixes.
  • The "Action-Object" Nuance: Previous tools often treated "Distribute" as a single concept. LiResolver distinguishes between "Distribute source code" and "Distribute binaries," which is vital because many licenses (like the GPL family) treat these very differently.
Comparison of flat vs. hierarchical analysis

Key Results

LiResolver demonstrated significant improvements over state-of-the-art tools like LiDetector and SPDX-VT:

  • High Precision: In localizing incompatibility issues, it achieved a 4.09% False Positive rate and a remarkably low 0.02% False Negative rate.
  • Effective Resolution: It successfully resolved 62.61% of 230 real-world incompatible projects.
  • NLP Accuracy: The relation extraction model achieved 95.09% accuracy, outperforming heuristic baselines (see Figure 5).
  • Developer Validation: The authors reported 50 issues to OSS developers; 14 responded, with 10 confirming or fixing the issues based on LiResolver’s suggestions.
Accuracy of Relation Extraction

Limitations and Future Work

While powerful, LiResolver has a few hurdles:

  • Missing Metadata: If a project lacks a root license or doesn't clearly state a copyright holder, the tool cannot identify which internal licenses are safe to modify.
  • Irrelevant Licenses: The tool currently doesn't filter out licenses used only for testing purposes, which might lead to "noise" in the results.
  • Complex Legal Nuance: While the 23 action categories cover most cases, rare or highly specific legal requirements might still fall outside the tool's current semantic model.

Future work could involve better filtering of non-production code and expanding the entity model to capture even more obscure legal clauses.

Summary updated

BibTeX
@inproceedings{xu2023liresolver,
  author = {Sihan Xu and Ya Gao and Lingling Fan and Linyu Li and Xiangrui Cai and Zheli Liu},
  title = {{LiResolver: License Incompatibility Resolution for Open Source Software}},
  booktitle = {Issta},
  year = {2023},
  doi = {10.1145/3597926.3598085},
}
Figure