Your dog is good at giving you the behaviour you are wanting (e.g. attention) but after the treat is delivered, your dog stops the behaviour (perhaps thinking that the treat delivery is the release cue). How to increase the duration of a behaviour?
There are a few ways that you can try:
One way is to delay the delivery of the treat slightly. Praise immediately after the behaviour but then use your voice to serve as a bridge as you then take a slightly longer time to get that treat out of your pocket. Then you may advance to taking a slightly longer time to begin to move your hand towards your pocket. The goal is to stretch that time but not too fast. Teach your dog to learn to wait by starting with little delays of the treat delivery.
One way is to delay the marker signal. The marker signal is the signal that the dog has learned means that she/he did the right thing and a reinforcement is coming. Some people use the word “Yes” some people use “Good dog” and some may use a clicker sound. It can be anything but it is something your dog has learned means that he/she did the right thing and a treat is coming. Perhaps your starting point is 1/2 second, meaning, your dog will perform the behaviour for 1/2 second and then you mark it (marker signal) and then deliver the treat. If your dog is very good at waiting 1/2 a second before you mark and then treat, try stretching your dog to 1 full second before you give the marker signal. If your dog stops doing the behaviour after 3/4 of a second, stay silent and wait for the dog to do the behaviour again and try marking it at 3/4 of a second (before your dog stops doing the behaviour).
One way is to let your dog know that there may be more than one treat coming — or not. If your dog is stopping the behaviour immediately after he/she gets the treat, then have several treats in your hand and begin to deliver a second and third and fourth treat in a row right after the first treat — before the dog can stop doing the behaviour you initially asked for and were treating with the first treat. This is the first step to extending the duration of the behaviour. After you see that your dog is learning to wait for the second and third treats, then you can start to stretch that time a little between the treats. Stretch gradually in order to maintain the level performance. And sometimes have four treats in a row, and sometimes have two treats in a row, and sometimes three and sometimes one. When you give the “last treat” for that behaviour (e.g. your dog has looked at you for the length of time you wanted) give a release command of some kind to let the dog know that it’s okay to stop the behaviour now. It might be a verbal cue or a visual cue (hand signal or a nod or something else you do with your body or eyes).