GITHUB-COPILOT practice question 2 of 15

What types of prompts or code snippets might be flagged by the GitHub Copilot toxicity filter? (Each correct answer presents part of the solution. Choose two.)

Full set: 65 questions
Answer options
A: Hate speech or discriminatory language (e.g., racial slurs, offensive stereotypes) Correct answer
B: Sexually suggestive or explicit content Correct answer
C: Code that contains logical errors or produces unexpected results
D: Code comments containing strong opinions or criticisms
Correct Answer:
A. Hate speech or discriminatory language (e.g., racial slurs, offensive stereotypes); B. Sexually suggestive or explicit content
Explanation

GitHub Copilot incorporates safety systems, including a toxicity filter, to prevent the generation of harmful or offensive content. According to official documentation, these filters are specifically designed to detect and block suggestions that fall into harmful categories. This includes hate speech, discriminatory language, and sexually explicit content. The system analyzes both user prompts and the model's potential suggestions to ensure they do not contain this type of material, aligning with GitHub's responsible AI principles.

Why Incorrect

C. Code that contains logical errors or produces unexpected results: This relates to code quality and correctness, not content safety. The toxicity filter is not designed to evaluate the functional logic of the code.
D. Code comments containing strong opinions or criticisms: While potentially unprofessional, this is generally not classified as "toxic" unless it crosses the line into harassment or hate speech, which are already covered by other options.

References

1. GitHub Docs. "Content exclusions for GitHub Copilot." Accessed October 2023. In the section "How does GitHub Copilot work?", the documentation states, "The filters check for specific keywords and topics, including... Hate speech... Self harm... Sexual content... Violent content." This directly supports options A and B.

2. GitHub Docs. "Responsible AI FAQs for GitHub Copilot." Accessed October 2023. This document explains, "To that end, we have built filters to block offensive words in the prompts and to avoid synthesizing suggestions in sensitive contexts. We are also working on a toxicity filter to detect and block generated suggestions that contain hate speech." This directly supports option A.

Scroll to Top