Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

ChatGPT Codebase: File Training & Deletion Facts

· 5 min read · Home Tech

In this article
  1. What ChatGPT Does With Your Uploaded Files
  2. How Training Data Works (and Why Your Code Isn't In It)
  3. Deleting Your Codebase From ChatGPT
  4. Common Misconception: "Does ChatGPT Remember My Code?"
  5. Choosing the Right Way to Share Code
  6. Costs and Limits of Uploading Large Codebases
  7. Safety and Privacy Best Practices
  8. Frequently Asked Questions

When you give ChatGPT your codebase, the files are used only to answer your questions in that conversation; they are not added to OpenAI's training data, and you can delete the conversation to remove the files from your account. This article explains what happens to your uploaded code, how training data works, and how deletion actually functions.

What ChatGPT Does With Your Uploaded Files

Uploading a file (like a .py, .js, or .txt file) through ChatGPT's file upload feature attaches that file to your current chat session. The model reads the content to answer questions, summarize code, or suggest fixes. The file becomes part of the conversation history, which is stored on OpenAI's servers so you can return to it later.

Importantly, the file is not used to "learn" from your code in a way that affects other users. Each conversation is isolated; the model does not retain knowledge from your session to apply to future chats with other people. The only context available is what's in the current conversation window.

How Training Data Works (and Why Your Code Isn't In It)

OpenAI's language models are trained on large datasets collected from the public internet, licensed data, and user feedback. Training happens in batches, and the model's weights are updated based on patterns in that data. Your uploaded files are not automatically included in this process.

OpenAI's API and ChatGPT usage policies state that as of 2023, data submitted through the API is not used for training by default. For ChatGPT (the consumer product), conversations may be used to improve models, but only after review and with opt-out controls for some users. However, file uploads specifically are treated as conversation content, not as a separate training signal. Even if a conversation is used for training, it would be anonymized and stripped of identifying information, and it would not directly reproduce your code in another user's output.

Deleting Your Codebase From ChatGPT

Deleting a conversation removes the files attached to it from your account. Here's what to do:

  • Open the chat that contains your uploaded code.
  • Click the trash icon or "Delete" option on the conversation in the sidebar.
  • Confirm deletion when prompted.

Deletion removes the conversation from your history, and OpenAI states that deleted conversations are removed from their systems within 30 days. However, if you used the API (not ChatGPT) to send code, deletion works differently: you must delete the file object via the API, and even then, copies may exist in backups for a short period.

Common Misconception: "Does ChatGPT Remember My Code?"

Many users worry that after deleting a conversation, the model still "knows" their code in future sessions. That is false. The model has no persistent memory of individual conversations. Each new chat starts with a blank context unless you use custom instructions or memory features (which store summaries, not raw code). Even if you delete a conversation, the model's weights are unchanged; it cannot recall your code unless you re-upload it.

Choosing the Right Way to Share Code

If you're concerned about privacy, consider these options:

  • Use the API with data retention settings: OpenAI's API allows you to set zero data retention (ZDR) for business plans, meaning your data isn't stored at all.
  • Anonymize your code: Remove comments, variable names, and proprietary logic before uploading.
  • Use local models: Run open-source models like Llama or CodeLlama on your own hardware to keep code entirely local.
  • Use ChatGPT Team or Enterprise: These plans offer stricter data controls and are not used for training by default.

Costs and Limits of Uploading Large Codebases

ChatGPT Plus and Pro have file upload limits (e.g., up to 25MB per file for Plus). There is no extra cost for uploading files; you pay the subscription fee. However, large codebases may exceed the context window (e.g., 128k tokens for GPT-4), so you might need to split files or use a tool like embeddings to index the code. For very large projects, consider using a code-specific AI tool that integrates with your IDE and sends only relevant snippets.

Safety and Privacy Best Practices

Before uploading your codebase, ask:

  • Does this code contain secrets (API keys, passwords, tokens)? If so, remove them first.
  • Is this code proprietary or under NDA? If yes, check your company's policy on using external AI tools.
  • Do you need to comply with data protection regulations (GDPR, HIPAA)? If so, avoid uploading personal data.

OpenAI does not claim to be a data processor for consumer ChatGPT, so treat any upload as potentially accessible to OpenAI staff for safety review. For business-critical code, use the API with ZDR or a local model.

Frequently Asked Questions

Can OpenAI see my uploaded code?

Yes, OpenAI staff and automated systems may review conversations to improve safety and model performance. This is stated in OpenAI's privacy policy. For sensitive code, use the API with zero data retention or a local model.

Does ChatGPT train on my uploaded files?

Not automatically. Consumer ChatGPT conversations may be used for training after review, but you can opt out via the settings menu. API data is not used for training by default as of 2023. Uploaded files are treated as part of the conversation, not as a separate training dataset.

How long are my uploaded files stored?

Files remain in your conversation history until you delete the conversation. After deletion, OpenAI says they are removed within 30 days. If you use the API, files are stored until you delete them, and backups may persist for up to 30 days.

Can I prevent my code from being used for training?

Yes, for ChatGPT, go to Settings → Data controls → turn off "Improve the model for everyone." For API, use a business plan with zero data retention. Alternatively, use a local model.

What if I accidentally share sensitive code?

Delete the conversation immediately. While deletion removes it from your account, copies may exist in backups for a short time. If the code contains secrets, rotate those credentials. For future uploads, use a tool like git-secret to scan for sensitive data.