A pig will voluntarily walk off an edge 3 blocks high , but not an edge 4 blocks high.
To investigate this, I started with @xfs's proof that a pig will not jump off blocks in a 9-patch arrangement if the drop is too high.
I then constructed the following apparatus to find the maximum distance a pig would voluntarily jump off: As you can see, a 2 block drop is fine A 3 block drop is also fine At a 4 block drop the pigs no longer jump off voluntarily Conclusion: The highest drop pigs will drop off voluntarily is 3 blocks
gaming.stackexchange.com/users/3610/fredley
A quick experiment.
None of them fell off
All of them fell off at the inner corners
All of them quickly fell off at sign posts.
gaming.stackexchange.com/users/9437/xfs
From what I have seen, most mobs wont wander off a two block high cliff unless they have seen you.
It's very difficult to say since if you get too close their behavior changes.
It could also be different on a mob by mob basis.
I have read that cows will ignore cliffs entirely and plummet to their doom!
gaming.stackexchange.com/users/None/
There may be some "sensing" of elevation change before an animal will fall off, but I've seen many unwilling creatures simply wander to their death -
so there seems to be no height restriction.
gaming.stackexchange.com/users/4393/Resorath
If you are holding wheat in your hand, a mob will follow you off of any drop, and will happily drop off a cliff while circling you for the wheat.
If you are leading a pig wearing a saddle and carrying another player, this is a very easy way to get the related achievement - lead the pig to the cliff, and stand at the edge.
The pig will circle around you and drop off.
gaming.stackexchange.com/users/14438/Broam
It is 3 i tested.
This was useful for me to get my pig to go 2500 blocks without commands and doable in survival all you need is a ravager and a pig
gaming.stackexchange.com/users/232834/Bobby Roy
I've noticed that mobs don't just walk off of cliffs on their own accord.  They stop when they sense a cliff (unless they are chasing you).  How high does a cliff have to be for them not to walk off of it?
How much of a drop will a mob voluntarily walk off of in Minecraft?
gaming.stackexchange.com
<minecraft-java-edition>
gaming.stackexchange.com/questions/23902
gaming.stackexchange.com/users/10126/Logan
A pig will voluntarily walk off an edge 3 blocks high, but there doesn't seem to be a height restriction. There seems to be a height restriction of approximately 3 blocks. However, by following some instructions the restriction is cancelled.
There seems to be a height restriction. Following some instructions seems to cancel the height restriction.