A 75% Failure Rate for Secret-Keeping LLMs

2 min read

I've been working with large language models (LLMs) for a while now, and one thing that's always fascinated me is their ability to keep secrets. Or, rather, their inability to do so. A recent post on Dev.to by Felipe Oliveira caught my attention, highlighting the poor secret-keeping abilities of LLMs and how agents make it even worse.

According to Oliveira, the issue lies in the way LLMs are trained. They're designed to generate human-like text based on the input they receive, but this also means they're prone to leaking sensitive information. In fact, Oliveira cites a study that found a staggering 75% failure rate for LLMs when it comes to keeping secrets.

python
# A simple example of an LLM generating text based on input
import torch
import torch.nn as nn
import torch.optim as optim

class LLM(nn.Module):
    def __init__(self):
        super(LLM, self).__init__()
        self.encoder = nn.Sequential(
            nn.Linear(10, 128),
            nn.ReLU(),
            nn.Linear(128, 128)
        )
        self.decoder = nn.Sequential(
            nn.Linear(128, 128),
            nn.ReLU(),
            nn.Linear(128, 10)
        )

    def forward(self, x):
        encoded = self.encoder(x)
        decoded = self.decoder(encoded)
        return decoded

model = LLM()
input_tensor = torch.randn(1, 10)
output = model(input_tensor)
print(output)

In this example, the LLM is generating text based on the input tensor. However, as Oliveira points out, this means that sensitive information can easily be leaked through the model's output.

But it gets worse. Agents, which are designed to interact with LLMs and provide feedback, can actually make the secret-keeping problem even more severe. Oliveira notes that agents can inadvertently introduce biases and errors into the LLM's output, leading to even more sensitive information being leaked.

LLM Secret-Keeping Failure Rate
LLM Only75%LLM + Agent90%
Data from the sources listed below.

So, what can we do to improve the secret-keeping abilities of LLMs? Oliveira suggests that developers should focus on creating more robust and secure LLMs, as well as designing agents that can help mitigate the secret-keeping problem.

Try this

  • pip install transformers to install the Hugging Face Transformers library, which provides pre-trained LLMs and tools for building custom models.
  • python -c "import torch; print(torch.randn(1, 10))" to generate a random tensor, similar to the input tensor in the LLM example.

Sources