No, you should iterate over them.
Replcae the following line: for param in model.roberta.parameters():
with:  for name, param in model.roberta.named_parameters():.
Then filter the parameters you want to freeze using the name variable.
You may print the names to see how they look like, and then come up with a condition that will filter the ones you need.
Hope it helps  .