MCL c 187 §17 is in part relevant, because that is the section on terminating tenancy at will. Here it is in relevant part:
For the purposes of this chapter, chapter one hundred and eleven and
chapter two hundred and thirty-nine, occupancy of a dwelling unit
within premises licensed as a rooming house or lodging house, except
for fraternities, sororities and dormitories of educational
institutions, for three consecutive months shall constitute a tenancy
at will
Thus you are not a tenant at will: if you have counterevidence that shows that you are, you could mention that. Section 8 says
If land is held by lease of a person having an estate therein
determinable on a life or on a contingency, and such estate determines
before the end of a period for which rent is payable, or if an estate
created by a written lease or an estate at will is determined before
the end of such period by surrender, either express or by operation of
law, by notice to quit for non-payment of rent, or by the death of any
party, the landlord or his executor or administrator may recover in
contract, a proportional part of such rent according to the portion of
the last period for which such rent was accruing which had expired at
such determination.
which means more or less "you owe the rest of the rent": but it does say that this is for a person who "has a lease". There does not seem to be any statutory definition of "lease". Presumably you agreed to something spelling out the amount, when due, what you can do etc. which would be your "lease". Since there is no statutory override, whatever the lease says, goes. One other source of law would be Landlord-Tenant Regulations (940 CMR 3.17), which however does not seem to add anything else.
Having gone through that, there is the distinct possibility that you have been granted a license to live in the unit, and you do not have a lease (you have a license), which is extremely clever of them. This version includes an Early Departure fee of one month's rent: of course, this document may not be applicable to you, but it is a possible document. Whether or not calling it a "license" allows them to skirt other aspects of MA Landlord-Tenant law would have to be determined in court.