Subdomain 1.1: Understand responsible AI principles
1.How does GitHub Copilot address the risk of generating code that matches publicly available, copyrighted repositories?
- A.By automatically attributing the original author in the code comments.
- B.By providing a duplication detection filter that blocks suggestions matching public code of about 150 characters.
- C.By only training its models on public domain (CC0) code.
- D.By requiring developers to manually search GitHub for matching snippets before accepting.
Show answer & explanation
Correct answer: B — By providing a duplication detection filter that blocks suggestions matching public code of about 150 characters.
- A. GitHub Copilot does not automatically attribute the original author in the code comments. Attribution is not the mechanism used by the tool to handle potential copyright matches.
- B. GitHub Copilot includes a duplication detection filter (often called 'Suggestions matching public code'). When enabled, this filter checks code suggestions against public code on GitHub and blocks suggestions that match a sequence of approximately 150 characters or more.
- C. GitHub Copilot is trained on a broad range of public repositories which use various licenses, not just those in the public domain or under CC0 licenses. Because of this, GitHub provides filtering tools to mitigate the risk of generating near-duplicate code.
- D. The responsibility for matching snippets is not shifted to the developer as a manual search requirement. While developers should always review AI-generated code, Copilot provides an automated filter to help prevent the suggestion of matching public code.