[validation] Aggregate loss by valid token count (#4167)