I watched a bio on him on TV. Shortly before he got into TV, he and his wife bought a big house back east (someone will know where).
The decided he would live in LA while filming while she lived on the east coast. This left him alone in LA for very long periods of time as he became a big star.
I have heard, from people who know writers who worked on the show, that they would be under instructions to write the parts badly for whatever hot young thing was doing a guest shot on the show (usually as one of Dr. Huxtable’s patients). Then at the table read Cosby would angrily say that this was terrible, announce that he was scrapping the whole scene as written, and would then invite the starlet to his place that weekend so they could work out a great scene for her together.