mathieu@laptop:~/blog/engineering$ cat heisenberg-context-prompt.txt
Then: what browser do you use?
Now: what model do you use?
Every (web) developer I know has asked this question at least once in their life: what browser did you use? Not out of curiosity but to pinpoint why the site behaves the way it does. Next we use that browser and fix the problem.
It was (sometimes) annoying but almost always solvable. And this has all to do that a browser will always render a website the same each time. Deterministic.
In games this problem (and solution) is the same, but bigger. What OS, CPU, GPU, etc are you using?
But with AI, and especially in the context of MCP, this problem is no longer platform independent. It is depending on the underlying technique; the LLM and the context. And it is even worse, you cannot reproduce it because the underlying technique is probabilistic.
While API and MCP serve two different use cases, the underlying principles remain the same: a server receives and validates data and then parse it to whatever you need it for. With APIS you have very strict and structured rules (and data) while with MCP the transfer of data is dependent on (often English) descriptive text and arguments. And while data still needs to be validated (even stricter then APIS), it is almost entirely dependent on the Model the client uses, their language (and spelling), the prompts, and the history of the chat (the full context). This shifts the responsibility from server to client.
So, I've written hundreds, maybe thousands, of sites, apps and games the past decades and I find LLM still a fantastic tool. The "magic" that a mathematic algorithm can 'understand' language and intent is still impressive. And this is also the foundation of all the hype, buzz and news around AI. I even called it the UI of the future.
But the probabilistic part of LLM is also the ugly side. One character difference in a question or sometimes even the same question can result in completely different outcomes.
And this is where Heisenberg comes in
The Heisenberg Context Prompt, named after Werner Heisenberg’s Uncertainty Principle in physics, is a phenomenon where the act of observing, measuring, or explicitly instructing the model changes its internal state and changes the outcome.
An example of this 'Fragility Problem' is that you might have a MCP call like this:
{
"name": "get_user_address",
"description": "Retrieves a user's address from the database.",
"inputSchema": {
"type": "object",
"properties": {
"userId": {
"type": "string",
"description": "The unique identifier of the user account"
}
},
"required": ["userId"]
}
}
But if a small model, bad (system) prompts or a long running session with AI tries to map this tool with the user request it might tries to call this function with an email instead of an ID or, if there are multiple numeric values in the chat, it may even sends the wrong one.
These challenges are not completely solvable with systems that are probabilistic. They can be minimised with good tool names, descriptions and the use of examples in instructions. But also understanding and proper use of LLMs will all help towards better results.
mathieu@laptop:~$ fortune