mlsanityData to 14 Oct 2026

CodeCipher: Learning to Obfuscate Source Code Against LLMs

arXiv 2410.05797 ↗First posted 8 Oct 2024cs.CLcited by 3

Not on the map. Why?

Abstract (arXiv)

While large code language models have made significant strides in AI-assisted coding tasks, there are growing concerns about privacy challenges. The user code is transparent to the cloud LLM service provider, inducing risks of unauthorized training, reading, and execution of the user code. In this paper, we propose CodeCipher, a novel method that perturbs privacy from code while preserving the original response from LLMs. CodeCipher transforms the LLM's embedding matrix so that each row corresponds to a different word in the original matrix, forming a token-to-token confusion mapping for obfuscating source code. The new embedding matrix is optimized by minimizing the task-specific loss function. To tackle the challenge of the discrete and sparse nature of word vector spaces, CodeCipher adopts a discrete optimization strategy that aligns the updated vector to the nearest valid token in the vocabulary before each gradient update. We demonstrate the effectiveness of our approach on three AI-assisted coding tasks including code completion, summarization, and translation. Results show that our model successfully confuses the privacy in source code while preserving the original LLM's performance.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 20 of its 41 references that are in the map. First posted on arXiv 8 Oct 2024.

Builds on

20 of 41 references.

References · 20

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2021Program Synthesis with Large Language Modelscited by 3,637
  3. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  4. 2023StarCoder: may the source be with you!cited by 799
  5. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  6. 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 434
  7. 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
  8. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 300
  9. 2024On Protecting the Data Privacy of Large Language Models (LLMs): A Surveycited by 96
  10. 2020Contrastive Code Representation Learningcited by 76
  11. 2023FATE-LLM: A Industrial Grade Federated Learning Framework for Large Language Modelscited by 63
  12. 2023Locally Differentially Private Document Generation Using Zero Shot Promptingcited by 63
8 more
  1. 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
  2. 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Modelscited by 34
  3. 2023Traces of Memorisation in Large Language Models for Codecited by 29
  4. 2021Bridge the Gap Between CV and NLP! A Gradient-based Textual Adversarial Attack Frameworkcited by 28
  5. 2024Robustness, Security, Privacy, Explainability, Efficiency, and Usability of Large Language Models for Codecited by 28
  6. 2021Adversarial Robustness of Deep Code Comment Generationcited by 22
  7. 2023Greening Large Language Models of Codecited by 19
  8. 2024LLM-based Privacy Data Augmentation Guided by Knowledge Distillation with a Distribution Tutor for Medical Text Classificationcited by 8

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 2.

3 papers.