I came in with a few ideas and felt okay about the first two or three.
Frame the problem as a multi-layered defense system: prevention during training, detection during generation, and mitigation post-generation. Emphasize that no single technique is sufficient, and discuss trade-offs between protection strength, model utility, and computational cost.
Pro tip: Acknowledge that perfect prevention is impossible; instead, propose a risk-based approach that combines multiple techniques and includes continuous monitoring and red-teaming. Show awareness of legal and ethical considerations beyond just technical solutions.
Remove or obfuscate sensitive or copyrighted code from training data using techniques like deduplication, license detection, and code transformation. This reduces the risk of memorization.
Apply methods such as differential privacy, regularization, and data augmentation to prevent the model from memorizing exact code snippets. Also consider training on synthetic or licensed data.
Implement decoding strategies that avoid copying, such as blocking n-gram overlaps with training data, using plagiarism detection, or employing a copy-detection module that filters outputs in real-time.
Run outputs through similarity checks against a database of private code, and if a match is found, either block the output or transform it (e.g., refactor, add comments) to avoid direct copying.
Continuously monitor for leakage using automated tools and red-teaming, and update defenses based on new attack vectors and feedback. Establish a process for reporting and fixing leaks.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.