don't know about berkeley specifically, but some towns have laws against more than a set number of unrelated people living together.
Though the court case that upheld these laws as constitutional, Village of Belle Terre v. Boraas, the zoning law was extreme at limiting only two unrelated persons - which is extreme.
Different houses on the same street can be zoned differently. My house is zoned "single family" but two houses down is zoned "boarding house."