Hello and welcome to JustAnswer!
If the problem is truly tied to the amount of fuel in the tank then the problem is very likely with the fuel pump in some way.
When fuel level is higher it allows fuel to fall into the fuel pump's pickup reservoir from the top.
When the level gets lower then fuel has to be drawn through the inlet filter on the bottom of the pump. If this filter is restricted from debris then it will cause fuel starvation when the level is low.
It could also be the pump sucking air when the level gets low.
If you can say for sure that the problem only happens when the level is under a quarter tank then most likely replacing the pump will be necessary.