If I was a rat I wouldn't do tricks to earn a carrot piece! :lol2: That's boring, normal food.
You need to keep a special, really tasty food purely for working with them, something that they never get to eat unless you are training them. That way they'll be excited about what they are getting and want to do what you are asking them to do. Things like yoghurt drops, but whatever it is only a tiny piece, not a big chunk, otherwise they'll spend more time eating and 'working'
It depends what you want to teach them. I taught my old rat how to run a mini assault course. Rats like to run into dark places so I was taught to place a box with some treats in at the end of whatever you want them to do and then they go over the course to get to the box.