There is no perfect way to deal with an "error" in training. Once the dog is doing something other than what you were hoping to see--whether you are building a new behavior or practicing a "known" one--every strategy has potential pitfalls.
Let's look at the main options.
There's punishment. Hurting or scaring a dog are off the table for me--but I might close a door that a dog is walking toward so they can't go through it, or move food away from the edge of the counter so a dog can't reach it, or slow my pace on leash so a dog can't charge forward. (Or I might not . . . keep reading.) Those are examples of "negative punishment," where the consequence for a behavior is the removal of access to positive reinforcement. But even mild penalties can poison cues or dampen the dog's enthusiasm for working with you--particularly if you find yourself penalizing over and over.
And then there is extinction--aka nonreinforcement. You have probably heard the common advice to just reward what you like and ignore what you don't. But it's not quite that simple, and dosage is key: if the rate of reinforcement in your training drops too low for too long, your dog may just leave.
Of course, that's not usually the first thing that happens when you hold out for too much too soon. When a previously reinforced behavior doesn't work, what you will see is other behavior that has worked in similar situations (the technical term for this is "resurgence"). If you don't respond to an error, and the dog has a strong or recent reinforcement history for the thing you were looking for in this situation, then it may shuffle back to the top quickly, and you can reinforce it. But if not, you may see what's called an "extinction burst," a flurry of variability and intensity that might include some behavior you would probably call "frustrated." Maybe in that burst you'll also see the behavior that you were hoping for, but it may come with outriders like snorting, huffing, sneezing, barking, or tippy tappy feet. Both punishment and extinction can even provoke aggression.
Even if your dog is not easily frustrated, you may want to avoid repeated "ignoring" of errors. Say you're training your dog to do both a paw target and a nose target. You are working on the paw target today, but they target with their nose instead. When you don't click the nose target, then they try the paw (resurgence!), which you reinforce. When that kind of thing happens, it's key to watch carefully what they do on the next rep. If they just do the paw again on the next round, you might be on the right path, but if you find yourself repeatedly swiping left on the "wrong" behavior to get to the "right" one, you may be starting to train the dog to do the whole sequence--nose then paw, nose then paw.
Redirection/resetting is often the best of our imperfect options. It keeps the dog engaged in the training session, and you can use it to get the dog into a position from which they are more likely to be successful. But do it too often and you may end up reinforcing the error more than the "right" behavior with your "reset cookies" or your go-to cues. Example: your dog lays down when you give the sit cue, so you toss a treat or give him a hand target to get him up, which you maybe also reinforce with a click and a treat. Do this once or twice, occasionally, and it's not likely to create a real problem. But do it over and over and over again and you are doing a nice job training your dog to lie down on the sit cue.
What you really want is not just a high rate of reinforcement but a high rate of reinforcement for mostly the desired behavior. If you are frequently repeating any of the strategies above, that is not what is happening.
Though I have my obvious preferences, the reality is that I might do any of these imperfect options depending on the specifics of the situation. But so long as you're not hurting or scaring your dog, then what you do at the moment an error is already occurring probably does not matter as much how often you do it or what you do next.
So, TL;DR, are some things you might do in the moment when a dog does something other than what you hoped:
- Remove, diminish, or delay the reinforcer if safety requires, or if the behavior getting reinforced even once would really set things back. But then adjust your plan.
- Wait a few seconds and see what else the dog offers, if you're pretty sure it will be what you want. If it's what you want, or something that sets the dog up to be more successful next time, reinforce that, but then adjust your plan. (Many trainers like to teach a "default" behavior of looking at you for further instruction--default meaning that it is so heavily reinforced in so many situations that it is likely to resurge first.)
- Don't give the reward, but neutrally bring them into position to try again, if you think they're likely to get it right. (No guarantees that this won't reinforce the error, but you can take an educated guess.) If they don't, adjust your plan.
- Just reset promptly, without waiting or dithering about whether you're reinforcing the error--but do it strategically. Do it fast, so you are likely to reinforce less of the "wrong" behavior. And do it so that when the dog looks up again, they are in a better position to start the "right" behavior than they were last time. But then adjust your plan.
- If you're not able to make these calls in real time, end the training session, give the dog something else to do, and take a longer break while you . . . you guessed it, adjust your plan.
Note the common theme here is "but then adjust your plan." Here are some starting points for thinking about how:
- How can I tweak the environment to better facilitate the "right" behavior?
- What might have cued the "wrong" behavior? Do the conditions look like they did when that behavior was reinforced? (I see this often when people try to capture two different behaviors without changing their position, the props, the dog's starting position, or where they are delivering their treats.)
- Are your criteria too high for the situation? (Spoiler alert: If your rate of reinforcement for the right thing is low, it's a good bet they are. Change the situation, or change your criteria.)
- If you're cuing the behavior, is your cue unclear, or perhaps not what you think it is?
- Is there another cue in the environment for a behavior that has been reinforced more than the one you are trying to ask for or teach?
- Is your reinforcer valuable enough for the situation? (But note that there are many other things to look at before upping treat value! If the dog doesn't understand what to do, he still can't get the reinforcer.)
- Is the way I'm delivering my reinforcer, or where I'm delivering it, helping or hurting my cause?
- Does your dog have a competing need (e.g., to eliminate, to eat, to relieve pain or discomfort)?
- Are there any prerequisite skills or pieces of the desired behavior you need to pop into the dog's repertoire on before you can expect them to pop out when you don't reinforce what they tried? What do you want to see resurge?
I may have missed some considerations in trying to recreate my thought process, but the most important question of all is: How are you going to use this error as information to change what you are doing?