Yes, you should provide weights. I assign weights $1 - \frac{\text{# of class members}}{\text{# of total members}}$. Glmnet rescales them to sum to the total number of class members anyway.
Here's an example using a binomial classification model, Y is the label vector. Can be applied to multinomial in the same fashion.
fraction_0 <- rep(1 - sum(Y == 0) / nrow(Y), sum(Y == 0))
fraction_1 <- rep(1 - sum(Y == 1) / nrow(Y), sum(Y == 1))
# assign that value to a "weights" vector
weights <- numeric(nrow(Y))
if (weighted == TRUE) {
weights[Y == 0] <- fraction_0
weights[Y == 1] <- fraction_1
} else {
weights <- rep(1, nrow(Y))
}
create an initial model
lambda_model <- glmnet(as.matrix(X), as.factor(Y[, 1]), family="binomial",
weights=weights, nlambda=100)