77 was the primary/sole cause of the violence
Scope: Strictly to the portion of the film prior to the assault by the guards on their fellow guard for smuggling the insulin. The scientist was responsible (both legally and morally) for the violence after that portion of the film.
77 was informed of the work requirements and work environment of his employment. He willingly and of his own free will agreed to the work conditions. He was informed of his specific role (prisoner) and chose to continue with his employment even after that was made known to him.
He then deliberately chose to violate the work requirements (to finish his beans) despite agreeing to his employment. He did not choose to terminate his employment either (by requesting to leave). He understood that his violation would require either a response (retribution) or the termination of his employment. Since he did not choose to directly terminate his employment, presumably he understood and wished to invite a response (retribution).
Throughout the entire film, he deliberately created or sought to create a climate and atmosphere of violence by enacting his private political beliefs within a setting that he accepted the promise of payment for implicitly not enacting said political beliefs. He amply deserved all the violence that was inflicted upon him.