Bobby Morrison used a sharpened piece of plastic cutlery to inflict multiple injuries on his victim in the grounds of Wetherby YOI.
A court heard it was not possible to count the number of blows delivered by Morrison such was the severity of the attack.
The victim suffered deep wounds to his head, neck and back during the incident in August last year.
CCTV footage played in court showed Morrison, aged 17 at the time of the incident, strike the victim repeatedly as officers tried to stop the attack.
Morrison was serving a 45-month sentence for robbery at the time in which his victim was threatened with a knife.
Mr Smith said the victim received medical treatment to have some of the wounds glued together.
As he was led away after the attack, Morrison told officers: “This is your fault. You should not have put him on the wing.
“If I didn’t get him he would have got me.”
Morrison, now aged 18, of no fixed address, pleaded guilty to wounding with intent and possession of an offensive weapon.
Max Saffman, mitigating, said the victim’s injuries were not serious despite the severity of the attack.
Mr Saffman said there had been difficulties between Morrison and victim before the incident,
He added: “These offences did not happen out of nowhere.”
He said: “What the cause of this dispute was I do not know.
“This was a frenzied attack and it is clear to me that you intended to cause serious harm indeed.”