What It's Like to Be an AI Snake
In my last post, I offered a proposal for resolving the hard problem of consciousness by embracing a form of panpsychism that sees subjective experience as an entity’s incoming causal relations, while their outgoing causal relations constitute their objective being, along with adopting a perspectivist metaphysics. In this post, I will apply this theory to speculate wildly about the experience of a simple AI snake I created at the end of February, which I will name ‘Snakey’.
For a little context, I wanted to try my hand at ‘Vibe Coding’ — working with AI to write code, with the AI doing the heavy lifting — and after I watched this video, I thought I would try to replicate it, getting ChatGPT to make a snake game then set up a machine learning agent to learn to play it autonomously. The project was a lot of fun, although it took me much longer and more effort than the guy in the video (I’m not complaining, though — this meant I got to learn more and have a greater sense of accomplishment). I ended up with a really fun (and slightly addictive) snake game where you actually play against Snakey. You can see me playing against an earlier version of it here:
(I’m the black Snake, and Snakey is the purple one. The music was just playing in the background, but it works nicely, I think :))
Inputs/Senses
In my last post, I wrote:
A thing’s experience/subjectivity is how the world relates to/acts upon it; its being/objectivity is how it relates to/acts upon the rest of the world. Its experience is the world flowing in; its being is its self flowing out.
This corresponds very neatly to the “input state” provided to Snakey — the data fed into the neural network for it to process and return an “output state” (its response). Initially, this consisted of the position of its head relative to the edges of the game, its direction of travel, and the position of the food relative to the edges of the game. After a while, I realised this was giving Snakey its information in an absolute form, taking a top-down view. That didn’t seem fair to me, especially since we biological organisms all get our incoming sense data in an already relativized format, since our experiences are always from our own perspectives. Snakey, in its first incarnation, was stuck in a perpetual out-of-body experience — a “god’s-eye view” it had no way to make sense of.
I therefore adjusted the input state so that Snakey didn’t experience its absolute position or direction of travel, and instead experienced everything else relative to its position and heading, i.e. it sensed how far the food was ahead/behind or to its left/right. I also replaced awareness of the walls with a sense of whether or not there was an obstacle (whether the wall or its own body) immediately in front or to the sides of its head. These changes made the input simpler and made the training go much quicker.
I think the fact that applying perspectivism to Snakey made its training so much quicker should give some support to perspectivism. Snakey has no absolute reference points. It doesn’t know which way is up, or where it is on the screen, or which way it’s heading, or where the food is on the screen. It’s all relative, and that’s far more helpful. Surely, if reality were absolute rather than relative, we’d need to know about it? Instead, the opposite appears to be the case: absolute views are positively unhelpful.
It’s also remarkable that trying to put myself “in its shoes” was so effective (despite Snakes not having feet…). Treating it as possessing a first-person perspective didn’t lead to absurdity, but to better understanding and improving Snakey. We might treat this as an extension of Dennett’s intentional stance, but beyond attributing intentions and beliefs, also attributing experience. Whether it’s just a useful fiction or something more real, it’s remarkable that it works.
It’s also strange to note that my experience of the game, as something that plays out with coloured pixels moving on a screen, is only my perspective. The game does not need to render on a screen for Snakey to play, and in fact, it didn’t render during its training. What I see on the screen is just my input state for the game. Am I playing the “real” game? Is Snakey? Are we even playing the same game?
The Past
Snakey doesn’t directly experience anything besides its “input state”, i.e. those variables I mentioned above. This means that it has no experience of its immediate past.
However, it does have some awareness of the past, via what it “learned” during its training phase. I do not mean that it can remember games from its training phase, but information from this time is present and causally efficacious within the ANN, as it found and refined its strategy. It is not a memory it could recall, but in a deeper sense, Snakey is this memory. It isn’t knowledge-that, it’s know-how. This information from the past is what structures Snakey, and so is always present to it, in its very being.
We might similarly consider our genetics to be a kind of “evolutionary memory,” recording which genetic strategies worked for survival and reproduction for our ancestors. For example, mammals naturally desire sex because it’s a good strategy for reproduction. Thankfully, we don’t recall our ancestors having sex, but the fact that they did is something that profoundly shapes our experiences and desires.
The Future
Does it have any awareness of the future? Interestingly, it (sort of) does. Snakey was trained as a ‘DQN Agent’. I learned about how these work by talking with ChatGPT, and so I asked it to summarize the key point:
What makes DQN especially interesting is how it enables a kind of learned forward thinking. When training, the agent updates its understanding of how good an action is not only based on the immediate reward it gets, but also based on what the best possible future outcome might be from the resulting state. This is called bootstrapping — the network improves its prediction for the current step by using its predictions for the next step. In this way, DQN allows future value to propagate backward through time, gradually shaping earlier decisions to reflect their long-term consequences. Over time, the agent becomes better at choosing actions that may not yield immediate rewards, but lead to better outcomes down the line.1
So Snakey will have some degree of awareness of the future built into how “desirable” different actions appear to it. It is not actively imagining these future states, but it is essentially engaged in predicting which actions have the highest long-term value.
Of course, it is not really gaining information from the future — that’s impossible, even for us. But it is learning how later moments tend to relate to earlier ones, and using that to infer something about the future from its present. In fact, this act of inference is the essence of what Snakey does/is. Its whole point is to assess which current action is most desirable.
Desire
Does Snakey experience desire? It’s not one of its inputs, so we cannot say it directly experiences desire, as though desire were one of its senses. But its whole existence is directed towards finding and eating its food.
We might see the expected value that Snakey calculates for each action as representing its desire. This feels strange because in attributing “desire” to Snakey we are attributing to it intentionality, and especially because we are linking it to something as simple as a single number. And yet, we naturally use the “intentional stance” when engaging with things like Snakey. It’s difficult to watch it or play against it without thinking of it as seeking the food. And indeed, I created Snakey with the intention that it would direct itself towards the food. I think this should be recognised as genuine intentionality, and we should feel free to drop the scare quotes.
Is its intentionality merely derivative from my intentionality — something second-hand and second-rate? I do not think so. We could perhaps argue that our intentions are similarly derivative, ultimately deriving from our evolutionary “training phase”, or even further to thermodynamic laws. Should we see evolution as possessing true intentionality, while we have something second-rate? Or see all intentionality as illusory? Both seem patently absurd to me. I think we should instead recognize that we can indeed imbue things with genuine intentionality. We do this with all our tools, crafting them to possess an inherent tendency to fulfil certain goals.
That’s not to say that Snakey has any representation of its intentionality, as we do. We act for reasons that we can know and reason about. But most living things, it seems, act for reasons that they do not represent to themselves and cannot contemplate. Snakey is probably closer to the level of a single-celled organism rather than a human or elephant.
So does Snakey experience its desire, or does it have desire yet not experience it? To begin, does it experience the expected values it calculates for each available action? This is the output and end of its process, so it is not part of its inputs. It does not calculate the values and then choose between the actions based on them — it calculates the values, and the highest one is simply taken as its decision. Nor does it do anything with the values. I think we can therefore say it does not experience them directly.
However, its whole being has been formed through the training process by the goal of pursuing the food. It has structurally internalised that goal, with the goal shaping how it experiences its input states and relates them both to each other and to its output states (i.e. actions). Desire is what gives structure and meaning to Snakey’s experience. Without it, the inputs would be just numbers.
To make this point clearer, we can imagine adding to the input state information that is irrelevant to its goal, such as whether or not it’s the weekend. This information might be meaningful to us, but it is useless to Snakey, and so in the course of its training it will not learn to incorporate this info. Whereas its other senses will be incorporated and linked to actions, giving them a holistic, contextual meaning, it will have no sense of what it being the weekend might mean, precisely because it means nothing to it and its goals. This information would have minimal causal influence on Snakey and hence would be only minimally experienced, being effectively ignored.
The same point applies to living organisms like ourselves: all of our experience is structured by desire. Every sight, smell, taste, touch, and sound is experienced and distinguished through the lens of desire.
So we might say that all of Snakey’s experience is its desire. Its experience of the food’s relative position is inseparable from its goal of pursuing the food, and its experience of obstacles around its head is inseparable from its goal of not crashing.
What’s really interesting is that its awareness of its past, its future, and its desire are inseparable. All three come in through the training phase and determine the structure of Snakey’s experience. All three determine the how of all Snakey experiences, such that no experience is untinged.
Pleasure/Pain
Does Snakey experience pleasure or pain? Does it hurt when it bumps its head? Does it enjoy eating the food? On these points, I think the answer is a simple “no.” There’s no signal in its inputs representing pleasure or pain, nor whether it has bumped its head or eaten the food (it also has no experience of its immediate past). It is oblivious to these things, knowing only where it is and where the food is relative to itself.
Might it experience pleasure or pain during its training? I think the answer is again “no”. Although in reinforcement learning in animals, pains and pleasures are used to encourage or discourage behaviours, this is not the case for machine learning. In animals, these function as signals for their brains to adjust themselves to repeat rewarded behaviours and avoid punished ones. But for ANNs, they are unable to update themselves, and so there is no point in signalling to them whether or not they did well. Instead, they are updated from the outside using the backpropagation function.
Thought/memory
I think it’s obvious Snakey does not have any thoughts. But just for fun, what might it look like if we tried to give it rudimentary powers of thought?
One possibility would be to provide it with an extra output state that it gets to set however it likes, which will then be presented back to it in an extra input on its next turn. Like leaving a little note for its future self. It might not use this at all, and I suspect with the current set-up it would not, as there would be little benefit to it. But perhaps with adjustments to the training set-up, it might learn to use this to pass to its future self some relevant information. Perhaps, if it periodically lost ‘sight’ of the food, it might use this extra output/input to remember its last known location. Or perhaps it would use it to know whether or not it turned recently, to increase its bodily awareness and help prevent self-collisions.
Interestingly, it would determine the meaning of the signal entirely by how/when it learns to use it, plus how it learns to respond to it. In this regard, it would be like words in human language, which gain their meaning from how/when we employ them, plus how we respond to them.
This meaning would also determine how it is experienced. If it were used to give information on the food’s location, it would be experienced and interpreted according to that meaning. It would also make it an extension of the causal influence of the food, making it simultaneously an experience of its past self’s communication and of the food. This is similar to how we simultaneously experience an artwork and the subject of the artwork. We experience the subject through the work.
Thanks for reading! Subscribe for free to receive new posts and support my work.
“Qualia”?
Does Snakey experience “qualia”? What is Snakey’s experience qualitatively like? Or is it entirely quantitative, as you might imagine for something that is essentially a tiny computer program?
If we look at what Snakey is experiencing, it is primarily spatial facts, telling it the location of the food relative to itself, and whether or not there are obstacles immediately before or to the sides of its head. But the question is, how does it experience this information? Fortunately, we have already hinted at the answer to this above, when we discussed how meaning and desire structure how its inputs are experienced.
I’d suggest that experience is qualitative because it’s semantic — its feel is shaped by what the information means to the organism. We can compare it to our experience of a particular word, which is determined not just by the word’s actual sounds, but by the meaning and function of that word as a bearer of meaning, full of implications and connotations. Indeed, our experience of the sounds as mere sounds plays a relatively small role, as we can see from things like the McGurk effect, how words in unfamiliar languages sound like gibberish, and even the experience of misheard song lyrics. We experience words primarily as words, and only secondarily as sounds.
I think this idea of experience as essentially semantic becomes clearer if we consider the experience of pleasure or pain. We cannot consider the experience of pleasure or pain in isolation from their meanings as indicators of something desirable/undesirable. I wrote more on this in my previous post, ‘The Structure of Happiness’ (though using different language).
Does this mean Snakey’s experience is qualitative, not just quantitative? I think this is a false dichotomy. Mathematical objects are not quality-less, but are themselves qualitatively experienced. Likewise, all qualities may be subjected to mathematical analysis, e.g. we can do addition with colours — blue + yellow = green — see? The difference is just that we’ve found/created clear rules for thinking about mathematical objects. So yes, I believe Snakey’s experience is indeed qualitative, as well as semantic, as well as mathematically structured. The three are not in opposition.
Wrapping up
OK, I had better leave this discussion there. I hope you have found it as interesting as I have. I did say it would be wild speculation, and it’s gone beyond what even I expected when I began. Whitehead said that “it is more important that a proposition be interesting than that it be true” and I hope I have at least succeeded in that.
Even if you find my wilder speculations a bit much, I hope you see the value in trying to understand the “mind” of a simple AI, and how that might shed light on the workings of more advanced “real” minds.
Well, what do you think? Have I gone off the rails? Have I made some subtle or obvious mistake? Should I spend less time with AI and more time with real snakes? Please let me know in the comments!
Thanks for reading! Subscribe for free to receive new posts and support my work.