Why are you calling various parts of the program "wanting", "liking", "reward", "confidence", etc.? For those attributes to be really there, they would have to be discoverable from the code alone, even if all the comments were omitted and all the variable names replaced by arbitrary ones like G36287.
As this algorithm executes, the last and 2last variables become the program's last 2 outputs. L1's even indexes become the average input(reward?) given the number of ones the program outputted the last 2 times. I called L1's odd indexes 'confidence' because, as they get higher, the corresponding average reward changes less based on evidence. When L1 becomes entangled with the input generation process, the algorithm chooses which outputs make the inputs higher on average. That is why I called the input 'reward'. L2 reads off the average reward given the las...
Can you rephrase the question while tabooing 'pleasure' and 'suffering'? What are you, really, asking here?
Does this algorithm, when run, instantiate a subjective experience with the same moral relevance as the subjective experience that happens when mu opioids are released in biological brains?
Python:
'''
L1=[1,1,0.5,1,1,1] #prior beliefs, alternate expectations and confidences
last=1
last2=0
while True:
L2=[L1[0],L1[2],L1[4]] #wanting?
action=1 #block chooses decision
if L2[last]>L2[1+last] or L2[0]>L2[last+1]:
action=0
if L2[2]>L2[0]:
action=1
print(action)
reward=int(input())
last2=last
C=1+2*(action+last2)
last=action
L1[C]=L1[C]+1#updating confidence
A=reward-L1[C-1]#pleasure/suffering(liking?)
L1[C-1]=L1[C-1]+A/L1[C]#updating expectation with A, which is so obvious to algorithm
'’’
Why I think this algorithm experiences happiness and/or suffering when run:
On line 20, the variable A is obvious to the algorithm, just like pleasure and suffering, because it is a variable it references. Just like with liking, it updates the algorithm’s expectations. If the algorithm runs for a long time, variable A will have negligible influence on wanting. This is like experiments in rats where researchers activated the liking circuits in rat brains without making them want anything.[1] Line 6 has expected rewards, analogous to wanting. Forcing the 1st item on the list to be 1000 each turn makes the algorithm incessantly output zero, even when it gets negative reward. This is like activating the wanting circuit in rats without activating their liking circuit. In rats, wanting and liking are separate. In this algorithm, the conjenctured wanting and liking are separate.
The algorithm also has a non-contrived hedonic treadmill. As A stays positive over multiple rounds, A becomes lower with the same reward. If A becomes negative, it becomes less negative with the same reward. Just getting rid of the updates which cause the hedonic treadmill makes the 'liking variable' knowably not correspond to liking. If this is true for humans, getting rid of the hedonic treadmill while keeping pleasure will be extremely difficult. Reinforcement learning is a major motif in the evolution of animals. Wanting and liking are part of reinforcement learning in animals and in this algorithm.
The algorithm steers actions to get high rewards. Here are sample interactions with the algorithm and some simple environments the algorithm models well. The actions are indented.
Reward for 1:
1
1
1
1
… the last 2 lines repeat forever
Reward for 0:
1
0
0
1
… the last 2 lines repeat forever.
Reward for switching:
1
0
0
1
0
0
1
1
0
1
… the last 4 lines repeat forever
These runs show that algorithm tries to avoid suffering and get reward.
Before commenting, please make sure you understand How An Algorithm Feels From Inside. If you see any fake explanations in my explanation, please tell me in the comments.
Open problem: what is the True Name of suffering?