Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
David E. Bernholdt, Lauren E Milechin, Dave Rumph, Michael A. Heroux, and James Willenbring,
David E. Bernholdt, Troy Comi, Lauren E Milechin, Dave Rumph, Michael A. Heroux, and James Willenbring,
"INTERSECT: Software Licensing."
Version 2023.06, June 2023,
Version 2024.08, August 2024,
https://github.com/INTERSECT-training/software-licensing
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ If you contribute to this lesson and would like to acknowledge specific funding
The contributing author(s) to this lesson are:

* David E. Bernholdt, Oak Ridge National Laboratory, bernholdtde@ornl.gov
* Troy Comi, Princeton University, tcomi@princeton.edu
* Lauren E Milechin, Massachusetts Institute of Technology, lauren.milechin@mit.edu
* Dave Rumph, Caltech, drumph@caltech.edu
* Michael A. Heroux, Sandia National Laboratories, maherou@sandia.gov
Expand All @@ -46,3 +47,5 @@ To cite this lesson, please consult [CITATION](CITATION).
The INTERSECT project is supported by NSF awards [2017424](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2017424) and [2017259](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2017259).

Portions of this lesson are based on the *An Introduction to Software Licensing* module in the [Better Scientific Software tutorials](https://bssw-tutorial.github.io/), developed by the [IDEAS Productivity project](https://ideas-productivity.org/). This work was supported by the U.S. Department of Energy Office of Science, Office of Advanced Scientific Computing Research (ASCR), and by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of the U.S. Department of Energy Office of Science and the National Nuclear Security Administration.

This work is supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Next-Generation Scientific Software Technologies (NGSST) program.
2 changes: 1 addition & 1 deletion _episodes/04-why-open-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Open-source is a great tool to help you build a community around your software.
But you shouldn't imagine that simply slapping an open source license on your software makes it sustainable.
Besides having software that is potentially useful to others, you'll need to work at it if you want to build a community that contributes to and helps support your software.
Many open source software projects never receive any outside contributions.
In a webinar entitled [What I Learned from 20 Years of Leading Open Source Projects](https://ideas-productivity.org/events/hpc-best-practices-webinars/#webinar056), Wolfgang Bangerth, one of the founders of the deal.II package, offers his experience of what it took to build a small single-group software project into a truly community-based resource -- and what it takes to keep it going.
In a webinar entitled [What I Learned from 20 Years of Leading Open Source Projects](https://ideas-productivity.org/events/hpcbp-056-20yearsopensource), Wolfgang Bangerth, one of the founders of the deal.II package, offers his experience of what it took to build a small single-group software project into a truly community-based resource -- and what it takes to keep it going.

> ## Discussion
>
Expand Down
112 changes: 59 additions & 53 deletions _episodes/07-collaboration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ questions:
objectives:
- "Understand the challenges surrounding code contributed from outside the project."
keypoints:
- "Collaborators may be resctricted in their ability to contribute to open source projects (e.g. industrial partners) or unable to copyright their work (government employees)."
- "Collaborators may be restricted in their ability to contribute to open source projects (e.g. industrial partners) or unable to copyright their work (government employees)."
- "You can include a Contributor License Agreement (CLA) to ensure collaborators agree to license terms prior to committing code."
- "Stackoverflow content is licensed as CC BY-SA, which is incompatible with permissive or proprietary licenses."
- "License and copyright around LLM-generated content is actively being litigated."
Expand Down Expand Up @@ -43,17 +43,17 @@ on a license early in a project's life cycle. Changing a license is possible,
but may require the explicit approval of all contributors; for larger, older
projects the prospect is daunting.

Part of being proactive is developing and publishing your CONTRIBUTING guidelines.
You can also choose to use a Contributor License Agreement (CLA), which is a legal
Part of being proactive is developing and publishing your `CONTRIBUTING` guidelines.
You can also choose to use a **Contributor License Agreement** (CLA), which is a legal
document that new contributors must sign prior to merging their code. While
protective of the software project, CLAs may limit inclusivity by acting as
a barrier to first time contributors. They can also create a power imbalance between
a barrier to first-time contributors. They can also create a power imbalance between
maintainers and contributors. Practically, CLAs often require review and
approval by the legal department of the contributor.

A Developer Certificate of Origin (DCO) is a lighter agreement that allows
A **Developer Certificate of Origin** (DCO) is a lighter-weight agreement that allows
contributors to confirm the code they commit is suitable for the project license.
They can be integrated into a PR or commit message instead of a separate legal document.
They can be integrated into a pull request or commit message instead of a separate legal document.
In either case, the policies for contributors should be clear and easy to find
and verify if legal issues do arise.

Expand All @@ -66,58 +66,65 @@ and verify if legal issues do arise.
> mention contributors?
{: .challenge}

## Code from internet forums
## Code from Internet Forums

Question and answer forums like stackoverflow provide a valuable avenue for
Question and answer forums like Stack Overflow provide a valuable avenue for
developers to connect with knowledgeable users covering a range of topics from
installation, language usage, and debugging. It is satisfying to find the exact
answer to your problem so you can get back to work, but how can you integrate
the answer in accordance with the license agreement of the forum?

The best case is to take the answer and distill it to your application. Say
you are searching for how to plot a scatter plot with transparency given by
another column in your dataframe. An answer may suggest matplotlib, seaborn,
or another plotting library. When you integrate the answer into your code,
you will have to modify the answer to fit your variables and when finally put
in place, the one line could have come directly from the documentation. Ideally
you would use the suggested answer to further research the documentation and
develop a distinct call. In this case, you are using an internet forum as a
shortcut to library documentation. You don't have to disclose where the original
answer to your problem so you can get back to work. But as with anything else
you see on the internet, the material is subject to copyright. It is worth
thinking about how you can incorporate solutions found online into your work
while respecting their copyrights. Material on Stack Overflow, for example,
is published under a CC-BY-SA license ([Creative Commons Attribution Sharealike](https://creativecommons.org/licenses/by-sa/4.0/)).

Generally, if you're using the Stack Overflow material as guidance or documentation,
and adapting it to your particular situation without using text (code) verbatim from the
Stack Overflow posting, it should be relatively straightforward because
you're not making direct use of the copyrighted material. You don't have to disclose where the original
idea came from, but for your own benefit it is a good idea to include the URL
in a comment.
in a comment. Its also nice to give credit where credit is due.
An example of this kind of use might be if you are searching for how to plot a scatter plot with transparency given by
another column in your dataframe. An answer may suggest matplotlib, seaborn,
or another plotting library. It may provide example code or command line instructions to make such a plot.
But you adapt it, with your variables and filenames, and other details. And in the end,
there's probably little from the original post appearing in your code -- maybe routine or command
names and a few key options.

But what if you are searching for something like a binary search written in python,
On the other hand, if you are searching for, say, a binary search written in python,
or the answer contains a function snippet for performing the task you need?
Fair use does not use length as a factor, if you directly copy and paste code
and you want to distribute that code, it would then fall under the original license,
for stackoverflow, that is CC-BY-SA.
and you want to distribute that code, it would then fall under the license applicable to the forum posting.
As mentioned, for Stack Overflow, for example, that's CC-BY-SA.

> ## Pop Quiz
>
> If you use CC-BY-SA work in your project, what kind of license should you use?
>
> > ## Solution
> > Though they are considered appropriate for software *documentation*, the Creative Commons recommend against using their licenses for software per se (see [Can I apply a Creative Commons license to software?](https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software)). But they do define a concept of "compatibility" between
some CC licenses and software licenses precisely for situations like this (see [Compatible Licenses](https://creativecommons.org/share-your-work/licensing-considerations/compatible-licenses/)). According to this page, CC-BY-SA 4.0 (not prior versions) is compatible with the [Free Art License](http://artlibre.org/licence/lal/en/) or the [GPLv3](https://www.gnu.org/copyleft/gpl.html) licenses.
>{: .solution}
{: .challenge}

## LLMs and code assistants
## Generative AI, Large Language Models, and Code Assistants

A recent development for software engineers is the rise of large language models
A recent development for software engineers is the rise of large language models (LLMs)
capable of producing code from English descriptions. The utilities are integrated
in many search engines, IDEs, or as standalone assistants. While performance
in many search engines, integrated development environments (IDEs), or as standalone assistants. While performance
and utility can vary wildly, LLMs can increase developer productivity by removing
some of the tedious jobs. Just be wary, correct-seeming code can be worse than
something clearly wrong!

Just as the technological limits of LLMs are still being discovered, the legal
aspect of AI and licenses are actively being determined in court. There are three
aspect of AI, copyright, and licensing are actively being determined in court. There are three
phases where licensing and copyright concerns appear in utilizing LLMs:

1. During training, what code has been ingested? How do the licenses of the
code affect what is produced?
1. Does the training process respect the licenses of the code used for training?
2. If you want to refine an LLM, what license is the model distributed with?
3. If I use code generate by an LLM, what attribution does it need and will it affect
3. If I use code generated by an LLM, what attribution does it need and will it affect
my license?

### Ingested code
### Ingested Code

Unless you are training your own LLM, this is more of an interesting case study
in copyright than a day-to-day concern. Since the implementation details of
Expand All @@ -127,61 +134,60 @@ for training.

Legal challenges against AI companies have been brought up by artists and
authors, who allege the generation of verbatim passages or replication of
artistic style indicate training data included copyrighted material against
the creators wishes. Code generation hasn't been included in these lawsuits
artistic style indicates that the training data included copyrighted material against
the creators' wishes. Code generation hasn't been included in these lawsuits
so far, but rulings on other domains could affect how LLMs are trained. If you
are concerned about the origin of code used to train an LLM, look for LLMs that
provide information on the training set and uses a training set aligned with your
provide information on the training set and use a training set aligned with your
license and values.

### Refining an LLM

Refining a published network is somewhat straight forward! Just like any other
In a technical sense, refining a published network is fairly straight forward! Just like any other
piece of software, you can follow the license distributed with the material in
creating derived works from the original network. However, the weights of
creating new works derived from the original network. However, the weights of
the foundation model could "contain" copyrighted material from data
on which they were trained. It's possible that during refinement, the network
will retain the copyright material in a form that can be recovered. Litigation
will be needed to sort out fair use, but keep in mind that refined networks
may contain the foundation model largely unchanged.

### Using code from LLMs
### Using Code from LLMs

You may have already used code from an LLM, either to play with a new technology
or even in production to save time on development. Continuing with the theme
of this section, we don't know all the answers until legislation and lawsuits
settle.

Consider the following scenario, you use an LLM to generate a function that is
Consider the following scenario: you use an LLM to generate a function that is
later discovered to be verbatim from a copyrighted code base, violating the
license. Are you liable for damages, the company that trained the network,
or the company you pay to use the LLM? Due to the difficulties with tracking
down what input data has contributed to LLM output, you may be the most likely
party targeted for damages.
license. Who's liable for damages? You? The company that trained the network?
The company you pay to use the LLM? Legally, we don't yet have answers to this,
but getting the code from an LLM may not be considered a defense against the fact
that your code infringes on someone else's copyright.

Some tools have been developed to scan LLM output to flag large snippets which
Some tools have been developed to scan LLM output to flag large snippets that
are present in other sources. Many tech companies don't allow code generation
from outside products due to privacy concerns, as well as licensing issues.
Keep in mind if you are interested in industry that reliance on an LLM for
code generation is probably not a good strategy.
As an aside, if you're interested in a job in industry, you might want to
make sure your coding skills are solid *without* help from an LLM.

The US government recently declared that AI generated work can not be
The US government recently declared that AI-generated work can not be
copyrighted if it's produced without human intervention beyond prompt engineering.
This is likely to apply to a work as a whole instead of snippets, e.g. if your
project has a few generated functions it could still have a copyright. If instead
you instruct an LLM to "make a game" (and it's able to do so), that could would
not be copyrighted. As an example, ["Zaraya of the Dawn"](https://www.copyright.gov/docs/zarya-of-the-dawn.pdf)
is a comic book where the images were produced by Midjourney. While the text
and layout were human generated and therefore subject to copyright, the US
and layout were human-generated and therefore subject to copyright, the US
Copyright Office found the images could not be copyrighted. Extending this to
software, if you have AI produce all of your UI, that portion of your code could
be public domain.
software, if you have AI produce all of your UI, that portion of your code might not be copyrightable.

If you are developing code you intend to monetize, the safest advice would be
to avoid LLM snippets altogether. Were it brought to light in discovery,
If you are developing code you intend to monetize, the safest advice currently would be
to avoid LLM-generated code altogether. Were it brought to light in discovery,
AI-generated code could open the door to damages over the entire code base.
Otherwise, treat LLM output like code from an internet forum, you can use it
for information and to point you towards a library call, but don't copy its
for information and to point you towards the code you need, but don't copy its
entire output. If you do copy and paste code, you may also want to mark in the
source code what is LLM-derived. Doing this consistently could safeguard parts
of your project that may resemble proprietary code by chance.