I have had the same problem since i updated to 4.4.4... except mine shuts off only when i touch the screen (like pull the menu down, open a app, ect.) so, I went and did a factory reset, nothing changed. downloaded the Nexus Root Toolkit, did a flash stock to 4.4.4 again, nothing.. Then now I have tried another flash stock to 4.4.3 but now have manually updated to 4.4.4. I will reply again to see if this changes anything.
My Nexus 4 is completely stock, not rooted, never tampered. So I am very surprised with this issue, but I have had another issue.. Along with the shutting off issue I have a problem which so far was fixed with the first Flash stock(i think) I would use my Nexus 4 with signal for texting and using data but when i went to actually use data like to search something up it would randomly say i have "no service".. not sure why it did this, happened when I had 4 bars and didn't move..