system
Given the following post, respond as if you're commenting on Reddit:
human
[Sci-fi] Under what circumstance would an AI generally feel pain?

So I just got done rewatching the Matrix trilogy, and something that's addressed in Revolutions is that Agent Smith managed to possess the avatar of a character in the second film, allowing him steal a man's physical body and use it to get the drop on Neo when he's not in the Matrix. During the movie, Smith uses a knife on his hand to find out what pain really feels like as he never really felt it while in the Matrix as a program and was curious as to what it felt like. 

There's an uncountable amount of fiction in the world featuring AI, each with a different depiction or representation on how they're shown, and even things where AI in different forms are shown being put into combat scenarios, such as the Terminator films or the Portal games, but my ultimate question for you today is: do general AIs feel pain, and if not, what circumstances would they have to be under in order to feel pain?
gpt
Quite a broad question, and with a short answer: "It depends on the AI."

Okay, cheating a little there. Yes AI can feel pain, but the way that pain is perceived varies quite diffrently from AI to AI.  
Terminators, like the T101 feel injuries, but it's not anything debilitating in itself. It's more like status updates or diagnostics.  
"Left leg missing at the knee" Instead of "AAAUGHG MY KNEE'S on fire!".

Other AI's like the hosts in Westworld feel pain in a way much more like we do. It's because they need to feel that pain in order to simulate human reactions.

And the AI's from the matrix, like Smith. These AI's are much more 'grown' compared to the previous two examples. These AI's aren't entirely purpose built. But they are built to run on human wetware, so in that respect they will interface quite neatly with the existing wetware and experience sensations in a similar way.