O'Sullivan has triumphed at the Masters and the Welsh Open this year but won just one match in what will be his last event before he goes into the defence of his Dafabet World Championship next month.
He joined the top four players in the world rankings - Neil Robertson, Mark Selby, Ding Junhui and Stuart Bingham - among the casualties so far at the Guild Hall, where the winner will collect £100,000 on Saturday.
China's 26-year-old Yu, ranked 48th in the world, is through to the quarter-finals of a ranking event for the first time after getting the better of a high quality match.
O'Sullivan made a break of 64 in the opening frame but Yu nicked it by clearing from the last red. He might have added the second but missed a tricky final pink and O'Sullivan knocked it in to square the tie. Yu regained the lead with an excellent run of 102, before O'Sullivan hit back with 53 and 57 to make it 2-2, then went ahead for the first time with a stunning 140 total clearance, the highest break of the tournament so far.
But Yu refused to buckle and dominated frame six for 3-3. He was first among the balls in the decider and made 57, then finished the job after O'Sullivan's counter faltered when he missed a red to a centre pocket on 16.
Yu, who now plays Barry Hawkins, described the result as the best of his career, alongside a win over Ding Junhui in the last 32 of the 2012 German Masters.
O'Sullivan, who has practised with Yu at their base in Romford, said: "I played ok today but he is a very good player. I started slowly and that cost me. Sometimes a defeat can do you good because having won the Masters and the Welsh I was wondering when the run would come to an end. I can knuckle down now and get my game into shape."
Hawkins edged out Ryan Day 4-3 in a match which finished at 12.50am. A bizarre incident at the end of the fifth frame saw Day pot the frame-ball pink only to touch the black with his cue on the follow through, immediately calling the foul on himself. Hawkins went 3-2 up then Day won the sixth. In the decider, Day missed the final brown when leading 42-34, and Hawkins converted excellent pots on the last four colours for victory.
Judd Trump looked in fine shape in a 4-0 defeat of Haikou World Open champion Shaun Murphy, knocking in breaks of 58, 53, 65 and 73.
"My safety was good and my positional play was the best it's been for a while," said Trump, who now plays Joe Perry. "When Ronnie goes out, everyone perks up a bit and thinks they have a better chance of winning, but I've got a tough game next against Joe, he has beaten me the last couple of times we've played so he's favourite."
Gerard Greene made the best comeback of the week so far, recovering from 3-0 down to beat Anthony Hamilton 4-3. Runs of 126, 71 and 70 put Hamilton 3-0 ahead, but Kent-based Greene won four in a row with top breaks of 91, 74 and 54.
Ball by ball scoring and results from tournaments