Most Helpful Guy
The problem with answering this is that there are two general reasons why this could be happening, and they are basically mirror opposites of each other. So answering it could either be throwing a nice guy under a bus, or making a bad guy sound far better than he deserves.
For Team Nice Guy: It could be that he is genuinely starting to develop real feelings. Love takes years to build. It is covered up early in a relationship by NRE (new relationship energy) that is very strong, and very infatuation-driven. But shallow. And temporary. Sometimes lasts a few weeks, or 6 months, or 2 years. But it will fade. And if love isn't there underneath it, the relationship is doomed. NRE is there to give love time to grow. So what could be happening is that he didn't feel particularly strong NRE, so he wasn't super affectionate. But there was enough that he stuck around around love actually had time to grow. And now he is feeling that, and it is stronger than the NRE ever was. So... awesome. This is a great development.
For Team Bad Guy: A guy will often adjust their behaviour dramatically if they are feeling an inordinate amount of guilt. If he was sleeping with other girls, or if he HAS another girl on the side, he may start pouring more attention into you to both cover up that guilt, and to make you feel like he loves you so much he could never cheat... making his deception less likely to be caught. It is a case of "the lady doth protest too much".
The problem is... these are both just as valid, and just as likely, given the information you presented. I can't say which team he is on with any degree of certainty whatsoever. Which isn't particularly helpful for you, unfortunately. Hopefully it will give you some food for thought, however, and you can start figuring out what team he is on based on other supportive behaviour. And, obviously, in your case I would hope he is on Team Nice Guy.
Most Helpful Girl
When guys start to act sweet it usually means they've messed up somehow.